Skip to main content
POST
Create AdminAgentMessage
An individual message within an admin agent session conversation. Messages can be from the user, assistant, system, or tool calls/results. Each message tracks its role, content, and any tool interactions including tool name, arguments, and results. Token usage is tracked per message for cost monitoring.

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 AdminAgentMessage-Create role.

Request Body

Required Fields

integer
required
ID of the admin agent session linked to this message.
integer
required
Role of the message sender: User, Assistant, System, ToolCall, or ToolResult.
integer
required
Number of LLM tokens consumed by this message.
integer
required
Agent when the assistant was asked to answer, Chat when the message was for the people in the conversation.

Optional Fields

string
The text content of the message.
string
Name of the tool that was called or produced a result.
string
JSON-formatted arguments passed to the tool.
string
JSON-formatted result returned by the tool.
integer
User who wrote the message (people only).
string
JSON with the users and/or agent mentioned in the message.

Code Examples

Response

200

integer
HTTP status code. 200 on success.
string
A human-readable message confirming the creation.
object
Contains the Id of the newly created record.
boolean
true if the adminagentmessage was created successfully.
array
null on success.
Example Response

400

string
A summary of the validation error(s), in the format PropertyName: error message.
any
null on validation failure.
object[]
Array of validation errors.
boolean
false when the request fails validation.
Example Response