aethexDocs
Twilio logo
Telephony

Twilio

Bring your own Twilio account to place and receive calls on your Twilio numbers.

How it works

Connect your Twilio account to Aethex and run agents on the Twilio numbers you already own. Calls are placed and received through your Twilio account, so your numbers, billing, and carrier relationship stay with Twilio. Aethex handles the agent: speech, language, tools, and call flow.

Connect a number

Store your Twilio credentials once, then register a Twilio number and point it at an agent. The auth token is encrypted at rest and never returned in a response.

Store credentials, then route a number
bash
# 1. Store your Twilio credentials (auth token is encrypted at rest)
#    Response includes the Aethex UUID for this account — use it in step 2
curl -X POST https://api.aethexai.com/api/v1/twilio-accounts \
  -H "X-API-Key: $AETHEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "account_sid": "ACxxxxxxxx", "auth_token": "your-twilio-auth-token" }'

# 2. Register a Twilio number and point it at an agent
#    twilio_account_id is the UUID returned by step 1
curl -X POST https://api.aethexai.com/api/v1/phone-numbers/twilio/register \
  -H "X-API-Key: $AETHEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "phone_number": "+14155550100", "twilio_account_id": "<TWILIO_ACCOUNT_UUID>", "agent_id": "<your-agent-id>" }'

What you get

Your Twilio numbers answered by the agent you choose, and outbound calls placed through your Twilio account. Numbers you register stay scoped to your workspace, so no other account can claim them.

Note
Keep your Twilio auth token current. If you rotate it in Twilio, update it here so calls keep connecting.

API reference

For every request and response field, see the Twilio Accounts API reference. The same account sends your text messages: see Text messaging.