Skip to content
Navigation

Approve or reject a step

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 — each carries the step's name, the files it touches and, for a before gate, the params it proposes.

{ "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 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.

Learn more: Agents guide

POST
https://api.cloudraker.com/v1/agent-runs/{id}/approvals/{approvalId}
Try it
Path parameters
Query parameters
Header parameters
Request body
Live API request

This request can change data or incur charges for the selected organization.

Authorization

  • bearerAuth
    HTTP
    required

Path parameters

  • id
    string
    required
    minLength: 1
  • approvalId
    string
    required
    minLength: 1

Query parameters

  • wait
    optional
    integer

    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.

    maximum: 120 · minimum: 0 · default: 60

Header parameters

  • idempotency-key
    optional
    string

    Retries with the same key replay the first applied mutation.

    maxLength: 255 · minLength: 1

Request body JSON required

  • decision
    approve
    or
    reject
    required

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

  • note
    optional
    string

    Why. Required on a rejection, recorded on the run either way.

    maxLength: 4000
  • params
    optional
    map of
    unknown

    Replace the inputs proposed for the step before it runs.

  • files
    optional
    array of
    string

    Replace the files the step works on, by file id.

    maxLength: 128 · minLength: 1

Returns

200

The decision, and where the run stands after it.

JSON
  • object
    string
    required
  • id
    string
    required
  • kind
    before
    or
    output
    required
  • action
    string
    required
  • status
    pending
    or
    approved
    or
    rejected
    or
    void
    required
  • requestedAt
    string
    required
  • decidedAt
    string | null
    required
  • note
    string | null
    required
  • run
    object
    required
    • id
      string
      required
    • status
      queued
      or
      processing
      or
      waiting
      or
      paused
      or
      completed
      or
      failed
      +2 more
      required

      Where the agent run is in its life.

      Status Meaning
      queued Accepted; its files are still being prepared
      processing The agent is working
      waiting Blocked on a person — see waiting, approvals and tasks[]
      paused Stopped short of finishing and resumable; not a failure
      completed Finished; result and output are populated
      failed Finished without producing a result
      cancelled Stopped on request
      expired Reached its expiresAt without finishing

      completed, failed, cancelled and expired are terminal. A completed run that still had outstanding work also carries incomplete: true.

    • statusUrl
      string
      required

400

A rejection with no reason, or edits over 1 MiB (invalid_request).

401

Missing or invalid credentials.
JSON
  • code
    string
    required
  • message
    string
    required
  • retryable
    boolean
    required
  • requestId
    string
    required
  • docUrl
    optional
    string

403

The credential is valid but cannot administer this organization.
JSON
  • code
    string
    required
  • message
    string
    required
  • retryable
    boolean
    required
  • requestId
    string
    required
  • docUrl
    optional
    string

404

Unknown run id (not_found), unknown sign-off (approval_not_found), or a file id that is not yours (not_found).

409

Already decided (approval_decided), the run has not started yet (run_not_started), or it is no longer running (run_not_running).

429

Rate limited. The /v1 API allows at least 67 requests per minute per organization (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the Retry-After interval and retry — the error is retryable.
JSON
  • code
    rate_limited
    required
  • message
    string
    required
  • retryable
    true
    required
  • requestId
    string
    required
  • docUrl
    optional
    string

Type to search…

↑↓ navigate↵ selectEsc close