Skip to main content
POST
Start a conversation with a customer on WhatsApp, Web Chat or Email using one of your agents. You can let the agent write the message, send your own text, use an approved WhatsApp template, or schedule the message for later. You can also use this API to get the agent’s reply straight back in the response, without messaging any customer. This is handy for testing an agent or building your own chat experience.

Endpoint

Authentication

Every request needs your workspace API key in the x-api-key header.
You can create an API key from your dashboard. See API Keys for details.

Choose how you want to use it

Message a customer

Send a message through one of your WhatsApp, Web Chat or Email channels. The customer receives it and can reply, and your agent carries on the conversation.

Get the agent's reply

Set doReturnResponse to true. The agent’s reply comes back in the response and nothing is sent to a customer.

Message a customer

Before you start

  • Set up a WhatsApp, Web Chat or Email channel under Integrations in your dashboard, and make sure it is enabled.
  • Assign an agent to the channel, or pass agentName in your request.

Basic fields

WhatsApp

Use whatsappOptions.messageType to choose how the first message is created.
The agent writes the opening message itself, using its instructions, the customer’s metadata and any additionalContext you provide. This is the default.
Sending from a specific number: if your WhatsApp channel has more than one number, pass agentNumber to choose which one to send from. It must be one of the channel’s numbers. If you leave it out, one of them is picked for you.

Web Chat

The agent writes the opening message and sends it to the user in your web chat. Pass the user’s ID as customerNumber. To give the agent extra instructions, use whatsappOptions.additionalContext.

Email

Use emailOptions.messageType to choose who writes the email.

Schedule a message

Instead of sending right away, you can send at a set time, only during working hours, or both. Scheduling works with every channel and message type.
Changed your mind? Use Cancel Scheduled Messages with the sessionId you got back to stop a message that hasn’t been sent yet.

Get the agent’s reply

Set doReturnResponse to true to send a message to your agent and receive its reply in the response. No message is sent to a customer, so you don’t need a channel.
To keep chatting, send the next message with the same sessionId:
doReturnResponse can’t be combined with scheduleTime, startWorkingHour or endWorkingHour.

Personalise with metadata

Anything you put in metadata can be used in your agent’s prompts as ${variable_name}. For example, with this metadata:
an agent prompt containing Greet ${name} and confirm order ${orderId} becomes Greet John Doe and confirm order ORD-1042.
WhatsApp templates don’t use metadata. Fill template placeholders with whatsappOptions.templateVariables instead.

Response

Message sent or scheduled

You get back a sessionId for the conversation. Keep it so you can look up the conversation later or cancel a scheduled message.

Agent reply (doReturnResponse)

You get back the sessionId and a transcript with your message and everything the agent did in reply.
The transcript may also include tool usage and other entries. See Transcript Entry Types for the full list.
Links to images and files in the transcript expire after a limited time. Download or save them promptly.

Errors

Errors use the same format:

Code Examples

cURL

JavaScript

Python

Node.js (axios)

Authorizations

x-api-key
string
header
required

Authentication header containing API key from SubVerse dashboard.

Body

application/json
communicationChannel
string

Name of the WhatsApp, Web Chat or Email channel to send from, exactly as it appears under Integrations in your dashboard. Leave it out when using doReturnResponse.

Example:

"Support WhatsApp"

customerNumber
string

Who to message. For WhatsApp, the customer's phone number with country code (e.g. +919876543210). For Web Chat, the user's ID on your website or app. Required for WhatsApp and Web Chat channels.

customerEmail
string<email>

The customer's email address. Required for Email channels.

agentName
string

The agent that should handle the conversation. If left out, the agent assigned to the channel is used. Required when doReturnResponse is true.

agentVersion
string

Which version of the agent to use: default (the published version), draft (latest saved draft) or a version number such as 2. If left out, the channel's version (or the published version) is used.

agentNumber
string

WhatsApp only. The business number to send from. It must be one of the numbers on the selected channel. If left out, one of the channel's numbers is picked for you.

metadata
object

Details about the customer to personalise the conversation. Use them in your agent's prompts as ${variable_name} and they will be replaced with the real values.

Example:
whatsappOptions
object

Options for WhatsApp channels. For Web Chat channels, only additionalContext applies.

emailOptions
object

Options for Email channels.

attachments
string<uri>[]

Links to files (images, PDFs, documents, etc.) to send along with the message. Links must be publicly accessible.

scheduleTime
string<date-time>

Send the message at a future date and time (ISO format, e.g. 2026-10-05T09:30:00Z). If the time has already passed, the message is sent right away.

startWorkingHour
string

Earliest time of day to send, in 24-hour HH:MM format. Messages due before this time wait until it is reached.

Example:

"09:00"

endWorkingHour
string

Latest time of day to send, in 24-hour HH:MM format. Messages due later are sent the next day at startWorkingHour (or at midnight if startWorkingHour isn't set).

Example:

"20:00"

timezone
string

Timezone used for startWorkingHour and endWorkingHour, e.g. Asia/Kolkata or America/New_York. Defaults to UTC.

doReturnResponse
boolean
default:false

Set to true to get the agent's reply straight back in the API response instead of sending it to a customer. Useful for testing an agent or building your own chat experience. Cannot be combined with scheduling options.

message
string

Used with doReturnResponse. The customer's message for the agent to reply to.

sessionId
string

Used with doReturnResponse. The sessionId from an earlier response, to continue the same conversation. Leave it out to start a new one.

chatOptions
object

Used with doReturnResponse.

Response

Chat triggered

responseCode
integer
required

Always returns 200 value, with error or success response details in message.

message
string
required

Success or error message with description.

data
any | null

Additional details if available.