Chats
List chats in a session
Chats belonging to the session, oldest first. A chat exists only inside a session; there is no way to address one without it. Visible to every member of the organization that owns the session.
sessionIdstring · uuidrequiredX-Organization-IdstringobjectstringrequireddataarrayrequiredShow child attributes
idstringrequiredsessionstring · uuidrequiredtitlestringnullableorganizationstringrequireduserstringrequiredmetadataobjectShow child attributes
deviceIdstring · uuidcreatedAtstring · date-timerequiredupdatedAtstring · date-timerequiredCreate a chat
Creates a chat in the session. Bind the chat to an allocated device by setting metadata.deviceId; the assistant's device tools then act on that device. Every action is still authorized against the caller, never against the bound device.
sessionIdstring · uuidrequiredX-Organization-IdstringtitlestringmetadataobjectShow child attributes
deviceIdstring · uuidA conversation with the assistant, inside a session.
idstringrequiredsessionstring · uuidrequiredtitlestringnullableorganizationstringrequireduserstringrequiredmetadataobjectShow child attributes
deviceIdstring · uuidcreatedAtstring · date-timerequiredupdatedAtstring · date-timerequiredGet a chat
Returns a chat in the session. A chat id that belongs to a different session is not found, even within the same organization.
sessionIdstring · uuidrequiredchatIdstringrequiredX-Organization-IdstringA conversation with the assistant, inside a session.
idstringrequiredsessionstring · uuidrequiredtitlestringnullableorganizationstringrequireduserstringrequiredmetadataobjectShow child attributes
deviceIdstring · uuidcreatedAtstring · date-timerequiredupdatedAtstring · date-timerequiredList messages in a chat
The most recent messages of the chat, returned oldest first, with cursor pagination backwards into older history. Each assistant message includes the tool calls it made, so a client can rebuild the conversation — text and tool calls — after a page reload. Follow nextCursor with ?before= to load older messages.
sessionIdstring · uuidrequiredchatIdstringrequiredlimitintegerbeforestring · date-timeX-Organization-IdstringobjectstringrequireddataarrayrequiredShow child attributes
idstringrequiredchatstringrequiredrolestringrequiredstatusstringrequiredcontentarrayrequiredShow child attributes
typestringrequiredtextstringrequiredexecutionobjectShow child attributes
idstringrequiredstatusstringrequiredtriggerMessagestringrequiredresponseMessagestringrequiredeventsUrlstringrequiredtoolCallsUrlstringrequiredcancelUrlstringrequiredstartedAtstring · date-timenullablecompletedAtstring · date-timenullabletoolCallsarrayShow child attributes
idstringrequiredexecutionstringrequiredmessagestringrequiredtoolstringrequiredstatusstringrequiredinputobjectoutputobjecterrorstringnullablecreatedAtstring · date-timerequiredcompletedAtstring · date-timenullablecreatedAtstring · date-timerequiredcompletedAtstring · date-timenullablenextCursorstringnullablePost a message and run the assistant
Appends a user message and runs the assistant. Three modes:
- default (async): responds 202 with the assistant message in status "running". Follow execution.eventsUrl to stream it.
- mode=sync: runs inline and responds 201 with the completed assistant message and its tool calls.
- stream=true: responds with a text/event-stream of execution and assistant.message events.
Set execute=false to store the user message without running the assistant.
sessionIdstring · uuidrequiredchatIdstringrequiredX-Organization-IdstringrolestringrequiredcontentarrayrequiredShow child attributes
typestringrequiredtextstringrequiredexecutebooleanmodestringstreambooleanmodelstringmetadataobjectGet a message
sessionIdstring · uuidrequiredchatIdstringrequiredmessageIdstringrequiredX-Organization-IdstringidstringrequiredchatstringrequiredrolestringrequiredstatusstringrequiredcontentarrayrequiredShow child attributes
typestringrequiredtextstringrequiredexecutionobjectShow child attributes
idstringrequiredstatusstringrequiredtriggerMessagestringrequiredresponseMessagestringrequiredeventsUrlstringrequiredtoolCallsUrlstringrequiredcancelUrlstringrequiredstartedAtstring · date-timenullablecompletedAtstring · date-timenullabletoolCallsarrayShow child attributes
idstringrequiredexecutionstringrequiredmessagestringrequiredtoolstringrequiredstatusstringrequiredinputobjectoutputobjecterrorstringnullablecreatedAtstring · date-timerequiredcompletedAtstring · date-timenullablecreatedAtstring · date-timerequiredcompletedAtstring · date-timenullableStream a message's execution events
Server-Sent Events for one assistant message: execution.started, assistant.message.started, assistant.message.delta, tool_call.created, tool_call.completed, assistant.message.completed, execution.completed|failed.
Safe to call after a disconnect: a still-running execution replays its events from the start, and a finished one replays its stored final state — the stored replay emits the message text as a single delta and no tool_call events. Clients must therefore not render the message's persisted text and also reattach here, or the text appears twice.
sessionIdstring · uuidrequiredchatIdstringrequiredmessageIdstringrequiredX-Organization-IdstringList a message's tool calls
sessionIdstring · uuidrequiredchatIdstringrequiredmessageIdstringrequiredX-Organization-IdstringobjectstringrequireddataarrayrequiredShow child attributes
idstringrequiredexecutionstringrequiredmessagestringrequiredtoolstringrequiredstatusstringrequiredinputobjectoutputobjecterrorstringnullablecreatedAtstring · date-timerequiredcompletedAtstring · date-timenullableCancel a running message
Requests cancellation of a message whose execution is still running. Requires a read/write or admin role.
sessionIdstring · uuidrequiredchatIdstringrequiredmessageIdstringrequiredX-Organization-IdstringidstringrequiredchatstringrequiredrolestringrequiredstatusstringrequiredcontentarrayrequiredShow child attributes
typestringrequiredtextstringrequiredexecutionobjectShow child attributes
idstringrequiredstatusstringrequiredtriggerMessagestringrequiredresponseMessagestringrequiredeventsUrlstringrequiredtoolCallsUrlstringrequiredcancelUrlstringrequiredstartedAtstring · date-timenullablecompletedAtstring · date-timenullabletoolCallsarrayShow child attributes
idstringrequiredexecutionstringrequiredmessagestringrequiredtoolstringrequiredstatusstringrequiredinputobjectoutputobjecterrorstringnullablecreatedAtstring · date-timerequiredcompletedAtstring · date-timenullablecreatedAtstring · date-timerequiredcompletedAtstring · date-timenullable