Skip to main content
POST
Start a simulation run for an automation

Authorizations

Authorization
string
header
required

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

Headers

Idempotency-Key
string
required

Replay-protection key in an organization-wide namespace shared by keyed mutations. It must contain 1 to 256 visible ASCII characters and be sent as exactly one header value. Request identity is the exact HTTP method, escaped path, raw query, and raw body bytes. The same request replays the original successful response; any different request returns 409 idempotency_conflict, and an active matching request returns 409 idempotency_in_progress. Completed receipts are retained for approximately 24 hours, pending claims may be reclaimed after approximately 1 hour, and no deduplication is guaranteed after expiry.

Required string length: 1 - 256
Pattern: ^[!-~]+$
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

agentId
string<uuid>
required

The agent whose automation is simulated.

Body

application/json
automationId
string<uuid>
required

The automation to simulate. Must belong to the agent in the path.

scenarios
object
required

Scenario batch document, schemaVersion 1: at most 20 scenarios, each one synthetic trigger input with optional checks, rubric and limits.

agentVersionId
string<uuid>

The agent version to test. Must be a version of the automation's agent. Omitted, the run tests the automation's pinned version.

allowWrites
boolean
default:false

Execute integration writes for real instead of recording them. For sandbox tenants of the integrations only; requires the role that can edit the automation.

evaluatorAgentId
string<uuid>

Evaluator for scenario rubrics. Omitted, the simulated agent grades its own episodes through the hardened evaluation path.

Response

Accepted

agentId
string<uuid>
required
agentVersionId
string
required
allowWrites
boolean
required

Whether integration writes executed for real.

automationId
string<uuid>
required
createdAt
string<date-time>
required
environmentId
string
required
episodeCount
integer<int64>
required
Required range: -9007199254740991 <= x <= 9007199254740991
failedCount
integer<int64>
required
Required range: -9007199254740991 <= x <= 9007199254740991
passedCount
integer<int64>
required
Required range: -9007199254740991 <= x <= 9007199254740991
runId
string<uuid>
required
scenariosDigest
string
required

SHA-256 of the frozen scenario batch.

status
enum<string>
required

Run lifecycle. Episode verdicts, not run status, say whether the agent passed.

Available options:
pending,
running,
completed,
failed,
cancelled
statusUrl
string
required

Canonical member URL for polling this run.

updatedAt
string<date-time>
required
completedAt
string<date-time>
costMicros
integer

Aggregated cost of the episode and rubric grader sessions in micro-USD, recorded when the run settles. For a cancelled or failed run it is the spend known at settlement, while its sessions were still stopping.

Required range: -9007199254740991 <= x <= 9007199254740991
createdBy
string
error
object

Why the run failed, when it did.

evaluatorAgentId
string<uuid>