Check if a single phone number can be ported to Twilio

GET /v1/Porting/Portability/PhoneNumber/{PhoneNumber}

Check if a single phone number can be ported to Twilio

Path parameters

  • PhoneNumber string(phone-number) Required

    Phone number to check portability in e164 format.

Query parameters

  • TargetAccountSid string

    Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

  • AddressSid string

    Address Sid of customer to which the number will be ported.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AD[0-9a-fA-F]{32}$.

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • phone_number string(phone-number) | null

      The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212).

    • account_sid string | null

      Account Sid that the phone number belongs to in Twilio. This is only returned for phone numbers that already exist in Twilio’s inventory and belong to your account or sub account.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • portable boolean | null

      Boolean flag indicates if the phone number can be ported into Twilio through the Porting API or not.

    • pin_and_account_number_required boolean | null

      Indicates if the port in process will require a personal identification number (PIN) and an account number for this phone number. If this is true you will be required to submit both a PIN and account number from the losing carrier for this number when opening a port in request. These fields will be required in order to complete the port in process to Twilio.

    • not_portable_reason string | null

      Reason why the phone number cannot be ported into Twilio, null otherwise.

    • not_portable_reason_code integer | null

      The Portability Reason Code for the phone number if it cannot be ported into Twilio, null otherwise.

    • number_type string

      The type of the requested phone number. One of LOCAL, UNKNOWN, MOBILE, TOLL-FREE.

      Values are LOCAL, UNKNOWN, MOBILE, or TOLL-FREE.

    • country string(iso-country-code) | null

      Country the phone number belongs to.

    • url string(uri) | null

      This is the url of the request that you're trying to reach out to locate the resource.

GET /v1/Porting/Portability/PhoneNumber/{PhoneNumber}
curl \
 --request GET 'https://numbers.twilio.com/v1/Porting/Portability/PhoneNumber/{PhoneNumber}' \
 --user "username:password"
Response examples (200)
{
  "url": "https://numbers.twilio.com/v1/Porting/Portability/PhoneNumber/+18001234567",
  "country": "US",
  "portable": false,
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa01",
  "number_type": "TOLL-FREE",
  "phone_number": "+18001234567",
  "not_portable_reason": "MANUAL_PORTING_AVAILABLE",
  "not_portable_reason_code": 22133,
  "pin_and_account_number_required": false
}