This page covers how to use Twilio's REST API to configure a SIP Trunk Phone Number's emergency Address. Before proceeding, you must read the SIP Trunking Emergency Calling doc.
Don't want to use the REST API? You can also use the Console to configure emergency calling Addresses. See the SIP Trunking Emergency Calling doc for more information.
Emergency Addresses
Before you can configure a Twilio Phone Number for emergency calling, you need to create an emergency Address. An emergency Address is an Address resource with the emergency_enabled property set to true.
You can use the same emergency Address for multiple Phone Numbers if appropriate.
Create a new emergency Address
To create a new emergency Address resource via REST API, create a new Address resource with the emergency_enabled parameter set to true. An example request is shown below.
Create a new emergency Address
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl
_25
// Download the helper library from https://www.twilio.com/docs/node/install
_25
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_25
_25
// Find your Account SID and Auth Token at twilio.com/console
_25
// and set the environment variables. See http://twil.io/secure
The response to this request contains a sid property. This is the Address's SID, which you need when configuring your Phone Numbers.
Use an existing Address resource as an emergency Address
If you already have an Address resource you wish to use as an emergency Address, update the Address resource so that the emergency_enabled property is true as shown in the example below.
Use an existing Address resource as an emergency Address
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
Associate an emergency Address with a Phone Number
Once you've created an emergency Address, you need to update the IncomingPhoneNumber resource's emergency_address_sid property with the emergency Address SID, as shown in the code sample below.
This request requires the SID of the Phone Number. You can find the SIDs of your SIP Trunk's Phone Numbers using the PhoneNumber Subresource.
Associate an emergency Address with a Phone Number
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
You can check on the status of a Phone Number's emergency Address registration by fetching the IncomingPhoneNumber resource and checking the value of the emergency_address_status property. An example of this request is shown below.
Check the emergency Address registration status of a Phone Number
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
To remove an emergency Address from a Phone Number, you need to remove the emergency_address_sid from the IncomingPhoneNumber resource as shown in the example below.
Remove an emergency_address_sid from a Phone Number
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
If you wish to delete an emergency Address, you must first make sure that it is no longer associated with any IncomingPhoneNumber resources (or any other Twilio resource).
You can then delete the Address resource, as shown in the sample request below.
Delete an emergency Address
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