---
title: "Validate Cedar policy content against a schema"
method: POST
path: "/zones/{zone_id}/policy-validations"
tags: ["PolicyValidations"]
---

# Validate Cedar policy content against a schema

`POST /zones/{zone_id}/policy-validations`

## Path parameters

- `zone_id` string, required

## Headers

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

## Request body

- PdpValidatePolicyContentRequest
  - `cedar_json` object, nullable — Cedar policy in JSON representation. Mutually exclusive with cedar_raw.
  - `cedar_raw` string, nullable — Cedar policy in human-readable Cedar syntax. Mutually exclusive with cedar_json.
  - `schema_version` string, required — Schema version to validate against. Must not be archived.

## Response `200`

Validation result

- PdpPolicyValidationResult
  - `valid` boolean, required — True if the policy passes schema validation with no errors.
  - `schema_version` string, required — Schema version validated against (echo back).
  - `errors` PdpPolicyValidationDiagnostic[], required — Validation errors. Empty array when valid.
    - `message` string, required — Human-readable description of the validation issue.
  - `warnings` PdpPolicyValidationDiagnostic[], required — Validation warnings. May be non-empty even when valid is true.
    - `message` string, required — Human-readable description of the validation issue.

## 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)
