Skip to main content

Policies

POST/v1/policies/validate

Validate 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/sdk

Code 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

FieldTypeRequiredDescription
policyobjectrequiredFull policy JSON configuration to validate

Responses

StatusDescription
200Successful Response
422Validation Error

Response schema

validrequiredboolean
blockers
warnings

Errors & what triggers them

CodeTriggerFix
401Missing or expired Authorization header.-
403Token does not have the required role (admin / editor).-
404Target resource does not exist in this org.-
422Request body failed validation.-