Skip to content
Docs
Policy Sets

Archive a policy set

Archive a policy set

client.zones.policySets.archive(stringpolicySetID, PolicySetArchiveParams { zone_id, ifMatch, xAPIVersion, xClientRequestID } params, RequestOptionsoptions?): PolicySetWithBinding { active, active_version, active_version_id, 4 more }
DELETE/zones/{zone_id}/policy-sets/{policy_set_id}

Archive a policy set

ParametersExpand Collapse
policySetID: string
params: PolicySetArchiveParams { zone_id, ifMatch, xAPIVersion, xClientRequestID }
zone_id: string

Path param: The zone identifier

ifMatch?: string

Header param: ETag value from a previous GET/POST/PATCH response. When provided, the update only succeeds if the resource has not been modified; otherwise 412 Precondition Failed is returned.

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
PolicySetWithBinding extends PolicySet { id, created_at, created_by, 9 more } { active, active_version, active_version_id, 4 more }
active?: boolean

Whether this policy set is currently bound to a scope

active_version?: number | null

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

active_version_id?: string | null

Public ID of the currently active (bound) version

mode?: "active" | "shadow" | null
Accepts one of the following:
"active"
"shadow"
scope_target_id?: string | null
shadow_version?: number | null

Human-readable version number of the shadow version

shadow_version_id?: string | null

Public ID of the shadow (observed) version, if any

Archive a policy set

import KeycardAPI from '@keycardai/api';

const client = new KeycardAPI();

const policySetWithBinding = await client.zones.policySets.archive('policy_set_id', {
  zone_id: 'zone_id',
});

console.log(policySetWithBinding);
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": "created_by",
  "name": "name",
  "owner_type": "platform",
  "scope_type": "zone",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "zone_id": "zone_id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "latest_version": 0,
  "latest_version_id": "latest_version_id",
  "updated_by": "updated_by",
  "active": true,
  "active_version": 0,
  "active_version_id": "active_version_id",
  "mode": "active",
  "scope_target_id": "scope_target_id",
  "shadow_version": 0,
  "shadow_version_id": "shadow_version_id"
}
Returns Examples
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": "created_by",
  "name": "name",
  "owner_type": "platform",
  "scope_type": "zone",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "zone_id": "zone_id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "latest_version": 0,
  "latest_version_id": "latest_version_id",
  "updated_by": "updated_by",
  "active": true,
  "active_version": 0,
  "active_version_id": "active_version_id",
  "mode": "active",
  "scope_target_id": "scope_target_id",
  "shadow_version": 0,
  "shadow_version_id": "shadow_version_id"
}