OmniDimension Sessions API
Create short-lived Sessions for web calls: your server trades its API key for a per-conversation token and a ready-to-use WebSocket URL, so your client can talk to an agent without any credential in the page.
Create short-lived Sessions for web calls: your server trades its API key for a per-conversation token and a ready-to-use WebSocket URL, so your client can talk to an agent without any credential in the page.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/omnidim-io:omnidim-io-sessions-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: OmniDimension Sessions API
version: '1.0'
description: 'Public REST API for the OmniDimension voice-agent platform. Use it
to manage agents, dispatch calls, run bulk-call campaigns, manage
knowledge bases, attach phone numbers, run agent simulations, and
administer reseller accounts.'
contact:
name: OmniDimension
url: https://omnidim.io
servers:
- url: https://omnidim.io/api/v1
description: Production. `https://backend.omnidim.io/api/v1` also works and serves the same API.
security:
- BearerAuth: []
tags:
- name: Sessions
description: 'Create short-lived Sessions for web calls: your server trades its
API key for a per-conversation token and a ready-to-use WebSocket
URL, so your client can talk to an agent without any credential in
the page.'
paths:
/sessions/create:
post:
tags:
- Sessions
operationId: createSession
summary: Create session
description: 'Create a voice Session: a short-lived, single-conversation
reservation that lets a client hold a live voice chat with your
agent. This is step 1 of 2. Creating the Session does not start any
audio on its own; it returns a `ws_url` that a client then connects
to over WebSocket to actually talk.
Call this endpoint from your server with your API key, and return
only the `ws_url` to your client. The API key must never reach the
browser. The `ws_url` is the only thing the client needs, and it is
safe to hand out because it is single-use and expires. For how to
connect and talk, see "Connect the client and talk" below the
request details.'
x-codeSamples:
- lang: js
label: Browser SDK (connect after create)
source: "import { WebSession } from '@omnidim-ai/client';\n\n// 1. Ask YOUR server to create the session (keeps the API key\n// server-side) and return the ws_url.\nconst { ws_url } = await fetch('/create-omnidim-session', {\n method: 'POST',\n}).then((r) => r.json());\n\n// 2. The browser connects to the ws_url and talks. No API key here.\nconst session = new WebSession();\nsession.on('transcript', (t) => console.log(t.role, t.text));\nawait session.start({ wsUrl: ws_url });\n"
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- agent_id
- type
properties:
user_id:
$ref: '#/components/schemas/ClientUserId'
agent_id:
type: integer
description: ID of the agent the session talks to.
example: 158910
type:
type: string
default: voice
example: voice
enum:
- voice
description: The session type. Only `voice` is supported.
custom_variables:
type: object
additionalProperties: true
description: 'Per-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`.
'
properties:
__languages:
oneOf:
- type: array
items:
type: string
- type: string
description: 'Languages 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`.
'
example: Hindi|Gujarati|English
__post_call_actions:
allOf:
- $ref: '#/components/schemas/PostCallActions'
description: 'Post-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`.
'
example:
name: Demo User
metadata:
type: object
additionalProperties: true
description: 'Key-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.
'
example:
crm_lead_id: lead_9876
source: website_form
responses:
'201':
description: Session created.
content:
application/json:
schema:
type: object
properties:
session_id:
type: integer
description: Correlate this with call logs and support requests.
example: 4521
token:
type: string
description: The Session Token. Single conversation, unguessable.
example: sess_51gF2qw8LxNz0vY4mT7Ka3RjD9pBcE6HuWiQnZsX0oM
expires_at:
type: string
format: date-time
description: End of the 15-minute connect window (UTC).
example: '2026-07-17T12:15:00Z'
ws_url:
type: string
description: Connect your client to this URL as returned.
example: wss://live.omnidim.io/chat/start_voice_chat?request_token=sess_51gF2qw8LxNz0vY4mT7Ka3RjD9pBcE6HuWiQnZsX0oM
post_call_actions_applied:
type: array
description: Channels from `__post_call_actions` that will run for this session. Present only when `__post_call_actions` was sent.
items:
type: string
enum:
- email
- webhook
example:
- email
- webhook
post_call_actions_ignored:
type: array
description: Items from `__post_call_actions` that were skipped. Present only when `__post_call_actions` was sent. When nothing was applied, the agent's own post-call actions run.
items:
$ref: '#/components/schemas/PostCallActionIgnored'
'400':
description: 'Unsupported session type (`unsupported_type`) or a malformed
request body (`invalid_request`).
'
content:
application/json:
schema:
$ref: '#/components/schemas/SessionError'
example:
error: unsupported_type
error_description: Only type 'voice' is supported.
'401':
description: Missing or invalid API key.
'402':
description: The organization balance is too low to start a call.
content:
application/json:
schema:
$ref: '#/components/schemas/SessionError'
example:
error: insufficient_balance
error_description: Balance is low. Please Choose Appropriate plan.
'404':
description: Agent not found in your organization.
content:
application/json:
schema:
$ref: '#/components/schemas/SessionError'
example:
error: agent_not_found
error_description: Agent not found or access denied
'429':
description: 'The organization is at its concurrent call limit. Wait for a
call to finish or purchase more concurrency, then retry.
'
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SessionError'
- type: object
properties:
limit:
type: integer
description: Your organization's concurrent call limit.
example:
error: concurrency_limit_reached
error_description: Your organization is at its concurrent call limit (2). Wait for a call to finish or purchase more concurrency.
limit: 2
components:
schemas:
ExtractedVariable:
type: object
required:
- key
- prompt
properties:
key:
type: string
description: Unique identifier for the variable in the post-call payload.
example: customer_issue
prompt:
type: string
description: Instruction for the model on what to pull out of the conversation.
example: Identify the main issue the customer is experiencing.
PostCallActions:
type: object
description: 'Side effects that fire once the call ends: email, webhook, Omni CRM,
Cloud WhatsApp, a workflow, Google Sheets, Slack, Salesforce, HubSpot
or Zoho Bigin.
'
properties:
email:
type: object
properties:
enabled:
type: boolean
recipients:
type: array
description: Email addresses that should receive the notification.
items:
type: string
format: email
example:
- support@example.com
include:
type: array
description: Which sections to include in the email body.
items:
type: string
enum:
- summary
- extracted_variables
- fullConversation
- sentiment
extracted_variables:
type: array
description: Variables the model should pull out of the conversation for the email.
items:
$ref: '#/components/schemas/ExtractedVariable'
trigger_call_statuses:
type: array
description: '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.
'
items:
type: string
enum:
- completed
- voicemail_detected
- failed
- no-answer
- busy
- canceled
example:
- completed
- voicemail_detected
webhook:
type: object
properties:
enabled:
type: boolean
url:
type: string
format: uri
description: Endpoint that receives a POST with the call payload.
example: https://your-webhook-endpoint.com/omnidim-callback
include:
type: array
description: Which sections to include in the webhook body.
items:
type: string
enum:
- summary
- extracted_variables
- fullConversation
- sentiment
extracted_variables:
type: array
description: Variables the model should pull out of the conversation for the webhook.
items:
$ref: '#/components/schemas/ExtractedVariable'
trigger_call_statuses:
type: array
description: 'Call outcomes that should fire this webhook. Omit to
use the default (`completed`, `voicemail_detected`).
'
items:
type: string
enum:
- completed
- voicemail_detected
- failed
- no-answer
- busy
- canceled
example:
- completed
- failed
omni_crm:
allOf:
- $ref: '#/components/schemas/PostCallActionCommon'
- type: object
description: Save the call to Omni CRM.
cloud_whatsapp:
allOf:
- $ref: '#/components/schemas/PostCallActionCommon'
- type: object
description: Send a Cloud WhatsApp template message after the call.
properties:
phone_number_id:
type: integer
description: 'The id of your organization''s Cloud WhatsApp number the
message is sent from.
'
template_id:
type: integer
description: 'An approved template on that number. A template that is not
approved, or that belongs to another number, is refused.
'
template_variables:
type: array
description: Which extracted variable fills each template placeholder.
items:
type: object
properties:
index:
type: string
description: The placeholder number, as a string.
example: '1'
extracted_var:
type: string
description: The key of the extracted variable whose value fills this placeholder.
example: customer_name
templates:
type: array
description: One or more templates to send, each with its variable mapping.
items:
$ref: '#/components/schemas/CloudWhatsAppTemplate'
workflow:
allOf:
- $ref: '#/components/schemas/PostCallActionCommon'
- type: object
description: Trigger a workflow after the call.
properties:
workflow_id:
type: integer
description: The id of the workflow to run.
google_sheets:
allOf:
- $ref: '#/components/schemas/PostCallActionCommon'
- type: object
description: 'Append the call to a Google Sheet. Sending this key replaces the
agent''s Google Sheets actions; leaving it out keeps them.
'
properties:
integration_id:
type: integer
description: Required. The id of your Google Sheets integration.
spreadsheet_id:
type: string
description: Required. The id in the sheet's URL, the part after `/d/`.
spreadsheet_name:
type: string
worksheet_name:
type: string
description: The tab to append to. Defaults to `Sheet1`.
slack:
allOf:
- $ref: '#/components/schemas/PostCallActionCommon'
- type: object
description: 'Post the call to a Slack channel. Sending this key replaces the
agent''s Slack actions; leaving it out keeps them.
'
properties:
integration_id:
type: integer
description: Required. The id of your Slack integration.
channel_id:
type: string
description: The channel id. Send this or `channel_name`.
channel_name:
type: string
description: The channel name. Send this or `channel_id`.
salesforce:
allOf:
- $ref: '#/components/schemas/PostCallActionCommon'
- type: object
description: 'Create 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.
'
properties:
integration_id:
type: integer
description: Required. The id of your Salesforce integration.
object_name:
type: string
enum:
- Lead
- Contact
- Account
- Opportunity
- Case
- Task
- Product
description: Defaults to `Lead`.
action:
type: string
enum:
- create
- upsert
description: '`upsert` finds the record by the caller''s number and updates
it or creates it. `create` creates a new record every call.
Defaults to `create`.
'
match_field:
type: string
description: '`upsert` only: the phone field the caller''s number is looked up in. Defaults to `Phone`.'
example: Phone
log_call:
type: boolean
description: Log the call on the record, with the summary and recording link. Defaults to false.
add_note:
type: boolean
description: Add the call summary as a note on the record. Defaults to false.
hubspot:
allOf:
- $ref: '#/components/schemas/PostCallActionCommon'
- type: object
description: 'Create 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.
'
properties:
integration_id:
type: integer
description: Required. The id of your HubSpot integration.
object_name:
type: string
enum:
- contact
- company
- deal
- ticket
description: Required.
zoho_bigin:
allOf:
- $ref: '#/components/schemas/PostCallActionCommon'
- type: object
description: 'Log the call in Zoho Bigin. Sending this key replaces the
agent''s Zoho Bigin actions; leaving it out keeps them.
'
properties:
integration_id:
type: integer
description: Required. The id of your Zoho Bigin integration.
create_call_log:
type: boolean
description: Log the call. Defaults to true.
update_contact:
type: boolean
description: Update a matching contact with what the call captured. Defaults to true.
create_contact:
type: boolean
description: Create a contact when no contact matches. Defaults to true.
SessionError:
type: object
properties:
error:
type: string
description: Machine-readable error code.
error_description:
type: string
description: Human-readable explanation.
code:
type: string
description: 'Stable, specific reason. Present on the newer endpoints (Voice
cloning, WhatsApp); older endpoints return only `error`.
'
request_id:
type: string
description: 'Correlates this response with the server log. Present alongside
`code`. Also sent as the `X-Request-Id` header.
'
PostCallActionIgnored:
type: object
description: A post-call action sent with a call that was dropped, and why.
properties:
channel:
oneOf:
- type: string
- type: 'null'
description: The channel the item belonged to (`email`, `webhook`, or the unsupported name you sent). `null` when the whole key was ignored.
example: webhook
code:
type: string
enum:
- invalid_url
- disabled
- no_recipients
- unsupported_channel
- duplicate_variable
- unsupported_route
- invalid_directive
description: 'Why the item was dropped. `invalid_directive` means
`__post_call_actions` was not an object with `email` and/or
`webhook` (a string, list, number, null or empty object); its
`channel` is `null` and the agent''s own post-call actions run.
'
example: invalid_url
message:
type: string
example: Webhook URL must point to an address reachable from the internet. Local and private network addresses cannot receive your call data. If you are testing locally, use a tunnel URL instead.
ClientUserId:
type: integer
description: 'Reseller 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](/docs/reseller/your-clients/acting-as-clients).
'
example: 1234
CloudWhatsAppTemplate:
type: object
description: One Cloud WhatsApp template to send after the call.
properties:
template_id:
type: integer
description: An approved template on the chosen number.
usage_description:
type: string
description: 'When this template should be sent. After the call, the model reads
these descriptions to choose which templates fit the conversation.
'
example: Send when the caller books an appointment.
always_send:
type: boolean
description: Send this template after every call, whichever templates the model chooses.
variable_mappings:
type: array
description: How to fill each template placeholder.
items:
type: object
properties:
index:
type: string
description: The placeholder number, as a string.
example: '1'
extracted_var:
type: string
description: The extracted variable whose value fills this placeholder.
static_value:
type: string
description: 'A fixed value for this placeholder. When set, it is used
instead of the extracted variable.
'
mode:
type: string
enum:
- variable
- static
description: 'Which 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`.
'
fallback_value:
type: string
description: The value to use when the variable is not extracted.
PostCallActionCommon:
type: object
description: Settings every post-call channel shares.
properties:
enabled:
type: boolean
include:
type: array
description: Which sections to include in this action.
items:
type: string
enum:
- summary
- extracted_variables
- fullConversation
- sentiment
extracted_variables:
type: array
description: Variables the model should pull out of the conversation for this action.
items:
$ref: '#/components/schemas/ExtractedVariable'
trigger_call_statuses:
type: array
description: 'Call outcomes that fire this action. Omit to use the default
(`completed`, `voicemail_detected`).
'
items:
type: string
enum:
- completed
- voicemail_detected
- failed
- no-answer
- busy
- canceled
securitySchemes:
BearerAuth:
type: http
scheme: bearer
description: 'Bearer token authentication. Obtain your API key from the
OmniDimension dashboard.
'