Headscale unofficial
POST/api/v1/policy/check

Check a policy

Validates a policy against the server's live users and nodes without saving it. Provide policy as a string when included; the request body is required.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 body field

Policy validation request.

policystringoptional
The policy text to validate against the server's live users and nodes.

2 status codes
200Returns an object containing the policy validation result.
defaultReturned when the request fails; includes a problem details object with information about the error.
detailstringoptional
A human-readable explanation specific to this occurrence of the problem.
errorsarray<object>optional
Optional list of individual error details
instancestringoptional
A URI reference that identifies the specific occurrence of the problem.
statusintegeroptional
HTTP status code
titlestringoptional
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
typestringoptional
A URI reference to human-readable documentation for the error.
Default:about:blank

Error handling

The request body is required, and policy, when supplied, must be a string. Validation uses the server's live users and nodes and does not persist the policy.