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

Hosted Number Order Resource


(error)

Danger

This Hosted Number Order Resource API will be discontinued from developer preview. All documentation and support will be retired by the end of 2024. A new version of this API is currently in Pilot and will be released as a Public Beta product in the second half of 2024. If you are interested in getting early access to the new version of the API and its documentation, please complete our interest form(link takes you to an external page) and we'll be in touch!

The Hosted Number Orders product allows an account to request for their phone numbers to be hosted on Twilio for SMS. Start the Hosted Number onboarding process by sending a POST to the list resource, which will create a new request to host a phone number, or move the Hosted Number Order along the onboarding process by updating the status of the Hosted Number Orders Instance Resource. Upon creation of a Hosted Number Order instance resource, a corresponding IncomingPhoneNumbers instance resource will also be created. Currently, Twilio only has the ability to onboard landline or toll-free US & Canada numbers that are not currently SMS enabled.

After the number's ownership has been verified, the user will then need to create a new Authorization Document that is electronically signed, giving Twilio permission to route SMS to and from Twilio's network. To see how to interact with the Authorization Documents resource, please visit the Public API reference.

Once the process is completed, users will be able to answer phone calls on their existing infrastructure and leverage the same number identity for two-way SMS on Twilio's platform.


HostedNumberOrder Properties

hostednumberorder-properties page anchor
Property nameTypePIIDescription
sidSID<HR>
Not PII

A 34 character string that uniquely identifies this HostedNumberOrder.

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

account_sidSID<AC>

A 34 character string that uniquely identifies the account.

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

incoming_phone_number_sidSID<PN>

A 34 character string that uniquely identifies the IncomingPhoneNumber resource that represents the phone number being hosted.

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

address_sidSID<AD>

A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.

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

signing_document_sidSID<PX>

A 34 character string that uniquely identifies the Authorization Document the user needs to sign.

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

phone_numberstring<phone-number>

Phone number to be hosted. This must be in E.164(link takes you to an external page) format, e.g., +16175551212


capabilitiesobject<phone-number-capabilities>

Set of booleans describing the capabilities hosted on Twilio's platform. SMS is currently only supported.


friendly_namestring
PII MTL: 30 days

A 64 character string that is a human-readable text that describes this resource.


unique_namestring

Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.


statusenum<string>

Status of this resource. It can hold one of the values: 1. Twilio Processing 2. Received, 3. Pending LOA, 4. Carrier Processing, 5. Completed, 6. Action Required, 7. Failed. See the HostedNumberOrders Status Values section for more information on each of these statuses.

Possible values:
receivedpending-verificationverifiedpending-loacarrier-processingtestingcompletedfailedaction-required

failure_reasonstring

A message that explains why a hosted_number_order went to status "action-required"


date_createdstring<date-time>

The date this resource was created, given as GMT RFC 2822(link takes you to an external page) format.


date_updatedstring<date-time>

The date that this resource was updated, given as GMT RFC 2822(link takes you to an external page) format.


verification_attemptsinteger

The number of attempts made to verify ownership of the phone number that is being hosted.


emailstring

Email of the owner of this phone number that is being hosted.


cc_emailsarray[string]

A list of emails that LOA document for this HostedNumberOrder will be carbon copied to.


urlstring<uri>

The URL of this HostedNumberOrder.


verification_typeenum<string>

The type of ownership verification required to move the number to a verified state. The verification methods are phone-call or phone-bill.

Possible values:
phone-callphone-bill

verification_document_sidSID<RI>

A 34 character string that uniquely identifies the Identity Document resource that represents the document for verifying ownership of the number to be hosted.

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

extensionstring

A numerical extension to be used when making the ownership verification call.


call_delayinteger

A value between 0-30 specifying the number of seconds to delay initiating the ownership verification call.


verification_codestring

A verification code provided in the response for a user to enter when they pick up the phone call.


verification_call_sidsarray[string]

A list of 34 character strings that are unique identifiers for the calls placed as part of ownership verification.


StatusDescription
twilio-processingTwilio is processing your request and will either send to the failed status if the number is not eligible to be hosted, or move the number to received status.
receivedTwilio has received the HostedNumberOrder request and determined that the phone number in the request can be hosted on Twilio's platform.
pending-verificationTwilio is awaiting the Hosted Number Order to be verified by the end-user by picking up the phone and listening to a security token. The verification code is valid for 10 minutes. Subsequent calls to the API within the expiration time will send the same verification code. There can be a max of three verification attempts before the status changes to action_required.
verifiedTwilio has confirmed with a security token that the person answering the phone has verified their request for Hosted SMS.
pending-loaLOA for the HostedNumberOrder has been generated, but the document has not yet been signed by the email recipient specified on the HostedNumberOrder.
carrier-processingLOA for the HostedNumberOrder has been signed, and the phone number has been submitted to Twilio's underlying provider/carrier to enable the specified capabilities.
testingThe phone number is undergoing capability testing for the capabilities specified in this order.
completedHostedNumberOrder onboarding has completed and the phone number is ready for use.
action-requiredHostedNumberOrder onboarding encountered a failure. An operations specialist will investigate the failure.
failedThe Hosted Number Order failed because the number is currently SMS enabled or has been idle for more than 30 days. At this point, it is no longer possible to re-submit the request for the failed Hosted Number Order. However, a new Hosted Number Order can be created for the same phone number once SMS registration has been deactivated on the phone number or the previous Hosted Number Order has failed due to being idle.

HostedNumberOrders Status Callback

status-callback page anchor

When a Hosted Number Order changes status, Twilio will make an asynchronous HTTP request to the StatusCallback URL if you provided one in your API request. By capturing this request, you can determine when the Hosted Number Order changes status.

The Hosted Number Orders status callback request passes the parameters listed in the table below:

StatusDescription
StatusThe new status of the Hosted Number Order
HostedNumberOrderSidThe unique sid of the Hosted Number Order
PhoneNumberThe [+E.164][e164] format of the Hosted Number Order

Create a HostedNumberOrder resource

create-a-hostednumberorder-resource page anchor
POST https://preview.twilio.com/HostedNumbers/HostedNumberOrders

Creates a new Hosted Number Order for the specified capability. Currently, only SMS is a supported capability.

Request body parameters

request-body-parameters page anchor
Property nameTypeRequiredPIIDescription
PhoneNumberstring<phone-number>required

The number to host in +E.164(link takes you to an external page) format


SmsCapabilitybooleanrequired

Used to specify that the SMS capability will be hosted on Twilio's platform.


AccountSidSID<AC>Optional

This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to.

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

FriendlyNamestringOptional

A 64 character string that is a human readable text that describes this resource.


UniqueNamestringOptional

Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.


CcEmailsarray[string]Optional

Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to.


SmsUrlstring<uri>Optional

The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource.


SmsMethodenum<http-method>Optional

The HTTP method that should be used to request the SmsUrl. Must be either GET or POST. This will be copied onto the IncomingPhoneNumber resource.

Possible values:
GETPOST

SmsFallbackUrlstring<uri>Optional

A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource.


SmsFallbackMethodenum<http-method>Optional

The HTTP method that should be used to request the SmsFallbackUrl. Must be either GET or POST. This will be copied onto the IncomingPhoneNumber resource.

Possible values:
GETPOST

StatusCallbackUrlstring<uri>Optional

Optional. The Status Callback URL attached to the IncomingPhoneNumber resource.


StatusCallbackMethodenum<http-method>Optional

Optional. The Status Callback Method attached to the IncomingPhoneNumber resource.

Possible values:
GETPOST

SmsApplicationSidSID<AP>Optional

Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a SmsApplicationSid is present, Twilio will ignore all of the SMS urls above and use those set on the application.

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

AddressSidSID<AD>Optional

Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.

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

EmailstringOptional

Optional. Email of the owner of this phone number that is being hosted.


VerificationTypeenum<string>Optional

Optional. The method used for verifying ownership of the number to be hosted. One of phone-call (default) or phone-bill.

Possible values:
phone-callphone-bill

VerificationDocumentSidSID<RI>Optional

Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill.

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

Create Hosted Number Order

create-hosted-number-order page anchor
Node.js
Python
C#
Java
PHP
Ruby
curl

_20
// Download the helper library from https://www.twilio.com/docs/node/install
_20
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20
_20
// Find your Account SID and Auth Token at twilio.com/console
_20
// and set the environment variables. See http://twil.io/secure
_20
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20
const authToken = process.env.TWILIO_AUTH_TOKEN;
_20
const client = twilio(accountSid, authToken);
_20
_20
async function createHostedNumberOrder() {
_20
const hostedNumberOrder =
_20
await client.preview.hosted_numbers.hostedNumberOrders.create({
_20
phoneNumber: "+15017122661",
_20
smsCapability: true,
_20
});
_20
_20
console.log(hostedNumberOrder.sid);
_20
}
_20
_20
createHostedNumberOrder();

Output

_28
{
_28
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_28
"address_sid": "AD11111111111111111111111111111111",
_28
"call_delay": 0,
_28
"capabilities": {
_28
"sms": true,
_28
"voice": false
_28
},
_28
"cc_emails": [],
_28
"date_created": "2017-03-28T20:06:39Z",
_28
"date_updated": "2017-03-28T20:06:39Z",
_28
"email": "test@twilio.com",
_28
"extension": null,
_28
"failure_reason": "",
_28
"friendly_name": null,
_28
"incoming_phone_number_sid": "PN11111111111111111111111111111111",
_28
"phone_number": "+15017122661",
_28
"sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_28
"signing_document_sid": null,
_28
"status": "received",
_28
"unique_name": null,
_28
"url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_28
"verification_attempts": 0,
_28
"verification_call_sids": null,
_28
"verification_code": null,
_28
"verification_document_sid": null,
_28
"verification_type": "phone-call"
_28
}


Fetch a HostedNumberOrder resource

fetch-a-hostednumberorder-resource page anchor
GET https://preview.twilio.com/HostedNumbers/HostedNumberOrders/{Sid}

Returns a single, existing Hosted Number Orders instance resource specified by the requested Hosted Number Orders instance resource SID.

Property nameTypeRequiredPIIDescription
SidSID<HR>required

A 34 character string that uniquely identifies this HostedNumberOrder.

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

Fetch a HostedNumberOrder

fetch-a-hostednumberorder page anchor
Node.js
Python
C#
Java
PHP
Ruby
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 fetchHostedNumberOrder() {
_18
const hostedNumberOrder = await client.preview.hosted_numbers
_18
.hostedNumberOrders("HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.fetch();
_18
_18
console.log(hostedNumberOrder.sid);
_18
}
_18
_18
fetchHostedNumberOrder();

Output

_34
{
_34
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"address_sid": "AD11111111111111111111111111111111",
_34
"call_delay": 15,
_34
"capabilities": {
_34
"sms": true,
_34
"voice": false
_34
},
_34
"cc_emails": [
_34
"aaa@twilio.com",
_34
"bbb@twilio.com"
_34
],
_34
"date_created": "2017-03-28T20:06:39Z",
_34
"date_updated": "2017-03-28T20:06:39Z",
_34
"email": "test@twilio.com",
_34
"extension": "5105",
_34
"failure_reason": "",
_34
"friendly_name": "friendly_name",
_34
"incoming_phone_number_sid": "PN11111111111111111111111111111111",
_34
"phone_number": "+14153608311",
_34
"sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"signing_document_sid": "PX11111111111111111111111111111111",
_34
"status": "received",
_34
"unique_name": "foobar",
_34
"url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"verification_attempts": 0,
_34
"verification_call_sids": [
_34
"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"
_34
],
_34
"verification_code": "8794",
_34
"verification_document_sid": null,
_34
"verification_type": "phone-call"
_34
}


Read multiple HostedNumberOrder resources

read-multiple-hostednumberorder-resources page anchor
GET https://preview.twilio.com/HostedNumbers/HostedNumberOrders

Property nameTypeRequiredPIIDescription
Statusenum<string>Optional

The Status of this HostedNumberOrder. One of received, pending-verification, verified, pending-loa, carrier-processing, testing, completed, failed, or action-required.

Possible values:
receivedpending-verificationverifiedpending-loacarrier-processingtestingcompletedfailedaction-required

PhoneNumberstring<phone-number>Optional

An E164 formatted phone number hosted by this HostedNumberOrder.


IncomingPhoneNumberSidSID<PN>Optional

A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder.

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

FriendlyNamestringOptional

A human readable description of this resource, up to 64 characters.


UniqueNamestringOptional

Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.


PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

List multiple HostedNumberOrders

list-multiple-hostednumberorders page anchor
Node.js
Python
C#
Java
PHP
Ruby
curl

_17
// Download the helper library from https://www.twilio.com/docs/node/install
_17
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_17
_17
// Find your Account SID and Auth Token at twilio.com/console
_17
// and set the environment variables. See http://twil.io/secure
_17
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_17
const authToken = process.env.TWILIO_AUTH_TOKEN;
_17
const client = twilio(accountSid, authToken);
_17
_17
async function listHostedNumberOrder() {
_17
const hostedNumberOrders =
_17
await client.preview.hosted_numbers.hostedNumberOrders.list({ limit: 20 });
_17
_17
hostedNumberOrders.forEach((h) => console.log(h.sid));
_17
}
_17
_17
listHostedNumberOrder();

Output

_12
{
_12
"meta": {
_12
"first_page_url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders?Status=completed&FriendlyName=example&PhoneNumber=%2B19193608000&UniqueName=something123&IncomingPhoneNumberSid=PNzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz&PageSize=50&Page=0",
_12
"key": "items",
_12
"next_page_url": null,
_12
"page": 0,
_12
"page_size": 50,
_12
"previous_page_url": null,
_12
"url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders?Status=completed&FriendlyName=example&PhoneNumber=%2B19193608000&UniqueName=something123&IncomingPhoneNumberSid=PNzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz&PageSize=50&Page=0"
_12
},
_12
"items": []
_12
}


Update a HostedNumberOrder resource

update-a-hostednumberorder-resource page anchor
POST https://preview.twilio.com/HostedNumbers/HostedNumberOrders/{Sid}

Tries to update a single, existing Hosted Number Orders instance resource's properties and returns the updated resource representation if successful. The returned response is identical to that returned above when fetching.

Property nameTypeRequiredPIIDescription
SidSID<HR>required

A 34 character string that uniquely identifies this HostedNumberOrder.

Pattern: ^HR[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
FriendlyNamestringOptional

A 64 character string that is a human readable text that describes this resource.


UniqueNamestringOptional

Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.


EmailstringOptional

Email of the owner of this phone number that is being hosted.


CcEmailsarray[string]Optional

Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to.


Statusenum<string>Optional

User can only post to pending-verification status to transition the HostedNumberOrder to initiate a verification call or verification of ownership with a copy of a phone bill.

Possible values:
receivedpending-verificationverifiedpending-loacarrier-processingtestingcompletedfailedaction-required

VerificationCodestringOptional

A verification code that is given to the user via a phone call to the phone number that is being hosted.


VerificationTypeenum<string>Optional

Optional. The method used for verifying ownership of the number to be hosted. One of phone-call (default) or phone-bill.

Possible values:
phone-callphone-bill

VerificationDocumentSidSID<RI>Optional

Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill.

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

ExtensionstringOptional

Digits to dial after connecting the verification call.


CallDelayintegerOptional

The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0.

Update Friendly Name of Hosted Number Order

update-friendly-name-of-hosted-number-order page anchor
Node.js
Python
C#
Java
PHP
Ruby
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 updateHostedNumberOrder() {
_18
const hostedNumberOrder = await client.preview.hosted_numbers
_18
.hostedNumberOrders("HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.update({ friendlyName: "My important hosted number order" });
_18
_18
console.log(hostedNumberOrder.sid);
_18
}
_18
_18
updateHostedNumberOrder();

Output

_34
{
_34
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"address_sid": "AD11111111111111111111111111111111",
_34
"call_delay": 15,
_34
"capabilities": {
_34
"sms": true,
_34
"voice": false
_34
},
_34
"cc_emails": [
_34
"test1@twilio.com",
_34
"test2@twilio.com"
_34
],
_34
"date_created": "2017-03-28T20:06:39Z",
_34
"date_updated": "2017-03-28T20:06:39Z",
_34
"email": "test+hosted@twilio.com",
_34
"extension": "1234",
_34
"failure_reason": "",
_34
"friendly_name": "My important hosted number order",
_34
"incoming_phone_number_sid": "PN11111111111111111111111111111111",
_34
"phone_number": "+14153608311",
_34
"sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"signing_document_sid": "PX11111111111111111111111111111111",
_34
"status": "pending-loa",
_34
"unique_name": "new unique name",
_34
"url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"verification_attempts": 1,
_34
"verification_call_sids": [
_34
"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"
_34
],
_34
"verification_code": "8794",
_34
"verification_document_sid": null,
_34
"verification_type": "phone-call"
_34
}

Prove Ownership with Phone Call

prove-ownership-with-phone-call page anchor
Node.js
Python
C#
Java
PHP
Ruby
curl

_21
// Download the helper library from https://www.twilio.com/docs/node/install
_21
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21
_21
// Find your Account SID and Auth Token at twilio.com/console
_21
// and set the environment variables. See http://twil.io/secure
_21
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21
const authToken = process.env.TWILIO_AUTH_TOKEN;
_21
const client = twilio(accountSid, authToken);
_21
_21
async function updateHostedNumberOrder() {
_21
const hostedNumberOrder = await client.preview.hosted_numbers
_21
.hostedNumberOrders("HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_21
.update({
_21
status: "pending-verification",
_21
verificationType: "phone-call",
_21
});
_21
_21
console.log(hostedNumberOrder.sid);
_21
}
_21
_21
updateHostedNumberOrder();

Output

_34
{
_34
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"address_sid": "AD11111111111111111111111111111111",
_34
"call_delay": 15,
_34
"capabilities": {
_34
"sms": true,
_34
"voice": false
_34
},
_34
"cc_emails": [
_34
"test1@twilio.com",
_34
"test2@twilio.com"
_34
],
_34
"date_created": "2017-03-28T20:06:39Z",
_34
"date_updated": "2017-03-28T20:06:39Z",
_34
"email": "test+hosted@twilio.com",
_34
"extension": "1234",
_34
"failure_reason": "",
_34
"friendly_name": "new friendly name",
_34
"incoming_phone_number_sid": "PN11111111111111111111111111111111",
_34
"phone_number": "+14153608311",
_34
"sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"signing_document_sid": "PX11111111111111111111111111111111",
_34
"status": "pending-verification",
_34
"unique_name": "new unique name",
_34
"url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"verification_attempts": 1,
_34
"verification_call_sids": [
_34
"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"
_34
],
_34
"verification_code": "8794",
_34
"verification_document_sid": null,
_34
"verification_type": "phone-call"
_34
}


Ownership Verification is a security measure to host the number with Twilio for SMS to ensure the authenticity of the request.


Delete a HostedNumberOrder resource

delete-a-hostednumberorder-resource page anchor
DELETE https://preview.twilio.com/HostedNumbers/HostedNumberOrders/{Sid}

Cancels the Hosted Number Order, and consequently, deletes the corresponding Incoming Phone Number.

(warning)

Warning

You can only issue the DELETE request when the HostedNumberOrder status is in received, pending-verification, verified or pending-loa. If the Hosted Number Order is completed, you can off-board the Twilio platform by issuing a DELETE request to the corresponding IncomingPhoneNumbers. If the Hosted Number Order is in a failed state due to either current SMS enablement or idle timeout, a new Hosted Number Order can be created. Please note that the Hosted Number Order will keep failing if SMS enablement is not removed from the number.

Property nameTypeRequiredPIIDescription
SidSID<HR>required

A 34 character string that uniquely identifies this HostedNumberOrder.

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

Delete a HostedNumberOrder

delete-a-hostednumberorder page anchor
Node.js
Python
C#
Java
PHP
Ruby
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 deleteHostedNumberOrder() {
_16
await client.preview.hosted_numbers
_16
.hostedNumberOrders("HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_16
.remove();
_16
}
_16
_16
deleteHostedNumberOrder();


Rate this page: