POST /v1/sessions/{sessionId}/execute
Execute a turn — Submit a user message and receive the agent's response.
ivy_ API key (Authorization: Bearer ivy_… or X-Ivy-Api-Key), a Clerk session JWT (Authorization: Bearer …) or the Clerk __session cookie (browser sessions). See Authentication.Submit a user message and receive the agent's response.
Streaming mode (stream: true, default): response is a Server-Sent Events stream.
Each line is data: <JSON> where the JSON is one stream event. The stream
terminates with a sync.completed event.
Batch mode (stream: false): response is a JSON object with events (array of
all stream events) and the final state.
Request
Path parameters
Session UUID (UUIDv7 — time-ordered)
Request body
User message text
Client identifier for version vector tracking
Stream response via SSE (true, default) or collect into a JSON batch (false)
Responses
200 OK
Response shape:
Full session state snapshot persisted in Supabase
400 Bad Request
Response shape: object
401 Unauthorized
Response shape: object
404 Not Found
Response shape: object
Was this page helpful?
POST /v1/sessions/{sessionId}/messages/sync
Send a message and wait for the full reply — Runs one turn on a session you own and returns the complete result as JSON once the turn finishes…
POST /v1/sessions/{sessionId}/sync
Sync session state — Push local changes to the server using version vectors for conflict detection.