Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Regional


Twilio's Global Infrastructure enables you to ensure that your application's Twilio data remains within the corresponding territory at all times, and that your commands execute with the shortest possible round trips to Twilio's servers. Twilio Regions are supported by the CLI as well, so you can continue to use the CLI without worrying about data residency.

In addition to Regions, you can control which geographic location your network request enters and exits Twilio's platform by defining an Edge Location. The Edge Location used by the CLI can be controlled either by setting it as a configuration, or with an environment variable.


Profile settings

profile-settings page anchor

You can specify the target Region for a profile using the --region and --edge flags:

twilio login --region au1 --edge sydney
(warning)

Warning

When creating a regional profile, you must specify both --region and --edge flags together. The edge location determines the network entry point for API requests made with this profile.

Valid region and edge combinations:

  • Australia Region (au1): --edge sydney
  • Ireland Region (ie1): --edge dublin
  • Japan Region (jp1): --edge tokyo

For a complete list of edge locations, see Edge Locations.

Profile Creation With Regional Credentials

profile-creation-with-regional-credentials page anchor

When creating a regional profile, you must use region-specific credentials. Each Twilio Region has its own Auth Token that is different from your default (US1) Auth Token.

To find your region-specific Auth Token:

  1. Log in to the Twilio Console(link takes you to an external page) and navigate to API keys & tokens(link takes you to an external page).
  2. In the Region dropdown, select your target region.
  3. In the Live credentials section, click the eye icon to view the Auth Token for that region.

Use this region-specific Auth Token when prompted during twilio login.

Example creating an Australia region profile:

1
$ twilio login --region au1 --edge sydney
2
You can find your Account SID and Auth Token at https://www.twilio.com/console
3
» Your Auth Token will be used once to create an API Key for future CLI access
4
? The Account SID for your Twilio Account: ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5
? Your Twilio Auth Token (must be AU1-specific): [hidden]
6
? Shorthand identifier for your profile: australia-prod
(information)

Info

The CLI stores both region and edge in your profile. All API requests made using this profile will automatically use the correct regional endpoint.

For more information on managing regional credentials, see Manage Regional API Credentials.


The Edge Location used by the CLI can be controlled by setting it as a configuration:

twilio config:set --edge=sydney

You can also specify the target Region, Edge, or both by using environment variables:

export TWILIO_REGION=au1
export TWILIO_EDGE=sydney
(information)

Info

Environment variables (TWILIO_REGION and TWILIO_EDGE) take precedence over profile settings. If you set these environment variables, they will override the region and edge configured in your active profile.