Skip to content
Docs

Versions

Versions

List versions of a policy
client.zones.policies.versions.list(stringpolicyID, VersionListParams { zone_id, after, before, 7 more } params, RequestOptionsoptions?): VersionListResponse { items, pagination }
GET/zones/{zone_id}/policies/{policy_id}/versions
Create a new immutable policy version
client.zones.policies.versions.create(stringpolicyID, VersionCreateParams { zone_id, schema_version, cedar_json, 3 more } params, RequestOptionsoptions?): PolicyVersion { id, created_at, created_by, 10 more }
POST/zones/{zone_id}/policies/{policy_id}/versions
Get a specific policy version
client.zones.policies.versions.retrieve(stringversionID, VersionRetrieveParams { zone_id, policy_id, format, 2 more } params, RequestOptionsoptions?): PolicyVersion { id, created_at, created_by, 10 more }
GET/zones/{zone_id}/policies/{policy_id}/versions/{version_id}
Archive a policy version
client.zones.policies.versions.archive(stringversionID, VersionArchiveParams { zone_id, policy_id, xAPIVersion, xClientRequestID } params, RequestOptionsoptions?): PolicyVersion { id, created_at, created_by, 10 more }
DELETE/zones/{zone_id}/policies/{policy_id}/versions/{version_id}
ModelsExpand Collapse
PolicyVersion { id, created_at, created_by, 10 more }
id: string
created_at: string
formatdate-time
created_by: string
owner_type: "platform" | "customer"

Who manages this policy version:

  • "platform" — managed by the Keycard platform (system policy versions).
  • "customer" — managed by the tenant (custom policy versions).
Accepts one of the following:
"platform"
"customer"
policy_id: string
schema_version: string

Schema version this policy was validated against when created.

sha: string

Hex-encoded content hash

version: number
zone_id: string
archived_at?: string | null
formatdate-time
archived_by?: string | null
cedar_json?: unknown

Cedar policy in JSON representation. Populated by default and when format=json is passed; null when format=cedar narrows the response to the text representation only.

cedar_raw?: string | null

Cedar policy in human-readable syntax. Populated by default and when format=cedar is passed; null when format=json narrows the response to the JSON representation only.