The Hosted Phone Numbers API is currently in development and not intended for use by new customers. This documentation exists to support customers who are already using the API. A new version of this API will be released as a generally available (GA) product in the near future. New customers should wait for the Hosted Phone Numbers GA release.
An Authorization Document is a resource representing a legally binding document between Twilio and a customer to Authorize Twilio to run messaging traffic on a given set of Phone Numbers.
Hosted Number Orders can be assigned to an Authorization Document detailing which Address a Hosted Number Order is activated with. Once the Authorization Document has been signed, the Hosted Number Orders will then be registered to Twilio for routing capability.
Status | Description |
---|---|
opened | Document is open and mutable. |
signing | Document has been sent out to the Email for signature and is immutable. |
signed | Document has been signed by the Email recipient and is immutable. |
canceled | Document has been canceled by the Email recipient and is immutable. |
failed | Document has failed with an error and is immutable. |
application/x-www-form-urlencoded
A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform.
A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument.
^AD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Email that this AuthorizationDocument will be sent to for signing.
The title of the person authorized to sign the Authorization Document for this phone number.
The contact phone number of the person authorized to sign the Authorization Document.
Email recipients who will be informed when an Authorization Document has been sent and signed.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createHostedNumbersAuthorizationDocument() {11const authorizationDocument =12await client.preview.hosted_numbers.authorizationDocuments.create({13addressSid: "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14contactPhoneNumber: "ContactPhoneNumber",15contactTitle: "ContactTitle",16email: "Email",17hostedNumberOrderSids: ["HostedNumberOrderSids"],18});1920console.log(authorizationDocument.sid);21}2223createHostedNumbersAuthorizationDocument();
1{2"address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"cc_emails": [4"test1@twilio.com",5"test2@twilio.com"6],7"date_created": "2017-03-28T20:06:39Z",8"date_updated": "2017-03-28T20:06:39Z",9"email": "Email",10"links": {11"dependent_hosted_number_orders": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders"12},13"sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"status": "signing",15"url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"16}
A 34 character string that uniquely identifies this AuthorizationDocument.
^PX[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchHostedNumbersAuthorizationDocument() {11const authorizationDocument = await client.preview.hosted_numbers12.authorizationDocuments("PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(authorizationDocument.sid);16}1718fetchHostedNumbersAuthorizationDocument();
1{2"address_sid": "AD11111111111111111111111111111111",3"cc_emails": [4"aaa@twilio.com",5"bbb@twilio.com"6],7"date_created": "2017-03-28T20:06:39Z",8"date_updated": "2017-03-28T20:06:39Z",9"email": "test@twilio.com",10"links": {11"dependent_hosted_number_orders": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders"12},13"sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"status": "signing",15"url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"16}
Email that this AuthorizationDocument will be sent to for signing.
Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled Status Values for more information on each of these statuses.
opened
signing
signed
canceled
failed
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listHostedNumbersAuthorizationDocument() {11const authorizationDocuments =12await client.preview.hosted_numbers.authorizationDocuments.list({13limit: 20,14});1516authorizationDocuments.forEach((a) => console.log(a.sid));17}1819listHostedNumbersAuthorizationDocument();
1{2"meta": {3"first_page_url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?Status=signed&Email=test%2Bhosted%40twilio.com&PageSize=50&Page=0",4"key": "items",5"next_page_url": null,6"page": 0,7"page_size": 50,8"previous_page_url": null,9"url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?Status=signed&Email=test%2Bhosted%40twilio.com&PageSize=50&Page=0"10},11"items": []12}
A 34 character string that uniquely identifies this AuthorizationDocument.
^PX[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform.
A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument.
^AD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Email that this AuthorizationDocument will be sent to for signing.
Email recipients who will be informed when an Authorization Document has been sent and signed
Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled Status Values for more information on each of these statuses.
opened
signing
signed
canceled
failed
The title of the person authorized to sign the Authorization Document for this phone number.
The contact phone number of the person authorized to sign the Authorization Document.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateHostedNumbersAuthorizationDocument() {11const authorizationDocument = await client.preview.hosted_numbers12.authorizationDocuments("PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.update({ hostedNumberOrderSids: ["HostedNumberOrderSids"] });1415console.log(authorizationDocument.sid);16}1718updateHostedNumbersAuthorizationDocument();
1{2"address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"cc_emails": [4"test1@twilio.com",5"test2@twilio.com"6],7"date_created": "2017-03-28T20:06:39Z",8"date_updated": "2017-03-28T20:06:39Z",9"email": "test+hosted@twilio.com",10"links": {11"dependent_hosted_number_orders": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders"12},13"sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"status": "signing",15"url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"16}