Can I Prevent Specific Phone Number Types from Being Verified?

Verification Services in Verify V2 can be configured to validate phone numbers prior to attempting a verification. Enabling this option also gives you the option of skipping landline phone numbers, and only attempting to verify SMS-capable phone numbers. This guide will explain how to control these options.

Create a new Verification Service that Blocks Landlines

Landline phone number blocking can be enabled when a new Verification Service is created. The Lookup and Landline Validation options will just need to be enabled in Console, or included with positive values in your API request.

For examples, please see the Create a Verify V2 Service section of Getting Started with Verify V2.

Update an existing Verification Service to Block Landlines via Console

  1. Access the Verification Services page in Console.
  2. Click the desired Verification Service to modify.
  3. Click to enable LOOKUP and LANDLINE VALIDATION.
    Click to enable the LOOKUP and LANDLINE VALIDATION options.
  4. Click Save.
    Click SAVE.

Update an existing Verification Service to Block Landlines via the REST API

Verify V2 Services can also be updated via the REST API. Here’s an example cURL script:

curl -X POST https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
--data-urlencode "LookupEnabled=true" \
--data-urlencode "SkipSmsToLandlines=true" \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token

This example will update the existing verification service with Service SID VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX to enable the Lookup and Landline Validation options. To make this script work for you, make the following updates, and then paste it into a terminal window:

For more details, including code samples using our Helper Libraries, please see Update a Service (Twilio Docs).

Have more questions? Submit a request
Powered by Zendesk