> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rasen.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rasen.ai/_mcp/server.

# Manage telephony connections

Telephony management requires `numbers.assign`. The API supports connections for Exotel, Plivo,
Smartflo, Twilio and Vobiz. Credentials are write-only: reads return connection metadata, never
credential values. Creating or replacing a connection with credentials also requires `secrets.manage`.

## Connections

Use `GET /telephony/connections` to list connections. To create one, send its `provider`, optional
`label` and provider-specific `credentials` to `POST /telephony/connections` with an
`Idempotency-Key`. The credentials object contains string values; use the fields required by your
provider and keep them in a secret manager.

Read `GET /telephony/connections/{connection_id}` before replacement or disable. Send its ETag in
`If-Match`, plus an idempotency key, with `PUT` or `DELETE` on that path. A replacement contains
the provider and credentials again. Disabling a connection is a soft disable.

## Discover and import numbers

List numbers already available through a connection:

```bash
curl -sS "$RASEN_API_BASE/telephony/connections/$CONNECTION_ID/available-phone-numbers" \
  -H "Authorization: Bearer $RASEN_API_KEY"
```

Import 1 to 50 existing carrier numbers in one request:

```bash
IMPORT_KEY=$(uuidgen)
curl --fail-with-body -sS -X POST "$RASEN_API_BASE/telephony/phone-numbers/import" \
  -H "Authorization: Bearer $RASEN_API_KEY" -H "Idempotency-Key: $IMPORT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"connection_id": "connection_…",
       "numbers": [{"number": "+12025550123", "label": "Support line"}]}'
```

Import does not purchase a number. After import, use [Phone routing](/guides/phone-numbers) to
assign a published agent for inbound or outbound calls.

## Remove an imported number

`DELETE /telephony/phone-numbers/{number_id}` removes the local imported number record. It requires
the number's current ETag and an idempotency key. It does not release the number at the carrier.

Use the [API Reference](/api-reference) for connection metadata, import results and refusal reasons.
An `account_changed` or `credentials_changed` conflict requires you to read and reconcile the
connection before repeating the intended action.