Skip to content
Docs
Versions

Archive a policy set version

Archive a policy set version

client.Zones.PolicySets.Versions.Archive(ctx, versionID, params) (*PolicySetVersion, error)
DELETE/zones/{zone_id}/policy-sets/{policy_set_id}/versions/{version_id}

Archive a policy set version

ParametersExpand Collapse
versionID string
params ZonePolicySetVersionArchiveParams
ZoneID param.Field[string]

Path param: The zone identifier

PolicySetID param.Field[string]

Path param: The policy set identifier

XAPIVersion param.Field[string]optional

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

XClientRequestID param.Field[string]optional

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

formatuuid
ReturnsExpand Collapse
type PolicySetVersion struct{…}
ID string
CreatedAt Time
formatdate-time
CreatedBy string
PolicyID string
PolicyVersionID string
Sha stringoptional

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

ManifestSha string

Hex-encoded SHA-256 of the canonicalized manifest

OwnerType PolicySetVersionOwnerType

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:
const PolicySetVersionOwnerTypePlatform PolicySetVersionOwnerType = "platform"
const PolicySetVersionOwnerTypeCustomer PolicySetVersionOwnerType = "customer"
PolicySetID string
SchemaVersion string

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

Version int64
Active booloptional

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

ArchivedAt Timeoptional
formatdate-time
ArchivedBy stringoptional
Attestation AttestationStatementoptional

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.

AttestedAt Time
formatdate-time
AttestedBy string
KeyID string

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

ManifestSha 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.

PolicySetID string
PolicySetVersion int64
Status AttestationStatementStatus

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:
const AttestationStatementStatusCreated AttestationStatementStatus = "created"
const AttestationStatementStatusReSigned AttestationStatementStatus = "re_signed"
Type AttestationStatementType

Statement type discriminator

V int64

Statement schema version

ZoneID string

Archive a policy set version

package main

import (
  "context"
  "fmt"

  "github.com/keycardai/keycard-go"
)

func main() {
  client := keycard.NewClient(

  )
  policySetVersion, err := client.Zones.PolicySets.Versions.Archive(
    context.TODO(),
    "version_id",
    keycard.ZonePolicySetVersionArchiveParams{
      ZoneID: "zone_id",
      PolicySetID: "policy_set_id",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", policySetVersion.ID)
}
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": "created_by",
  "manifest": {
    "entries": [
      {
        "policy_id": "policy_id",
        "policy_version_id": "policy_version_id",
        "sha": "sha"
      }
    ]
  },
  "manifest_sha": "manifest_sha",
  "owner_type": "platform",
  "policy_set_id": "policy_set_id",
  "schema_version": "schema_version",
  "version": 0,
  "active": true,
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by": "archived_by",
  "attestation": {
    "attested_at": "2019-12-27T18:11:19.117Z",
    "attested_by": "attested_by",
    "key_id": "key_id",
    "manifest_sha": "manifest_sha",
    "policy_set_id": "policy_set_id",
    "policy_set_version": 0,
    "status": "created",
    "type": "policy_set_attestation",
    "v": 1,
    "zone_id": "zone_id"
  }
}
Returns Examples
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": "created_by",
  "manifest": {
    "entries": [
      {
        "policy_id": "policy_id",
        "policy_version_id": "policy_version_id",
        "sha": "sha"
      }
    ]
  },
  "manifest_sha": "manifest_sha",
  "owner_type": "platform",
  "policy_set_id": "policy_set_id",
  "schema_version": "schema_version",
  "version": 0,
  "active": true,
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by": "archived_by",
  "attestation": {
    "attested_at": "2019-12-27T18:11:19.117Z",
    "attested_by": "attested_by",
    "key_id": "key_id",
    "manifest_sha": "manifest_sha",
    "policy_set_id": "policy_set_id",
    "policy_set_version": 0,
    "status": "created",
    "type": "policy_set_attestation",
    "v": 1,
    "zone_id": "zone_id"
  }
}