Skip to main content

Message

Chat message

Usage profiles​

UsageFields and validation
In requestsView fields
In responsesView fields
In webhook payloadsView fields

In requests​

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
rolestring (ROLE_SYSTEM, ROLE_USER, ROLE_ASSISTANT, ROLE_TOOL) or integer (int32) (1, 2, 3, 4)Required in requestsRole of the participant that produced the chat message.
contentArray of ContentPartOptionalContent parts composing the chat message.
toolCallsArray of ToolCallOptionalAssistant-to-tool invocations.
namestringOptionalName identifying the sender of the chat message.
timestampstring (date-time)OptionalTimestamp associated with the conversation message or event.
messageIdstringOptionalUnique message identifier.
annotationsArray of AnnotationOptionalStructured annotations (e.g., standardized web search URL citations, PDF reuse tokens)
sequencestring (int64)OptionalMonotonic, per-conversation sequence number for stable ordering (1-based) Pattern: ^-?\d+$.
generatedBystringOptionalWorkflow run id or generator key that produced this message (e.g., workflow run key)
usageUsageOptionalToken usage for this generation (populated for assistant messages)
modelstringOptionalModel that generated this message (e.g., "anthropic/claude-sonnet-4")
generationContextGenerationContextOptionalDynamic context that shaped this generation (memories, search params, turn info)
clientContextClientContextOptionalArbitrary client-supplied context attached by the client for this message
feedbackArray of MessageFeedbackOptionalFeedback on an assistant message, with one entry per rater identified by rated_by. A later rating by the same rater replaces their earlier entry.
sourceUserMessageIdstringOptionalIdentifier of the user message that opened this conversation turn. Generated messages in the same turn share this value; a user message carries its own message_id. Empty on historical messages that predate turn attribution.
finishReasonstringOptionalWhy the model stopped, verbatim from the provider: "stop", "tool_calls", "length", "error". Empty for historical messages.

Values of role​

Participant role attached to a conversation message and forwarded in model context.

ValueNo.FormMeaning
ROLE_SYSTEM1CanonicalInstructions or context provided as a system message.
ROLE_USER2CanonicalInput supplied by the user or customer application.
ROLE_ASSISTANT3CanonicalContent produced by the assistant, including its tool-call requests.
ROLE_TOOL4CanonicalA tool result supplied back to the assistant.

Request validation​

These rules apply when this value is supplied in a request. Request validation does not guarantee that response fields are present or satisfy the same rules.

Applies toRuleRequirement
Messagemessage_content_or_tool_callscontent or tool_calls required
roleDefined enum valuetrue
roleDisallowed values0

In responses​

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
rolestring (ROLE_SYSTEM, ROLE_USER, ROLE_ASSISTANT, ROLE_TOOL) or integer (int32)Required in requestsRole of the participant that produced the chat message.
contentArray of ContentPartOptionalContent parts composing the chat message.
toolCallsArray of ToolCallOptionalAssistant-to-tool invocations.
namestringOptionalName identifying the sender of the chat message.
timestampstring (date-time)OptionalTimestamp associated with the conversation message or event.
messageIdstringOptionalUnique message identifier.
annotationsArray of AnnotationOptionalStructured annotations (e.g., standardized web search URL citations, PDF reuse tokens)
sequencestring (int64)OptionalMonotonic, per-conversation sequence number for stable ordering (1-based) Pattern: ^-?\d+$.
generatedBystringOptionalWorkflow run id or generator key that produced this message (e.g., workflow run key)
usageUsageOptionalToken usage for this generation (populated for assistant messages)
modelstringOptionalModel that generated this message (e.g., "anthropic/claude-sonnet-4")
generationContextGenerationContextOptionalDynamic context that shaped this generation (memories, search params, turn info)
clientContextClientContextOptionalArbitrary client-supplied context attached by the client for this message
feedbackArray of MessageFeedbackOptionalFeedback on an assistant message, with one entry per rater identified by rated_by. A later rating by the same rater replaces their earlier entry.
sourceUserMessageIdstringOptionalIdentifier of the user message that opened this conversation turn. Generated messages in the same turn share this value; a user message carries its own message_id. Empty on historical messages that predate turn attribution.
finishReasonstringOptionalWhy the model stopped, verbatim from the provider: "stop", "tool_calls", "length", "error". Empty for historical messages.

Values of role​

Participant role attached to a conversation message and forwarded in model context.

ValueNo.FormMeaning
ROLE_SYSTEM1CanonicalInstructions or context provided as a system message.
ROLE_USER2CanonicalInput supplied by the user or customer application.
ROLE_ASSISTANT3CanonicalContent produced by the assistant, including its tool-call requests.
ROLE_TOOL4CanonicalA tool result supplied back to the assistant.

Request validation​

These rules apply when this value is supplied in a request. Request validation does not guarantee that response fields are present or satisfy the same rules.

Applies toRuleRequirement
Messagemessage_content_or_tool_callscontent or tool_calls required
roleDefined enum valuetrue
roleDisallowed values0

In webhook payloads​

Webhook JSON uses protobuf field names (snake_case).

FieldTypePresenceMeaning
rolestring (ROLE_SYSTEM, ROLE_USER, ROLE_ASSISTANT, ROLE_TOOL) or integer (int32)Required in requestsRole of the participant that produced the chat message.
contentArray of ContentPartOptionalContent parts composing the chat message.
tool_callsArray of ToolCallOptionalAssistant-to-tool invocations.
namestringOptionalName identifying the sender of the chat message.
timestampstring (date-time)OptionalTimestamp associated with the conversation message or event.
message_idstringOptionalUnique message identifier.
annotationsArray of AnnotationOptionalStructured annotations (e.g., standardized web search URL citations, PDF reuse tokens)
sequencestring (int64)OptionalMonotonic, per-conversation sequence number for stable ordering (1-based) Pattern: ^-?\d+$.
generated_bystringOptionalWorkflow run id or generator key that produced this message (e.g., workflow run key)
usageUsageOptionalToken usage for this generation (populated for assistant messages)
modelstringOptionalModel that generated this message (e.g., "anthropic/claude-sonnet-4")
generation_contextGenerationContextOptionalDynamic context that shaped this generation (memories, search params, turn info)
client_contextClientContextOptionalArbitrary client-supplied context attached by the client for this message
feedbackArray of MessageFeedbackOptionalFeedback on an assistant message, with one entry per rater identified by rated_by. A later rating by the same rater replaces their earlier entry.
source_user_message_idstringOptionalIdentifier of the user message that opened this conversation turn. Generated messages in the same turn share this value; a user message carries its own message_id. Empty on historical messages that predate turn attribution.
finish_reasonstringOptionalWhy the model stopped, verbatim from the provider: "stop", "tool_calls", "length", "error". Empty for historical messages.

Values of role​

Participant role attached to a conversation message and forwarded in model context.

ValueNo.FormMeaning
ROLE_SYSTEM1CanonicalInstructions or context provided as a system message.
ROLE_USER2CanonicalInput supplied by the user or customer application.
ROLE_ASSISTANT3CanonicalContent produced by the assistant, including its tool-call requests.
ROLE_TOOL4CanonicalA tool result supplied back to the assistant.

Request validation​

These rules apply when this value is supplied in a request. Request validation does not guarantee that response fields are present or satisfy the same rules.

Applies toRuleRequirement
Messagemessage_content_or_tool_callscontent or tool_calls required
roleDefined enum valuetrue
roleDisallowed values0

Where used​

ReferenceRelationship
Append a message without generatingPOST /api/v1/llm/append-message
Send a message to a conversationPOST /api/v1/llm/send-message
Send a message and wait for the resultPOST /api/v1/llm/send-message-sync
Withdraw your rating on a messagePOST /api/v1/llm/delete-message-rating
Get full conversation statePOST /api/v1/llm/conversation-state
Rate an assistant messagePOST /api/v1/llm/rate-message
Submit client-side tool results and wait for the next segmentPOST /api/v1/llm/submit-client-tool-results-sync
llm.message_publishedWebhook JSON uses protobuf field names (snake_case).
LLMMessagePublishedEventNested in model

Download the public reference contract.

Document: DOC-API-MODEL-message.