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

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

const verificationCheck = await client.verifications.check('vfn_01jayh15c2f2xamftg0xpyq1nj', {
  code: '123456',
});

console.log(verificationCheck.result);
{
  "result": "ok",
  "verification": {
    "attempt_count": 1,
    "id": "vfn_01jayh15c2f2xamftg0xpyq1nj",
    "phone_number": "+18015551234",
    "status": "verified"
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

The ID of the verification to check against.

Example:

"vfn_01jayh15c2f2xamftg0xpyq1nj"

Body

application/json

Parameters for checking a Verification code

code
string
required

The Verification code that was received.

Example:

"123456"

Response

Correct code

The result of checking a Verification code

result
enum<string>

The result of the code check.

Available options:
ok,
incorrect,
exhausted,
expired,
already_verified
verification
Verification · object

A phone number verification

Example:
{
  "attempt_count": 0,
  "id": "vfn_01jayh15c2f2xamftg0xpyq1nj",
  "phone_number": "+18015551234",
  "status": "pending"
}