Create a WebSocket call
Reserves a call and returns a single-use WebSocket URL for streaming raw audio from your own backend. The URL carries its own token, is valid for about two minutes, and can be connected exactly once.
Connecting to that URL can itself be refused with 503 and body {"code": "capacity"} when the serving replica has no free call slot. The reservation is not consumed in that case, so create a new call and connect again.
The message protocol — audio framing and every JSON event in both directions — is documented under Platform → Voice Agents → WebSocket transport.
Authorization
personalAccessToken Personal Access Token of a Dynamiq user — the only credential accepted by the management API (api.*). Prefix dyn_pat_ (legacy uak_ tokens still authenticate). Send as Authorization: Bearer <token>.
In: header
Path Parameters
Voice agent UUID.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/agents/voice/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/calls/websocket" \ -H "Content-Type: application/json" \ -d '{}'{
"data": {
"call_id": "0d0a16ab-a508-4d58-bf24-5dc3cb248f3e",
"websocket_url": "string",
"audio_format": {
"encoding": "pcm_s16le",
"sample_rate": 8000,
"container": "raw"
},
"expires_at": "2019-08-24T14:15:22Z"
}
}{
"error": {
"code": "bad_request",
"message": "Bad Request",
"details": {
"input": "cannot be blank"
}
}
}{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"code": "not_found",
"message": "Not Found"
}
}Create a WebRTC session
Mints a short-lived realtime session for a browser or mobile client. Call this from your server and hand the client only `url` and `token` — the Personal Access Token must never reach the client. Note this response is **bare**: it is not wrapped in a `data` envelope.
Create a WebRTC session for a draft agent
Mints a realtime session without requiring a saved agent — pass a full `config` inline to talk to a configuration that has not been created yet. This is what the builder's **Live Preview** uses. Pass `agent_id` instead to mint a session for a saved agent; that is equivalent to `POST /v1/agents/voice/agents/{agent_id}/rooms`. The response is **bare** — it is not wrapped in a `data` envelope.