Skip to content
API Reference

Update a policy set

client.Zones.PolicySets.Update(ctx, policySetID, params) (*PolicySetWithBinding, error)
PATCH/zones/{zone_id}/policy-sets/{policy_set_id}

Update metadata or manage binding. Set active=true to bind, active=false to unbind.

ParametersExpand Collapse
policySetID string
params ZonePolicySetUpdateParams
ZoneID param.Field[string]

Path param: The zone identifier

Name param.Field[string]optional

Body param

IfMatch param.Field[string]optional

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 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 PolicySetWithBinding struct{…}
Active booloptional

Whether this policy set is currently bound to a scope

ActiveVersion int64optional

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

ActiveVersionID stringoptional

Public ID of the currently active (bound) version

Mode stringoptional
Accepts one of the following:
const PolicySetWithBindingModeActive PolicySetWithBindingMode = "active"
const PolicySetWithBindingModeShadow PolicySetWithBindingMode = "shadow"
ScopeTargetID stringoptional

Update a policy set

package main

import (
  "context"
  "fmt"

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

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

  )
  policySetWithBinding, err := client.Zones.PolicySets.Update(
    context.TODO(),
    "policy_set_id",
    keycard.ZonePolicySetUpdateParams{
      ZoneID: "zone_id",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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"
}
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"
}