Start an agent session on your own call leg
Admits a call that runs the agent’s live published version and returns a signed media WebSocket for a call leg that your switch, carrier, dialer or application already owns. Rasen places, answers and routes no telephone call and needs no phone number. Stream the leg’s audio to websocket_url before expires_at; the agent’s audio comes back on the same socket. Optional expected_version_id only refuses an unexpected live version. Requires current admission capacity: at_capacity and quota_exceeded say to retry with the same key after Retry-After. Same key and body replay the same call, websocket_url and expires_at. The call’s metadata is returned on call reads.
Authentication
Create and manage workspace-owned keys through the existing app session routes, outside this public API. Creator and manager identities are audit actors only. Key validity follows workspace policy, expiry and explicit revocation, independently of creator membership. Do not include a workspace-selection header.
Headers
Stable key per logical intent, 1–255 printable characters. Persist it before sending. Retry the same key/body after an uncertain result for 24 hours. A changed body conflicts. Beyond retention, reconcile the resource before retrying; this is not permanent deduplication. Current authorization is rechecked on replay. Evaluation order: authenticate and check current authorization; look up intent; replay its stored receipt before checking the current revision; only a new intent evaluates If-Match and executes. Fingerprint includes method, path, body and original If-Match. A changed request returns idempotency_key_reused. The server stores only a keyed (HMAC) fingerprint, and no error or response ever returns a fingerprint or hash of a request. In-flight intent returns 409 idempotency_in_progress with Retry-After; retry the same intent after reconciliation. Receipts describe that attempt, not current resource state. A replay returns the original status code and body, with the response header Idempotent-Replayed: true.
Request
A label for call reads and filters. It does not place or answer a call. Omitted, it is the live version’s call_direction setting, or outbound when that is not set.
Optional precondition: refuse if this is not the live version at admission. Does not select an old version.
Flat object of string values. At most 64 keys; each key matches ^[a-z][a-z0-9_]63$. Each value is at most 4096 characters and contains no control characters except tab and newline. The whole object is at most 16 KiB as JSON. Nested objects and non-string values are refused, never converted. Overrides literal defaults; undeclared names are allowed. Credentials are forbidden.
Bounded customer correlation map: at most 16 keys; each key matches ^[a-z][a-z0-9_]63$ (the same form the metadata_key filter accepts); each value at most 512 characters; at most 4 KiB in total. No credential storage. Metadata is not a uniqueness or permanent deduplication guarantee.
Response headers
true when this response replays a stored Idempotency-Key result. The status and body equal the original.
Path-absolute URL of the resource to poll, including the API base path. Agent-scoped knowledge creates point to the canonical knowledge source URL.
Response
The signed media WebSocket URL of this call. It is a credential: connect to it exactly as returned, before expires_at, and do not log it. One socket per call.
The socket must connect and send audio before this time (120 seconds after admission). After it, the reserved capacity is released and the call ends with end_reason never_connected. A replay never extends it.