ApprovalsVote on an approval request

Vote on an approval request

An approver's vote. reject = veto (the request becomes REJECTED). The final approve (threshold reached) applies the mutation IN THE SAME request (with an optimistic lock: if the target has changed, REJECTED stale). The response contains the final status + resolvedResultId / applyError.

curl -X POST "https://policy-engine-rest.ezig.workers.dev/api/v1/vaults/demo_vault/approval-requests/example_string/approvals" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "decision": "approve",
  "comment": "example_string"
}'
{
  "status": "example_string",
  "approvals": 42,
  "threshold": 42,
  "finalized": true,
  "applyError": {
    "code": "example_string",
    "message": "example_string"
  },
  "resolvedResultId": "example_string",
  "stepsProgress": [
    {
      "stepIndex": 42,
      "action": "example_string",
      "threshold": 42,
      "approvals": 42,
      "satisfied": true
    }
  ]
}
POST
/api/v1/vaults/{code}/approval-requests/{id}/approvals
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Session token. Mobile/services. The web uses a cookie.

Session token. Mobile/services. The web uses a cookie.
API Key (cookie: session_token)
session_tokenstring
Required

API key (sent in cookie)

path
codestring
Required

Unique Vault code (slug)

path
idstring
Required

Approval request id (cuid)

Content-Typestring
Required

The media type of the request body

Options: application/json
decisionstring
Required
Options: approve, reject
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Session token. Mobile/services. The web uses a cookie.

path
parameterstring
Required

API Key for authentication. Provide your API key in the cookie.

Path Parameters

codestring
Required

Unique Vault code (slug)

Example:
demo_vault
idstring
Required

Approval request id (cuid)

Body

application/json
decisionstring
Required
Allowed values:approvereject

Responses

statusstring
Required
approvalsinteger
Required
thresholdinteger
Required
finalizedboolean
Required

true means this vote finalized the request (applied/rejected)

applyErrorstring
Required
resolvedResultIdstring
Required
stepsProgressarray

Composite requests only: progress by step