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.
/api/v2/approval-policies/{policyId}/versionsAuthorizationBearer token (Anlyon API key) · headerrequiredWorkspace API key sent as Authorization: Bearer <key>.
better-auth.session_tokenAPI key · cookierequiredBrowser session used by dashboard-only operations.
policyIdstringrequiredPublic approval-policy id (apol_xxx).
limitintegerVersions per page, newest first. Default 50.
beforeintegerVersion cursor: return versions older than this. Use pagination.nextBefore from the previous page.
X-Request-IdstringOptional caller correlation ID. Unsafe or oversized values are replaced.
One page of retained versions, newest first.
successbooleanrequiredtruedataApprovalPolicyVersion[]requiredShow propertiesHide properties
ApprovalPolicyVersionpolicyIdstringrequiredversionintegerrequiredoperationstringrequiredcreatedupdateddeletedbaselinesnapshotobjectrequiredImmutable database row snapshot with snake_case field names. A deletion tombstone carries the next version number.
contentHashstringrequiredSHA-256 of PostgreSQL snapshot jsonb text encoded as UTF-8. An integrity digest, not a signature.
actorobject | nullrequiredShow propertiesHide properties
typestringrequiredapi_keyuserunknownidstringrequiredchangeNotestring | nullrequiredcreatedAtstring<date-time>requiredpaginationobjectrequiredShow propertiesHide properties
limitintegerrequirednextBeforeinteger | nullrequiredPass as before for the next (older) page. Null on the last page.
earliestVersionintegerrequiredThe oldest retained version.
latestVersionintegerrequiredBad Request - Invalid input data
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectUnauthorized - Invalid or missing API key
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectAuthenticated credential lacks the required scope or workspace access.
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectNot Found - Resource does not exist
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectToo Many Requests - Rate limit exceeded
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobject
