Skip to main content
POST
Create a realtime session

Authorizations

Authorization
string
header
required

Your Wixzel Phone API key: Authorization: Bearer wv_live_.... Keys are scoped; grant only what the integration needs.

Body

application/json
agent_id
string
required
Pattern: ^[0-9a-f]{24}$
Example:

"6a96a3ead6e886d42462dd3e"

lead_id
string

Existing lead to attribute the session to — merge fields such as {{name}} resolve from it, and appointment booking uses its phone. Without one, merge fields resolve to nothing and the call has no lead.

Pattern: ^[0-9a-f]{24}$
Example:

"6a96a3ead6e886d42462dd3e"

metadata
object

Your own identifiers, kept verbatim on the resulting call and echoed in its callCompleted webhook. Flat, string to string. Never sent to the model.

max_duration_seconds
integer

Hard cap on the conversation. Defaults to 600; at most 3600.

Required range: 10 <= x <= 3600
Example:

600

allowed_origins
string[]

When set, the socket is refused unless the browser's Origin is one of these. Recommended for browser use: it stops a secret copied out of your page being used from another site.

Maximum array length: 10
Maximum string length: 255
Pattern: ^https?:\/\/[a-z0-9.-]+(:\d{1,5})?$

Response

The session and its client secret

id
string
required

Becomes the session_id of the resulting call.

Example:

"rt-5b0c7c0e-9d1f-4c52-8a9e-2f0d3a4b6c7d"

object
enum<string>
required
Available options:
realtime_session
client_secret
object
required
url
string
required
Example:

"wss://api.phone.wixzel.com/v1/realtime"

agent_id
string
required
Pattern: ^[0-9a-f]{24}$
Example:

"6a96a3ead6e886d42462dd3e"

engine
string
required
Example:

"gemini_live"

max_duration_seconds
integer
required
audio_format
enum<string>
required

Base64 G.711 µ-law, 8 kHz mono, both directions — what a phone line carries.

Available options:
mulaw_8000