Skip to content

POST /v1/sessions/{session_id}/messages - Create message (user message triggers workflow)

POST
/v1/sessions/{session_id}/messages
session_id
required
string

Session ID (prefixed, e.g., sess_…)

Request to create a message

object
controls
One of:
null
message
required

The message to create

object
content
required

Array of content parts (text and image only)

Array
One of:

Text content

object
text
required
string
type
required
string
Allowed values: text
role

Message role (always “user” for API-created messages)

string
Allowed values: system user agent tool_result
metadata

Request-level metadata

object | null
tags

Tags for the message

array | null

Message created successfully

A message in the conversation

object
content
required

Message content as array of content parts (text, images, tool calls, tool results)

Array
One of:

Text content

object
text
required
string
type
required
string
Allowed values: text
controls
One of:
null
created_at
required

Timestamp when the message was created

string format: date-time
id
required

Unique message ID (format: message_{32-hex})

string
Example
message_01933b5a00007000800000000000001
metadata

Message-level metadata

object | null
role
required

Message role

string
Allowed values: system user agent tool_result
thinking

Thinking content from extended thinking models (Anthropic Claude) This is the model’s chain-of-thought reasoning before producing the response. Must be included in subsequent API calls when thinking is enabled.

string | null
thinking_signature

Cryptographic signature for thinking content (Anthropic Claude) Required when sending thinking back in subsequent API calls.

string | null

Invalid ID format

Session not found

Internal server error