---
title: "Set the default policy schema for a zone"
method: PATCH
path: "/zones/{zone_id}/policy-schemas/{version}"
tags: ["PolicySchemas"]
---

# Set the default policy schema for a zone

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

## Path parameters

- `zone_id` string, required
- `version` string, required

## Headers

- `X-API-Version` string
- `X-Client-Request-ID` string, uuid

## Request body

- PdpSetDefaultPolicySchemaRequest

## Response `200`

The updated policy schema

- PdpSchemaVersionWithZoneInfo — 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.
  - `version` string, required
  - `status` 'active' | 'deprecated' | 'archived', required — 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.
  - `cedar_schema` string, nullable — Cedar schema in human-readable syntax. Populated when format=cedar.
  - `cedar_schema_json` object, nullable — Cedar schema as JSON object. Populated when format=json (default).
  - `deprecated_at` string, date-time, nullable
  - `archived_at` string, date-time, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `is_default` boolean, required — 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.

## Other responses

- `400` — bad request error response when caller supplied invalid input data
- `401` — unauthorized error response when caller session is not authenticated
- `403` — forbidden error response when caller does not have permissions to a resource
- `404` — not found error response when caller does not have permission to see a resource or the resource does not exist
- `429` — rate limit exceeded error response when caller has exhausted api limits for the given time period
- `500` — internal server error response when server encountered error of its own creation
- `503` — service unavailable error when server you're attempting to reach is not available
- `default` — internal server error response when server encountered error of its own creation

---

[API](https://skmtc.net/keycardai/apis/untitled-api.md) · [All operations](https://skmtc.net/keycardai/apis/untitled-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/keycardai/untitled-api/revisions/2f5033ed4491/schema)
