HTTP: sessions
Default control-plane operations. Complete OpenAPI schema · Authentication and tenancy.
POST /api/sessions/{session_id}/compact
Section titled “POST /api/sessions/{session_id}/compact”Compact Session
Operation ID: compact_session_api_sessions__session_id__compact_post.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"pattern":"^[^\\x00]+$","title":"Session Id"} |
Cayu-Mutation-ID |
header | False | {"anyOf":[{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9][A-Za-z0-9._~-]*$"},{"type":"null"}],"description":"Client-generated mutation identity used to correlate an ambiguous SSE reconnect with its durable server acceptance event. Send the same value on the initial mutation and every Last-Event-ID replay request; it is a replay correlation key, not permission to repeat the POST.","title":"Cayu-Mutation-Id"} |
Request body
Section titled “Request body”{ "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompactSessionBody" } } }}Model declarations: CompactSessionBody.
Responses
Section titled “Responses”{ "200": { "description": "Server-Sent Events stream. Each runtime event is emitted as an SSE frame whose `data:` value is a JSON SseEventEnvelope. A classified terminal runtime or observer condition is emitted as `event: error` with a SseErrorEnvelope payload.", "content": { "text/event-stream": { "schema": { "type": "string", "description": "SSE stream. Runtime `data:` frames contain SseEventEnvelope JSON; `event: error` frames contain SseErrorEnvelope JSON." } } } }, "404": { "description": "The replay session or mutation target does not exist.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "409": { "description": "The replay event marker is unknown or the mutation conflicts with the current session state.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "500": { "description": "The mutation could not open an accepted durable stream.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: ApiErrorResponse, HTTPValidationError.
GET /api/sessions/{session_id}/human-review
Section titled “GET /api/sessions/{session_id}/human-review”Inspect Human Review
Operation ID: inspect_human_review_api_sessions__session_id__human_review_get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","title":"Session Id"} |
purpose |
query | True | {"type":"string","minLength":1,"maxLength":128,"title":"Purpose"} |
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HumanReviewView" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: HTTPValidationError, HumanReviewView.
GET /api/sessions
Section titled “GET /api/sessions”List Sessions
Operation ID: list_sessions_api_sessions_get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
limit |
query | False | {"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Limit"} |
offset |
query | False | {"type":"integer","minimum":0,"default":0,"title":"Offset"} |
cursor |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"} |
q |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"} |
status |
query | False | {"anyOf":[{"$ref":"#/components/schemas/SessionStatus"},{"type":"null"}],"title":"Status"} |
debug_state |
query | False | {"anyOf":[{"$ref":"#/components/schemas/SessionDebugState"},{"type":"null"}],"title":"Debug State"} |
agent_name |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"} |
provider_name |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Name"} |
model |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"} |
environment_name |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Environment Name"} |
parent_session_id |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Session Id"} |
causal_budget_id |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Causal Budget Id"} |
order_by |
query | False | {"$ref":"#/components/schemas/SessionOrder","default":"updated_at_desc"} |
label |
query | False | {"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Label"} |
label_selector |
query | False | {"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Label Selector"} |
include |
query | False | {"anyOf":[{"type":"array","items":{"const":"usage","type":"string"}},{"type":"null"}],"title":"Include"} |
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListSessionsResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: HTTPValidationError, ListSessionsResponse.
POST /api/sessions/{session_id}/topology
Section titled “POST /api/sessions/{session_id}/topology”Get Session Topology
Operation ID: get_session_topology_api_sessions__session_id__topology_post.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
Request body
Section titled “Request body”{ "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionTopologyRequest" } } }}Model declarations: SessionTopologyRequest.
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionTopologyResponse" } } } }, "404": { "description": "The focus session or one requested expanded session/task parent does not exist.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "409": { "description": "Durable session/task lineage is inconsistent, or continuation authority cannot cross the configured redaction boundary.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "413": { "description": "The request bytes, session/task ancestry, or serialized response exceed a safety bound.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "501": { "description": "The configured session store does not implement topology reads.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: ApiErrorResponse, HTTPValidationError, SessionTopologyResponse.
POST /api/sessions/summary
Section titled “POST /api/sessions/summary”Get Sessions Summary
Operation ID: get_sessions_summary_api_sessions_summary_post.
| Parameter | Location | Required | Schema |
|---|---|---|---|
limit |
query | False | {"type":"integer","maximum":1000,"minimum":1,"default":1000,"title":"Limit"} |
offset |
query | False | {"type":"integer","minimum":0,"default":0,"title":"Offset"} |
cursor |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"} |
q |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"} |
status |
query | False | {"anyOf":[{"$ref":"#/components/schemas/SessionStatus"},{"type":"null"}],"title":"Status"} |
debug_state |
query | False | {"anyOf":[{"$ref":"#/components/schemas/SessionDebugState"},{"type":"null"}],"title":"Debug State"} |
agent_name |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"} |
provider_name |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Name"} |
model |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"} |
environment_name |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Environment Name"} |
parent_session_id |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Session Id"} |
causal_budget_id |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Causal Budget Id"} |
order_by |
query | False | {"$ref":"#/components/schemas/SessionOrder","default":"updated_at_desc"} |
label |
query | False | {"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Label"} |
label_selector |
query | False | {"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Label Selector"} |
Request body
Section titled “Request body”{ "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/SessionsSummaryBody" }, { "type": "null" } ], "title": "Body" } } }}Model declarations: SessionsSummaryBody.
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionsSummaryResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: HTTPValidationError, SessionsSummaryResponse.
GET /api/sessions/{session_id}/usage
Section titled “GET /api/sessions/{session_id}/usage”Get Session Usage
Operation ID: get_session_usage_api_sessions__session_id__usage_get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
if-none-match |
header | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-None-Match"} |
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionUsageSummary" } } } }, "304": { "description": "The summary still matches `If-None-Match`." }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: HTTPValidationError, SessionUsageSummary.
POST /api/sessions/{session_id}/cost
Section titled “POST /api/sessions/{session_id}/cost”Estimate Session Cost
Operation ID: estimate_session_cost_api_sessions__session_id__cost_post.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
Request body
Section titled “Request body”{ "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionCostBody" } } }}Model declarations: SessionCostBody.
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionCostSummary" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: HTTPValidationError, SessionCostSummary.
GET /api/sessions/{session_id}/state
Section titled “GET /api/sessions/{session_id}/state”Get Session State
Return bounded lifecycle state. The response carries a weak ETag; a matching If-None-Match returns 304 without a body.
Operation ID: get_session_state_api_sessions__session_id__state_get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionStateResponse" } } } }, "304": { "description": "The session state is unchanged from the `If-None-Match` entity tag." }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: HTTPValidationError, SessionStateResponse.
GET /api/sessions/{session_id}/tool-view
Section titled “GET /api/sessions/{session_id}/tool-view”Get Session Tool View
Inspect one tenant-bound current view without callable authority.
Operation ID: get_session_tool_view_api_sessions__session_id__tool_view_get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
limit |
query | False | {"type":"integer","maximum":256,"minimum":1,"default":256,"title":"Limit"} |
Responses
Section titled “Responses”{ "200": { "description": "A bounded, content-minimized current discovery view.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ToolDiscoveryViewInspection" } } }, "headers": { "Cache-Control": { "description": "Prevents authenticated discovery metadata from being cached.", "schema": { "type": "string", "enum": [ "private, no-store" ] } } } }, "401": { "description": "The request has no valid authenticated identity.", "headers": { "Cache-Control": { "description": "Prevents authenticated discovery metadata from being cached.", "schema": { "type": "string", "enum": [ "private, no-store" ] } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "403": { "description": "The authenticated identity has no verified tenant.", "headers": { "Cache-Control": { "description": "Prevents authenticated discovery metadata from being cached.", "schema": { "type": "string", "enum": [ "private, no-store" ] } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "404": { "description": "The session/view does not exist or belongs to a different verified tenant.", "headers": { "Cache-Control": { "description": "Prevents authenticated discovery metadata from being cached.", "schema": { "type": "string", "enum": [ "private, no-store" ] } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "409": { "description": "The durable discovery view is inconsistent with current authority.", "headers": { "Cache-Control": { "description": "Prevents authenticated discovery metadata from being cached.", "schema": { "type": "string", "enum": [ "private, no-store" ] } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "422": { "description": "The bounded tool-view inspection request is invalid.", "headers": { "Cache-Control": { "description": "Prevents authenticated discovery metadata from being cached.", "schema": { "type": "string", "enum": [ "private, no-store" ] } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "500": { "description": "Tool-view inspection failed before a safe view could be returned.", "headers": { "Cache-Control": { "description": "Prevents authenticated discovery metadata from being cached.", "schema": { "type": "string", "enum": [ "private, no-store" ] } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }}Model declarations: ApiErrorResponse, ToolDiscoveryViewInspection.
GET /api/sessions/{session_id}/summary
Section titled “GET /api/sessions/{session_id}/summary”Get Session Summary
Operation ID: get_session_summary_api_sessions__session_id__summary_get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionSummaryResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: HTTPValidationError, SessionSummaryResponse.
GET /api/sessions/{session_id}/interactions
Section titled “GET /api/sessions/{session_id}/interactions”List Session Interactions
Operation ID: list_session_interactions_api_sessions__session_id__interactions_get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
before_sequence |
query | False | {"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Before Sequence"} |
limit |
query | False | {"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"} |
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListSessionInteractionsResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: HTTPValidationError, ListSessionInteractionsResponse.
GET /api/sessions/{session_id}/interactions/{interaction_id}
Section titled “GET /api/sessions/{session_id}/interactions/{interaction_id}”Get Session Interaction
Operation ID: get_session_interaction_api_sessions__session_id__interactions__interaction_id__get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
interaction_id |
path | True | {"type":"string","minLength":1,"title":"Interaction Id"} |
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiInteractionSummary" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: ApiInteractionSummary, HTTPValidationError.
GET /api/sessions/{session_id}/events
Section titled “GET /api/sessions/{session_id}/events”List Session Events
Operation ID: list_session_events_api_sessions__session_id__events_get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
event_id |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"description":"Return the event with this exact session-scoped event ID, if it exists.","title":"Event Id"} |
event_type |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"} |
interaction_id |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"description":"Return only events attributed to this interaction.","title":"Interaction Id"} |
exclude_event_type |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exclude one event type before applying pagination.","title":"Exclude Event Type"} |
tool_name |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"} |
agent_name |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"} |
environment_name |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Environment Name"} |
workflow_name |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Name"} |
after_sequence |
query | False | {"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Return only events with a greater durable sequence.","title":"After Sequence"} |
before_sequence |
query | False | {"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Return only events with a smaller durable sequence.","title":"Before Sequence"} |
order_by |
query | False | {"$ref":"#/components/schemas/EventOrder","description":"Return events in durable sequence order.","default":"sequence_asc"} |
limit |
query | False | {"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"} |
wait_seconds |
query | False | {"anyOf":[{"type":"number","maximum":25.0,"minimum":0},{"type":"null"}],"description":"Long-poll fallback for clients that cannot hold the follow stream open. Wait up to this many seconds for a matching event after after_sequence while the session is pending, running, or interrupting, then return the page (possibly empty).","title":"Wait Seconds"} |
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListSessionEventsResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: HTTPValidationError, ListSessionEventsResponse.
GET /api/sessions/{session_id}/events/stream
Section titled “GET /api/sessions/{session_id}/events/stream”Follow Session Events
Follow one session’s durable events over Server-Sent Events without admitting or re-running any mutation. Start after after_sequence, or resume after the event named by the standard Last-Event-ID header, which takes precedence so a browser EventSource reconnects natively. Filters match GET /sessions/{session_id}/events. The stream sends SSE comment heartbeats and, after the session’s terminal event, one event: end frame before closing; an already-terminal session drains and closes immediately. Concurrent streams are capped per caller and per session and return 429 with Retry-After when exceeded.
Operation ID: follow_session_events_api_sessions__session_id__events_stream_get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
after_sequence |
query | False | {"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Stream only events with a greater durable sequence. Ignored when a Last-Event-ID header is present.","title":"After Sequence"} |
event_type |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"description":"Send only events of this type.","title":"Event Type"} |
exclude_event_type |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"description":"Do not send events of this type.","title":"Exclude Event Type"} |
interaction_id |
query | False | {"anyOf":[{"type":"string"},{"type":"null"}],"description":"Send only events attributed to this interaction.","title":"Interaction Id"} |
Responses
Section titled “Responses”{ "200": { "description": "Read-only Server-Sent Events stream of one session's durable events. Each event is an SSE frame with an `id:` marker and a JSON SseEventEnvelope `data:` value. Heartbeats are SSE comment lines. After the session's terminal event the stream sends `event: end` with a SseSessionFollowEndEnvelope and closes. A classified observer condition is emitted as `event: error` with a SseErrorEnvelope payload.", "content": { "text/event-stream": { "schema": { "type": "string", "description": "SSE stream. Event `data:` frames contain SseEventEnvelope JSON; `event: end` frames contain SseSessionFollowEndEnvelope JSON; `event: error` frames contain SseErrorEnvelope JSON." } } } }, "404": { "description": "The session does not exist.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "409": { "description": "The Last-Event-ID event marker is unknown in this session.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "429": { "description": "The caller or session already holds the configured maximum number of follow streams. Retry after the `Retry-After` header.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: ApiErrorResponse, HTTPValidationError.
GET /api/sessions/{session_id}/transcript
Section titled “GET /api/sessions/{session_id}/transcript”Get Session Transcript
Operation ID: get_session_transcript_api_sessions__session_id__transcript_get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
role |
query | False | {"anyOf":[{"$ref":"#/components/schemas/MessageRole"},{"type":"null"}],"title":"Role"} |
interaction_id |
query | False | {"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Return only transcript records attributed to this interaction.","title":"Interaction Id"} |
offset |
query | False | {"type":"integer","minimum":0,"default":0,"title":"Offset"} |
limit |
query | False | {"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"} |
include_thinking |
query | False | {"type":"boolean","default":true,"title":"Include Thinking"} |
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionTranscriptResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: HTTPValidationError, SessionTranscriptResponse.
GET /api/sessions/{session_id}
Section titled “GET /api/sessions/{session_id}”Get Session
Operation ID: get_session_api_sessions__session_id__get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiSessionDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: ApiSessionDetail, HTTPValidationError.
DELETE /api/sessions/{session_id}
Section titled “DELETE /api/sessions/{session_id}”Delete Session
Operation ID: delete_session_api_sessions__session_id__delete.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
Responses
Section titled “Responses”{ "204": { "description": "Successful Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: HTTPValidationError.
PATCH /api/sessions/{session_id}/labels
Section titled “PATCH /api/sessions/{session_id}/labels”Update Session Labels
Operation ID: update_session_labels_api_sessions__session_id__labels_patch.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
Request body
Section titled “Request body”{ "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateSessionLabelsBody" } } }}Model declarations: UpdateSessionLabelsBody.
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiSession" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: ApiSession, HTTPValidationError.
PATCH /api/sessions/{session_id}/metadata
Section titled “PATCH /api/sessions/{session_id}/metadata”Update Session Metadata
Operation ID: update_session_metadata_api_sessions__session_id__metadata_patch.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
Request body
Section titled “Request body”{ "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateSessionMetadataBody" } } }}Model declarations: UpdateSessionMetadataBody.
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiSession" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: ApiSession, HTTPValidationError.
POST /api/sessions/{session_id}/interrupt
Section titled “POST /api/sessions/{session_id}/interrupt”Interrupt Session
Operation ID: interrupt_session_api_sessions__session_id__interrupt_post.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
Cayu-Mutation-ID |
header | False | {"anyOf":[{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9][A-Za-z0-9._~-]*$"},{"type":"null"}],"description":"Client-generated mutation identity used to correlate an ambiguous SSE reconnect with its durable server acceptance event. Send the same value on the initial mutation and every Last-Event-ID replay request; it is a replay correlation key, not permission to repeat the POST.","title":"Cayu-Mutation-Id"} |
Request body
Section titled “Request body”{ "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/InterruptSessionBody" }, { "type": "null" } ], "title": "Body" } } }}Model declarations: InterruptSessionBody.
Responses
Section titled “Responses”{ "200": { "description": "Server-Sent Events stream. Each runtime event is emitted as an SSE frame whose `data:` value is a JSON SseEventEnvelope. A classified terminal runtime or observer condition is emitted as `event: error` with a SseErrorEnvelope payload.", "content": { "text/event-stream": { "schema": { "type": "string", "description": "SSE stream. Runtime `data:` frames contain SseEventEnvelope JSON; `event: error` frames contain SseErrorEnvelope JSON." } } } }, "404": { "description": "The replay session or mutation target does not exist.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "409": { "description": "The replay event marker is unknown or the mutation conflicts with the current session state.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "500": { "description": "The mutation could not open an accepted durable stream.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "413": { "description": "The control-plane request exceeds its encoded byte limit.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }}Model declarations: ApiErrorResponse, HTTPValidationError.
POST /api/sessions/{session_id}/messages
Section titled “POST /api/sessions/{session_id}/messages”Enqueue Session Message
Operation ID: enqueue_session_message_api_sessions__session_id__messages_post.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","minLength":1,"title":"Session Id"} |
Cayu-Mutation-ID |
header | False | {"anyOf":[{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9][A-Za-z0-9._~-]*$"},{"type":"null"}],"description":"Client-generated mutation identity used to correlate an ambiguous SSE reconnect with its durable server acceptance event. Send the same value on the initial mutation and every Last-Event-ID replay request; it is a replay correlation key, not permission to repeat the POST.","title":"Cayu-Mutation-Id"} |
Request body
Section titled “Request body”{ "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EnqueueSessionMessageBody" } } }}Model declarations: EnqueueSessionMessageBody.
Responses
Section titled “Responses”{ "200": { "description": "Server-Sent Events stream. Each runtime event is emitted as an SSE frame whose `data:` value is a JSON SseEventEnvelope. A classified terminal runtime or observer condition is emitted as `event: error` with a SseErrorEnvelope payload.", "content": { "text/event-stream": { "schema": { "type": "string", "description": "SSE stream. Runtime `data:` frames contain SseEventEnvelope JSON; `event: error` frames contain SseErrorEnvelope JSON." } } } }, "400": { "description": "The request attempts to override authenticated actor identity.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "401": { "description": "Authentication is required.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "403": { "description": "Session-message access is not authorized.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "409": { "description": "The request conflicts with exact durable authority or terminal state.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "413": { "description": "The request exceeds the private request byte limit.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "422": { "description": "Invalid session-message request; rejected input is not reflected.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "500": { "description": "The session-message operation failed.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "503": { "description": "The store does not support this session-message operation.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "404": { "description": "The replay session or mutation target does not exist.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }}Model declarations: ApiErrorResponse.
GET /api/sessions/{session_id}/messages
Section titled “GET /api/sessions/{session_id}/messages”Inspect Session Messages
Operation ID: inspect_session_messages_api_sessions__session_id__messages_get.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","title":"Session Id"} |
limit |
query | False | {"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"} |
cursor_session_instance_id |
query | False | {"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}],"title":"Cursor Session Instance Id"} |
cursor_through_ordering_key |
query | False | {"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":0},{"type":"null"}],"title":"Cursor Through Ordering Key"} |
cursor_after_priority |
query | False | {"anyOf":[{"type":"integer","maximum":2,"minimum":0},{"type":"null"}],"title":"Cursor After Priority"} |
cursor_after_ordering_key |
query | False | {"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":0},{"type":"null"}],"title":"Cursor After Ordering Key"} |
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionMessageInspection" } } } }, "400": { "description": "The request attempts to override authenticated actor identity.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "401": { "description": "Authentication is required.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "403": { "description": "Session-message access is not authorized.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "409": { "description": "The request conflicts with exact durable authority or terminal state.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "413": { "description": "The request exceeds the private request byte limit.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "422": { "description": "Invalid session-message request; rejected input is not reflected.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "500": { "description": "The session-message operation failed.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "503": { "description": "The store does not support this session-message operation.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }}Model declarations: ApiErrorResponse, SessionMessageInspection.
POST /api/sessions/{session_id}/messages/source-snapshot
Section titled “POST /api/sessions/{session_id}/messages/source-snapshot”Snapshot Session Message Source
Operation ID: snapshot_session_message_source_api_sessions__session_id__messages_source_snapshot_post.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","title":"Session Id"} |
Request body
Section titled “Request body”{ "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionMessageSourceBody" } } }}Model declarations: SessionMessageSourceBody.
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionMessageSource" } } } }, "400": { "description": "The request attempts to override authenticated actor identity.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "401": { "description": "Authentication is required.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "403": { "description": "Session-message access is not authorized.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "409": { "description": "The request conflicts with exact durable authority or terminal state.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "413": { "description": "The request exceeds the private request byte limit.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "422": { "description": "Invalid session-message request; rejected input is not reflected.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "500": { "description": "The session-message operation failed.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "503": { "description": "The store does not support this session-message operation.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }}Model declarations: ApiErrorResponse, SessionMessageSource.
POST /api/sessions/{session_id}/messages/{queue_id}/withdraw
Section titled “POST /api/sessions/{session_id}/messages/{queue_id}/withdraw”Withdraw Session Message
Operation ID: withdraw_session_message_api_sessions__session_id__messages__queue_id__withdraw_post.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","title":"Session Id"} |
queue_id |
path | True | {"type":"string","title":"Queue Id"} |
Request body
Section titled “Request body”{ "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionMessageActionBody" } } }}Model declarations: SessionMessageActionBody.
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionMessageActionResult" } } } }, "400": { "description": "The request attempts to override authenticated actor identity.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "401": { "description": "Authentication is required.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "403": { "description": "Session-message access is not authorized.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "409": { "description": "The request conflicts with exact durable authority or terminal state.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "413": { "description": "The request exceeds the private request byte limit.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "422": { "description": "Invalid session-message request; rejected input is not reflected.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "500": { "description": "The session-message operation failed.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "503": { "description": "The store does not support this session-message operation.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }}Model declarations: ApiErrorResponse, SessionMessageActionResult.
POST /api/sessions/{session_id}/messages/{queue_id}/quarantine
Section titled “POST /api/sessions/{session_id}/messages/{queue_id}/quarantine”Quarantine Session Message
Operation ID: quarantine_session_message_api_sessions__session_id__messages__queue_id__quarantine_post.
| Parameter | Location | Required | Schema |
|---|---|---|---|
session_id |
path | True | {"type":"string","title":"Session Id"} |
queue_id |
path | True | {"type":"string","title":"Queue Id"} |
Request body
Section titled “Request body”{ "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionMessageActionBody" } } }}Model declarations: SessionMessageActionBody.
Responses
Section titled “Responses”{ "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionMessageActionResult" } } } }, "400": { "description": "The request attempts to override authenticated actor identity.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "401": { "description": "Authentication is required.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "403": { "description": "Session-message access is not authorized.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "409": { "description": "The request conflicts with exact durable authority or terminal state.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "413": { "description": "The request exceeds the private request byte limit.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "422": { "description": "Invalid session-message request; rejected input is not reflected.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "500": { "description": "The session-message operation failed.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }, "503": { "description": "The store does not support this session-message operation.", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "private, no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiErrorResponse" } } } }}Model declarations: ApiErrorResponse, SessionMessageActionResult.