Skip to main content

Add a message

POST 

/v1/projects/:project_id/agents/:agent_id/sessions/:session_id/messages

Appends a user message to the session — plain message text or a document_id, exactly one of the two. idempotency_key makes the append safe to retry: a repeat with the same key returns the original message (HTTP 200) and triggers no new work. When the session has auto_generate on, the response is the agent's reply (a Generation shape) instead of the saved message.

Request

Responses

A duplicate append (idempotency key matched); the saved message.