Skip to content
API Reference

Set the default policy schema for a zone

PATCH/zones/{zone_id}/policy-schemas/{version}

Set the default policy schema for a zone

Path ParametersExpand Collapse
zone_id: string
version: string
Header ParametersExpand Collapse
"X-API-Version": optional string
"X-Client-Request-ID": optional string
formatuuid
Body ParametersJSONExpand Collapse
body: optional unknown
ReturnsExpand Collapse
SchemaVersionWithZoneInfo = SchemaVersion { created_at, status, updated_at, 5 more }

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.

is_default: boolean

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.

Set the default policy schema for a zone

curl https://api.keycard.ai/zones/$ZONE_ID/policy-schemas/$VERSION \
    -X PATCH
{
  "created_at": "2019-12-27T18:11:19.117Z",
  "status": "active",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "version": "version",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "cedar_schema": "cedar_schema",
  "cedar_schema_json": {},
  "deprecated_at": "2019-12-27T18:11:19.117Z",
  "is_default": true
}
Returns Examples
{
  "created_at": "2019-12-27T18:11:19.117Z",
  "status": "active",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "version": "version",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "cedar_schema": "cedar_schema",
  "cedar_schema_json": {},
  "deprecated_at": "2019-12-27T18:11:19.117Z",
  "is_default": true
}