Skip to navigation

Manage telephony connections

Connect a carrier, import existing numbers, and route them to published agents.

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:

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:

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 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 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.