Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Verification Attempts


(information)

Info

The Verification Attempts API is currently in the Public Beta release stage!

Please note that Verification Attempts API currently only supports SMS, WhatsApp, and Voice channels.

The Verification Attempts API allows you to list and filter verification attempts generated by your Verify V2 services in the last 30 days.

A verification attempt is a communication attempt with the end user that contains a verification code and uses one of the channels supported by Twilio Verify. A single verification may generate one or more verification attempts.

This API contains two endpoints:

  1. List Multiple Verification Attempts : Returns a list of verification attempts that match the selected query parameters. Each verification attempt includes information such as channel specific data, conversion status, and price.
  2. Fetch a Verification Attempt : Returns a specific verification attempt by SID.

You can get a summary of verification attempts including total conversions and conversion rate percentage using the Verification Attempts Summary API.

Verification Attempts API currently supports the SMS, Call and WhatsApp channel.


Rate limits

Verification Attempts API provides a built-in rate limit of 100 requests per minute. If you reach this limit, you will start receiving HTTP 429 "Too Many Requests" responses.


Timeouts

Verification Attempts API has a timeout value of 15 seconds. However, its 99th percentile is within 1 second.


Pagination

Verification Attempts API has a default value of 50 items per page. The number of items per page can be controlled by the PageSize query string parameter. Valid values range from 1 to 1000 items per page.


Verification Attempt Response Properties

These properties are returned in the JSON response output. The values of some fields may change over time to reflect their current status, most notably message_status and price.

message_status

This field will reflect the message's outbound progression until it reaches a final delivery outcome. Learn more here about possible message statuses and their meanings.

price

This field will reflect the current calculated price of the message. It may change depending on the message's outbound status and delivery outcome. Pricing is dependent on a number of factors including carriers used, verification delivery attempt count and number of message segments for each SMS. Final pricing data may not be available until 24 hours after message delivery.

Please note that for some countries (e.g. China) or carriers, we may not be able to fetch message_status and price info.

Property nameTypePIIDescription
sidSID<VL>
Not PII

The SID that uniquely identifies the verification attempt resource.

Pattern: ^VL[0-9a-fA-F]{32}$Min length: 34Max length: 34

account_sidSID<AC>

The SID of the Account that created the Verification resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

service_sidSID<VA>

The SID of the Service used to generate the attempt.

Pattern: ^VA[0-9a-fA-F]{32}$Min length: 34Max length: 34

verification_sidSID<VE>

The SID of the Verification that generated the attempt.

Pattern: ^VE[0-9a-fA-F]{32}$Min length: 34Max length: 34

date_createdstring<date-time>

The date that this Attempt was created, given in ISO 8601 format.


date_updatedstring<date-time>

The date that this Attempt was updated, given in ISO 8601 format.


conversion_statusenum<string>

A string specifying the conversion status of the verification. A conversion happens when the user is able to provide the correct code. Possible values are CONVERTED and UNCONVERTED.

Possible values:
convertedunconverted

channelenum<string>

A string specifying the communication channel used for the verification attempt. i.e SMS, CALL, etc.

Possible values:
smscallemailwhatsapp

priceobject

An object containing the charge for this verification attempt related to the channel costs and the currency used. The costs related to the succeeded verifications are not included. May not be immediately available. More information on pricing is available here.


channel_dataobject

An object containing the channel specific information for an attempt.


urlstring<uri>

Fetch a Verification Attempt

GET https://verify.twilio.com/v2/Attempts/{Sid}

Returns a single verification attempt specified by the provided SID.

Path parameters

Property nameTypeRequiredPIIDescription
SidSID<VL>required

The unique SID identifier of a Verification Attempt

Pattern: ^VL[0-9a-fA-F]{32}$Min length: 34Max length: 34

Fetch a VerificationAttempt

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function fetchVerificationAttempt() {
_18
const verificationAttempt = await client.verify.v2
_18
.verificationAttempts("VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.fetch();
_18
_18
console.log(verificationAttempt.sid);
_18
}
_18
_18
fetchVerificationAttempt();

Output

_28
{
_28
"sid": "VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_28
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_28
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_28
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_28
"date_created": "2020-08-11T18:36:59Z",
_28
"date_updated": "2020-08-11T18:37:00Z",
_28
"conversion_status": "unconverted",
_28
"channel": "sms",
_28
"price": {
_28
"value": "0.005",
_28
"currency": "usd"
_28
},
_28
"channel_data": {
_28
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_28
"to": "+573003003030",
_28
"status": "unconfirmed",
_28
"message_status": "undelivered",
_28
"error_code": "30008",
_28
"country": "CO",
_28
"code_length": 6,
_28
"locale": "es",
_28
"mcc": "732",
_28
"mnc": "103",
_28
"carrier": "Colombia Movil (Tigo)"
_28
},
_28
"url": "https://verify.twilio.com/v2/Attempts/VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_28
}


List Multiple Verification Attempts

GET https://verify.twilio.com/v2/Attempts

Returns a paginated list of verification attempts that match the selected query parameters.

Below are the available query parameters for selecting and filtering verification attempts. An empty array is returned if there are no matches.

Query parameters

Property nameTypeRequiredPIIDescription
DateCreatedAfterstring<date-time>Optional

Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.


DateCreatedBeforestring<date-time>Optional

Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.


ChannelData.TostringOptional

Destination of a verification. It is phone number in E.164 format.


Countrystring<iso-country-code>Optional

Filter used to query Verification Attempts sent to the specified destination country.


Channelenum<string>Optional

Filter used to query Verification Attempts by communication channel. Valid values are SMS and CALL

Possible values:
smscallemailwhatsapp

VerifyServiceSidSID<VA>Optional

Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned.

Pattern: ^VA[0-9a-fA-F]{32}$Min length: 34Max length: 34

VerificationSidSID<VE>Optional

Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned.

Pattern: ^VE[0-9a-fA-F]{32}$Min length: 34Max length: 34

Statusenum<string>Optional

Filter used to query Verification Attempts by conversion status. Valid values are UNCONVERTED, for attempts that were not converted, and CONVERTED, for attempts that were confirmed.

Possible values:
convertedunconverted

PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

List Verification Attempts

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function listVerificationAttempt() {
_18
const verificationAttempts = await client.verify.v2.verificationAttempts.list(
_18
{ limit: 20 }
_18
);
_18
_18
verificationAttempts.forEach((v) => console.log(v.sid));
_18
}
_18
_18
listVerificationAttempt();

Output

_12
{
_12
"attempts": [],
_12
"meta": {
_12
"key": "attempts",
_12
"page": 0,
_12
"page_size": 50,
_12
"first_page_url": "https://verify.twilio.com/v2/Attempts?PageSize=50&Page=0",
_12
"previous_page_url": null,
_12
"url": "https://verify.twilio.com/v2/Attempts?PageSize=50&Page=0",
_12
"next_page_url": null
_12
}
_12
}

List Unconverted Verification Attempts Sent to Colombia

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_22
// Download the helper library from https://www.twilio.com/docs/node/install
_22
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_22
_22
// Find your Account SID and Auth Token at twilio.com/console
_22
// and set the environment variables. See http://twil.io/secure
_22
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_22
const authToken = process.env.TWILIO_AUTH_TOKEN;
_22
const client = twilio(accountSid, authToken);
_22
_22
async function listVerificationAttempt() {
_22
const verificationAttempts = await client.verify.v2.verificationAttempts.list(
_22
{
_22
country: "CO",
_22
status: "unconverted",
_22
limit: 20,
_22
}
_22
);
_22
_22
verificationAttempts.forEach((v) => console.log(v.sid));
_22
}
_22
_22
listVerificationAttempt();

Output

_41
{
_41
"attempts": [
_41
{
_41
"sid": "VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_41
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_41
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_41
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_41
"date_created": "2020-08-11T18:36:59Z",
_41
"date_updated": "2020-08-11T18:37:00Z",
_41
"conversion_status": "unconverted",
_41
"channel": "sms",
_41
"price": {
_41
"value": "0.005",
_41
"currency": "usd"
_41
},
_41
"channel_data": {
_41
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_41
"to": "+573003003030",
_41
"status": "unconfirmed",
_41
"message_status": "undelivered",
_41
"error_code": "30008",
_41
"country": "CO",
_41
"code_length": 6,
_41
"locale": "es",
_41
"mcc": "732",
_41
"mnc": "103",
_41
"carrier": "Colombia Movil (Tigo)"
_41
},
_41
"url": "https://verify.twilio.com/v2/Attempts/VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_41
}
_41
],
_41
"meta": {
_41
"key": "attempts",
_41
"page": 0,
_41
"page_size": 50,
_41
"first_page_url": "https://verify.twilio.com/v2/Attempts?PageSize=50&Page=0",
_41
"previous_page_url": null,
_41
"url": "https://verify.twilio.com/v2/Attempts?PageSize=50&Page=0",
_41
"next_page_url": null
_41
}
_41
}

List Verification Attempts With No Matches Returned

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_21
// Download the helper library from https://www.twilio.com/docs/node/install
_21
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21
_21
// Find your Account SID and Auth Token at twilio.com/console
_21
// and set the environment variables. See http://twil.io/secure
_21
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21
const authToken = process.env.TWILIO_AUTH_TOKEN;
_21
const client = twilio(accountSid, authToken);
_21
_21
async function listVerificationAttempt() {
_21
const verificationAttempts = await client.verify.v2.verificationAttempts.list(
_21
{
_21
verificationSid: "VL_UNKNOWN_SID",
_21
limit: 20,
_21
}
_21
);
_21
_21
verificationAttempts.forEach((v) => console.log(v.sid));
_21
}
_21
_21
listVerificationAttempt();

Output

_12
{
_12
"attempts": [],
_12
"meta": {
_12
"key": "attempts",
_12
"page": 0,
_12
"page_size": 50,
_12
"first_page_url": "https://verify.twilio.com/v2/Attempts?PageSize=50&Page=0",
_12
"previous_page_url": null,
_12
"url": "https://verify.twilio.com/v2/Attempts?PageSize=50&Page=0",
_12
"next_page_url": null
_12
}
_12
}


Rate this page: