Capture an eval case from a run

Fork an agent execution into a test case: freeze its conversation history up to a fork point, attach every recorded tool result as an editable mock, and save it with origin “saved_from_run”. Capture only — reads the run and writes a case; it never re-executes anything. Restricted to agent executions the caller owns.

Authentication

AuthorizationBearer
API key or Clerk session token

Path parameters

idstringRequired>=1 character

Request

This endpoint expects an object.
executionIdstringRequired>=1 character

Runtime execution id (from a log/trace row) of the agent run to fork from.

expectedobjectOptional

What “good” looks like for the graded next step (optional; e.g. pre-filled from a 👍).

forkMessageIndexintegerOptional>=0

Where to fork the frozen history (index into the reconstructed message array). Defaults to just before the last recorded tool-call action, so the run’s final action is the graded next step.

namestringOptional>=1 character

Case name. Defaults to “Saved from run <executionId>”.

notesstringOptional

Response

Case captured
caseobject
replayableboolean

True when every recorded tool output was captured in full. False when any output was truncated at capture — the case still saves, but tool outputs are partial (”⚠ tool outputs weren’t fully captured”).

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error