Policies
POST
/v1/policies/validateValidate Policy Endpoint
Dry-run policy validation (F0.2 + F2 lint). Runs the same strict schema validation enforced at upsert/publish time (writing nothing), then layers in the F2 contradiction analyzer (e.g. a detector requesting a remote mode while no_external_calls is set). Blockers would reject a save; warnings + contradictions are advisory for the console editor's inline lint.
Bearer token or X-API-Keyscope: org memberoperation_id: policies.validate
Authentication
Send either Authorization: Bearer <token> or X-API-Key: <token>. Any org token with sufficient scope. Create tokens from the console or the /v1/orgs/{org_id}/tokens endpoints. Requests without a valid credential are rejected with 401.
SDK install
pip install znyx-sdknpm install @znyx/sdkCode samples
Request
curl -X POST "$ZNYX_API_URL/v1/policies/validate" \
-H "Authorization: Bearer $ZNYX_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"policy": {}
}'Response
application/json
Successful Response
{
"valid": false,
"blockers": [
{
"code": "string",
"loc": "string",
"message": "string"
}
],
"warnings": [
{
"code": "string",
"loc": "string",
"message": "string"
}
]
}Schema: object
Request bodyrequired
| Field | Type | Required | Description |
|---|---|---|---|
| policy | object | required | Full policy JSON configuration to validate |
Responses
| Status | Description |
|---|---|
| 200 | Successful Response |
| 422 | Validation Error |
Response schema
validrequiredboolean
blockers
warnings
Errors & what triggers them
| Code | Trigger | Fix |
|---|---|---|
| 401 | Missing or expired Authorization header. | - |
| 403 | Token does not have the required role (admin / editor). | - |
| 404 | Target resource does not exist in this org. | - |
| 422 | Request body failed validation. | - |