Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this pageProducts used
Looking for more inspiration?Visit the

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.


Available API features

available-api-features page anchor

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:

For an in-depth list of available Messaging features in IE1, see Messaging IE1 Feature Availability.


(warning)

Warning

You can access these messaging features for SMS in IE1 in the new Twilio Console:

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:

1. Create IE1-specific API credentials

1-create-ie1-specific-api-credentials page anchor

To authenticate requests to the IE1 Region, you must create region-specific API keys. See Manage regional API credentials to get started.

2. Configure your senders for IE1

2-configure-your-senders-for-ie1 page anchor

To send SMS with phone numbers or short codes, update the number's region to IE1 for messaging. This allows the number to send in the region and processes inbound messages in IE1.

To set a phone number region to IE1, follow these steps in the Twilio Console:

  1. Go to Communications > Numbers & senders > Overview(link takes you to an external page), then click your phone number.
  2. In the Regional tab, check your phone number's active region.
  3. Click Change active region.
  4. Select your desired region and click Update region.

To set a short code's region to IE1 or update a phone number's region in code, use the Regional Configuration API.

Alphanumeric sender IDs do not require additional configuration to be used in IE1, since they do not support inbound messaging.

3. Send messages in IE1 through the API or SDK

3-send-messages-in-ie1-through-the-api-or-sdk page anchor

Once your credentials and senders are prepared, you can begin sending messages by targeting the IE1-specific base API URLs or by configuring your SDK to use the IE1 region. See the API or SDK sections for details and examples.


Using the Programmable Messaging API in IE1

using-the-programmable-messaging-api-in-ie1 page anchor

To make API requests to the IE1 Region, use the following base URLs:

API ResourceAPI URL for Ireland (IE1) Region
Messageshttps://api.dublin.ie1.twilio.com/2010-04-01/Accounts/$ACCOUNT_SID/Messages/
Messaging Serviceshttps://messaging.dublin.ie1.twilio.com/v1/Services
Incoming Phone Numbershttps://api.dublin.ie1.twilio.com/2010-04-01/Accounts/$ACCOUNT_SID/IncomingPhoneNumbers/
Short Codeshttps://api.dublin.ie1.twilio.com/2010-04-01/Accounts/$ACCOUNT_SID/SMS/ShortCodes/

To send an SMS message through the IE1 Region, make a POST request to the Messages resource using the IE1 base URL.

Send an SMS message through IE1

send-an-sms-message-through-ie1 page anchor
1
curl -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=+353XXXXXXXXX" \
4
--data-urlencode "To=+353XXXXXXXXX" \
5
-u {IE1_API_KEY_SID}:{IE1_API_KEY_SECRET}

Messaging Services in IE1

messaging-services-in-ie1 page anchor
(information)

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(link takes you to an external page) in the Console. For a list of Messaging Service features 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.

Create a Messaging Service in IE1

create-a-messaging-service-in-ie1 page anchor
1
curl -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 sender to an IE1 Messaging Service, make a POST request to the appropriate subresource under the Messaging Service using the IE1 base URL.

(information)

Configure region first

Before adding phone numbers and short codes to a Messaging Service in IE1, configure them for IE1. Alphanumeric sender IDs don't require configuration.

Add a phone number sender to an IE1 Messaging Service

add-a-phone-number-sender-to-an-ie1-messaging-service page anchor
1
curl -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}

Add an alphanumeric sender ID to an IE1 Messaging Service

add-an-alphanumeric-sender-id-to-an-ie1-messaging-service page anchor
1
curl -X POST "https://messaging.twilio.com/v1/Services/{ServiceSid}/AlphaSenders" \
2
--data-urlencode "AlphaSender=My company" \
3
-u {IE1_API_KEY_SID}:{IE1_API_KEY_SECRET}

Add a short code sender to an IE1 Messaging Service

add-a-short-code-sender-to-an-ie1-messaging-service page anchor
1
curl -X POST "https://messaging.dublin.ie1.twilio.com/v1/Services/{ServiceSid}/ShortCodes" \
2
--data-urlencode "ShortCodeSid={ShortCodeSid}" \
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 MessagingServiceSid parameter in your API request:

Send a message with an IE1 Messaging Service

send-a-message-with-an-ie1-messaging-service page anchor
1
curl -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 "MessagingServiceSid={MessagingServiceSid}" \
4
--data-urlencode "To=+353XXXXXXXXX" \
5
-u {IE1_API_KEY_SID}:{IE1_API_KEY_SECRET}

Configure inbound SMS webhooks

configure-inbound-sms-webhooks page anchor

Inbound webhooks for messages received in IE1 can be configured at the phone number, short code, or messaging service level.

Using the Incoming Phone Numbers resource:

Configure an inbound webhook on a phone number

configure-an-inbound-webhook-on-a-phone-number page anchor
1
curl -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 ShortCodes resource:

Configure an inbound webhook on a short code

configure-an-inbound-webhook-on-a-short-code page anchor
1
curl -X POST "https://api.dublin.ie1.twilio.com/2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes/{ShortCodeSid}.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:

Configure an inbound webhook on a Messaging Service

configure-an-inbound-webhook-on-a-messaging-service page anchor
1
curl -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-urlencode "UseInboundWebhookOnNumber=false" \
5
-u {IE1_API_KEY_SID}:{IE1_API_KEY_SECRET}

Using the Twilio SDKs with IE1

using-the-twilio-sdks-with-ie1 page anchor

When using Twilio SDKs, specify the edge and region parameters to target the IE1 Region. For example, using the Node.js SDK:

Target the IE1 Region with the Node.js SDK

target-the-ie1-region-with-the-nodejs-sdk page anchor
1
const twilio = require('twilio');
2
3
const ie1ApiKey = 'IE1_API_KEY';
4
const ie1ApiSecret = 'IE1_API_SECRET';
5
6
const client = twilio(ie1ApiKey, ie1ApiSecret, {
7
accountSid: accountSid,
8
edge: 'dublin',
9
region: 'ie1'
10
});