The Verification Check Resource represents a verification validation. This will check whether the user-provided token is correct.
Prerequisites:
These fields are returned in the output JSON response. The type SID<VE>
is a unique ID starting with the letters VE.
The unique string that we created to identify the VerificationCheck resource.
^VE[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Service the resource is associated with.
^VA[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the VerificationCheck resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The phone number or email being verified. Phone numbers must be in E.164 format.
The verification method to use. One of: email
, sms
, whatsapp
, call
, or sna
.
sms
call
email
whatsapp
sna
The status of the verification. Can be: pending
, approved
, canceled
, max_attempts_reached
, deleted
, failed
or expired
.
Use "status" instead. Legacy property indicating whether the verification was successful.
The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.
The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.
The ISO 8601 date and time in GMT when the Verification Check resource was created.
The ISO 8601 date and time in GMT when the Verification Check resource was last updated.
List of error codes as a result of attempting a verification using the sna
channel. The error codes are chronologically ordered, from the first attempt to the latest attempt. This will be an empty list if no errors occured or null
if the last channel used wasn't sna
.
POST https://verify.twilio.com/v2/Services/{ServiceSid}/VerificationCheck
Twilio deletes the verification SID once it's:
If any of these occur, verification checks will return a 404 Not Found
error like this:
Unable to create record: The requested resource /Services/VAXXXXXXXXXXXXX/VerificationCheck was not found
If you'd like to double check what happened with a given verification - please use the Twilio Console Verify Logs.
These are the available input parameters for checking a verification. The type SID<VE>
is a unique ID starting with the letters VE.
application/x-www-form-urlencoded
The phone number or email to verify. Either this parameter or the verification_sid
must be specified. Phone numbers must be in E.164 format.
A SID that uniquely identifies the Verification Check. Either this parameter or the to
phone number/email must be specified.
^VE[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.
The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.
A sna client token received in sna url invocation response needs to be passed in Verification Check request and should match to get successful response.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createVerificationCheck() {11const verificationCheck = await client.verify.v212.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.verificationChecks.create({14code: "1234",15to: "+15017122661",16});1718console.log(verificationCheck.status);19}2021createVerificationCheck();
1{2"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"to": "+15017122661",6"channel": "sms",7"status": "approved",8"valid": true,9"amount": null,10"payee": null,11"sna_attempts_error_codes": [],12"date_created": "2015-07-30T20:00:00Z",13"date_updated": "2015-07-30T20:00:00Z"14}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createVerificationCheck() {11const verificationCheck = await client.verify.v212.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.verificationChecks.create({14code: "123456",15to: "recipient@foo.com",16});1718console.log(verificationCheck.status);19}2021createVerificationCheck();
1{2"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"to": "recipient@foo.com",6"channel": "sms",7"status": "approved",8"valid": true,9"amount": null,10"payee": null,11"sna_attempts_error_codes": [],12"date_created": "2015-07-30T20:00:00Z",13"date_updated": "2015-07-30T20:00:00Z"14}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createVerificationCheck() {11const verificationCheck = await client.verify.v212.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.verificationChecks.create({14code: "1234",15verificationSid: "VEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",16});1718console.log(verificationCheck.status);19}2021createVerificationCheck();
1{2"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"to": "+15017122661",6"channel": "sms",7"status": "approved",8"valid": true,9"amount": null,10"payee": null,11"sna_attempts_error_codes": [],12"date_created": "2015-07-30T20:00:00Z",13"date_updated": "2015-07-30T20:00:00Z"14}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createVerificationCheck() {11const verificationCheck = await client.verify.v212.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.verificationChecks.create({ to: "+15017122661" });1415console.log(verificationCheck.sid);16}1718createVerificationCheck();
1{2"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"to": "+15017122661",6"channel": "sna",7"status": "approved",8"valid": true,9"amount": null,10"payee": null,11"sna_attempts_error_codes": [12{13"attempt_sid": "VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"code": 6000115}16],17"date_created": "2015-07-30T20:00:00Z",18"date_updated": "2015-07-30T20:00:00Z"19}
It is possible for a Silent Network Auth (SNA) Verification Check to show a status
of approved
with error codes listed under sna_attempts_error_codes
. This can happen when a Verification Attempt for the SNA Verification failed and resulted in an error, and then a subsequent Verification Attempt was successful and resulted in the approval.