Skip to main content
POST
Admit a turn

Behavior

The request carries a turn_id (a UUID you generate) and Accept: application/json. It answers 202 with {turn, stream} once the user message is stored and the turn is queued, or 200 with the same body for a repeat of the same turn_id and message. A request without a turn_id or without Accept: application/json answers 400 stream_turn_required. Read the turn’s frames from GET .../turns/{turn_id}/stream?end_user=...&after=..., a Server-Sent Events stream. Each frame is id: <seq>, event: <type>, data: <json>, then a blank line, and every turn ends with exactly one turn_end or error frame. If the connection drops, open the stream again with after set to the last seq you applied. A failure before admission is a normal JSON error; after it, the failure arrives as an error frame on the stream. confirmations continue a paused turn: send them with the paused turn’s turn_id, covering exactly the paused call ids, and the frames continue on the same stream. Client tool results are never posted here: post each one to .../turns/{turn_id}/tool-calls/{tool_call_id}/result. A turns POST carrying tool_results answers 409. A new message while a turn is paused is 409 pending_turn with details.pause_kind and details.pending_call_ids. To retry the latest failed turn on the active branch, send retry_of with its turn ID, a fresh turn_id, and unchanged message and attachment_ids. Invalid retries return 409 retry_conflict. See Retry a failed turn. The turn runs on the platform’s workers and keeps running when your client disconnects. A turn may run for up to 10 minutes. When the platform is at capacity the route answers 503 turn_capacity with Retry-After before anything is stored. Turn requests have their own rate limit bucket per org: 300 requests per minute, or the deployment’s default limit when that is higher. Every frame, the turn state model, and every stop reason are on Turns and streaming. Client tools and confirmations are on Client tools and confirmations.

Authorizations

Authorization
string
header
required

The org's platform API key.

Headers

Accept
string

Required: application/json, with a turn_id in the body. Any other request is answered 400 stream_turn_required.

Path Parameters

instanceSlug
string
required

The conversation instance's slug.

conversationID
string
required

The conversation's id (a UUID).

Body

application/json
end_user
string
required

The end user the conversation belongs to.

turn_id
string
required

Required. The caller's id for the turn (a UUID): the turn it starts, or the paused turn a confirmations post continues.

attachment_ids
string[] | null
confirmations
object[] | null
edit_of_message_id
string
message
string
message_origin
enum<string>

app when the app wrote message (a starter prompt the person pressed and sent unchanged); absent when the person typed it. Requires message.

Available options:
app
page_context
any
read_only
boolean

Run this message turn offering only the tools that read: every tool that writes, starts a run, files a working copy or asks for a confirmation is withheld, and the turn queues no memory learning. The conversation and its messages are still stored. Requires message.

retry_of
string
sealed_through_active
integer<int64>

With an edit that stops the active turn: the N of that turn's seal.

stop_active_turn
boolean
tool_results
object[] | null

Response

OK

stream
object
required
turn
object
required
Last modified on November 30, 2026