OpenAiChatMessages
Create OpenAiChatMessage
Create a new OpenAiChatMessage record.
POST
Create OpenAiChatMessage
An OpenAiChatMessage is a single turn in an AI conversation — what the contact said, what the AI answered, a tool the AI ran, or a message an operator pushed into the thread. Messages belong to an AiChannelSession and share its ChatSession GUID, so filtering by conversation and ordering by creation time reproduces the transcript. This entity is read-only: turns are written by the AI pipeline as the conversation happens and are never edited afterwards.
Authentication
This endpoint requires OAuth2 authentication. Include a valid bearer token in the
Authorization header.
The authenticated user must be a full unrestricted administrator or have the OpenAiChatMessage-Create role.Enums
eOpenAiChatMessageType — Action values
eOpenAiChatMessageType — Action values
Request Body
Required Fields
What this message was, beyond its role: Operator for ordinary AI or operator turns; OutboundCoworkerMessage and OutboundHelpDesk for AI replies delivered as a customer message or a help desk ticket; InboundCoworkerReply and InboundHelpDeskReply for the customer answering through those channels. Use it with the CoworkerMessage, HelpDeskMessage and HelpDeskComment links to show where a turn actually happened..
Message body. User and assistant turns hold the text shown to people, in Markdown or HTML depending on channel; Tool turns hold a serialised tool result, and the assistant turn that requests tools holds a JSON array of tool calls rather than prose..
Optional Fields
ID of the platform user this message is attributed to. Set for messages exchanged inside an authenticated session; empty for anonymous web-chat and inbound email or WhatsApp contacts..
ID of the conversation this message belongs to. Filter on it to read one conversation’s transcript in order..
ID of the customer message this turn was delivered as or came from, when the AI replied over the CoworkerMessage channel..
ID of the help desk ticket this turn created or belongs to, set when the conversation was escalated to the help desk..
ID of the help desk comment this turn came from, set when the customer or an operator replied on the escalated ticket..
Code Examples
Response
200
Example Response
400
Example Response