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

Eligibility Resource


Twilio's Eligibility API allows you to determine if the non-Twilio phone numbers already in your possession can be hosted with Twilio. It's often possible to use your existing phone numbers with Twilio's Messaging Services without changing the voice provider by hosting the messaging capability of those numbers with Twilio.

Determining a number's eligibility is the first step of the hosting process. Using the API, you can check the eligibility of a number or group of numbers before starting the hosting process. If a number cannot be hosted by Twilio, the API will provide a reason and suggest potential next steps.


Base URL

base-url page anchor

All URLs referenced in the API documentation have the following base:

https://numbers.twilio.com/v1/HostedNumber/Eligibility

The API is served over HTTPS. To ensure data privacy, unencrypted HTTP is not supported.


HTTP requests to the API are protected with HTTP Basic authentication(link takes you to an external page). To learn more about how Twilio handles authentication, please refer to our security documentation.

In short, you will use your Twilio Account SID as the username and your Auth Token as the password for HTTP Basic authentication with Twilio.

You can find your Account SID and Auth Token in the Console(link takes you to an external page).

Twilio console showing auth token and SID.

To learn more about authentication and interaction with the Twilio REST API, check out our documentation for requests to the API and Twilio's response.


Create a single eligibility check

create-a-single-eligibility-check page anchor

Resource URL: https://numbers.twilio.com/v1/HostedNumber/Eligibility

To check a single phone number's eligibility, make a POST request to this resource.

See the following code sample for a complete curl request. See the request properties table for all the properties available on this resource.


_10
curl --location --request POST 'https://numbers.twilio.com/v1/HostedNumber/Eligibility' \
_10
-u "Account_SID:Auth_Token" \
_10
--header 'Content-Type: application/json' \
_10
--data-raw '{
_10
"friendly_name": "My first eligibility check",
_10
"phone_numbers": [
_10
{"phone_number": "+13175787XXX", "hosting_account_sid": "AC264f0af1e323b9a38e513c433828dXXX"}
_10
]
_10
}'

Request properties

request-properties page anchor

The resource accepts an array of one object called phone_numbers. The object must contain a phone_number in E.164 format to check for eligibility. A phone_numbers object may also contain a Twilio Account SID (hosting_account_sid) belonging to the Twilio Account where you want to host the phone number. If a SID is not provided, the account used to make the request will be used as the hosting Twilio Account. This resource also accepts an optional friendly_name property, which allows you to assign a human-readable reference to the eligibility request.

ParameterRequiredField TypeValidationDescription
phone_numbersYes.ArraySize must equal 1.An array of one object containing fields:
  • phone_number, the number (E.164 format) to check for hosting eligibility.
  • hosting_account_sid (optional), the Twilio Account or Subaccount SID where the number will be hosted. If this field is not provided, the authentication Account SID used when making the request will be used as the hosting account.
friendly_nameNo.StringName of the eligibility check.

The following table provides all the properties that may be returned by the resource.

ParameterDescriptionPossible return values
phone_numberPhone number that was checked for hosting eligibility.
hosting_account_sidTwilio's Account or Subaccount SID where the number would be hosted.
eligibility_statusThe number's eligibility to be hosted with Twilio.
  • "eligible"
  • "ineligible"
  • eligibility_sub_statusAdditional information about why a number cannot be hosted with Twilio.
  • country-ineligible
  • number-format-ineligible
  • number-type-ineligible
  • carrier-ineligible
  • already-in-twilio
  • internal-processing-error
  • invalid-phone-number
  • invalid-hosting-account-sid
  • eligible-by-manual-process
  • may-be-eligible-by-manual-process
  • eligible
  • ineligibility_reasonThe primary reason the number cannot be hosted with Twilio.
  • eligible-for-hosting
  • country-not-supported
  • number-format-ineligible
  • number-type-ineligible
  • numbers-provider-does-not-allow-twilio-to-host-it
  • already-in-twilio-but-not-in-use
  • already-in-twilio-and-in-hosting-process
  • already-in-twilio-for-both-capabilities
  • already-in-twilio-without-messaging-capability
  • already-in-twilio-owned-by-other-account
  • internal-processing-error
  • invalid-phone-number
  • hosting-account-sid-does-not-belong-to-your-account
  • hosting-account-sid-does-not-exist
  • eligible-for-hosting-by-manual-process
  • missing-provider-data
  • already-hosted-in-twilio
  • support-validation-required-number-without-an-approved-nnid
  • next_stepAction that customers can take based on the eligibility result.
  • none
  • create-hosted-number-order
  • edit-ineligible-number-and-run-eligibility-check-again
  • manage-hosting-order
  • recover-messaging-capability
  • contact-support-ineligible-carrier
  • contact-support-internal-transfer
  • contact-support-ineligible-inventory-status
  • number-type-cannot-be-hosted
  • retry-the-eligibility-check
  • update-hosting-account-sid
  • contact-support-to-manually-host-the-number
  • contact-support-missing-provider-data
  • contact-support-for-manual-process
  • contact-support-to-retire-previous-orders
  • phone_number_typeThe phone number's type.
  • toll-free
  • local
  • mobile
  • unknown
  • iso_country_codeThe country to which the number belongs.

    The following example responses are provided for your reference.

    Eligible number

    eligible-number page anchor

    _12
    "results": [
    _12
    {
    _12
    "phone_number": "+1XXXXXXXXXX",
    _12
    "next_step": "CREATE_HOSTED_NUMBER_ORDER",
    _12
    "phone_number_type": "TOLLFREE",
    _12
    "eligibility_sub_status": "ELIGIBLE",
    _12
    "eligibility_status": "ELIGIBLE",
    _12
    "hosting_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    _12
    "ineligibility_reason": "None",
    _12
    "iso_country_code": "USA"
    _12
    }
    _12
    ]

    Ineligible number (wrong number format)

    ineligible-number-wrong-number-format page anchor

    _12
    "results": [
    _12
    {
    _12
    "phone_number": "+493333344444544XXX",
    _12
    "next_step": "EDIT_INELIGIBLE_NUMBER_AND_RUN_ELIGIBILITY_CHECK_AGAIN",
    _12
    "phone_number_type": "UNKNOWN",
    _12
    "eligibility_sub_status": "NUMBER_FORMAT_INELIGIBLE",
    _12
    "eligibility_status": "INELIGIBLE",
    _12
    "hosting_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    _12
    "ineligibility_reason": "NUMBER_FORMAT_INELIGIBLE",
    _12
    "iso_country_code": null
    _12
    }
    _12
    ]

    Ineligible number (number type ineligible)

    ineligible-number-number-type-ineligible page anchor

    _12
    "results": [
    _12
    {
    _12
    "phone_number": "+1XXXXXXXXXX",
    _12
    "next_step": "NUMBER_TYPE_CANNOT_BE_HOSTED",
    _12
    "phone_number_type": "MOBILE",
    _12
    "eligibility_sub_status": "NUMBER_TYPE_INELIGIBLE",
    _12
    "eligibility_status": "INELIGIBLE",
    _12
    "hosting_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    _12
    "ineligibility_reason": "NUMBER_TYPE_INELIGIBLE",
    _12
    "iso_country_code": "US"
    _12
    }
    _12
    ]

    The following table enumerates and describes all the possible error codes within the response body of an HTTP 400: Bad Request.

    Status CodeError MessageDescription
    21470Account SID is requiredAccount SID is missing or invalid
    21470Invalid Account SIDInvalid Account SID
    21471Account not foundValid Account SID, but account not found
    22102Phone Number is requiredThe phone_number field is missing
    22102Invalid Phone NumberPhone number is invalid
    22116Invalid Friendly NameFriendly name is empty or exceeds 128 characters
    22124Phone number(s) are requiredThe phone_numbers field is missing
    22125Phone number(s) cannot exceed the maximum limit allowedNumber of phone numbers cannot exceed one

    Create a bulk eligibility check request

    create-a-bulk-eligibility-check-request page anchor

    Resource URL: https://numbers.twilio.com/v1/HostedNumber/Eligibility/Bulk

    To check a set of up to 1,000 phone numbers' eligibility, make a POST request to this resource. After the bulk eligibility check is created, the next step is to get the results for the bulk request.

    See the following code sample for a complete curl request. See the request properties table for all the properties available on this resource.


    _19
    curl --location --request POST 'https://numbers.twilio.com/v1/HostedNumber/Eligibility/Bulk' \
    _19
    -u "Account_SID:Auth_Token" \
    _19
    --header 'Content-Type: application/json' \
    _19
    --data-raw '{
    _19
    "friendly_name": "My first eligibility check",
    _19
    "phone_numbers": [
    _19
    {
    _19
    "phone_number": "+13175787XXX",
    _19
    "hosting_account_sid": "AC264f0af1e323b9a38e513c433828dXXX"
    _19
    },
    _19
    {
    _19
    "phone_number": "+15017122XXX",
    _19
    "hosting_account_sid": "AC264f0af1e323b9a38e513c433828dXXX"
    _19
    },
    _19
    {
    _19
    "phone_number": "+18003482XXX"
    _19
    }
    _19
    ]
    _19
    }'

    The resource accepts an array of objects called phone_numbers. Each object must contain a phone_number in E.164 format to check for eligibility. A phone_numbers object may also contain a Twilio Account SID (hosting_account_sid) belonging to the Twilio Account where you want to host the phone numbers. If a SID is not provided, the account used to make the request will be used as the hosting Twilio Account. This resource also accepts an optional friendly_name property, which allows you to assign a human-readable reference to the eligibility request.

    ParameterRequiredField TypeValidationDescription
    phone_numbersYes.Array1 ≤ size ≤ 1000An array of one to 1,000 objects containing fields:
    • phone_number, the number (E.164 format) to check for hosting eligibility.
    • hosting_account_sid (optional), the Twilio Account or Subaccount SID where the number will be hosted. If this field is not provided, the authentication Account SID used when making the request will be used as the hosting account.
    friendly_nameYes.StringName of the eligibility check.

    A POST request to the above resource will return a status and request_id, among other properties. Processing a bulk request may require some time depending on the quantity of numbers to be checked. Once the status of your request is "SUCCESSFUL", you can use the request_id to retrieve the eligibility results for the numbers sent in your bulk request as described in the Get results for a bulk request section of this page.

    NameTypeDescription
    statusStringThis is the status of the bulk eligibility check request. Return values include: SUCCESSFUL, QUEUED, PROCESSING).
    date_completeddate_time<ISO8601>Date the request was completed. It will be null until the eligibility check is completed.
    urlURLThis is the URL that you can use to GET the results of the request.
    friendly_nameStringThis is the string that you assigned as a friendly name for describing the eligibility check request.
    resultsObject[]The result set that contains the eligibility check response for each requested number. It will be empty until the eligibility check is completed.
    request_idSID<EC>The SID of the bulk eligibility check.
    date_createddate_time<ISO8601>Date the request was created.

    _10
    {
    _10
    "status": "QUEUED",
    _10
    "date_completed": null,
    _10
    "url": "https://numbers.twilio.com/v1/HostedNumber/Eligibility/Bulk/Request_ID",
    _10
    "friendly_name": "friendly_name",
    _10
    "results": [],
    _10
    "request_id": "Request_ID",
    _10
    "date_created": "2024-03-21T22:06:24Z"
    _10
    }

    The following table enumerates and describes all the possible error codes within the response body of an HTTP 400: Bad Request.

    Status CodeError MessageDescription
    21470Account SID is requiredAccount SID is missing or invalid
    21470Invalid Account SIDInvalid Account SID
    21471Account not foundValid Account SID, but account not found
    22102Phone Number is requiredThe phone_number field is missing
    22102Invalid Phone NumberPhone number is invalid
    22116Invalid Friendly NameFriendly name is empty or exceeds 128 characters
    22124Phone number(s) are requiredThe phone_numbers field is missing
    22125Phone number(s) cannot exceed the maximum limit allowedNumber of phone numbers cannot exceed 1000
    22127Friendly Name is requiredFriendly name is missing

    Get results for a bulk request

    get-results-for-a-bulk-request page anchor

    Resource URL: https://numbers.twilio.com/v1/HostedNumber/Eligibility/Bulk/{request_id}

    To retrieve the eligibility results for the phone numbers passed to the Bulk Eligibility resource, make a GET request to this resource with the request_id returned by your initial POST request to the Bulk Eligibility resource. Once the status of your initial POST request is "SUCCESSFUL", you will see the eligibility status for each phone number in the response from this resource. Descriptions for each eligibility response property are provided in the below response properties table.


    _10
    curl --location --request GET 'https://numbers.twilio.com/v1/HostedNumber/Eligibility/Bulk/ECXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
    _10
    -u "Account_SID:Auth_Token" \
    _10
    --header 'Content-Type: application/json' \

    The following table provides all the properties that may be returned by the resource.

    ParameterDescriptionPossible return values
    phone_numberPhone number that was checked for hosting eligibility.
    hosting_account_sidTwilio's Account or Subaccount SID where the number would be hosted.
    eligibility_statusThe number's eligibility to be hosted with Twilio.
  • "eligible"
  • "ineligible"
  • eligibility_sub_statusAdditional information about why a number cannot be hosted with Twilio.
  • country-ineligible
  • number-format-ineligible
  • number-type-ineligible
  • carrier-ineligible
  • already-in-twilio
  • internal-processing-error
  • invalid-phone-number
  • invalid-hosting-account-sid
  • eligible-by-manual-process
  • may-be-eligible-by-manual-process
  • eligible
  • ineligibility_reasonThe primary reason the number cannot be hosted with Twilio.
  • eligible-for-hosting
  • country-not-supported
  • number-format-ineligible
  • number-type-ineligible
  • numbers-provider-does-not-allow-twilio-to-host-it
  • already-in-twilio-but-not-in-use
  • already-in-twilio-and-in-hosting-process
  • already-in-twilio-for-both-capabilities
  • already-in-twilio-without-messaging-capability
  • already-in-twilio-owned-by-other-account
  • internal-processing-error
  • invalid-phone-number
  • hosting-account-sid-does-not-belong-to-your-account
  • hosting-account-sid-does-not-exist
  • eligible-for-hosting-by-manual-process
  • missing-provider-data
  • already-hosted-in-twilio
  • support-validation-required-number-without-an-approved-nnid
  • next_stepAction that customers can take based on the eligibility result.
  • none
  • create-hosted-number-order
  • edit-ineligible-number-and-run-eligibility-check-again
  • manage-hosting-order
  • recover-messaging-capability
  • contact-support-ineligible-carrier
  • contact-support-internal-transfer
  • contact-support-ineligible-inventory-status
  • number-type-cannot-be-hosted
  • retry-the-eligibility-check
  • update-hosting-account-sid
  • contact-support-to-manually-host-the-number
  • contact-support-missing-provider-data
  • contact-support-for-manual-process
  • contact-support-to-retire-previous-orders
  • phone_number_typeThe phone number's type.
  • toll-free
  • local
  • mobile
  • unknown
  • iso_country_codeThe country to which the number belongs.

    The following example responses are provided for your reference.


    _30
    {
    _30
    "status": "SUCCESSFUL",
    _30
    "date_completed": "2024-03-21T22:07:20Z",
    _30
    "url": "https://numbers.twilio.com/v1/HostedNumber/Eligibility/Bulk/Request_ID",
    _30
    "friendly_name": "friendly_name",
    _30
    "results": [
    _30
    {
    _30
    "phone_number": "+1XXXXXXXXXX",
    _30
    "next_step": "NUMBER_TYPE_CANNOT_BE_HOSTED",
    _30
    "phone_number_type": "MOBILE",
    _30
    "eligibility_sub_status": "NUMBER_TYPE_INELIGIBLE",
    _30
    "eligibility_status": "INELIGIBLE",
    _30
    "hosting_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    _30
    "ineligibility_reason": "NUMBER_TYPE_INELIGIBLE",
    _30
    "iso_country_code": "US"
    _30
    },
    _30
    {
    _30
    "phone_number": "+493333344444544XXX",
    _30
    "next_step": "EDIT_INELIGIBLE_NUMBER_AND_RUN_ELIGIBILITY_CHECK_AGAIN",
    _30
    "phone_number_type": "UNKNOWN",
    _30
    "eligibility_sub_status": "NUMBER_FORMAT_INELIGIBLE",
    _30
    "eligibility_status": "INELIGIBLE",
    _30
    "hosting_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    _30
    "ineligibility_reason": "NUMBER_FORMAT_INELIGIBLE",
    _30
    "iso_country_code": null
    _30
    }
    _30
    ],
    _30
    "request_id": "Request_ID",
    _30
    "date_created": "2024-03-21T22:06:24Z"
    _30
    }

    Processing (not completed yet)

    processing-not-completed-yet page anchor

    _30
    {
    _30
    "status": "PROCESSING",
    _30
    "date_completed": null,
    _30
    "url": "https://numbers.twilio.com/v1/HostedNumber/Eligibility/Bulk/Request_ID",
    _30
    "friendly_name": "friendly_name",
    _30
    "results": [
    _30
    {
    _30
    "phone_number": "+1XXXXXXXXXX",
    _30
    "next_step": "NUMBER_TYPE_CANNOT_BE_HOSTED",
    _30
    "phone_number_type": "MOBILE",
    _30
    "eligibility_sub_status": "NUMBER_TYPE_INELIGIBLE",
    _30
    "eligibility_status": "INELIGIBLE",
    _30
    "hosting_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    _30
    "ineligibility_reason": "NUMBER_TYPE_INELIGIBLE",
    _30
    "iso_country_code": "US"
    _30
    },
    _30
    {
    _30
    "phone_number": "+493333344444544XXX",
    _30
    "next_step": "EDIT_INELIGIBLE_NUMBER_AND_RUN_ELIGIBILITY_CHECK_AGAIN",
    _30
    "phone_number_type": "UNKNOWN",
    _30
    "eligibility_sub_status": "NUMBER_FORMAT_INELIGIBLE",
    _30
    "eligibility_status": "INELIGIBLE",
    _30
    "hosting_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    _30
    "ineligibility_reason": "NUMBER_FORMAT_INELIGIBLE",
    _30
    "iso_country_code": null
    _30
    }
    _30
    ],
    _30
    "request_id": "Request_ID",
    _30
    "date_created": "2024-03-21T22:06:24Z"
    _30
    }


    Rate this page: