> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cartesia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Regional Routing

> How Twilio regions affect call routing and credential scoping.

Twilio phone numbers are scoped to a region through the API credentials used to manage them.

This region determines how Twilio API calls are routed — this can help optimize latency by directing region-specific traffic to a regional Cartesia cluster.

## How It Works

When you import a Twilio phone number into Cartesia:

1. **Twilio routes the call regionally**: Twilio directs incoming calls to the region configured on the API key managing that number — `us1`, `ie1` (Ireland), or `au1` (Australia).
2. **Cartesia must target the same region**: To act on a live call (transfers, hold, hangup), Cartesia sends API requests back to Twilio. These requests must reach the same region where Twilio is handling the call.
3. **Setting the region on the provider keeps both sides aligned**: When you specify a region on your Cartesia provider, all outgoing API requests from Cartesia automatically target the correct Twilio regional edge.

The region is tied to the provider's API credentials, not the phone number's country code or your agent's deployment region. A UK number (`+44...`) under a `us1` provider may route to a US Twilio server. To route it through the closest server instead, create it under an `ie1` (Ireland) API key.

<Warning>
  If the region is missing or incorrect, operations like transfers and outbound calls fail. The region on Twilio credentials must match the region specified in Cartesia.
</Warning>

## Configuration

<Steps>
  <Step title="Check your Twilio region">
    In the [Twilio Console](https://console.twilio.com/), go to **Phone Numbers → Manage → Active numbers**, select your number, and check the **Edge Location** under **Voice & Fax**.

    Supported regions: `us1` (US, default), `ie1` (Ireland), `au1` (Australia).
  </Step>

  <Step title="Set the region in Twilio (if needed)">
    If the edge location doesn't match your desired region, update it in the **Voice & Fax** section of your phone number configuration and save.

    <Note>
      Non-default regions require a region-specific API key from Twilio. A standard US key will not work for `ie1` or `au1` routing and will result in authentication errors.
    </Note>
  </Step>

  <Step title="Match the region in Cartesia">
    When you create a provider or import a phone number, set the `region` field to match your Twilio configuration. If the regions don't match, mid-call operations like transfers will fail with authentication errors.

    For non-US regions, you must use a region-specific Twilio API key — a standard US key will not work.
  </Step>
</Steps>

## Setting Up Multi-Region

If you operate in multiple Twilio regions, create a separate provider object for each:

1. In your Twilio account, create a region-specific API key (see [Integration guide, Step 2](/line/integrations/telephony/twilio/integration#step-2-create-an-api-key))
2. Link the same Twilio Account SID with each region:

```bash theme={null}
# US region
curl -X POST "https://api.cartesia.ai/agents/phone-numbers/providers" \
  -H "Authorization: Bearer $CARTESIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Cartesia-Version: 2026-03-01" \
  -d '{
    "type": "twilio",
    "account_sid": "YOUR_TWILIO_ACCOUNT_SID",
    "api_key_sid": "US_API_KEY_SID",
    "api_key_secret": "US_API_KEY_SECRET",
    "region": "us1"
  }'

# Ireland region
curl -X POST "https://api.cartesia.ai/agents/phone-numbers/providers" \
  -H "Authorization: Bearer $CARTESIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Cartesia-Version: 2026-03-01" \
  -d '{
    "type": "twilio",
    "account_sid": "YOUR_TWILIO_ACCOUNT_SID",
    "api_key_sid": "IE_API_KEY_SID",
    "api_key_secret": "IE_API_KEY_SECRET",
    "region": "ie1"
  }'
```

Each Account SID + region pair is unique. Import phone numbers under the provider matching their intended routing region.

## Troubleshooting

| Symptom                                             | Cause                                                           | Fix                                                                                                                |
| --------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| Outbound call fails with auth error                 | API key region doesn't match the provider region in Cartesia    | Verify the region on the provider matches the region your Twilio API key was created for                           |
| Calls route through the wrong region                | Phone number imported under wrong provider                      | Update the phone number's provider via `PATCH /agents/phone-numbers/{id}` with the correct provider ID             |
| Credential update rejected with unreachable numbers | New API key can't access phone numbers in the provider's region | Ensure the new key has access to all numbers. Twilio returns the list of unreachable numbers in the error response |
