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

Safe List


(information)

Safe List API is in Pilot

This Verify feature is currently in the Pilot maturity stage.

Verify Customers who have enabled Fraud Guard will have default access to the Safe List API. Fraud Guard is now in the GA maturity stage and is available to all Verify customers at no extra cost.

If you are not using Fraud Guard, you'll need to contact sales(link takes you to an external page) to request access to this API.

Note: Safe List API currently only supports the SMS channel.

Safe List API allows you to maintain a list of phone numbers that will never be blocked by Verify Fraud Guardor Geo permissions. While we are always adapting our fraud detection model to keep false positives extremely low, Safe List API adds another layer of protection by letting you mark phone numbers as safe to ensure they are never erroneously blocked.

This API contains three endpoints:

  1. Add a Phone Number
  2. Check a Phone Number
  3. Remove a Phone Number

Alternatively, you can add a previously blocked phone number to the Safe List via Twilio Console on the Verify Logs Blocked Verifications tab(link takes you to an external page). See Viewing Logs With Twilio Console for more information.


Rate limits

rate-limits page anchor

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


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


Safe List Response Properties

safe-list-response-properties page anchor

These properties are returned in the JSON response output.

Property nameTypePIIDescription
sidSID<GN>
Not PII

The unique string that we created to identify the SafeList resource.

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

phone_numberstring
PII MTL: 0 days

The phone number in SafeList.


urlstring<uri>

The absolute URL of the SafeList resource.


POST https://verify.twilio.com/v2/SafeList/Numbers

Adds a single phone number to the Safe List based on the given phone_number parameter. Phone numbers must be in E.164 format.

If attempting to add a number that already exists in the Safe List, HTTP 400 with Error Code 60411 will be returned. Phone numbers will remain in the Safe List indefinitely until they are explicitly removed.

Request body parameters

request-body-parameters page anchor
Property nameTypeRequiredPIIDescription
PhoneNumberstringrequired

The phone number to be added in SafeList. Phone numbers must be in E.164 format.

Add a Phone Number to the Safe List

add-a-phone-number-to-the-safe-list page anchor
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 createSafelist() {
_18
const safelist = await client.verify.v2.safelist.create({
_18
phoneNumber: "+18001234567",
_18
});
_18
_18
console.log(safelist.sid);
_18
}
_18
_18
createSafelist();

Output

_10
{
_10
"sid": "GNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"phone_number": "+18001234567",
_10
"url": "https://verify.twilio.com/v2/SafeList/Numbers/+18001234567"
_10
}


GET https://verify.twilio.com/v2/SafeList/Numbers/{PhoneNumber}

Checks if a single phone number is in the Safe List based on the given phone_number parameter. Phone numbers must be in E.164 format.

If the given phone number is not in the Safe List, HTTP 404 will be returned.

Property nameTypeRequiredPIIDescription
PhoneNumberstringrequired

The phone number to be fetched from SafeList. Phone numbers must be in E.164 format.

Check if a Phone Number is in the Safe List

check-if-a-phone-number-is-in-the-safe-list page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

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

Output

_10
{
_10
"sid": "GNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"phone_number": "+18001234567",
_10
"url": "https://verify.twilio.com/v2/SafeList/Numbers/+18001234567"
_10
}


DELETE https://verify.twilio.com/v2/SafeList/Numbers/{PhoneNumber}

Removes a single phone number from the Safe List based on the given phone_number parameter. Phone numbers must be in E.164 format.

If the given phone number is not in the Safe List, HTTP 404 will be returned.

Property nameTypeRequiredPIIDescription
PhoneNumberstringrequired

The phone number to be removed from SafeList. Phone numbers must be in E.164 format.

Remove a Phone Number from the Safe List

remove-a-phone-number-from-the-safe-list page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

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


Rate this page: