Approve or reject a step

View as Markdown
Answers a sign-off an agent run is waiting on, and lets the run carry on. Read the outstanding ones from `approvals[]` on [the run](https://docs.cloudraker.com/api/cloud-raker-api/agents/get-agent-run) — each carries the step's name, the files it touches and, for a `before` gate, the `params` it proposes. ```json { "decision": "approve" } ``` **Rejecting needs a reason.** `{ "decision": "reject", "note": "Wrong signer." }` — a rejection without a `note` is a `400`. **Editing before you approve.** Send `params` to replace the proposed inputs, `files` to replace the files the step works on (ids from [POST /v1/files](https://docs.cloudraker.com/api/cloud-raker-api/files/create-file) or the run's own inputs). The two together must stay under 1 MiB. The response carries the decision plus `run.status`, so you know whether the run moved on, finished, or is blocked on the next thing. `?wait=` holds the request while the run picks the work back up, releasing early the moment it finishes or blocks again. Deciding the same sign-off twice is a `409` — the first answer stands. <Note> An API key has no person behind it, so the run records your organization's key as the actor rather than a named individual. </Note> **Learn more:** [Agents guide](https://docs.cloudraker.com/capabilities/agents)

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

idstringRequired>=1 character
approvalIdstringRequired>=1 character

Query parameters

waitintegerOptional0-120Defaults to 60

How many seconds to hold the request open. Releases early the moment the run finishes or blocks on a person. Maximum 120; 0 returns immediately.

Request

This endpoint expects an object.
decisionenumRequired

Approve to let the step run (or its result stand), reject to refuse it. A rejection needs a note.

notestringOptional<=4000 characters
Why. Required on a rejection, recorded on the run either way.
paramsmap from strings to anyOptional
Replace the inputs proposed for the step before it runs.
fileslist of stringsOptional
Replace the files the step works on, by file id.

Response

The decision, and where the run stands after it.
object"agent_run_approval"
idstring
kindenum
actionstring
statusenum
requestedAtstring
decidedAtstring or null
notestring or null
runobject

Errors

400
Bad Request Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error