Approve or reject a held run
POST/
Approves or rejects the approval a held run waits for, as its own link would.
Needs an API token with the Cancel and delete permission for runs (run:manage).
Parameters
Path
idRequired · UUIDThe run’s ID.
Body
decisionRequired · stringapproveorreject, in any case.approved,rejected,declineanddeclinedwork too.
Who may answer
Deciding carries a run on, so it needs the same permission as cancelling. A reader without it doesn’t get the approve and reject links in Get a run either. The run records who answered.
Responses
- 200OK
The answer is recorded. A worker carries the run on shortly.
idisn’t a UUID, ordecisionisn’t approve or reject.- 403
FORBIDDENThe token lacks the Cancel and delete permission for runs (
run:manage), which deciding needs. - 404
NOT_FOUNDNo run with this ID in the token’s workspace.
- 409
NOT_WAITINGThe run isn’t waiting for an approval.
Someone already answered it.
The workspace’s account is suspended.
The answer couldn’t be recorded. The run is still held.
The answer couldn’t be handed to a worker. The run is still held.
Any call can also answer: 401 UNAUTHORIZED · 401 TOKEN_ENDED · 403 TOKEN_SURFACE_OFF · 403 FEATURE_OFF · 403 EMBED_NOT_ALLOWED · 403 EMBED_NOT_AVAILABLE · 403 ACCOUNT_SUSPENDED · 413 PAYLOAD_TOO_LARGE · 415 INVALID_CONTENT_TYPE · 429 RATE_LIMITED · 503 BUSY · 503 PAUSED · 503 SERVICE_UNAVAILABLE. See Errors.
Request
GORUNNER="https://api.gorunner.io"
GORUNNER_TOKEN="grt_…" # needs Cancel and delete for runs
RUN_ID="your-run-id"
curl -X POST "$GORUNNER/api/runs/$RUN_ID/decision" \
-H "Authorization: Bearer $GORUNNER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"decision": "approve"
}'const GORUNNER = "https://api.gorunner.io";
const TOKEN = process.env.GORUNNER_TOKEN;
const RUN_ID = process.env.RUN_ID;
const res = await fetch(
`${GORUNNER}/api/runs/${RUN_ID}/decision`,
{
method: "POST",
headers: {
Authorization: `Bearer ${TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ decision: "approve" }),
},
);
const { data } = await res.json();import os, requests
GORUNNER = "https://api.gorunner.io"
TOKEN = os.environ["GORUNNER_TOKEN"]
RUN_ID = os.environ["RUN_ID"]
res = requests.post(
f"{GORUNNER}/api/runs/{RUN_ID}/decision",
headers={"Authorization": f"Bearer {TOKEN}"},
json={"decision": "approve"},
)
data = res.json()["data"]Response · 200 OK
{
"data": {
"runId": "8f0c41d2-6b7e-4c1a-9d3f-2a5b7c9e1f04",
"status": "resuming",
"waitStep": "manager_ok",
"decision": "approved"
}
}Every field
Body
decisionRequired · stringapproved/rejected, anddecline/declinedfor a rejection, are accepted too, in any case.One of
approve,reject.
Response · 200 OK
dataobjectrunIdUUIDstatusstringOne of
resuming.waitStepstringdecisionstringOne of
approved,rejected.