aethexDocs

API Reference

Carrier Connect

Link a Telnyx account by API key and auto-provision a working SIP trunk from one of your Telnyx numbers — no carrier-portal visits, no copying SIP credentials.

Base URL
https://api.aethexai.com/api/v1
Endpoints
5
Scopes
carrier_accounts:readcarrier_accounts:writesip_trunks:writephone_numbers:write
POST/integrations/telephony/carriers

Validate a carrier API key and store it (encrypted).

Link Carrier Account

Validates the API key against the carrier, then stores it encrypted at rest. The key is never returned in any response. Uses the self-serve carrier_accounts:write scope. One active account per carrier per tenant — release the existing one before linking another.

Request body

3
  • providerstringrequired

    Carrier to link: telnyx.

  • api_keystringrequired

    The carrier REST API key. Validated against the carrier before it is stored; never echoed back.

  • labelstringoptional

    Optional human-readable label.

Errors

5
422Unprocessable Entity

The carrier rejected the API key, or the provider is unknown.

Check the API key and that provider is telnyx.

409Conflict

A carrier account for this provider is already linked.

Release the existing account before linking another.

429Too Many Requests

Per-tenant link rate limit exceeded (5/min).

Retry after the Retry-After interval.

502Bad Gateway

The carrier's API rejected key validation with an upstream error (e.g. a carrier-side rate limit on the balance/profile read).

Retry shortly; if it persists, check the carrier account's API status.

503Service Unavailable

The carrier API was unreachable, the rate limiter is offline, or the encryption key is missing.

Retry shortly; if it persists, contact support.

POST/integrations/telephony/carriers/:id/connect

Auto-provision: carrier connection → Aethex edge → SIP trunk.

Connect a Number

Drives the carrier's REST API to create a SIP connection pointed at the Aethex edge and assign phone_number, then stands up the matching Aethex SIP trunk and — if agent_id is given — routes inbound calls on the number to that agent. Telnyx is register-style (a Telnyx Credential Connection). Carrier-side objects are rolled back if the trunk creation fails.

Path & Query

1
  • idstringrequired

    UUID of the linked carrier account.

Request body

2
  • phone_numberstringrequired

    E.164 number on the carrier account to connect (e.g. +14155550100).

  • agent_idstringoptional

    Route inbound calls on this number to this agent.

Errors

6
404Not Found

No such linked account, or agent_id not found.

Link the carrier account first; check the agent id.

422Unprocessable Entity

The carrier rejected the stored API key, or the body is malformed.

Re-link the carrier account with a valid key; check phone_number is E.164.

409Conflict

The number is already registered to a trunk (on this or another tenant).

Release the existing registration first, or use a number that isn't connected.

429Too Many Requests

Per-account connect rate limit exceeded (3/min).

Retry after the Retry-After interval.

502Bad Gateway

Telnyx refused a provisioning step (e.g. the number is not on the account).

Confirm the number is on the Telnyx account.

503Service Unavailable

The carrier API was unreachable, or the encryption key is missing.

Retry shortly.

GET/integrations/telephony/carriers

List this tenant's linked carrier accounts.

List Carrier Accounts

Returns linked carrier accounts (metadata only — the API key is never returned). Paginated.

Path & Query

2
  • limitintegeroptional

    How many rows to return. 1–200, defaults to 50.

  • offsetintegeroptional

    How many rows to skip before the first one returned. Defaults to 0.

GET/integrations/telephony/carriers/:id

Fetch one linked carrier account.

Get Carrier Account

Returns a single carrier account's metadata (provider, label, status). The API key is never returned.

Path & Query

1
  • idstringrequired

    UUID of the carrier account.

Errors

1
404Not Found

No carrier account with that id under this tenant.

Check the account id.

DELETE/integrations/telephony/carriers/:id

Release a linked carrier account (idempotent).

Release Carrier Account

Marks the carrier account released. Idempotent — returns 204 whether it was active, already released, or absent. SIP trunks already provisioned from it are left untouched.

Path & Query

1
  • idstringrequired

    UUID of the carrier account.