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.

Path Parameters

session_id
string<uuid>
required

Session id (UUID) as returned by startSession or listSessions.

Body

application/json

A definition of done for a session -- the task plus the rubric it is graded against. Accepted both when starting a session and when adding an outcome to a running one. Exactly one of rubric and rubric_ref is required.

description
string
required

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

Minimum string length: 1
rubric
string
required

Markdown the grader scores the work against. Criteria must be independently checkable: 'the CSV has a numeric price column' can be verified, 'the data looks good' cannot. Send this or rubric_ref.

Minimum string length: 1
grader_model_ref_id
string

Model reference for the grader. Defaults to the session's model.

max_iterations
integer<int64>
default:0

Ceiling on grader passes before the outcome ends as max_iterations_reached. Omit it, or send 0, to revise until the grader is satisfied, which is the default. Set a number only to cap a rubric you are not sure can be met.

Required range: x >= 0
rubric_ref
object

The rubric as a file instead of inline markdown: the file's text is read once, when the outcome is defined, and recorded as the rubric. Exactly one of rubric and rubric_ref is required.

Example:

Response

A session's definition of done: the task to achieve plus a rubric a grader scores the work against, tracked through its own grading lifecycle. Defined when the session starts, and read back to see whether the work was accepted.

A session's definition of done: the task to achieve plus a rubric a grader scores the work against, tracked through its own grading lifecycle. Defined when the session starts, and read back to see whether the work was accepted.

created_at
string<date-time>
required

RFC 3339 timestamp of when this record was created. Server-assigned.

description
string
required

Objective the agent works toward, in prose, and the statement of it quoted to the grader. Opens the session when the start request carries no message.

max_iterations
integer<int64>
required

Ceiling on grader passes before the outcome ends as max_iterations_reached. Zero means unbounded, which is the default: the loop runs until the grader is satisfied.

organization_id
string
required

Organization that owns this record. Resolved from the API key; never accepted from the caller.

outcome_id
string
required

Identifier for this outcome (UUID). Server-assigned.

rubric
string
required

Markdown rubric the grader scores the work against. Write independently checkable criteria; vague criteria produce noisy revision loops.

session_id
string
required

Session this outcome belongs to (UUID).

status
enum<string>
required

Where the outcome is in its grading lifecycle: pending (no grader has looked at it), running (the agent is working toward it), evaluating (a grader pass is in flight), or terminal (grading finished; read terminal_result).

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

RFC 3339 timestamp of the last change to this record. Server-assigned.

agent_id
string

Agent this outcome belongs to (UUID), copied from the session that defined it.

defined_by_event_id
string

Event in the session's log that defined this outcome (UUID).

ended_at
string<date-time>

RFC 3339 timestamp of when grading reached a terminal result. Absent while the outcome is still open.

evaluations
object[]

Grader passes in order, newest last. Returned only by reads that ask for evaluations, and empty until a grader has run.

grader_model_ref_id
string

Model reference the grader runs on (UUID), letting grading use a different model than the agent doing the work. Defaults to the session's model.

rubric_ref
string

Where the rubric text came from when it was not sent inline: file:<file_id> for a rubric read from a file when the outcome was defined. rubric always carries the text; later changes to the file do not move the bar.

rubric_sha256
string

Lowercase SHA-256 digest of the uploaded file the rubric was read from, for matching it to the file. Not a digest of rubric: the recorded text is the file's minus a byte-order mark and with line endings normalized.

terminal_result
enum<string>

Final verdict, set only once status is terminal: satisfied, max_iterations_reached, failed, or interrupted. Empty before then.

Available options:
satisfied,
max_iterations_reached,
failed,
interrupted