Skip to main content
POST
/
verifications
/
sms
JavaScript
import Telnyx from 'telnyx';

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

const createVerificationResponse = await client.verifications.triggerSMS({
  phone_number: '+13035551234',
  verify_profile_id: '12ade33a-21c0-473b-b055-b3c836e1c292',
});

console.log(createVerificationResponse.data);
{
  "data": {
    "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
    "type": "sms",
    "record_type": "verification",
    "phone_number": "+13035551234",
    "verify_profile_id": "12ade33a-21c0-473b-b055-b3c836e1c292",
    "custom_code": "43612",
    "timeout_secs": 300,
    "status": "accepted",
    "created_at": "2020-09-14T17:03:32.965812",
    "updated_at": "2020-09-14T17:03:32.965812"
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json

The request body when creating a verification.

phone_number
string
required

+E164 formatted phone number.

Example:

"+13035551234"

verify_profile_id
string<uuid>
required

The identifier of the associated Verify profile.

Example:

"12ade33a-21c0-473b-b055-b3c836e1c292"

custom_code
string | null

Send a self-generated numeric code to the end-user

Example:

"43612"

timeout_secs
integer

The number of seconds the verification code is valid for.

Example:

300

Response

Expected verifications response to a valid request.

data
Verification · object
required