API reference

Voice test

Get a short-lived token to talk to an agent from a browser, without a phone call.

A voice test lets you speak with an agent through a browser microphone instead of a phone line. This endpoint does not start the conversation itself. It returns the WebSocket address of the voice engine and a token that lets one browser open one test call with one agent. The browser voice test guide shows how to use them, and testing without a phone lists the other options.

OperationMethod and pathMinimum role
Create a voice test tokenPOST /agent-voice-test/{agent_id}member

Note: A voice test needs the voice engine to be running and reachable from the browser at the returned address. The address is operator-configured; when the operator has not set a public one, a local development address is returned.

Create a voice test token

POST /agent-voice-test/{agent_id}

Returns where the browser should connect and a signed token for one test call with this agent. The token is valid for 120 seconds and can be used once. Request a new token for each test call.

The test call is recorded as an ordinary execution: it has a transcript and a recording, and it is charged like a call but without a telephony cost. It is marked with context_details.web_call so you can tell it apart from phone calls. See Executions.

Auth: API key or session token. Role: member and up.

ParameterInTypeRequiredDescription
agent_idpathstring (UUID)yesThe agent to talk to. It must belong to the caller's account.

The request has no body.

Request

bash
curl -X POST https://api.sevennadi.si/agent-voice-test/3c9d2f8e-1a2b-4c3d-8e4f-5a6b7c8d9e0f \
  -H "Authorization: Bearer vk-0123456789abcdef0123456789abcdef"

Response 200 OK

json
{
  "ws_url": "wss://engine.sevennadi.si/web",
  "token": "MDNkMDY0YWEuLi4.0123456789abcdef0123456789abcdef01234567",
  "expires_in": 120
}
FieldMeaning
ws_urlThe voice engine's WebSocket endpoint for browser calls.
tokenOpaque. Pass it to the engine when connecting. Do not parse it.
expires_inSeconds the token is good for connecting.

Create the token on your server and hand only the token and address to the browser. Your API key should not reach the browser.

Errors

StatusMessage
401Access denied
403Your role (viewer) can't change agents, knowledge bases, batches, campaigns and calls. It needs member access; ask an owner or admin of the workspace.
404Agent not found