ApprovalsПроголосовать по заявке

Проголосовать по заявке

Голос одобряющего. reject = вето (заявка REJECTED). Финальный approve (добран порог) применяет мутацию В ЭТОМ ЖЕ запросе (с optimistic-lock: если цель изменилась — REJECTED stale). В ответе финальный статус + 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

better-auth session token. Мобилка/сервисы. Веб использует cookie.

better-auth session token. Мобилка/сервисы. Веб использует cookie.
API Key (cookie: better-auth.session_token)
path
codestring
Required

Уникальный код Vault'а (slug)

path
idstring
Required

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. better-auth session token. Мобилка/сервисы. Веб использует cookie.

path
parameterstring
Required

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

Path Parameters

codestring
Required

Уникальный код Vault'а (slug)

Example:
demo_vault
idstring
Required

id заявки (cuid)

Body

application/json
decisionstring
Required
Allowed values:approvereject

Responses

statusstring
Required
approvalsinteger
Required
thresholdinteger
Required
finalizedboolean
Required

true — этот голос финализировал заявку (применена/отклонена)

applyErrorstring
Required
resolvedResultIdstring
Required
stepsProgressarray

Только для композитных заявок: прогресс по шагам