Authorization Document Resource
Danger
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.
Property nameTypePIIDescription
A 34 character string that uniquely identifies this AuthorizationDocument.
Pattern: ^PX[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument.
Pattern: ^AD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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.
Possible values: opened
signing
signed
canceled
failed
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.
date_createdstring<date-time>
date_updatedstring<date-time>
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. |
POST https://preview.twilio.com/HostedNumbers/AuthorizationDocuments
Create an Authorization Document for authorizing the hosting of phone numbers' capability on Twilio's platform.
The resource is explicit and all Hosted Number Orders added upon creation are the entire list of numbers that are assigned to the Authorization Document. Once the POST
to create a new Authorization Document has been created, the LOA will immediately be sent out for signature.
Property nameTypeRequiredPIIDescription
HostedNumberOrderSidsarray[string]required A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform.
AddressSidSID<AD>required A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument.
Pattern: ^AD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Email that this AuthorizationDocument will be sent to for signing.
ContactTitlestringrequired The title of the person authorized to sign the Authorization Document for this phone number.
ContactPhoneNumberstringrequired The contact phone number of the person authorized to sign the Authorization Document.
CcEmailsarray[string]Optional Email recipients who will be informed when an Authorization Document has been sent and signed.
_23// Download the helper library from https://www.twilio.com/docs/node/install
_23const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_23// Find your Account SID and Auth Token at twilio.com/console
_23// and set the environment variables. See http://twil.io/secure
_23const accountSid = process.env.TWILIO_ACCOUNT_SID;
_23const authToken = process.env.TWILIO_AUTH_TOKEN;
_23const client = twilio(accountSid, authToken);
_23async function createAuthorizationDocument() {
_23 const authorizationDocument =
_23 await client.preview.hosted_numbers.authorizationDocuments.create({
_23 addressSid: "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_23 contactPhoneNumber: "ContactPhoneNumber",
_23 contactTitle: "ContactTitle",
_23 hostedNumberOrderSids: ["HostedNumberOrderSids"],
_23 console.log(authorizationDocument.sid);
_23createAuthorizationDocument();
_16 "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_16 "date_created": "2017-03-28T20:06:39Z",
_16 "date_updated": "2017-03-28T20:06:39Z",
_16 "dependent_hosted_number_orders": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders"
_16 "sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_16 "url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
GET https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/{Sid}
Property nameTypeRequiredPIIDescription
A 34 character string that uniquely identifies this AuthorizationDocument.
Pattern: ^PX[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
_18// Download the helper library from https://www.twilio.com/docs/node/install
_18const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18// Find your Account SID and Auth Token at twilio.com/console
_18// and set the environment variables. See http://twil.io/secure
_18const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18const authToken = process.env.TWILIO_AUTH_TOKEN;
_18const client = twilio(accountSid, authToken);
_18async function fetchAuthorizationDocument() {
_18 const authorizationDocument = await client.preview.hosted_numbers
_18 .authorizationDocuments("PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18 console.log(authorizationDocument.sid);
_18fetchAuthorizationDocument();
_16 "address_sid": "AD11111111111111111111111111111111",
_16 "date_created": "2017-03-28T20:06:39Z",
_16 "date_updated": "2017-03-28T20:06:39Z",
_16 "email": "test@twilio.com",
_16 "dependent_hosted_number_orders": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders"
_16 "sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_16 "url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
GET https://preview.twilio.com/HostedNumbers/AuthorizationDocuments
Property nameTypeRequiredPIIDescription
Email that this AuthorizationDocument will be sent to for signing.
Statusenum<string>Optional 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.
Possible values: opened
signing
signed
canceled
failed
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum: 1
Maximum: 1000
The page index. This value is simply for client state.
Minimum: 0
The page token. This is provided by the API.
_19// Download the helper library from https://www.twilio.com/docs/node/install
_19const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19// Find your Account SID and Auth Token at twilio.com/console
_19// and set the environment variables. See http://twil.io/secure
_19const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19const authToken = process.env.TWILIO_AUTH_TOKEN;
_19const client = twilio(accountSid, authToken);
_19async function listAuthorizationDocument() {
_19 const authorizationDocuments =
_19 await client.preview.hosted_numbers.authorizationDocuments.list({
_19 authorizationDocuments.forEach((a) => console.log(a.sid));
_19listAuthorizationDocument();
_12 "first_page_url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?Status=signed&Email=test%2Bhosted%40twilio.com&PageSize=50&Page=0",
_12 "next_page_url": null,
_12 "previous_page_url": null,
_12 "url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?Status=signed&Email=test%2Bhosted%40twilio.com&PageSize=50&Page=0"
POST https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/{Sid}
Requests to update a single, existing Authorization Documents instance resource's properties and returns the updated resource representation if successful.
Warning
Authorization Documents can only be updated when in opened status. To update the Authorization Document, update the Status to opened
.
Property nameTypeRequiredPIIDescription
A 34 character string that uniquely identifies this AuthorizationDocument.
Pattern: ^PX[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Property nameTypeRequiredPIIDescription
HostedNumberOrderSidsarray[string]Optional A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform.
AddressSidSID<AD>Optional A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument.
Pattern: ^AD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Email that this AuthorizationDocument will be sent to for signing.
CcEmailsarray[string]Optional Email recipients who will be informed when an Authorization Document has been sent and signed
Statusenum<string>Optional 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.
Possible values: opened
signing
signed
canceled
failed
ContactTitlestringOptional The title of the person authorized to sign the Authorization Document for this phone number.
ContactPhoneNumberstringOptional The contact phone number of the person authorized to sign the Authorization Document.
_18// Download the helper library from https://www.twilio.com/docs/node/install
_18const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18// Find your Account SID and Auth Token at twilio.com/console
_18// and set the environment variables. See http://twil.io/secure
_18const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18const authToken = process.env.TWILIO_AUTH_TOKEN;
_18const client = twilio(accountSid, authToken);
_18async function updateAuthorizationDocument() {
_18 const authorizationDocument = await client.preview.hosted_numbers
_18 .authorizationDocuments("PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18 .update({ hostedNumberOrderSids: ["HostedNumberOrderSids"] });
_18 console.log(authorizationDocument.sid);
_18updateAuthorizationDocument();
_16 "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_16 "date_created": "2017-03-28T20:06:39Z",
_16 "date_updated": "2017-03-28T20:06:39Z",
_16 "email": "test+hosted@twilio.com",
_16 "dependent_hosted_number_orders": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders"
_16 "sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_16 "url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"