Skip to content
Docs

Versions

Versions

List versions of a policy
client.Zones.Policies.Versions.List(ctx, policyID, params) (*ZonePolicyVersionListResponse, error)
GET/zones/{zone_id}/policies/{policy_id}/versions
Create a new immutable policy version
client.Zones.Policies.Versions.New(ctx, policyID, params) (*PolicyVersion, error)
POST/zones/{zone_id}/policies/{policy_id}/versions
Get a specific policy version
client.Zones.Policies.Versions.Get(ctx, versionID, params) (*PolicyVersion, error)
GET/zones/{zone_id}/policies/{policy_id}/versions/{version_id}
Archive a policy version
client.Zones.Policies.Versions.Archive(ctx, versionID, params) (*PolicyVersion, error)
DELETE/zones/{zone_id}/policies/{policy_id}/versions/{version_id}
ModelsExpand Collapse
type PolicyVersion struct{…}
ID string
CreatedAt Time
formatdate-time
CreatedBy string
OwnerType PolicyVersionOwnerType

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:
const PolicyVersionOwnerTypePlatform PolicyVersionOwnerType = "platform"
const PolicyVersionOwnerTypeCustomer PolicyVersionOwnerType = "customer"
PolicyID string
SchemaVersion string

Schema version this policy was validated against when created.

Sha string

Hex-encoded content hash

Version int64
ZoneID string
ArchivedAt Timeoptional
formatdate-time
ArchivedBy stringoptional
CedarJson anyoptional

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.

CedarRaw stringoptional

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.