API reference
Approve
POST /v1/agents/approve
Answers a pending approval that has isLinkOnly: false. The task continues as soon as the answer lands.
Request
Answer an approval
curl -s "$SAI_API_URL/v1/agents/approve" \
-H "Authorization: Bearer $SAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "approvalId": "ap_7Qw", "response": "yes" }'For a choice question:
Answer a choice question
curl -s "$SAI_API_URL/v1/agents/approve" \
-H "Authorization: Bearer $SAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"approvalId": "ap_9Lm",
"response": "yes",
"selections": [["desktop"]]
}'Response
200 OK · Approval answeredJSON
{ "ok": true, "status": "approved" }status is approved, approved_task or denied.
Errors
Gotchas
- A choice approval with
response: "yes"and noselectionsis recorded as a deny. Always sendselectionsforapprovalType: "choice". selectionson a non-choice approval returns422.- Read
isLinkOnlybefore calling. Link-only approvals cannot be answered here.
Note
The
409 link_onlybody withapprovalUrlis available from October 1. Today's staging returns a bare400.