Cancel a verification

POST
/v1/verifications/{id}/cancel

Cancels a pending verification: its code stops working. Canceling it again returns it as is.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.

Path Parameters

id*string

The verification's id.

Header Parameters

Coss-Version?"2026-10-10"

The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.

Value in"2026-10-10"

Response Body

The canceled verification.

application/json
  1. response
object*"verification"
Value in"verification"
id*string
channel*string
Value in"sms""email"
to*string
country*|

ISO 3166 country of a phone number.

status*string

pending until the right code is checked (approved) or it ends: expired, canceled, failed (too many wrong codes, or the code couldn't be sent) or blocked (the fraud guard stopped it before anything was sent).

Value in"pending""approved""expired""canceled""failed""blocked"
failure*|

Why it failed.

reasons*array<>

Why it was blocked (empty otherwise).

attempts*integer

Wrong codes checked so far.

max_attempts*integer
sends*array<>

Each time the code was sent.

tags*array<>
sandbox*boolean

Made in a sandbox environment: simulated, and the code is always zeros.

expires_at*string
Formatdate-time
approved_at*|
Formatdate-time
created_at*string
Formatdate-time
import { Coss } from "coss";const coss = new Coss({  apiKey: process.env.COSS_API_KEY,  baseUrl: "https://api.coss.com",});const { data, error } = await coss.verify.cancel("vrf_01k8e2m4q2f3e9v6t5r1n0p8yz");
{  "object": "verification",  "id": "vrf_01k8e2m4q2f3e9v6t5r1n0p8yz",  "channel": "sms",  "to": "+14155550199",  "country": "US",  "status": "pending",  "failure": null,  "reasons": [],  "attempts": 0,  "max_attempts": 5,  "sends": [    {      "channel": "sms",      "route": "shared_number",      "sms_id": "sms_01k8e2m4q2f3e9v6t5r1n0p8yz",      "email_id": null,      "created_at": "2026-11-10T12:00:00.000Z"    }  ],  "tags": [],  "sandbox": false,  "expires_at": "2026-11-10T12:10:00.000Z",  "approved_at": null,  "created_at": "2026-11-10T12:00:00.000Z"}