Skip to main content
POST
/
verifications
JavaScript
import Surge from '@surgeapi/node';

const client = new Surge({
  apiKey: 'My API Key',
});

const verification = await client.verifications.create({ phone_number: '+18015551234' });

console.log(verification.id);
{
  "attempt_count": 0,
  "id": "vfn_01jayh15c2f2xamftg0xpyq1nj",
  "phone_number": "+18015551234",
  "status": "pending"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Parameters for creating a Verification

phone_number
string<phone-number>
required

The phone number to be verified. In E.164 format.

Example:

"+18015551234"

Response

Created verification

A phone number verification

attempt_count
integer
required

The number of times the code has been attempted.

id
string
required

Unique identifier for the object.

phone_number
string<phone-number>
required

The phone number being verified. In E.164 format.

Example:

"+18015551234"

status
enum<string>
required

The current status of the verification.

Available options:
pending,
verified,
exhausted,
expired