# Verification Attempts

> \[!NOTE]
>
> The Verification Attempts API is currently in the Public Beta release stage.
>
> Verification Attempts API currently supports the following channels: **SMS**, **Voice**, **WhatsApp**, **RBM** (Rich Business Messaging), and **Email**.

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](#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](#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](/docs/verify/api/verification-attempts-summary).

## 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](https://help.twilio.com/hc/en-us/articles/223134347-What-are-the-Possible-SMS-and-MMS-Message-Statuses-and-What-do-They-Mean-).

### 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.

```json
{"type":"object","refName":"verify.v2.verification_attempt","modelName":"verify_v2_verification_attempt","properties":{"sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^VL[0-9a-fA-F]{32}$","nullable":true,"description":"The SID that uniquely identifies the verification attempt resource."},"account_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$","nullable":true,"description":"The SID of the [Account](/docs/iam/api/account) that created the Verification resource."},"service_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^VA[0-9a-fA-F]{32}$","nullable":true,"description":"The SID of the [Service](/docs/verify/api/service) used to generate the attempt."},"verification_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^VE[0-9a-fA-F]{32}$","nullable":true,"description":"The SID of the [Verification](/docs/verify/api/verification) that generated the attempt."},"date_created":{"type":"string","format":"date-time","nullable":true,"description":"The date that this Attempt was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format."},"date_updated":{"type":"string","format":"date-time","nullable":true,"description":"The date that this Attempt was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format."},"conversion_status":{"type":"string","enum":["converted","unconverted"],"description":"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`.","refName":"verification_attempt_enum_conversion_status","modelName":"verification_attempt_enum_conversion_status"},"channel":{"type":"string","enum":["sms","call","email","whatsapp","rbm"],"description":"A string specifying the communication channel used for the verification attempt.","refName":"verification_attempt_enum_channels","modelName":"verification_attempt_enum_channels"},"price":{"nullable":true,"description":"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](https://www.twilio.com/en-us/verify/pricing)."},"channel_data":{"nullable":true,"description":"An object containing the channel specific information for an attempt."},"url":{"type":"string","format":"uri","nullable":true}}}
```

## Fetch a Verification Attempt

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

Returns a single verification attempt specified by the provided SID.

### Path parameters

```json
[{"name":"Sid","in":"path","description":"The unique SID identifier of a Verification Attempt","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^VL[0-9a-fA-F]{32}$"},"required":true}]
```

Fetch an Attempt

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchVerificationAttempt() {
  const verificationAttempt = await client.verify.v2
    .verificationAttempts("VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .fetch();

  console.log(verificationAttempt.sid);
}

fetchVerificationAttempt();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

verification_attempt = client.verify.v2.verification_attempts(
    "VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
).fetch()

print(verification_attempt.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Verify.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var verificationAttempt = await VerificationAttemptResource.FetchAsync(
            pathSid: "VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(verificationAttempt.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.verify.v2.VerificationAttempt;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        VerificationAttempt verificationAttempt =
            VerificationAttempt.fetcher("VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch();

        System.out.println(verificationAttempt.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.VerifyV2.FetchVerificationAttempt("VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$verification_attempt = $twilio->verify->v2
    ->verificationAttempts("VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->fetch();

print $verification_attempt->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

verification_attempt = @client
                       .verify
                       .v2
                       .verification_attempts('VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
                       .fetch

puts verification_attempt.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:verify:v2:attempts:fetch \
   --sid VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X GET "https://verify.twilio.com/v2/Attempts/VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

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

```json
[{"name":"DateCreatedAfter","in":"query","description":"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.","schema":{"type":"string","format":"date-time"}},{"name":"DateCreatedBefore","in":"query","description":"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.","schema":{"type":"string","format":"date-time"}},{"name":"ChannelData.To","in":"query","description":"Destination of a verification. It is phone number in E.164 format.","schema":{"type":"string"},"x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},{"name":"Country","in":"query","description":"Filter used to query Verification Attempts sent to the specified destination country.","schema":{"type":"string","format":"iso-country-code"}},{"name":"Channel","in":"query","description":"Filter used to query Verification Attempts by communication channel.","schema":{"type":"string","enum":["sms","call","email","whatsapp","rbm"],"description":"A string specifying the communication channel used for the verification attempt.","refName":"verification_attempt_enum_channels","modelName":"verification_attempt_enum_channels"}},{"name":"VerifyServiceSid","in":"query","description":"Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^VA[0-9a-fA-F]{32}$"}},{"name":"VerificationSid","in":"query","description":"Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^VE[0-9a-fA-F]{32}$"}},{"name":"Status","in":"query","description":"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.","schema":{"type":"string","enum":["converted","unconverted"],"description":"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`.","refName":"verification_attempt_enum_conversion_status","modelName":"verification_attempt_enum_conversion_status"}},{"name":"PageSize","in":"query","description":"How many resources to return in each list page. The default is 50, and the maximum is 1000.","schema":{"type":"integer","format":"int64","minimum":1,"maximum":1000}},{"name":"Page","in":"query","description":"The page index. This value is simply for client state.","schema":{"type":"integer","minimum":0}},{"name":"PageToken","in":"query","description":"The page token. This is provided by the API.","schema":{"type":"string"}}]
```

{" "}

List Verification Attempts

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listVerificationAttempt() {
  const verificationAttempts = await client.verify.v2.verificationAttempts.list(
    { limit: 20 }
  );

  verificationAttempts.forEach((v) => console.log(v.sid));
}

listVerificationAttempt();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

verification_attempts = client.verify.v2.verification_attempts.list(limit=20)

for record in verification_attempts:
    print(record.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Verify.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var verificationAttempts = await VerificationAttemptResource.ReadAsync(limit: 20);

        foreach (var record in verificationAttempts) {
            Console.WriteLine(record.Sid);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.verify.v2.VerificationAttempt;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<VerificationAttempt> verificationAttempts = VerificationAttempt.reader().limit(20).read();

        for (VerificationAttempt record : verificationAttempts) {
            System.out.println(record.getSid());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	verify "github.com/twilio/twilio-go/rest/verify/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &verify.ListVerificationAttemptParams{}
	params.SetLimit(20)

	resp, err := client.VerifyV2.ListVerificationAttempt(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].Sid != nil {
				fmt.Println(*resp[record].Sid)
			} else {
				fmt.Println(resp[record].Sid)
			}
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$verificationAttempts = $twilio->verify->v2->verificationAttempts->read([], 20);

foreach ($verificationAttempts as $record) {
    print $record->sid;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

verification_attempts = @client
                        .verify
                        .v2
                        .verification_attempts
                        .list(limit: 20)

verification_attempts.each do |record|
   puts record.sid
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:verify:v2:attempts:list
```

```bash
curl -X GET "https://verify.twilio.com/v2/Attempts?PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

{" "}

List Unconverted Verification Attempts Sent to Colombia

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listVerificationAttempt() {
  const verificationAttempts = await client.verify.v2.verificationAttempts.list(
    {
      country: "CO",
      status: "unconverted",
      limit: 20,
    }
  );

  verificationAttempts.forEach((v) => console.log(v.sid));
}

listVerificationAttempt();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

verification_attempts = client.verify.v2.verification_attempts.list(
    country="CO", status="unconverted", limit=20
)

for record in verification_attempts:
    print(record.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Verify.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var verificationAttempts = await VerificationAttemptResource.ReadAsync(
            country: "CO",
            status: VerificationAttemptResource.ConversionStatusEnum.Unconverted,
            limit: 20);

        foreach (var record in verificationAttempts) {
            Console.WriteLine(record.Sid);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.verify.v2.VerificationAttempt;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<VerificationAttempt> verificationAttempts =
            VerificationAttempt.reader()
                .setCountry("CO")
                .setStatus(VerificationAttempt.ConversionStatus.UNCONVERTED)
                .limit(20)
                .read();

        for (VerificationAttempt record : verificationAttempts) {
            System.out.println(record.getSid());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	verify "github.com/twilio/twilio-go/rest/verify/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &verify.ListVerificationAttemptParams{}
	params.SetCountry("CO")
	params.SetStatus("unconverted")
	params.SetLimit(20)

	resp, err := client.VerifyV2.ListVerificationAttempt(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].Sid != nil {
				fmt.Println(*resp[record].Sid)
			} else {
				fmt.Println(resp[record].Sid)
			}
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$verificationAttempts = $twilio->verify->v2->verificationAttempts->read(
    [
        "country" => "CO",
        "status" => "unconverted",
    ],
    20
);

foreach ($verificationAttempts as $record) {
    print $record->sid;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

verification_attempts = @client
                        .verify
                        .v2
                        .verification_attempts
                        .list(
                          country: 'CO',
                          status: 'unconverted',
                          limit: 20
                        )

verification_attempts.each do |record|
   puts record.sid
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:verify:v2:attempts:list \
   --country CO \
   --status unconverted
```

```bash
curl -X GET "https://verify.twilio.com/v2/Attempts?Country=CO&Status=unconverted&PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

List Verification Attempts With No Matches Returned

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listVerificationAttempt() {
  const verificationAttempts = await client.verify.v2.verificationAttempts.list(
    {
      verificationSid: "VL_UNKNOWN_SID",
      limit: 20,
    }
  );

  verificationAttempts.forEach((v) => console.log(v.sid));
}

listVerificationAttempt();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

verification_attempts = client.verify.v2.verification_attempts.list(
    verification_sid="VL_UNKNOWN_SID", limit=20
)

for record in verification_attempts:
    print(record.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Verify.V2;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var verificationAttempts = await VerificationAttemptResource.ReadAsync(
            verificationSid: "VL_UNKNOWN_SID", limit: 20);

        foreach (var record in verificationAttempts) {
            Console.WriteLine(record.Sid);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.verify.v2.VerificationAttempt;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<VerificationAttempt> verificationAttempts =
            VerificationAttempt.reader().setVerificationSid("VL_UNKNOWN_SID").limit(20).read();

        for (VerificationAttempt record : verificationAttempts) {
            System.out.println(record.getSid());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	verify "github.com/twilio/twilio-go/rest/verify/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &verify.ListVerificationAttemptParams{}
	params.SetVerificationSid("VL_UNKNOWN_SID")
	params.SetLimit(20)

	resp, err := client.VerifyV2.ListVerificationAttempt(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].Sid != nil {
				fmt.Println(*resp[record].Sid)
			} else {
				fmt.Println(resp[record].Sid)
			}
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$verificationAttempts = $twilio->verify->v2->verificationAttempts->read(
    ["verificationSid" => "VL_UNKNOWN_SID"],
    20
);

foreach ($verificationAttempts as $record) {
    print $record->sid;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

verification_attempts = @client
                        .verify
                        .v2
                        .verification_attempts
                        .list(
                          verification_sid: 'VL_UNKNOWN_SID',
                          limit: 20
                        )

verification_attempts.each do |record|
   puts record.sid
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:verify:v2:attempts:list \
   --verification-sid VL_UNKNOWN_SID
```

```bash
curl -X GET "https://verify.twilio.com/v2/Attempts?VerificationSid=VL_UNKNOWN_SID&PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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