Skip to contentSkip to navigationSkip to topbar
On this page

Global Safe List


(information)

Global Safe List API is now in GA

This feature is currently in the GA maturity stage.

Customers using the below products will now have access to the Global Safe List API.

  1. Verify customers who have enabled Fraud Guard
  2. Verify customers who have enabled Geo Permissions
  3. Programmable Messaging customers who have enabled SMS Pumping Protection and are seeing 30450 error codes
  4. Programmable Messaging customers who are seeing 30453 error codes

Note : Global Safe List API supports only the SMS and Verify CALL channels.

Global Safe List API allows you to maintain a list of phone numbers and phone number 1k prefixes that will never be blocked by Verify Fraud Guard, Verify Geo Permissions, Programmable Messaging SMS Pumping Protection or any other internal fraud & risk check solution.

The Global Safe List API supports 1k prefix safelisting for phone numbers with a total length at-least 10 characters, including the + sign and country code. For instance, if a phone number is +18001234567, its 1k prefix would be represented as +18001234xxx, where xxx replaces the last three digits.

While we are always adapting our fraud detection systems to keep false positives extremely low, Global Safe List API adds another layer of protection by letting you mark legitimate phone numbers and phone number 1k prefixes as safe to ensure they are never erroneously blocked.

This API contains three endpoints:

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

Alternatively, you can add a previously blocked phone number to the Global 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

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


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


Global Safe List Response Properties

global-safe-list-response-properties page anchor

These properties are returned in the JSON response output.

Property nameTypeRequiredDescriptionChild properties
sidSID<GN>

Optional

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

Optional

PII MTL: 0 days

The phone number in SafeList.


Add a Phone Number or Prefix

add-a-phone-number-or-prefix page anchor

POST https://accounts.twilio.com/v1/SafeList/Numbers

Adds a single phone number or a phone number 1k prefix to the Safe List based on the given phone_number parameter.

The Phone number 1k prefix format should follow the regex pattern : ^\+[1-9]\d{%d,11}xxx$. For example : If a phone number is +18001234567, the 1k prefix is +18001234xxx. The 1k prefix of a phone number of length at-least 10 is allowed.

Phone numbers must be in E.164 format.

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

Request body parameters

request-body-parameters page anchor
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
PhoneNumberstringrequired

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

Add a Phone Number to the Safe ListLink to code sample: Add a Phone Number to the Safe List
1
curl -X POST "https://accounts.twilio.com/v1/SafeList/Numbers" \
2
--data-urlencode "PhoneNumber=+18001234567" \
3
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

Output

1
{
2
"sid": "GNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"phone_number": "+18001234567"
4
}
1
curl -X POST "https://accounts.twilio.com/v1/SafeList/Numbers" \
2
--data-urlencode "PhoneNumber=+18001234xxx" \
3
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

Output

1
{
2
"sid": "GNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"phone_number": "+18001234xxx"
4
}

Check a Phone Number or Prefix

check-a-phone-number-or-prefix page anchor

GET https://accounts.twilio.com/v1/SafeList/Numbers

Checks if a single phone number or a phone number 1k prefix 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 or phone number 1k prefix is not in the Safe List, HTTP 404 will be returned.

Property nameTypeRequiredPIIDescription
PhoneNumberstring

Optional

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 ListLink to code sample: Check if a Phone Number is in the Safe List
1
curl -X GET "https://accounts.twilio.com/v1/SafeList/Numbers?PhoneNumber=%2B18001234567" \
2
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

Output

1
{
2
"sid": "GNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"phone_number": "+18001234567"
4
}
1
curl -X GET "https://accounts.twilio.com/v1/SafeList/Numbers?PhoneNumber=%2B18001234xxx" \
2
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

Output

1
{
2
"sid": "GNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"phone_number": "+18001234xxx"
4
}

Remove a Phone Number or Prefix

remove-a-phone-number-or-prefix page anchor

DELETE https://accounts.twilio.com/v1/SafeList/Numbers

Removes a phone number or a phone number 1k prefix from the Safe List. Phone number must be in E.164 format.

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

Property nameTypeRequiredPIIDescription
PhoneNumberstring

Optional

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

1
curl -X DELETE "https://accounts.twilio.com/v1/SafeList/Numbers?PhoneNumber=%2B18001234567" \
2
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
1
curl -X DELETE "https://accounts.twilio.com/v1/SafeList/Numbers?PhoneNumber=%2B18001234xxx" \
2
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN