Skip to content
Anlyon
Esc
↑↓navigate↵open⌘Jpreview

Read immutable policy history

Returns retained snapshots newest first, a page at a time, including the deletion tombstone after a policy is removed. Page with before set to pagination.nextBefore; the cursor is stable while new versions are added. pagination.earliestVersion is the oldest retained version, so a decision citing an older one predates retained history. Older overwritten versions are not reconstructed; baseline entries mark migration-time evidence. Scoped to the credential environment. Tenant or environment erasure removes its retained history.

GET/api/v2/approval-policies/{policyId}/versions
Authorization
AuthorizationBearer token (Anlyon API key) · headerrequired

Workspace API key sent as Authorization: Bearer <key>.

or
better-auth.session_tokenAPI key · cookierequired

Browser session used by dashboard-only operations.

Path parameters
policyIdstringrequired

Public approval-policy id (apol_xxx).

Query parameters
limitinteger

Versions per page, newest first. Default 50.

min 1 · max 100 · default: 50
beforeinteger

Version cursor: return versions older than this. Use pagination.nextBefore from the previous page.

min 1
Header parameters
X-Request-Idstring

Optional caller correlation ID. Unsafe or oversized values are replaced.

max length 128
Responses
200

One page of retained versions, newest first.

successbooleanrequired
Allowed:true
dataApprovalPolicyVersion[]required
Show properties
Array of ApprovalPolicyVersion
policyIdstringrequired
versionintegerrequired
operationstringrequired
Allowed:createdupdateddeletedbaseline
snapshotobjectrequired

Immutable database row snapshot with snake_case field names. A deletion tombstone carries the next version number.

contentHashstringrequired

SHA-256 of PostgreSQL snapshot jsonb text encoded as UTF-8. An integrity digest, not a signature.

actorobject | nullrequired
Show properties
typestringrequired
Allowed:api_keyuserunknown
idstringrequired
changeNotestring | nullrequired
createdAtstring<date-time>required
paginationobjectrequired
Show properties
limitintegerrequired
min 1 · max 100
nextBeforeinteger | nullrequired

Pass as before for the next (older) page. Null on the last page.

earliestVersionintegerrequired

The oldest retained version.

min 1
latestVersionintegerrequired
min 1
400

Bad Request - Invalid input data

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

401

Unauthorized - Invalid or missing API key

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

403

Authenticated credential lacks the required scope or workspace access.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

404

Not Found - Resource does not exist

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

429

Too Many Requests - Rate limit exceeded. A workspace's API requests are limited per minute and per UTC clock hour by plan; Retry-After says when to try again, and an hourly refusal names the limit and when the count resets. Successful responses carry the same limits in X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (the minute) and X-RateLimit-Limit-Hour, X-RateLimit-Remaining-Hour, X-RateLimit-Reset-Hour (the hour).

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://api.anlyon.com/api/v2/approval-policies/string/versions' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "success": true,
  "data": [
    {
      "policyId": "string",
      "version": 0,
      "operation": "created",
      "snapshot": {},
      "contentHash": "string",
      "actor": {
        "type": "api_key",
        "id": "string"
      },
      "changeNote": "string",
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ],
  "pagination": {
    "limit": 1,
    "nextBefore": 0,
    "earliestVersion": 1,
    "latestVersion": 1
  }
}

Was this page helpful?