Use the Programmable Messaging API with Twilio Regions
You can use the Programmable Messaging API in Twilio's Ireland (IE1) region for EU data residency.
For more information on how SMS personal data is processed when using this feature, see the overview of EU Data Residency for SMS.
This guide explains how to configure your application to use the Programmable Messaging API with the IE1 Region. For a general overview of Twilio Regions, see Understanding Twilio Regions. For information about the Messaging API, see Programmable Messaging API Overview.
With SMS in the IE1 region, you can use the Programmable Messaging API to send and receive SMS messages with EU Data Residency. This includes:
- Configuring the phone number to be used in IE1 using the new Twilio Console or Phone Number Regional Configuration API.
- Sending outbound SMS using alphanumeric sender IDs and phone numbers that have been enabled in the IE1 region.
- Programmable Messaging API Messages resource to send and manage SMS messages.
- Messaging Services resource to manage messaging services and their senders.
- Inbound SMS processing with webhooks configured through either:
- The Incoming Phone Numbers resource.
- Messaging Services webhooks.
For an in-depth list of available Messaging features in IE1, see Messaging IE1 Feature Availability.
Warning
Messaging features in IE1 are only available in the new Twilio Console. The legacy Twilio Console does not support Messaging IE1 features.
You can access these messaging features for SMS in IE1 in the new Twilio Console:
- Configuring phone numbers for IE1 in Numbers and Senders.
- Setting a phone number's active region to IE1 from the Regional tab.
- Configuring a phone number's webhook from the Messaging tab.
- Managing Messaging Services in IE1.
- Messaging Logs in IE1.
- Messaging Insights in IE1.
For an in-depth list of available Messaging features in IE1, see Messaging IE1 Feature Availability.
Any Twilio customer can use the Programmable Messaging API in IE1. To get started, follow these steps:
To authenticate requests to the IE1 Region, you must create region-specific API keys. See Manage regional API credentials to get started.
If you plan on sending with phone numbers, you must update the phone number's active region to IE1 for messaging. This ensures that inbound messages and webhooks configured on the phone number are processed in IE1.
To set a phone number active region to IE1, follow these steps in the Console:
- Navigate to Numbers & Senders > Phone Numbers, then select your phone number.
- In the Regional tab, check your phone number's active region.
- Click Change active region.
- Select the region you want to switch to, and click Update region.
Use the Phone Number Regional Configuration API to set the active region programmatically.
Alphanumeric sender IDs do not require additional configuration to be used in IE1, since they do not support inbound messaging.
Once your credentials and senders are prepared, you can begin sending messages by targeting the IE1-specific base AP URLs or by configuring your SDK to use the IE1 region. See the API or SDK sections for details and examples.
To make API requests to the IE1 Region, use the following base URLs:
| API Resource | API URL for Ireland (IE1) Region |
|---|---|
| Messages | https://api.dublin.ie1.twilio.com/2010-04-01/Accounts/$ACCOUNT_SID/Messages/ |
| Messaging Services | https://messaging.dublin.ie1.twilio.com/v1/Services |
| Incoming Phone Numbers | https://api.dublin.ie1.twilio.com/2010-04-01/Accounts/$ACCOUNT_SID/IncomingPhoneNumbers/ |
Info
Only the dublin edge location is supported for messaging API requests in IE1.
To send an SMS message through the IE1 Region, make a POST request to the Messages resource using the IE1 base URL.
1curl -X POST "https://api.dublin.ie1.twilio.com/2010-04-01/Accounts/*ACCOUNT_SID*/Messages.json" \2--data-urlencode "Body=Hello from IE1!" \3--data-urlencode "From=+35XXXXXXXXXX" \4--data-urlencode "To=+35XXXXXXXXXX" \5-u {IE1_API_KEY_SID}:{IE1_API_KEY_SECRET}
Info
Messaging Services are isolated within their region and cannot be used in or transferred to a different region.
You can create and manage messaging services using the Services resource in IE1 or Messaging Services in the Console. For a list of Messaging Service features currently supported in IE1, see Messaging IE1 Feature Availability.
To create a Messaging Service in the IE1 Region, make a POST request to the Services resource using the IE1 base URL.
1curl -X POST "https://messaging.dublin.ie1.twilio.com/v1/Services" \2--data-urlencode "FriendlyName=My IE1 Messaging Service" \3-u {IE1_API_KEY_SID}:{IE1_API_KEY_SECRET}
To add a Messaging Service sender in IE1, make a POST request to the appropriate subresource under the Messaging Service using the IE1 base URL.
Info
Only phone number senders that are configured for IE1 can be added to Messaging Services in IE1.
1curl -X POST "https://messaging.dublin.ie1.twilio.com/v1/Services/{ServiceSid}/PhoneNumbers" \2--data-urlencode "PhoneNumber=+35XXXXXXXXXX" \3-u {IE1_API_KEY_SID}:{IE1_API_KEY_SECRET}
To send messages with the Messaging Service in IE1, include the Messaging Service SID as the From parameter in your API request:
1curl -X POST "https://api.dublin.ie1.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json" \2--data-urlencode "Body=Hello from IE1 Messaging Service!" \3--data-urlencode "From={ServiceSid}" \4--data-urlencode "To=+35XXXXXXXXXX" \5-u {IE1_API_KEY_SID}:{IE1_API_KEY_SECRET}
Inbound webhooks for messages received in IE1 can be configured at the phone number or messaging service level.
Set a phone number webhook from Numbers and Senders or the service webhook from Messaging Services in the Console.
Using the Incoming Phone Numbers resource:
1curl -X POST "https://api.dublin.ie1.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{PhoneNumberSid}.json" \2--data-urlencode "SmsUrl=https://www.example.com/sms" \3--data-urlencode "SmsMethod=POST" \4-u {IE1_API_KEY_SID}:{IE1_API_KEY_SECRET}
Using the Messaging Services resource:
1curl -X POST "https://messaging.dublin.ie1.twilio.com/v1/Services/{ServiceSid}" \2--data-urlencode "InboundRequestUrl=https://www.example.com/sms" \3--data-urlencode "InboundMethod=POST" \4--data-urlendcode "useInboundWebhookOnNumber=false" \5-u {IE1_API_KEY_SID}:{IE1_API_KEY_SECRET}
When using Twilio SDKs, specify the edge and region parameters to target the IE1 Region. For example, using the Node.js SDK:
1const twilio = require('twilio');23const ie1ApiKey = 'IE1_API_KEY';4const ie1ApiSecret = 'IE1_API_SECRET';56const client = twilio(ie1ApiKey, ie1ApiSecret, {7accountSid: accountSid,8edge: 'dublin',9region: 'ie1'10});