Skip to content
Docs

Versions

Versions

List versions of a policy
zones.policies.versions.list(strpolicy_id, VersionListParams**kwargs) -> VersionListResponse
GET/zones/{zone_id}/policies/{policy_id}/versions
Create a new immutable policy version
zones.policies.versions.create(strpolicy_id, VersionCreateParams**kwargs) -> PolicyVersion
POST/zones/{zone_id}/policies/{policy_id}/versions
Get a specific policy version
zones.policies.versions.retrieve(strversion_id, VersionRetrieveParams**kwargs) -> PolicyVersion
GET/zones/{zone_id}/policies/{policy_id}/versions/{version_id}
Archive a policy version
zones.policies.versions.archive(strversion_id, VersionArchiveParams**kwargs) -> PolicyVersion
DELETE/zones/{zone_id}/policies/{policy_id}/versions/{version_id}
ModelsExpand Collapse
class PolicyVersion:
id: str
created_at: datetime
formatdate-time
created_by: str
owner_type: Literal["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: str
schema_version: str

Schema version this policy was validated against when created.

sha: str

Hex-encoded content hash

version: int
zone_id: str
archived_at: Optional[datetime]
formatdate-time
archived_by: Optional[str]
cedar_json: Optional[object]

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: Optional[str]

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.