PoliciesИстория версий политики

История версий политики

Append-only редакции политики. Каждое изменение (включая правку лимитов и одобряющих) порождает версию со снапшотом решающей части: effect, condition, approval, limits, approvers.

reason: created — при создании; updated — при правке; backfill — версия собрана миграцией 0041 из текущего состояния и НЕ обязана совпадать с той, что принимала более старые решения.

Решение ссылается на версию полем decisionPolicyVersionId; у решений старше Ф4 оно null — версия неизвестна.

curl -X GET "https://policy-engine-rest.ezig.workers.dev/api/v1/policies/example_string/versions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "policyId": "example_string",
  "currentVersionId": "example_string",
  "items": [
    {
      "id": "example_string",
      "version": 42,
      "reason": "created",
      "changedById": "example_string",
      "changedAt": "2026-07-02T11:25:15.134Z",
      "isCurrent": true,
      "snapshotJson": "null"
    }
  ]
}
GET
/api/v1/policies/{id}/versions
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)
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

Responses

policyIdstring
Required
currentVersionIdstring
Required
itemsarray
Required