Durably admit a caller-owned Turn and its 1:1 Run
const url = 'https://example.com/v1/sessions/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731/turns/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"message":"Use a sliding window of 100 requests per minute per API key.","model":"claude-opus-5","replyTo":{"interactionId":"toolu_01H8sZ4kQm2rVn9pXfB3tGdA"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/v1/sessions/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731/turns/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "message": "Use a sliding window of 100 requests per minute per API key.", "model": "claude-opus-5", "replyTo": { "interactionId": "toolu_01H8sZ4kQm2rVn9pXfB3tGdA" } }'Returns after the immutable Turn and QUEUED Run commit. Compute provisioning and engine admission happen asynchronously. Reply to an open Interaction by setting replyTo.interactionId.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A UUID identifying one Cloud resource; Session, Turn, Publication and Merge ids are minted by the caller so an ambiguous retry addresses the same durable command instead of creating a second one.
Example
9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731A UUID you mint and own; it is the idempotency key for creation and the address of every Turn, artifact and publication underneath
A UUID identifying one Cloud resource; Session, Turn, Publication and Merge ids are minted by the caller so an ambiguous retry addresses the same durable command instead of creating a second one.
Example
9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731A UUID you mint for this Turn; it is both the idempotency key and the id of the Run it creates
Request Bodyrequired
Section titled “Request Bodyrequired”Body of the idempotent Turn admission. The same caller-owned Turn id with the same content is a safe retry; the same id with different content is a conflict.
object
The prompt to execute; it becomes this Turn’s immutable input
Model for this Turn only, overriding the Session default; it must be one the Session’s settled runtime advertises
Compatibility echo only: when present it must equal the Session’s settled runtime. Omit it for ordinary Turns; create a new Session to change runtime.
Answers one specific open Interaction — the id is rechecked at admission and again at engine dispatch, so a stale prompt in a UI cannot answer a different question
object
Example
{ "message": "Use a sliding window of 100 requests per minute per API key.", "model": "claude-opus-5", "replyTo": { "interactionId": "toolu_01H8sZ4kQm2rVn9pXfB3tGdA" }}Responses
Section titled “Responses”Turn admitted or replayed
The 202 result of admitting a Turn: the immutable Turn and its queued Run are already committed to Postgres, while compute provisioning and engine start happen afterwards.
object
The durably admitted Turn, normally still pending dispatch at this point
object
The caller-owned Turn id; the one Run admitted with it carries this exact same value
Session this Turn belongs to
Session-local admission order starting at 0, and the value Turn paging is keyed on
The immutable admitted input — the message plus whatever model, runtime and reply the caller actually requested
object
object
Durable hand-off state to the engine: pending before a worker claims it, attempted once delivery started, confirmed when the engine accepted it, rejected when it definitively did not
The single Run this Turn created; its id equals the Turn id
object
A UUID identifying one Cloud resource; Session, Turn, Publication and Merge ids are minted by the caller so an ambiguous retry addresses the same durable command instead of creating a second one.
When admission committed the Turn, which is before any compute necessarily existed
The 1:1 Run created with it, normally still queued
object
Run id, always equal to the id of the Turn that created it
Session this Run belongs to
queued, dispatching and running are in flight, awaiting means the agent is blocked on human input, and completed, failed, cancelled and crashed are terminal
How many times a worker has claimed this Run; recovery after a lost worker increments it instead of creating a second Run
Whether cancellation was durably requested; it stays true after the Run terminates, and it never asserts that an external side effect was undone
Coarse machine code for the most recent failure, retained across retries; absent when nothing has failed
object
When admission committed this Run in queued
Last durable Run state change
When a worker actually began executing; absent while the Run is still queued
When the Run reached a terminal status; absent otherwise
False when this request was an exact idempotent replay and the stored Turn was returned unchanged
Example
{ "turn": { "id": "8f2d5b41-6e0c-47a9-b3d8-51ca9e07f2b6", "sessionId": "9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731", "ordinal": 1, "input": { "message": "Use a sliding window of 100 requests per minute per API key.", "model": "claude-opus-5", "runtime": "wamp", "replyTo": { "interactionId": "toolu_01H8sZ4kQm2rVn9pXfB3tGdA" } }, "dispatch": "pending", "run": { "id": "8f2d5b41-6e0c-47a9-b3d8-51ca9e07f2b6" }, "createdAt": "2026-08-12T09:46:12Z" }, "run": { "id": "8f2d5b41-6e0c-47a9-b3d8-51ca9e07f2b6", "sessionId": "9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731", "status": "queued", "attempts": 0, "cancellationRequested": false, "createdAt": "2026-08-12T09:46:12Z", "updatedAt": "2026-08-12T09:46:12Z" }, "created": true}Headers
Section titled “Headers”Malformed request
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "invalid_request"}The resource is missing or inaccessible
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "cloud_session_not_found"}Idempotency, lifecycle, revision or single-flight conflict
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "cloud_session_conflict"}The pre-authentication edge budget or durable human-membership/App-installation budget is exhausted
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "cloud_rate_limit_exceeded", "retryAfterSeconds": 3}Headers
Section titled “Headers”IETF HTTPAPI structured quota policy
IETF HTTPAPI structured current service limit
A retryable workspace, runtime or provider condition
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "cloud_workspace_unavailable"}