Skip to content
API Reference

Policy Schemas

List policy schemas
client.Zones.PolicySchemas.List(ctx, zoneID, params) (*ZonePolicySchemaListResponse, error)
GET/zones/{zone_id}/policy-schemas
Get a policy schema by version
client.Zones.PolicySchemas.Get(ctx, version, params) (*SchemaVersionWithZoneInfo, error)
GET/zones/{zone_id}/policy-schemas/{version}
Set the default policy schema for a zone
client.Zones.PolicySchemas.SetDefault(ctx, version, params) (*SchemaVersionWithZoneInfo, error)
PATCH/zones/{zone_id}/policy-schemas/{version}
ModelsExpand Collapse
type SchemaVersion struct{…}

A versioned Cedar schema that defines the entity model, actions, and context shape used for policy evaluation. The schema contains the valid entity types (User, Application, Resource), their attributes, and the allowed attribute values. See the Credentials API spec for a full reference of entity attributes and valid values.

CreatedAt Time
formatdate-time
Status SchemaVersionStatus

Controls what can be done with this schema version:

  • "active" - new policy versions can be created and validated against it.
  • "deprecated" - superseded by a newer version but still accepts new policy versions.
  • "archived" - closed to new policy versions. Existing policy set versions pinned to this schema still evaluate normally.
Accepts one of the following:
const SchemaVersionStatusActive SchemaVersionStatus = "active"
const SchemaVersionStatusDeprecated SchemaVersionStatus = "deprecated"
const SchemaVersionStatusArchived SchemaVersionStatus = "archived"
UpdatedAt Time
formatdate-time
Version string
ArchivedAt Timeoptional
formatdate-time
CedarSchema stringoptional

Cedar schema in human-readable syntax. Populated when format=cedar.

CedarSchemaJson anyoptional

Cedar schema as JSON object. Populated when format=json (default).

DeprecatedAt Timeoptional
formatdate-time
type SchemaVersionWithZoneInfo struct{…}

A versioned Cedar schema that defines the entity model, actions, and context shape used for policy evaluation. The schema contains the valid entity types (User, Application, Resource), their attributes, and the allowed attribute values. See the Credentials API spec for a full reference of entity attributes and valid values.

IsDefault bool

Whether this is the zone's default schema. Clients use this to pre-select which schema to write policies against. Has no effect on evaluation.