Skip to main content

Overview

The platform telephony plane (client.telephony.*) maps your phone numbers to voice agents on backend-core’s /api/v2/platform/telephony/* surface. The primary flow is attach a number to an agent - what telephony calls the Leg-B termination (Unpod’s SuperSBC routes the inbound call through to your agent on LiveKit). You list your org’s numbers, then attach one or many to an agent. The underlying voice bridge is resolved for you (hidden) - you work with numbers and agents, not bridges.
This plane (client.telephony.*) is distinct from the Speech Stack management plane at client.numbers. The telephony plane is Org-Handle-scoped and needs your API key and org handle (Token auth) - a Bearer UNPOD_API_KEY alone is refused.

Concepts


Authenticate

The telephony plane is org-scoped. Export your host, API key and org handle (Account & keys); a client with no arguments reads them:

List Numbers

Number fields

Every verb on this plane takes the E.164 number - the internal id is not exposed.

Attach Numbers to an Agent

Map one or more numbers to an agent by E.164 number (not id - Django resolves it). The bridge is resolved automatically; each number reports its own outcome (partial-success), so one bad number never fails the rest. With the default attach_type="agent", agent_id must be the handle of an agent your org owns. Otherwise the whole request fails with 400 Agent not found for this organization. and nothing is attached. (attach_type="pipeline" skips this check.) list() also returns numbers your org already attached, so pick the ones whose status is not_assigned:

Result fields

Each NumberResult:
The agent attach returns the per-number lifecycle - there is no carrier origin_endpoint. That belongs to the BYO-carrier (Leg-A) path below.

agent_id is optional

Omit agent_id to wire a number for agent use without binding an agent yet. Don’t call attach again to bind one: the number is already attached, so a second attach fails with 400 No valid unassigned numbers found. Change the agent on the attached number instead:
numbers.agent.change(number, agent_id, *, attach_type=None) defaults to attach_type="pipeline" (a Speech Stack agent). For an agent handle like the one above, pass attach_type="agent", or the call fails with 404 Agent not found. For a Speech Stack agent you can also use client.agents.update(agent_id, number=...) (it sends no attach_type, so it takes the "pipeline" default). Over HTTP, use POST /api/v2/platform/telephony/numbers/reassign/ with {"number": "+14155550100", "agent_id": "asst_sales"} (attach_type is agent by default there). A number attached without an agent can be moved this way. It fails with 409 and a code: Detach first if you want to re-attach.

Attach to a pipe instead of an agent

Pass attach_type="pipeline" with a pipe_id to terminate the number on a Speech Pipe rather than an agent. attach_type defaults to "agent". A pipeline attach without pipe_id fails with 400 (over HTTP the field is supervoice_agent_id; pipe_id is an accepted alias).

Attach for your own app (human_call)

Pass attach_type="human_call" when no agent answers: your app places and answers calls with the Telephony APIs. Leave out agent_id; passing one fails with 400.
See Get a Number for every attach option and error.

Detach Numbers

Release numbers by E.164 number - the inverse of attach. The termination, agent, and pipe are read from the stored record. The number is released, not deleted, so it stays available for a later re-attach.

Check the Lifecycle


Bring Your Own Carrier (Leg A) - Future / Beta

Bringing your own SIP carrier (client.telephony.trunks.*) wires the Leg-A carrier leg. Today that leg is the hardcoded SuperSBC default, so this surface is future/beta - prefer the agent attach above for production. When enabled, the flow is: create a trunk, attach numbers, and point your carrier at the returned origin endpoint.

Common Patterns

Attach the first available number to an agent

Attach many numbers to one agent


Sample code

Runnable code for this page in unpod-ai/sample-apps:

sbc/call_test.py

Attaches a number before calling through the SBC.

Next Steps

Agents

Build the agent your numbers route to.

Numbers

Acquire and manage numbers from the dashboard.