Start an agent run
Starts an agent on a set of files and returns the run.
{
"agent": "01JQ8ZKMRT4V6WXYZ0ABCDEFGH",
"files": [{ "url": "https://example.com/intake.pdf" }],
"metadata": { "caseId": "42" }
}
Files take the usual two shapes: { "url": "…" } registers the file and fetches it, { "id": "…" } reuses one you already registered with POST /v1/files. Files you pass by URL join your reusable corpus, so a long-running agent never loses its inputs.
Waiting for the result. The call holds open up to ?wait= seconds (default 60, max 120, 0 returns immediately) and releases early the moment the run either finishes or blocks on a person.
| Outcome | Response |
|---|---|
| Finished inside the window | 200 with the full run |
| Files still being prepared | 202 with status: "queued" |
| Still working at the cap | 202 with {object, id, status, statusUrl} |
| Blocked on a person | 202 right away, status: "waiting" |
Note: The
202is a graceful degrade, never an error — poll the run; the run id is yours from this response on either way.A
queuedrun is not working yet: its files are still being prepared, which for scanned documents or long audio can take minutes, and reading the run is what picks it up once they are ready. So aqueuedrun has to be polled — waiting on a webhook instead leaves it queued, because a run that has not started has nothing to report. Once it is running, its events are delivered as they happen.Agent runs are long-lived: one blocked on a person waits days, up to the
expiresAton the run (about seven days), after which an unfinished run parks itself for good. Its files, and anything it already filed, are never taken back. Replaying anidempotency-keyreturns the original run alongside anidempotent-replay: trueresponse header.
Learn more: Agents guide
https://api.cloudraker.com/v1/agent-runsTry it
Authorization
Query parameters
Header parameters
Request body JSON required
- webhookoptional
Where to deliver this run's events, given one of two ways.
{ "url": "…" }— a one-off https endpoint for this run only.{ "id": "whe_…" }— a saved endpoint fromPOST /v1/webhooks. Runs hold the reference, so pausing or re-pointing that endpoint applies to this run too.
Deliveries are at-least-once and signed — dedupe on
eventIdand verify againstGET /v1/webhooks/jwks.json.
Returns
200
The finished run.
- statusqueuedorprocessingorwaitingorpausedorcompletedorfailed+2 morerequired
Where the agent run is in its life.
Status Meaning queuedAccepted; its files are still being prepared processingThe agent is working waitingBlocked on a person — see waiting,approvalsandtasks[]pausedStopped short of finishing and resumable; not a failure completedFinished; resultandoutputare populatedfailedFinished without producing a result cancelledStopped on request expiredReached its expiresAtwithout finishingcompleted,failed,cancelledandexpiredare terminal. Acompletedrun that still had outstanding work also carriesincomplete: true.
202
Accepted — queued on its files, still working, or blocked on a person.
- statusqueuedorprocessingorwaitingorpausedorcompletedorfailed+2 morerequired
Where the agent run is in its life.
Status Meaning queuedAccepted; its files are still being prepared processingThe agent is working waitingBlocked on a person — see waiting,approvalsandtasks[]pausedStopped short of finishing and resumable; not a failure completedFinished; resultandoutputare populatedfailedFinished without producing a result cancelledStopped on request expiredReached its expiresAtwithout finishingcompleted,failed,cancelledandexpiredare terminal. Acompletedrun that still had outstanding work also carriesincomplete: true.