Skip to contentSkip to navigationSkip to topbar
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

rate-limits page anchor

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.


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


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

verification-attempt-response-properties page anchor

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

message_status page anchor

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(link takes you to an external page).

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 nameTypeRequiredDescriptionChild properties
sidSID<VL>Optional
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>Optional

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>Optional

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>Optional

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>Optional

The date that this Attempt was created, given in ISO 8601(link takes you to an external page) format.


date_updatedstring<date-time>Optional

The date that this Attempt was updated, given in ISO 8601(link takes you to an external page) format.


conversion_statusenum<string>Optional

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>Optional

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

Possible values:
smscallemailwhatsapp

priceobjectOptional

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(link takes you to an external page).


channel_dataobjectOptional

An object containing the channel specific information for an attempt.


urlstring<uri>Optional

Fetch a Verification Attempt

fetch-a-verification-attempt page anchor
GET https://verify.twilio.com/v2/Attempts/{Sid}

Returns a single verification attempt specified by the provided SID.

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 an AttemptLink to code sample: Fetch an Attempt
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchVerificationAttempt() {
11
const verificationAttempt = await client.verify.v2
12
.verificationAttempts("VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.fetch();
14
15
console.log(verificationAttempt.sid);
16
}
17
18
fetchVerificationAttempt();

Output

1
{
2
"sid": "VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"date_created": "2020-08-11T18:36:59Z",
7
"date_updated": "2020-08-11T18:37:00Z",
8
"conversion_status": "unconverted",
9
"channel": "sms",
10
"price": {
11
"value": "0.005",
12
"currency": "usd"
13
},
14
"channel_data": {
15
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
16
"to": "+573003003030",
17
"status": "unconfirmed",
18
"message_status": "undelivered",
19
"error_code": "30008",
20
"country": "CO",
21
"code_length": 6,
22
"locale": "es",
23
"mcc": "732",
24
"mnc": "103",
25
"carrier": "Colombia Movil (Tigo)"
26
},
27
"url": "https://verify.twilio.com/v2/Attempts/VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
28
}

List Multiple Verification Attempts

list-multiple-verification-attempts page anchor
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.

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.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listVerificationAttempt() {
11
const verificationAttempts = await client.verify.v2.verificationAttempts.list(
12
{ limit: 20 }
13
);
14
15
verificationAttempts.forEach((v) => console.log(v.sid));
16
}
17
18
listVerificationAttempt();

Output

1
{
2
"attempts": [],
3
"meta": {
4
"key": "attempts",
5
"page": 0,
6
"page_size": 50,
7
"first_page_url": "https://verify.twilio.com/v2/Attempts?PageSize=50&Page=0",
8
"previous_page_url": null,
9
"url": "https://verify.twilio.com/v2/Attempts?PageSize=50&Page=0",
10
"next_page_url": null
11
}
12
}
List Unconverted Verification Attempts Sent to ColombiaLink to code sample: List Unconverted Verification Attempts Sent to Colombia
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listVerificationAttempt() {
11
const verificationAttempts = await client.verify.v2.verificationAttempts.list(
12
{
13
country: "CO",
14
status: "unconverted",
15
limit: 20,
16
}
17
);
18
19
verificationAttempts.forEach((v) => console.log(v.sid));
20
}
21
22
listVerificationAttempt();

Output

1
{
2
"attempts": [
3
{
4
"sid": "VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
8
"date_created": "2020-08-11T18:36:59Z",
9
"date_updated": "2020-08-11T18:37:00Z",
10
"conversion_status": "unconverted",
11
"channel": "sms",
12
"price": {
13
"value": "0.005",
14
"currency": "usd"
15
},
16
"channel_data": {
17
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
18
"to": "+573003003030",
19
"status": "unconfirmed",
20
"message_status": "undelivered",
21
"error_code": "30008",
22
"country": "CO",
23
"code_length": 6,
24
"locale": "es",
25
"mcc": "732",
26
"mnc": "103",
27
"carrier": "Colombia Movil (Tigo)"
28
},
29
"url": "https://verify.twilio.com/v2/Attempts/VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
30
}
31
],
32
"meta": {
33
"key": "attempts",
34
"page": 0,
35
"page_size": 50,
36
"first_page_url": "https://verify.twilio.com/v2/Attempts?PageSize=50&Page=0",
37
"previous_page_url": null,
38
"url": "https://verify.twilio.com/v2/Attempts?PageSize=50&Page=0",
39
"next_page_url": null
40
}
41
}
List Verification Attempts With No Matches ReturnedLink to code sample: List Verification Attempts With No Matches Returned
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listVerificationAttempt() {
11
const verificationAttempts = await client.verify.v2.verificationAttempts.list(
12
{
13
verificationSid: "VL_UNKNOWN_SID",
14
limit: 20,
15
}
16
);
17
18
verificationAttempts.forEach((v) => console.log(v.sid));
19
}
20
21
listVerificationAttempt();

Output

1
{
2
"attempts": [],
3
"meta": {
4
"key": "attempts",
5
"page": 0,
6
"page_size": 50,
7
"first_page_url": "https://verify.twilio.com/v2/Attempts?PageSize=50&Page=0",
8
"previous_page_url": null,
9
"url": "https://verify.twilio.com/v2/Attempts?PageSize=50&Page=0",
10
"next_page_url": null
11
}
12
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.