Skip to main content
POST
Define what done looks like for a session

Authorizations

Authorization
string
header
required

A Recursion API key, created in the console under API keys.

Headers

x-tenant-id
string

Optional tenant consistency check. When present, it must name the tenant bound to the API key, including when x-organization-id is default.

Minimum string length: 1
x-organization-id
string

Organization in which to act. Required for a tenant-scoped API key. Optional for an organization-scoped key, where it must name that same organization. The value may be an organization id or default.

Minimum string length: 1

Path Parameters

sessionId
string<uuid>
required

Session id (UUID) as returned by managedAgentsStartSession or managedAgentsListSessions.

Body

application/json

A definition of done for a session -- the task plus the criteria it is graded against. Accepted both when starting a session and when adding an outcome to a running one. Send criteria, rubric, or rubric_ref; criteria and rubric are accepted together only when the rubric parses to exactly those criteria, as in a read-back body.

criteria
object[]
required

The criteria the evaluator checks the work against, in order. Verdicts and revision feedback cite each criterion by its criterion_key. Send criteria, rubric, or rubric_ref; criteria and rubric are accepted together only when the rubric parses to exactly those criteria, as in a read-back body. Criteria render to at most 256 KiB.

Required array length: 1 - 200 elements
description
string
required

The objective the agent works toward, and the statement of it the evaluator is given. It opens the session when the start request carries no message.

Minimum string length: 1
evaluatorAgentId
string

Agent selected to evaluate this outcome. Omit to inherit the writer agent version's default evaluator. If neither is set, defining the outcome returns 400.

max_iterations
null | integer
default:5

Ceiling on evaluation passes. Omit or send null for five; send 0 explicitly for unbounded.

Required range: 0 <= x <= 9007199254740991
rubric
string

Deprecated: send criteria. A markdown rubric, read once into criteria when the outcome is defined. Send criteria, rubric, or rubric_ref; criteria and rubric are accepted together only when the rubric parses to exactly those criteria, as in a read-back body. Criteria render to at most 256 KiB.

Minimum string length: 1
rubric_ref
object

The rubric as a file: its text is read once into criteria when the outcome is defined. Send criteria, rubric, or rubric_ref; criteria and rubric are accepted together only when the rubric parses to exactly those criteria, as in a read-back body. Criteria render to at most 256 KiB.

Response

A writer session's definition of done and its persisted evaluator verdicts.

A writer session's definition of done and its persisted evaluator verdicts.

created_at
string<date-time>
required

RFC 3339 timestamp when the outcome was created.

description
string
required

Objective the writer works toward, in prose.

max_iterations
integer<int64>
required

Maximum evaluator passes; zero explicitly means unbounded.

Required range: -9007199254740991 <= x <= 9007199254740991
organization_id
string
required

Organization that owns the outcome.

outcome_id
string
required

Server-assigned outcome identifier (UUID).

rubric
string
required

Deprecated: read criteria. The markdown rubric as it was sent, or the criteria rendered as a keyed markdown rubric when the outcome was defined from a criteria list.

session_id
string
required

Writer session this outcome belongs to (UUID).

status
enum<string>
required

Current outcome lifecycle state, including evaluating while a root pass is in flight.

Available options:
pending,
running,
evaluating,
terminal
updated_at
string<date-time>
required

RFC 3339 timestamp of the latest outcome change.

agent_id
string

Writer agent that owns the outcome (UUID).

criteria
object[]

Criteria the writer's work is evaluated against, in rubric order. Absent on an outcome whose historical rubric has no structured form; read rubric for it.

ended_at
string<date-time>

RFC 3339 timestamp when the outcome became terminal.

evaluations
object[]

Evaluator verdicts in order, newest last. Only passes that produced a verdict are listed: a pass that could not grade the work is reported by the pass status, and by terminal_result and terminal_explanation when it ended the outcome. A historical pass whose grader session is no longer recorded stays listed here even though it has no evaluator.

evaluatorAgentId
string

Agent selected to evaluate the outcome, frozen when defined.

historicalRoots
object[]

Original cloned grader roots with no pass link or verdict; iteration and exact preparation start are unknown.

passes
object[]

Cloned grading attempts, including preparation, failure, and interruption before a verdict exists.

rubric_ref
string

Source file reference when the rubric was captured from an uploaded file.

rubric_sha256
string

SHA-256 digest of the source rubric file, when present.

terminal_explanation
string

Why the outcome ended, beside terminal_result: the final verdict's explanation, or the reason an outcome that ended without one could not be graded. Absent until terminal, and on an outcome that ended before explanations were recorded.

terminal_result
enum<string>

Final outcome verdict; absent until terminal. not_applicable means no criterion applied and is not success.

Available options:
satisfied,
max_iterations_reached,
not_applicable,
not_evaluable,
failed