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

# Connect Twilio

> Add a Twilio line with your Account SID and Auth Token; Athena creates the Elastic SIP Trunk and places calls through it.

When you add a Twilio line, Athena uses your Twilio keys to create an **Elastic SIP Trunk** for that line (secured with
TLS and SRTP, with its own credential list) and places every call through it. You don't create the trunk yourself.

## Before you start

* The **Account SID** (starts with `AC`) and **Auth Token** of the Twilio account that owns your phone numbers.
* **Elastic SIP Trunking** available on that account.
* The Twilio number you want to call from, in international format (for example `+14155550100`).

## Add the line

**1. Create the line**

Open **Telephony**, select **Add configuration**, choose **Twilio**, and enter the Account SID and Auth Token. When you save, Athena checks with Twilio that these keys can use Elastic SIP Trunking. If they can't, the save is refused and the dialog says what to change.

**2. Add your number**

Open **Manage Phone Numbers** on the line and add the number you call from. It must belong to the same Twilio account.

**3. Wait about one minute**

Athena creates the trunk. In the Twilio console under **Elastic SIP Trunking > Trunks**, a trunk named `dograh-<line number>` appears.

**4. Place a test call**

Saving proves the keys; a test call proves the line.

> [!NOTE]
>
> Don't edit or delete a `dograh-...` trunk or its credential list while the line is in use.

## Using the API

Create the line with `POST /api/v1/organizations/telephony-configs`, then add numbers with
`POST /api/v1/organizations/telephony-configs/{config_id}/phone-numbers`
([reference](https://docs.tryopencomputer.com/api-reference/organizations/create-phone-number.md)). A save refused because of the keys returns HTTP 422
with the fix in `detail`.

## When calls don't go out

| What you see | What to do |
| - | - |
| Save refused: "These Twilio keys cannot use Elastic SIP Trunking" | Use the Account SID and Auth Token of the account that owns the numbers, and check that Elastic SIP Trunking is available on it. |
| "This line has no phone number yet" | Add the number you call from to this line, then call again. |
| The trunk exists, but calls to one country fail | Allow that destination in the Twilio account's calling permissions, then call again. |
| The line shows **Calls on this line are not going out** | Open the line: the reason and the time of the last try are shown there. |

If a call still doesn't go out, send support the line's configuration ID and the time of the test call. Don't send keys.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.