Update Run
Progress report from the process executing the run. Any report refreshes the lease (`heartbeat_at`); `append_transcript` entries are added to the end of the transcript. Moving to a finished status (`succeeded`, `failed`, `cancelled`) stamps `ended_at`, sets a running agent back to `idle` (`error` after a failure) and enforces its monthly budget, pausing it with a `budget_override` approval when reached. Errors: 400 `RUN_FINISHED` (already finished), 400 `INVALID_STATE` (back to `queued`), 409 `RUN_LEASE_LOST` (`runner_id` differs from the claiming runner). Publishes `run.updated`, plus `agent.updated` and `approval.created` as needed.
Progress report from the process executing the run.
Any report refreshes the lease (heartbeat_at); append_transcript entries are
added to the end of the transcript. Moving to a finished status (succeeded,
failed, cancelled) stamps ended_at, sets a running agent back to idle
(error after a failure) and enforces its monthly budget, pausing it with a
budget_override approval when reached.
Errors: 400 RUN_FINISHED (already finished), 400 INVALID_STATE (back to
queued), 409 RUN_LEASE_LOST (runner_id differs from the claiming runner).
Publishes run.updated, plus agent.updated and approval.created as needed.
HTTPBearerAuthorizationBearer <token>run_id*Run Iduuidcompany_id*Company Iduuidapplication/json- body
Reported by whatever executes runs (an adapter or runner process).
append_transcript?array<>[]cost_cents?|nullerror?string|nullrunner_id?|nullstatus?|nullsummary?string|nulltokens_in?|nulltokens_out?|nullSuccessful Response
application/json- response
agent_id*Agent Iduuidcost_cents*Cost Centscreated_at*|nullended_at*|nullerror*string|nullheartbeat_at?|nullid*Iduuidroutine_id*|nullrunner_id?string|nullstarted_at*|nullstatus*Statussummary*string|nulltask_id*|nulltokens_in*Tokens Intokens_out*Tokens Outtranscript*array<>|nulltrigger*Triggercurl -X PATCH "https://example.com/api/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08/runs/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "Content-Type: application/json" \ -d '{}'{ "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "cost_cents": 0, "created_at": "2019-08-24T14:15:22Z", "ended_at": "2019-08-24T14:15:22Z", "error": "string", "heartbeat_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "routine_id": "f53c5ff7-cfb7-4f43-8b79-3421a01d8e2a", "runner_id": "string", "started_at": "2019-08-24T14:15:22Z", "status": "string", "summary": "string", "task_id": "736fde4d-9029-4915-8189-01353d6982cb", "tokens_in": 0, "tokens_out": 0, "transcript": [ {} ], "trigger": "string"}Get Run GET
Get one run, including its full transcript. Answers 404 `NOT_FOUND` when the run does not belong to this company.
Cancel Run POST
Cancel a queued or running run. Equivalent to `PATCH /runs/{run_id}` with `status: cancelled` and no `runner_id`, so it works whichever runner holds the run. The agent's budget is enforced as for any finished run. Fails with 400 `RUN_FINISHED` if the run already finished.