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

SIP Domain Resource


A SIP Domain resource describes a custom DNS hostname that can accept SIP traffic for your account. A SIP request to that domain, such as to sip:alice@example.sip.twilio.com, routes to Twilio. Twilio authenticates the request and requests TwiML from the voice_url of the SIP Domain.


SIP Domain Authentication

Your SIP Domain must map at least one of these two authentication methods or requests to it will be blocked.


SipDomain Properties

Property nameTypePIIDescription
account_sidSID<AC>
Not PII

The SID of the Account that created the SipDomain resource.

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

api_versionstring

The API version used to process the call.


auth_typestring

The types of authentication you have mapped to your domain. Can be: IP_ACL and CREDENTIAL_LIST. If you have both defined for your domain, both will be returned in a comma delimited string. If auth_type is not defined, the domain will not be able to receive any traffic.


date_createdstring<date-time-rfc-2822>

date_updatedstring<date-time-rfc-2822>

The date and time in GMT that the resource was last updated specified in RFC 2822 format.


domain_namestring

The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and "-" and must end with sip.twilio.com.


friendly_namestring

The string that you assigned to describe the resource.


sidSID<SD>

The unique string that that we created to identify the SipDomain resource.

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

uristring

The URI of the resource, relative to https://api.twilio.com.


voice_fallback_methodenum<http-method>

The HTTP method we use to call voice_fallback_url. Can be: GET or POST.

Possible values:
GETPOST

voice_fallback_urlstring<uri>
PII MTL: 30 days

The URL that we call when an error occurs while retrieving or executing the TwiML requested from voice_url.


voice_methodenum<http-method>

The HTTP method we use to call voice_url. Can be: GET or POST.

Possible values:
GETPOST

voice_status_callback_methodenum<http-method>

The HTTP method we use to call voice_status_callback_url. Either GET or POST.

Possible values:
GETPOST

voice_status_callback_urlstring<uri>

The URL that we call to pass status parameters (such as call ended) to your application.


voice_urlstring<uri>

The URL we call using the voice_method when the domain receives a call.


subresource_urisobject<uri-map>

A list of mapping resources associated with the SIP Domain resource identified by their relative URIs.


sip_registrationboolean

Whether to allow SIP Endpoints to register with the domain to receive calls.


emergency_calling_enabledboolean

Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.


secureboolean

Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain.


byoc_trunk_sidSID<BY>

The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with.

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

emergency_caller_sidSID<PN>

Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call.

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

Create a SipDomain resource

POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains.json

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that will create the resource.

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

Request body parameters

Property nameTypeRequiredPIIDescription
DomainNamestringrequired

The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and "-" and must end with sip.twilio.com.


FriendlyNamestringOptional

A descriptive string that you created to describe the resource. It can be up to 64 characters long.


VoiceUrlstring<uri>Optional

The URL we should when the domain receives a call.


VoiceMethodenum<http-method>Optional

The HTTP method we should use to call voice_url. Can be: GET or POST.

Possible values:
GETPOST

VoiceFallbackUrlstring<uri>Optional

The URL that we should call when an error occurs while retrieving or executing the TwiML from voice_url.


VoiceFallbackMethodenum<http-method>Optional

The HTTP method we should use to call voice_fallback_url. Can be: GET or POST.

Possible values:
GETPOST

VoiceStatusCallbackUrlstring<uri>Optional

The URL that we should call to pass status parameters (such as call ended) to your application.


VoiceStatusCallbackMethodenum<http-method>Optional

The HTTP method we should use to call voice_status_callback_url. Can be: GET or POST.

Possible values:
GETPOST

SipRegistrationbooleanOptional

Whether to allow SIP Endpoints to register with the domain to receive calls. Can be true or false. true allows SIP Endpoints to register with the domain to receive calls, false does not.


EmergencyCallingEnabledbooleanOptional

Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.


SecurebooleanOptional

Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain.


ByocTrunkSidSID<BY>Optional

The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with.

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

EmergencyCallerSidSID<PN>Optional

Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call.

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

Create a SipDomain resource

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
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 createSipDomain() {
_16
const domain = await client.sip.domains.create({ domainName: "domain_name" });
_16
_16
console.log(domain.accountSid);
_16
}
_16
_16
createSipDomain();

Output

_26
{
_26
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"api_version": "2010-04-01",
_26
"auth_type": "IP_ACL",
_26
"date_created": "Mon, 20 Jul 2015 17:27:10 +0000",
_26
"date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",
_26
"domain_name": "domain_name",
_26
"friendly_name": "Scranton Office",
_26
"sip_registration": true,
_26
"sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_26
"subresource_uris": {
_26
"credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json",
_26
"ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json"
_26
},
_26
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_26
"voice_fallback_method": "POST",
_26
"voice_fallback_url": null,
_26
"voice_method": "POST",
_26
"voice_status_callback_method": "POST",
_26
"voice_status_callback_url": null,
_26
"voice_url": "https://dundermifflin.example.com/twilio/app.php",
_26
"emergency_calling_enabled": true,
_26
"secure": true,
_26
"byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_26
"emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_26
}


Fetch a SipDomain resource

GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that created the SipDomain resource to fetch.

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

SidSID<SD>required

The Twilio-provided string that uniquely identifies the SipDomain resource to fetch.

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

Fetch a SipDomain resource

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
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 fetchSipDomain() {
_18
const domain = await client.sip
_18
.domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_18
.fetch();
_18
_18
console.log(domain.accountSid);
_18
}
_18
_18
fetchSipDomain();

Output

_26
{
_26
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"api_version": "2010-04-01",
_26
"auth_type": "IP_ACL",
_26
"date_created": "Mon, 20 Jul 2015 17:27:10 +0000",
_26
"date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",
_26
"domain_name": "dunder-mifflin-scranton.sip.twilio.com",
_26
"friendly_name": "Scranton Office",
_26
"sip_registration": true,
_26
"sid": "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"subresource_uris": {
_26
"credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json",
_26
"ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json"
_26
},
_26
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_26
"voice_fallback_method": "POST",
_26
"voice_fallback_url": null,
_26
"voice_method": "POST",
_26
"voice_status_callback_method": "POST",
_26
"voice_status_callback_url": null,
_26
"voice_url": "https://dundermifflin.example.com/twilio/app.php",
_26
"emergency_calling_enabled": true,
_26
"secure": true,
_26
"byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_26
"emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_26
}


Read multiple SipDomain resources

GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains.json

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that created the SipDomain resources to read.

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

Query parameters

Property nameTypeRequiredPIIDescription
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.

Read multiple SipDomain resources

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
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 listSipDomain() {
_16
const domains = await client.sip.domains.list({ limit: 20 });
_16
_16
domains.forEach((d) => console.log(d.accountSid));
_16
}
_16
_16
listSipDomain();

Output

_38
{
_38
"domains": [
_38
{
_38
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_38
"api_version": "2010-04-01",
_38
"auth_type": "IP_ACL",
_38
"date_created": "Mon, 20 Jul 2015 17:27:10 +0000",
_38
"date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",
_38
"domain_name": "dunder-mifflin-scranton.sip.twilio.com",
_38
"friendly_name": "Scranton Office",
_38
"sip_registration": true,
_38
"sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_38
"subresource_uris": {
_38
"credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json",
_38
"ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json"
_38
},
_38
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_38
"voice_fallback_method": "POST",
_38
"voice_fallback_url": null,
_38
"voice_method": "POST",
_38
"voice_status_callback_method": "POST",
_38
"voice_status_callback_url": null,
_38
"voice_url": "https://dundermifflin.example.com/twilio/app.php",
_38
"emergency_calling_enabled": true,
_38
"secure": true,
_38
"byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_38
"emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_38
}
_38
],
_38
"start": 0,
_38
"end": 0,
_38
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0",
_38
"next_page_uri": null,
_38
"page": 0,
_38
"page_size": 50,
_38
"previous_page_uri": null,
_38
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0"
_38
}


Update a SipDomain resource

POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that created the SipDomain resource to update.

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

SidSID<SD>required

The Twilio-provided string that uniquely identifies the SipDomain resource to update.

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

Request body parameters

Property nameTypeRequiredPIIDescription
FriendlyNamestringOptional

A descriptive string that you created to describe the resource. It can be up to 64 characters long.


VoiceFallbackMethodenum<http-method>Optional

The HTTP method we should use to call voice_fallback_url. Can be: GET or POST.

Possible values:
GETPOST

VoiceFallbackUrlstring<uri>Optional

The URL that we should call when an error occurs while retrieving or executing the TwiML requested by voice_url.


VoiceMethodenum<http-method>Optional

The HTTP method we should use to call voice_url

Possible values:
GETPOST

VoiceStatusCallbackMethodenum<http-method>Optional

The HTTP method we should use to call voice_status_callback_url. Can be: GET or POST.

Possible values:
GETPOST

VoiceStatusCallbackUrlstring<uri>Optional

The URL that we should call to pass status parameters (such as call ended) to your application.


VoiceUrlstring<uri>Optional

The URL we should call when the domain receives a call.


SipRegistrationbooleanOptional

Whether to allow SIP Endpoints to register with the domain to receive calls. Can be true or false. true allows SIP Endpoints to register with the domain to receive calls, false does not.


DomainNamestringOptional

The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and "-" and must end with sip.twilio.com.


EmergencyCallingEnabledbooleanOptional

Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.


SecurebooleanOptional

Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain.


ByocTrunkSidSID<BY>Optional

The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with.

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

EmergencyCallerSidSID<PN>Optional

Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call.

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

Update a SipDomain resource

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
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 updateSipDomain() {
_18
const domain = await client.sip
_18
.domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_18
.update({ friendlyName: "friendly_name" });
_18
_18
console.log(domain.accountSid);
_18
}
_18
_18
updateSipDomain();

Output

_26
{
_26
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"api_version": "2010-04-01",
_26
"auth_type": "IP_ACL",
_26
"date_created": "Mon, 20 Jul 2015 17:27:10 +0000",
_26
"date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",
_26
"domain_name": "dunder-mifflin-scranton.sip.twilio.com",
_26
"friendly_name": "friendly_name",
_26
"sip_registration": true,
_26
"sid": "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"subresource_uris": {
_26
"credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json",
_26
"ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json"
_26
},
_26
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_26
"voice_fallback_method": "POST",
_26
"voice_fallback_url": null,
_26
"voice_method": "POST",
_26
"voice_status_callback_method": "POST",
_26
"voice_status_callback_url": null,
_26
"voice_url": "https://dundermifflin.example.com/twilio/app.php",
_26
"emergency_calling_enabled": true,
_26
"secure": true,
_26
"byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_26
"emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_26
}


Delete a SipDomain resource

DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that created the SipDomain resources to delete.

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

SidSID<SD>required

The Twilio-provided string that uniquely identifies the SipDomain resource to delete.

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

Delete a SipDomain resource

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_14
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = twilio(accountSid, authToken);
_14
_14
async function deleteSipDomain() {
_14
await client.sip.domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").remove();
_14
}
_14
_14
deleteSipDomain();


Rate this page: