Browse documentation
Retrieve a run
Retrieves one retained run and a selected turn. Requires run:read.
Without turn_id, the latest turn is selected.
The turn carries the input, output, status, error and agent_version
that executed it. These are durable run data, stored with the run for as
long as it is retained, and they do not depend on the run's events. An
expired run returns 410 with code run_expired.
/runs/{runId}Authorization
AuthorizationBearer <token>Path parameters
runIdstringrequired- pattern
"^run_[A-Za-z0-9]+$"
Query parameters
turn_idstring- pattern
"^turn_[A-Za-z0-9]+$"
Response
Run object
Additional properties are allowed.
idstringrequired- pattern
"^run_[A-Za-z0-9]+$"
objectstringrequired- const
"run"
agent_idstringrequired- pattern
"^agt_[A-Za-z0-9]+$"
agent_versionintegerrequiredThe deployment version that executes the returned turn. It equals turn.agent_version.
- minimum
1
statestringrequired- enum
["idle","busy"]
dispositionstringrequired- enum
["created_run","created_turn","queued_turn","steered"]
tagsarrayrequiredThe run's tags, sorted, without repeats. A run has at most 20.
- maxItems
20- uniqueItems
true
Show nested schema
A free-form label of 1 to 64 characters, stored exactly as sent. It is case-sensitive and nothing is trimmed. It may not be only whitespace or contain a control character.
- minLength
1- maxLength
64- pattern
"^(?![ \\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]+$)[^\\u0000-\\u001f\\u007f-\\u009f]+$"
turnobjectrequiredAdditional properties are allowed.
Show nested schema
idstringrequired- pattern
"^turn_[A-Za-z0-9]+$"
objectstringrequired- const
"turn"
agent_versionintegerrequiredThe deployment version of the agent that executes this turn. It is pinned when the turn is admitted and never changes, so it still names the version that ran after the agent's active version moves on. A run can hold turns on different versions.
- minimum
1
statusstringrequiredcompleted, failed, cancelled and incomplete are final.
completed returns its complete result and no error. failed
is described by error. cancelled has empty output and no
error. incomplete keeps the partial output it produced, and
error explains why it stopped when the runtime reported a reason
(otherwise null). cancelling means a cancellation
was accepted and the runtime is cleaning up.
- enum
["queued","in_progress","cancelling","completed","failed","cancelled","incomplete"]
inputarrayrequiredShow nested schema
Additional properties are allowed.
outputarrayrequiredShow nested schema
object1
Additional properties are allowed.
typestringrequired- const
"output_text"
textstringrequiredobject2
Additional properties are allowed.
typestringrequired- const
"output_file"
file_idstringrequiredfilenamestringrequiredmedia_typestringrequiredcreated_atintegerrequired- minimum
0
started_atinteger | nullrequired- minimum
0
completed_atinteger | nullrequired- minimum
0
duration_msinteger | nullrequired- minimum
0
errorunionrequiredWhy a failed turn stopped (always present), or why an incomplete turn stopped when the runtime reported a reason (otherwise null). null for every other status. It is stored with the turn and stays available regardless of event retention.
Show nested schema
null1
object2
The structured reason a turn stopped by error. code is a stable machine-readable reason and new codes can be added. retryable says whether sending the same work again can succeed. reference identifies the failure for support.
Additional properties are allowed.
codestringrequiredsourcestringrequired- enum
["provider","extension","runtime","platform","configuration"]
messagestringrequiredretryablebooleanrequiredreferencestringrequired