Phone numbers
Use numbers already imported into the workspace. You can connect carrier accounts and import numbers through the Telephony management API, or in the Rasen app. Importing a number does not buy it from a carrier.
Each number has an ETag, equal to the body’s revision. Every change sends it in If-Match.
Outbound: let an agent call from a number
The answer is the number with its new revision and outbound_agent_ids. Adding a pair that is
already there, or removing one that is not, changes nothing and keeps the revision. Other agents on
the number are never touched. DELETE on the same path removes the agent.
Inbound: answer a number with an agent
A number answers inbound calls with at most one agent, across every workspace.
The assignment is saved first. With configure_inbound: true the platform then asks the carrier to
route the number, and setup_state says what happened:
setup_state is an open list: treat a value you do not know as unknown, never as success. The
setup can also be refused outright with 409 carrier_action_required or
409 carrier_capability_unsupported (details.carrier and details.capability).
409 conflictwithreason: connected_elsewheremeans another workspace answers this number inbound. Nothing about that workspace is disclosed. The number can still be used for outbound calls.- Removing the inbound agent (
DELETE …/assignments/inbound) stops the platform answering. It does not change the carrier: the answer issetup_state: not_required, andnext_actionsays the carrier may still route the number. POST /phone-numbers/{number_id}/provisionis an explicit new setup attempt for a number that has an inbound agent. It never creates a second carrier application. Without an inbound agent it answers409 conflictwithreason: inbound_agent_required.
Retries and visibility
- Every assignment and provisioning change stores its full answer. A replay with the same key returns
that answer with its original
ETag, and it is answered before the current revision is checked. - Use a new key for each new provisioning attempt;
GET /phone-numbers/{number_id}shows the current setup state. - A number of another workspace, a removed number and a malformed number ID all answer
404 not_found. Carrier references and credentials never appear in an answer.