Create session
Create a short-lived voice session and get a ws_url for one conversation.
Connect the client and talk
The ws_url alone does nothing until a client connects to it. Creating the session is step 1;
connecting a client is step 2. Your API key stays on your server: the client only ever receives
the ws_url, which is single use and expires.
- The token is valid to connect for 15 minutes after creation.
- It covers one conversation and dies when that conversation ends.
- Connect to the
ws_urlexactly as returned. Never build, edit, or cache it; the format is not part of the contract. - If the connection drops mid-call, reconnecting to the same
ws_urlre-attaches to the same conversation, so a brief network blip does not lose the call.
Two client paths, both using the same ws_url:
- Browser: the
@omnidim-ai/clientweb SDK handles microphone capture, agent audio playback, barge-in, and transcripts. - Any other platform: speak the wire protocol in Web call protocol: 16 kHz mono PCM16 frames in, audio and transcript events out.
This is step 1 of 2. Creating the session starts no audio. The client then
connects to ws_url over WebSocket to talk.
Call this endpoint from your server with your API key. Return only ws_url
to your client, and never the API key. The ws_url is single-use and
expires, so it is safe to hand to your client. For how to connect and talk,
see "Connect the client and talk" below the request details.
Body
agent_idintegerrequiredID of the agent the session talks to.
typeenumrequiredThe session type. Only voice is supported.
One of: voice
Default voice
custom_variablesobjectPer-session variables that personalize the conversation.
Set server-side, so visitors cannot tamper with them.
Two reserved keys are read as instructions for this session
and never reach the agent: __languages and
__post_call_actions.
+ Show child fields (2)− Hide child fields
__languagesone ofLanguages this session runs in, replacing the agent's
configured list. The first entry is the language the
visitor is greeted in. Send an array, or a pipe-separated
string such as Hindi|English.
__post_call_actionsobjectPost-call actions for this session only, in the same shape
as post_call_actions on agent create. Email and webhook
only. They replace the agent's own post-call actions for
this session. Items that cannot be used are skipped and
listed in post_call_actions_ignored.
+ Show child fields (10)− Hide child fields
emailobject+ Show child fields (5)− Hide child fields
enabledbooleanrecipientsstring[]Email addresses that should receive the notification.
includestring[]Which sections to include in the email body.
One of: summaryextracted_variablesfullConversationsentiment
extracted_variablesobject[]Variables the model should pull out of the conversation for the email.
+ Show child fields (2)− Hide child fields
keystringrequiredUnique identifier for the variable in the post-call payload.
promptstringrequiredInstruction for the model on what to pull out of the conversation.
trigger_call_statusesstring[]Call outcomes that should fire this action. Omit to
use the default (completed, voicemail_detected).
Pass an explicit list to also include failed calls,
no-answers, busy signals, etc.
One of: completedvoicemail_detectedfailedno-answerbusycanceled
webhookobject+ Show child fields (5)− Hide child fields
enabledbooleanurlstringEndpoint that receives a POST with the call payload.
Format uri
includestring[]Which sections to include in the webhook body.
One of: summaryextracted_variablesfullConversationsentiment
extracted_variablesobject[]Variables the model should pull out of the conversation for the webhook.
+ Show child fields (2)− Hide child fields
keystringrequiredUnique identifier for the variable in the post-call payload.
promptstringrequiredInstruction for the model on what to pull out of the conversation.
trigger_call_statusesstring[]Call outcomes that should fire this webhook. Omit to
use the default (completed, voicemail_detected).
One of: completedvoicemail_detectedfailedno-answerbusycanceled
omni_crmobjectSave the call to Omni CRM.
+ Show child fields (4)− Hide child fields
enabledbooleanincludestring[]Which sections to include in this action.
One of: summaryextracted_variablesfullConversationsentiment
extracted_variablesobject[]Variables the model should pull out of the conversation for this action.
+ Show child fields (2)− Hide child fields
keystringrequiredUnique identifier for the variable in the post-call payload.
promptstringrequiredInstruction for the model on what to pull out of the conversation.
trigger_call_statusesstring[]Call outcomes that fire this action. Omit to use the default
(completed, voicemail_detected).
One of: completedvoicemail_detectedfailedno-answerbusycanceled
cloud_whatsappobjectSend a Cloud WhatsApp template message after the call.
+ Show child fields (8)− Hide child fields
enabledbooleanincludestring[]Which sections to include in this action.
One of: summaryextracted_variablesfullConversationsentiment
extracted_variablesobject[]Variables the model should pull out of the conversation for this action.
+ Show child fields (2)− Hide child fields
keystringrequiredUnique identifier for the variable in the post-call payload.
promptstringrequiredInstruction for the model on what to pull out of the conversation.
trigger_call_statusesstring[]Call outcomes that fire this action. Omit to use the default
(completed, voicemail_detected).
One of: completedvoicemail_detectedfailedno-answerbusycanceled
phone_number_idintegerThe id of your organization's Cloud WhatsApp number the message is sent from.
template_idintegerAn approved template on that number. A template that is not approved, or that belongs to another number, is refused.
template_variablesobject[]Which extracted variable fills each template placeholder.
+ Show child fields (2)− Hide child fields
indexstringThe placeholder number, as a string.
extracted_varstringThe key of the extracted variable whose value fills this placeholder.
templatesobject[]One or more templates to send, each with its variable mapping.
+ Show child fields (4)− Hide child fields
template_idintegerAn approved template on the chosen number.
usage_descriptionstringWhen this template should be sent. After the call, the model reads these descriptions to choose which templates fit the conversation.
always_sendbooleanSend this template after every call, whichever templates the model chooses.
variable_mappingsobject[]How to fill each template placeholder.
+ Show child fields (5)− Hide child fields
indexstringThe placeholder number, as a string.
extracted_varstringThe extracted variable whose value fills this placeholder.
static_valuestringA fixed value for this placeholder. When set, it is used instead of the extracted variable.
modeenumWhich input the dashboard shows for this placeholder. It
does not change the value sent: a static_value is used
first, then the extracted variable, then fallback_value.
One of: variablestatic
fallback_valuestringThe value to use when the variable is not extracted.
workflowobjectTrigger a workflow after the call.
+ Show child fields (5)− Hide child fields
enabledbooleanincludestring[]Which sections to include in this action.
One of: summaryextracted_variablesfullConversationsentiment
extracted_variablesobject[]Variables the model should pull out of the conversation for this action.
+ Show child fields (2)− Hide child fields
keystringrequiredUnique identifier for the variable in the post-call payload.
promptstringrequiredInstruction for the model on what to pull out of the conversation.
trigger_call_statusesstring[]Call outcomes that fire this action. Omit to use the default
(completed, voicemail_detected).
One of: completedvoicemail_detectedfailedno-answerbusycanceled
workflow_idintegerThe id of the workflow to run.
google_sheetsobjectAppend the call to a Google Sheet. Sending this key replaces the agent's Google Sheets actions; leaving it out keeps them.
+ Show child fields (8)− Hide child fields
enabledbooleanincludestring[]Which sections to include in this action.
One of: summaryextracted_variablesfullConversationsentiment
extracted_variablesobject[]Variables the model should pull out of the conversation for this action.
+ Show child fields (2)− Hide child fields
keystringrequiredUnique identifier for the variable in the post-call payload.
promptstringrequiredInstruction for the model on what to pull out of the conversation.
trigger_call_statusesstring[]Call outcomes that fire this action. Omit to use the default
(completed, voicemail_detected).
One of: completedvoicemail_detectedfailedno-answerbusycanceled
integration_idintegerRequired. The id of your Google Sheets integration.
spreadsheet_idstringRequired. The id in the sheet's URL, the part after /d/.
spreadsheet_namestringworksheet_namestringThe tab to append to. Defaults to Sheet1.
slackobjectPost the call to a Slack channel. Sending this key replaces the agent's Slack actions; leaving it out keeps them.
+ Show child fields (7)− Hide child fields
enabledbooleanincludestring[]Which sections to include in this action.
One of: summaryextracted_variablesfullConversationsentiment
extracted_variablesobject[]Variables the model should pull out of the conversation for this action.
+ Show child fields (2)− Hide child fields
keystringrequiredUnique identifier for the variable in the post-call payload.
promptstringrequiredInstruction for the model on what to pull out of the conversation.
trigger_call_statusesstring[]Call outcomes that fire this action. Omit to use the default
(completed, voicemail_detected).
One of: completedvoicemail_detectedfailedno-answerbusycanceled
integration_idintegerRequired. The id of your Slack integration.
channel_idstringThe channel id. Send this or channel_name.
channel_namestringThe channel name. Send this or channel_id.
salesforceobjectCreate or update a Salesforce record from the call. Sends a
fixed set of fields for the object, so it takes no
extracted_variables. Sending this key replaces the agent's
Salesforce actions; leaving it out keeps them.
+ Show child fields (10)− Hide child fields
enabledbooleanincludestring[]Which sections to include in this action.
One of: summaryextracted_variablesfullConversationsentiment
extracted_variablesobject[]Variables the model should pull out of the conversation for this action.
+ Show child fields (2)− Hide child fields
keystringrequiredUnique identifier for the variable in the post-call payload.
promptstringrequiredInstruction for the model on what to pull out of the conversation.
trigger_call_statusesstring[]Call outcomes that fire this action. Omit to use the default
(completed, voicemail_detected).
One of: completedvoicemail_detectedfailedno-answerbusycanceled
integration_idintegerRequired. The id of your Salesforce integration.
object_nameenumDefaults to Lead.
One of: LeadContactAccountOpportunityCaseTaskProduct
actionenumupsert finds the record by the caller's number and updates
it or creates it. create creates a new record every call.
Defaults to create.
One of: createupsert
match_fieldstringupsert only: the phone field the caller's number is looked up in. Defaults to Phone.
log_callbooleanLog the call on the record, with the summary and recording link. Defaults to false.
add_notebooleanAdd the call summary as a note on the record. Defaults to false.
hubspotobjectCreate a HubSpot record from the call. Sends a fixed set of
fields for the object, so it takes no extracted_variables.
Sending this key replaces the agent's HubSpot actions; leaving
it out keeps them.
+ Show child fields (6)− Hide child fields
enabledbooleanincludestring[]Which sections to include in this action.
One of: summaryextracted_variablesfullConversationsentiment
extracted_variablesobject[]Variables the model should pull out of the conversation for this action.
+ Show child fields (2)− Hide child fields
keystringrequiredUnique identifier for the variable in the post-call payload.
promptstringrequiredInstruction for the model on what to pull out of the conversation.
trigger_call_statusesstring[]Call outcomes that fire this action. Omit to use the default
(completed, voicemail_detected).
One of: completedvoicemail_detectedfailedno-answerbusycanceled
integration_idintegerRequired. The id of your HubSpot integration.
object_nameenumRequired.
One of: contactcompanydealticket
zoho_biginobjectLog the call in Zoho Bigin. Sending this key replaces the agent's Zoho Bigin actions; leaving it out keeps them.
+ Show child fields (8)− Hide child fields
enabledbooleanincludestring[]Which sections to include in this action.
One of: summaryextracted_variablesfullConversationsentiment
extracted_variablesobject[]Variables the model should pull out of the conversation for this action.
+ Show child fields (2)− Hide child fields
keystringrequiredUnique identifier for the variable in the post-call payload.
promptstringrequiredInstruction for the model on what to pull out of the conversation.
trigger_call_statusesstring[]Call outcomes that fire this action. Omit to use the default
(completed, voicemail_detected).
One of: completedvoicemail_detectedfailedno-answerbusycanceled
integration_idintegerRequired. The id of your Zoho Bigin integration.
create_call_logbooleanLog the call. Defaults to true.
update_contactbooleanUpdate a matching contact with what the call captured. Defaults to true.
create_contactbooleanCreate a contact when no contact matches. Defaults to true.
metadataobjectKey-value pairs stored on the session for your own
tracking (e.g. CRM or lead IDs). Not shared with the
agent; echoed back as metadata in the post-call
webhook so you can correlate results with your records.
user_idintegerresellers onlyReseller keys only: act as one of your clients by its user id. Omit it to act on your own account. How acting for a client works.
Was this page helpful?
