https://<project-ref>.supabase.co/functions/v1/approval-decision
Auth: Supabase user JWT (not an agk_ API key). Caller must have reviewer, admin, or owner role in the workspace.
Request
Body
| Field | Type | Required | Description |
|---|---|---|---|
approvalRequestId | string (uuid) | Yes | The ID from the 202 approval response |
decision | string | Yes | "approved" or "denied" |
reason | string | No | Reviewer’s note, stored in review_reason |
Success response
| Field | Type | Description |
|---|---|---|
ok | boolean | true on success |
status | string | Final status: executed, failed, denied |
executionResult | object | null | Tool API response (on approve + successful execution) |
notificationQueued | boolean | Whether notification delivery was attempted |
notificationError | string | null | Notification error message, if any |
What happens on approve
approval_requests.status→approvedapproval_requests.reviewed_byandreviewed_atare set- An audit log entry is written (
decision = allow) executeDeferredActionreplays the stored HTTP call to the tool APIapproval_requests.execution_resultis set to the tool responseapproval_requests.status→executed- A notification is queued for the
approval_decidedevent
What happens on deny
approval_requests.status→denied- An audit log entry is written (
decision = block) deferred_actions.status→failed- A notification is queued for the
approval_decidedevent
Error responses
Status codes
| Code | Meaning |
|---|---|
200 | Decision recorded and (if approved) executed |
400 | Invalid request body |
401 | Not authenticated |
403 | Reviewer role required |
404 | Approval request not found |
405 | Method not allowed |
409 | Approval already has a decision |
500 | Database or execution error |