ApprovalsЛента заявок

Лента заявок

Заявки, видимые мне (инициатор / одобряющий / admin). Фильтры: ?status=PENDING|APPROVED|REJECTED|CANCELLED, ?action=, ?mine=true (я инициатор), ?pendingMine=true (ждут МОЕГО голоса), ?from/?to (createdAt), ?resolvedFrom/?resolvedTo, ?initiatorId=, ?approverId=, ?decisionPolicyId=, ?targetType=.

Каждый элемент обогащён (§21.1): initiator (карточка), У заявок на ПЕРЕВОД (targetType=transfer) приходит блок transfer: сумма (raw + amountDecimal), актив, получатель, статус, txHash, адрес-источник. Он нужен, чтобы лента согласований строилась из ОДНОГО источника: до него деньги были только в Transaction, и клиенты держали второй поток (переводы из /history) ради суммы — из-за чего один и тот же перевод показывался как ДВА ожидания. У остальных действий — null. Полная карточка перевода по-прежнему за GET /transfers/:id. decisionPolicyName, approvalsCount/rejectsCount, firstVoteAt/lastVoteAt, resolutionDurationSeconds.

curl -X GET "https://policy-engine-rest.ezig.workers.dev/api/v1/vaults/demo_vault/approval-requests?status=PENDING&action=example_string&mine=true&pendingMine=true&from=example_string&to=example_string&resolvedFrom=example_string&resolvedTo=example_string&initiatorId=example_string&approverId=example_string&decisionPolicyId=example_string&targetType=example_string&limit=42&cursor=example_string" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "items": [
    {
      "id": "cmr3f41z20001psp7phmyapw3",
      "vaultId": "example_string",
      "action": "example_string",
      "status": "example_string",
      "initiatorId": "example_string",
      "targetType": "example_string",
      "targetId": "example_string",
      "baseVersion": "example_string",
      "payload": "null",
      "decisionPolicyId": "example_string",
      "decisionPolicyCode": "example_string",
      "approvalThreshold": 42,
      "resolvedResultId": "example_string",
      "resolvedAt": "2026-07-02T11:25:15.134Z",
      "createdAt": "2026-07-02T11:25:15.134Z",
      "updatedAt": "2026-07-02T11:25:15.134Z",
      "_count": {
        "approvers": 42
      },
      "initiator": {
        "id": "example_string",
        "name": "John Doe",
        "email": "user@example.com",
        "username": "John Doe",
        "image": "example_string",
        "color": "#000",
        "emoji": "🦊"
      },
      "decisionPolicyName": "John Doe",
      "approvalsCount": 10,
      "rejectsCount": 10,
      "firstVoteAt": "2026-07-02T11:25:15.134Z",
      "lastVoteAt": "2026-07-02T11:25:15.134Z",
      "resolutionDurationSeconds": 42
    }
  ],
  "nextCursor": "example_string"
}
GET
/api/v1/vaults/{code}/approval-requests
GET
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)

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

Query Parameters

statusstring
Allowed values:PENDINGAPPROVEDREJECTEDCANCELLED
minestring
Allowed values:truefalse
pendingMinestring
Allowed values:truefalse

Responses

itemsarray
Required
nextCursorstring
Required