Skip to content
API Reference

Policy Sets

Policy Sets

List policy sets in a zone
client.zones.policySets.list(stringzoneID, PolicySetListParams { active, after, before, 11 more } params?, RequestOptionsoptions?): PolicySetListResponse { items, pagination }
GET/zones/{zone_id}/policy-sets
Create a new policy set
client.zones.policySets.create(stringzoneID, PolicySetCreateParams { name, scope_type, xAPIVersion, xClientRequestID } params, RequestOptionsoptions?): PolicySetWithBinding { active, active_version, active_version_id, 4 more }
POST/zones/{zone_id}/policy-sets
Get a policy set by ID
client.zones.policySets.retrieve(stringpolicySetID, PolicySetRetrieveParams { zone_id, xAPIVersion, xClientRequestID } params, RequestOptionsoptions?): PolicySetWithBinding { active, active_version, active_version_id, 4 more }
GET/zones/{zone_id}/policy-sets/{policy_set_id}
Update a policy set
client.zones.policySets.update(stringpolicySetID, PolicySetUpdateParams { zone_id, name, ifMatch, 2 more } params, RequestOptionsoptions?): PolicySetWithBinding { active, active_version, active_version_id, 4 more }
PATCH/zones/{zone_id}/policy-sets/{policy_set_id}
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}
ModelsExpand Collapse
Attestation { payload, protected, signature }

JWS Flattened JSON Serialization (RFC 7515 §7.2.2) of a policy set attestation. The protected header carries the signing algorithm and key identifier; the payload is a base64url-encoded AttestationStatement canonicalized per RFC 8785 (JCS). Verify using the zone JWKS endpoint (RFC 7517). Currently signed with RS256; future zone key types (e.g. EdDSA) will be indicated by the "alg" header — no envelope changes required.

payload: string

Base64url-encoded AttestationStatement (RFC 7515 §3). Decode to inspect attestation content. The RFC 8785 canonical form of the decoded JSON is the JWS Signing Input alongside the protected header.

protected: string

Base64url-encoded JWS protected header (RFC 7515 §4). Contains at minimum "alg" (signing algorithm — currently RS256, will migrate to EdDSA) and "kid" (signing key identifier resolvable via the zone JWKS endpoint).

signature: string

Base64url-encoded digital signature computed over the JWS Signing Input (ASCII(protected) || '.' || payload) per RFC 7515 §5.1.

AttestationStatement { attested_at, attested_by, key_id, 7 more }

Decoded content of an Attestation JWS payload. Describes the exact policy set version composition at attestation time. This schema defines what consumers see after base64url-decoding the Attestation.payload field.

attested_at: string
formatdate-time
attested_by: string
key_id: string

Key ID of the signing key used to produce the attestation signature. Matches the "kid" in the JWS protected header.

manifest_sha: string

SHA-256 of the policy set version manifest. Verifiers MUST check this matches the policy_set_version.manifest_sha to detect attestation/version mismatches.

policy_set_id: string
policy_set_version: number
status: "created" | "re_signed"

Event that produced this attestation. "created" is the initial attestation at version creation; "re_signed" is a re-attestation after key rotation (same content, new signature).

Accepts one of the following:
"created"
"re_signed"
type: "policy_set_attestation"

Statement type discriminator

v: 1

Statement schema version

zone_id: string
PolicySet { 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 set:

  • "platform" — managed by the Keycard platform (system policies).
  • "customer" — managed by the tenant (custom policies).
Accepts one of the following:
"platform"
"customer"
scope_type: "zone" | "resource" | "user" | "session"

The scope at which this policy set applies:

  • "zone" — applies to all requests in the zone.
  • "resource" — scoped to a specific resource.
  • "user" — scoped to a specific user.
  • "session" — scoped to a specific session.
Accepts one of the following:
"zone"
"resource"
"user"
"session"
updated_at: string
formatdate-time
zone_id: string
archived_at?: string | null
formatdate-time
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
PolicySetDraft { created_at, manifest, policy_set_id, 7 more }
created_at: string
formatdate-time
manifest: PolicySetManifest { entries }
entries: Array<PolicySetManifestEntry { policy_id, policy_version_id, sha } >
policy_id: string
policy_version_id: string
sha?: string

SHA-256 of the policy version content, populated by the server

policy_set_id: string
schema_version: string
updated_at: string
formatdate-time
updated_by: string
base_version_id?: string | null

ID of the policy set version this draft was hydrated from. Null when the draft was created without an existing version.

description?: string | null
name?: string | null
warnings?: Array<Warning>

Warnings about manifest entries that would prevent creating a version from this draft. Present only when there are warnings; omitted when empty.

message: string

Human-readable description of the warning, e.g. 'validated against schema "2026-02-24", draft targets "2026-03-16"' or 'policy version is archived'.

policy_id: string
policy_version_id: string
type: "policy_version_archived" | "schema_version_mismatch"
Accepts one of the following:
"policy_version_archived"
"schema_version_mismatch"
detail?: Detail { draft_schema_version, policy_schema_version }

Structured detail payload. Present for warning types that carry additional context (e.g. schema_version_mismatch includes the two schema versions). Omitted when the type alone is sufficient (e.g. policy_version_archived).

draft_schema_version?: string

Schema version the draft targets. Present only for schema_version_mismatch warnings.

policy_schema_version?: string

Schema version the policy version was validated against. Present only for schema_version_mismatch warnings.

PolicySetManifest { entries }
entries: Array<PolicySetManifestEntry { policy_id, policy_version_id, sha } >
policy_id: string
policy_version_id: string
sha?: string

SHA-256 of the policy version content, populated by the server

PolicySetManifestEntry { policy_id, policy_version_id, sha }
policy_id: string
policy_version_id: string
sha?: string

SHA-256 of the policy version content, populated by the server

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

Policy SetsVersions

List versions of a policy set
client.zones.policySets.versions.list(stringpolicySetID, VersionListParams { zone_id, after, before, 6 more } params, RequestOptionsoptions?): VersionListResponse { items, pagination }
GET/zones/{zone_id}/policy-sets/{policy_set_id}/versions
Create a new immutable policy set version
client.zones.policySets.versions.create(stringpolicySetID, VersionCreateParams { zone_id, manifest, schema_version, 2 more } params, RequestOptionsoptions?): PolicySetVersion { id, created_at, created_by, 10 more }
POST/zones/{zone_id}/policy-sets/{policy_set_id}/versions
Get a specific policy set version
client.zones.policySets.versions.retrieve(stringversionID, VersionRetrieveParams { zone_id, policy_set_id, xAPIVersion, xClientRequestID } params, RequestOptionsoptions?): PolicySetVersion { id, created_at, created_by, 10 more }
GET/zones/{zone_id}/policy-sets/{policy_set_id}/versions/{version_id}
Activate a policy set version
client.zones.policySets.versions.update(stringversionID, VersionUpdateParams { zone_id, policy_set_id, active, 2 more } params, RequestOptionsoptions?): PolicySetVersion { id, created_at, created_by, 10 more }
PATCH/zones/{zone_id}/policy-sets/{policy_set_id}/versions/{version_id}
Archive a policy set version
client.zones.policySets.versions.archive(stringversionID, VersionArchiveParams { zone_id, policy_set_id, xAPIVersion, xClientRequestID } params, RequestOptionsoptions?): PolicySetVersion { id, created_at, created_by, 10 more }
DELETE/zones/{zone_id}/policy-sets/{policy_set_id}/versions/{version_id}
List policy versions in a policy set version
client.zones.policySets.versions.listPolicies(stringversionID, VersionListPoliciesParams { zone_id, policy_set_id, after, 8 more } params, RequestOptionsoptions?): VersionListPoliciesResponse { items, pagination }
GET/zones/{zone_id}/policy-sets/{policy_set_id}/versions/{version_id}/policies
ModelsExpand Collapse
PolicySetVersion { id, created_at, created_by, 10 more }
id: string
created_at: string
formatdate-time
created_by: string
manifest: PolicySetManifest { entries }
entries: Array<PolicySetManifestEntry { policy_id, policy_version_id, sha } >
policy_id: string
policy_version_id: string
sha?: string

SHA-256 of the policy version content, populated by the server

manifest_sha: string

Hex-encoded SHA-256 of the canonicalized manifest

owner_type: "platform" | "customer"

Who manages this policy set version:

  • "platform" — managed by the Keycard platform (system policy set versions).
  • "customer" — managed by the tenant (custom policy set versions).
Accepts one of the following:
"platform"
"customer"
policy_set_id: string
schema_version: string

Schema version pinned to this policy set version. Determines the Cedar schema used for evaluation when activated.

version: number
active?: boolean

Whether this policy set version is currently bound with mode='active'

archived_at?: string | null
formatdate-time
archived_by?: string | null
attestation?: AttestationStatement { attested_at, attested_by, key_id, 7 more } | null

Decoded content of an Attestation JWS payload. Describes the exact policy set version composition at attestation time. This schema defines what consumers see after base64url-decoding the Attestation.payload field.

attested_at: string
formatdate-time
attested_by: string
key_id: string

Key ID of the signing key used to produce the attestation signature. Matches the "kid" in the JWS protected header.

manifest_sha: string

SHA-256 of the policy set version manifest. Verifiers MUST check this matches the policy_set_version.manifest_sha to detect attestation/version mismatches.

policy_set_id: string
policy_set_version: number
status: "created" | "re_signed"

Event that produced this attestation. "created" is the initial attestation at version creation; "re_signed" is a re-attestation after key rotation (same content, new signature).

Accepts one of the following:
"created"
"re_signed"
type: "policy_set_attestation"

Statement type discriminator

v: 1

Statement schema version

zone_id: string