Skip to content
API Reference

Archive a policy

zones.policies.archive(strpolicy_id, PolicyArchiveParams**kwargs) -> Policy
DELETE/zones/{zone_id}/policies/{policy_id}

Archive a policy

ParametersExpand Collapse
zone_id: str
policy_id: str
x_api_version: Optional[str]
x_client_request_id: Optional[str]
formatuuid
ReturnsExpand Collapse
class Policy:
id: str
created_at: datetime
formatdate-time
created_by: str
name: str
owner_type: Literal["platform", "customer"]

Who manages this policy:

  • "platform" — managed by the Keycard platform (system policies).
  • "customer" — managed by the tenant (custom policies).
Accepts one of the following:
"platform"
"customer"
updated_at: datetime
formatdate-time
zone_id: str
archived_at: Optional[datetime]
formatdate-time
description: Optional[str]
latest_version: Optional[int]

Human-readable version number of the latest version (e.g., 1, 2, 3)

latest_version_id: Optional[str]
updated_by: Optional[str]

Archive a policy

from keycardai_api import KeycardAPI

client = KeycardAPI()
policy = client.zones.policies.archive(
    policy_id="policy_id",
    zone_id="zone_id",
)
print(policy.id)
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": "created_by",
  "name": "name",
  "owner_type": "platform",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "zone_id": "zone_id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "latest_version": 0,
  "latest_version_id": "latest_version_id",
  "updated_by": "updated_by"
}
Returns Examples
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": "created_by",
  "name": "name",
  "owner_type": "platform",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "zone_id": "zone_id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "latest_version": 0,
  "latest_version_id": "latest_version_id",
  "updated_by": "updated_by"
}