Chat

Send a query

Send a message to an API channel and receive JSON or an SSE stream.

POST/v2/chat

Authenticate with the channel API key and send query text or uploaded attachments. The channel determines which agent receives the message.

Conversation and retry behavior

To continue a conversation, include the returned data.metadata.conversation_id in your next request.

external_message_id makes retries safe: resend the same ID and body to retrieve the original result. Only stream may change. The channel chooses the agent; no agent_id is needed. A platform API key cannot authenticate this request.

Streaming explains events and reconnection. The integration guide covers contact fields, file uploads, per-request instructions and knowledge selection.

Authentication

Authorizationstringheaderrequired
Channel API key from Deploy → API in your agent dashboard. The channel determines the agent. Platform API keys are not accepted for query.

Authenticate with a Bearer token in this format: Bearer <token>

Header Parameters

last-event-idstring | null

Request bodyrequired

Additional propertiesfalse
querystring
Message text to send to the agent. Provide text or at least one uploaded attachment.
Default:
attachmentsobject[]
Previously uploaded attachments. Include at most 5 files.
Maximum items: 5
Show child attributes
blob_idintegerrequired
Exclusive minimum: 0
Additional propertiesfalse
conversation_idstring | null
Conversation ID from an earlier response. Omit it to start a new conversation.
Format: uuid
external_message_idstring | null
Your unique message ID. Reuse the same ID and body when retrying a request.
Maximum length: 255
Minimum length: 1
contactobject | null
Contact details to associate with this conversation.
Show child attributes
identifierstring | null
Maximum length: 255
namestring | null
Maximum length: 255
first_namestring | null
Maximum length: 255
last_namestring | null
Maximum length: 255
emailstring | null
Format: email
phone_numberstring | null
Maximum length: 64
localestring | null
Maximum length: 32
custom_attributesobject
Additional properties
Additional propertiesfalse
system_promptstring | null
Additional instructions for this request.
knowledge_base_idsstring[] | null
Limit this request to the selected knowledge bases.
Maximum items: 100
streamboolean
Use true to receive Server-Sent Events. The default is false for a JSON response.
Default: false

Response

– application/json · text/event-stream
Successful Response
dataobjectrequired
Show child attributes
messageobject | nullrequired
Show child attributes
idstringrequired
Format: uuid
roleenum<string>required
Available options: userassistantoperator
partsobject[]required
anyOf
Show child attributes
idstringrequired
Format: uuid
typeenum<string>
Default: text
textstringrequired
Show child attributes
idstringrequired
Format: uuid
client_idstring
Default:
positionintegerrequired
typeenum<string>required
Available options: attachmentvoice
updated_atstringrequired
Format: date-time
content_attributesobjectrequired
Show child attributes
schema_versionenum<integer>
Default: 1
kindenum<string>required
Available options: imagevoicefile
filenamestringrequired
statusenum<string>required
Available options: pendingprocessingreadyfailedrejected
content_typestring | null
byte_sizeinteger | null
widthinteger | null
heightinteger | null
duration_secondsnumber | null
error_codestring | null
transcriptionobject | null
delivery_statusstring | null
download_urlstring | null
expires_ininteger | null
Additional propertiesfalse
metadataobjectrequired
Show child attributes
conversation_statusstringrequired
bot_activebooleanrequired
handoff_statusenum<string>required
Available options: not_requestedpendingoperator_owned
conversation_idstringrequired
Format: uuid
user_message_idstringrequired
Format: uuid
external_message_idstringrequired
contact_idstringrequired
Format: uuid
finish_reasonenum<string>required
Available options: completedsuppressedfailedcancelled
usageobject
Show child attributes
creditsinteger
Default: 0
MuChat documentation