Skip to content
API Reference

Archive a policy

client.zones.policies.archive(stringpolicyID, PolicyArchiveParams { zone_id, xAPIVersion, xClientRequestID } params, RequestOptionsoptions?): Policy { id, created_at, created_by, 9 more }
DELETE/zones/{zone_id}/policies/{policy_id}

Archive a policy

ParametersExpand Collapse
policyID: string
params: PolicyArchiveParams { zone_id, xAPIVersion, xClientRequestID }
zone_id: string

Path param: The zone identifier

xAPIVersion?: string

Header param: API version header (date-based, e.g. 2026-02-01)

xClientRequestID?: string

Header param: Unique request identifier specified by the originating caller and passed along by proxies.

formatuuid
ReturnsExpand Collapse
Policy { id, created_at, created_by, 9 more }
id: string
created_at: string
formatdate-time
created_by: string
name: string
owner_type: "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: string
formatdate-time
zone_id: string
archived_at?: string | null
formatdate-time
description?: string | null
latest_version?: number | null

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

latest_version_id?: string | null
updated_by?: string | null

Archive a policy

import KeycardAPI from '@keycardai/api';

const client = new KeycardAPI();

const policy = await client.zones.policies.archive('policy_id', { zone_id: 'zone_id' });

console.log(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"
}