Check a Policy version without activating it
const url = 'https://api.dockt.com/v1/policy-versions/plv_example/check';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.dockt.com/v1/policy-versions/plv_example/check \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Dockt Policy version identifier.
Header Parameters
Section titled “Header Parameters”Rejects the request with 401 unless the browser session belongs to this auth_user_id. This assertion does not grant authority.
Responses
Section titled “Responses”Envelope for a single resource response.
Envelope for a single resource response.
object
A version compiled as activation would, without activating it.
object
object
Dockt Policy version identifier.
Whether the version would activate.
object
The rules for all work as this version would apply them. Empty when it does not compile.
A rule as evaluation applies it, in the shape of Policy rules.
object
Human-readable name shown in Dockt and customer systems.
object
Who a rule is about: a worker’s Assignment, or a company’s Engagement at the Workplace.
The package release or the Policy version the rule comes from.
object
object
Dockt Policy identifier.
object
Dockt Policy version identifier.
Overrides already applied; applies_when, expectation and enforcement include them.
object
What a Policy override may do to a rule: change_enforcement (enforcement), require_also, accept_also, apply_only_when, apply_also_when, set_qualification_comparison_policy (qualification_comparison_policy), replace_applies_when (applies_when), replace_expectation (expectation) or remove_alternatives (remove).
replaced means a part of the rule was replaced; like weakening, it needs a reason.
Overrides a Policy may apply to this rule, one override per rule across a Policy and its base. Package rules and a base Policy’s rules allow them; a Policy’s own rules change in a new version.
object
object
Every rule that applies to the example.
Example
{ "object": "single", "data": { "object": "policy_check", "policy_version": { "id": "plv_example" }, "rules": [ { "applies_when": { "kind": "always" }, "enforcement": "required", "applies_to": "assignment", "source": { "type": "package" }, "adjustments": [ { "operation": "change_enforcement", "direction": "strengthened", "policy_version": { "id": "plv_example" } } ], "allowed_overrides": [ "change_enforcement" ] } ], "examples": [ { "failures": [ { "expected": "applies", "actual": "applies" } ] } ] }}Problem Details response for HTTP 400. The type URI is the stable machine-readable error code.
Standard error response with a stable status, human-readable detail, and optional validation errors.
object
Structured request validation issues.
object
One request validation issue with a stable field path and human-readable message.
object
Example
{ "type": "https://docs.dockt.com/errors/invalid-request", "title": "Bad request", "status": 400, "detail": "The request did not match the expected schema.", "instance": "req_example1042"}Problem Details response for HTTP 401. The type URI is the stable machine-readable error code.
Standard error response with a stable status, human-readable detail, and optional validation errors.
object
Structured request validation issues.
object
One request validation issue with a stable field path and human-readable message.
object
Example
{ "type": "https://docs.dockt.com/errors/missing-auth", "title": "Unauthorized", "status": 401, "detail": "Send a valid bearer token or browser session.", "instance": "req_example1042"}Problem Details response for HTTP 403. The type URI is the stable machine-readable error code.
Standard error response with a stable status, human-readable detail, and optional validation errors.
object
Structured request validation issues.
object
One request validation issue with a stable field path and human-readable message.
object
Example
{ "type": "https://docs.dockt.com/errors/forbidden", "title": "Forbidden", "status": 403, "detail": "The authenticated principal does not have the required permission.", "instance": "req_example1042"}Problem Details response for HTTP 404. The type URI is the stable machine-readable error code.
Standard error response with a stable status, human-readable detail, and optional validation errors.
object
Structured request validation issues.
object
One request validation issue with a stable field path and human-readable message.
object
Example
{ "type": "https://docs.dockt.com/errors/not-found", "title": "Not found", "status": 404, "detail": "The requested resource was not found in the authenticated scope.", "instance": "req_example1042"}Problem Details response for HTTP 409. The type URI is the stable machine-readable error code.
Standard error response with a stable status, human-readable detail, and optional validation errors.
object
Structured request validation issues.
object
One request validation issue with a stable field path and human-readable message.
object
Example
{ "type": "https://docs.dockt.com/errors/conflict", "title": "Conflict", "status": 409, "detail": "The request conflicts with the current resource state.", "instance": "req_example1042"}Problem Details response for HTTP 422. The type URI is the stable machine-readable error code.
Standard error response with a stable status, human-readable detail, and optional validation errors.
object
Structured request validation issues.
object
One request validation issue with a stable field path and human-readable message.
object
Example
{ "type": "https://docs.dockt.com/errors/validation", "title": "Validation failed", "status": 422, "detail": "Correct the invalid fields and send the request again.", "instance": "req_example1042", "errors": { "issues": [ { "path": [ "body", "inputs", "3", "value" ], "message": "Expected a two-letter country code." } ] }}Problem Details response for HTTP 429. The type URI is the stable machine-readable error code.
Standard error response with a stable status, human-readable detail, and optional validation errors.
object
Structured request validation issues.
object
One request validation issue with a stable field path and human-readable message.
object
Example
{ "type": "https://docs.dockt.com/errors/rate-limit", "title": "Too many requests", "status": 429, "detail": "Wait for the Retry-After interval before retrying.", "instance": "req_example1042"}Problem Details response for HTTP 500. The type URI is the stable machine-readable error code.
Standard error response with a stable status, human-readable detail, and optional validation errors.
object
Structured request validation issues.
object
One request validation issue with a stable field path and human-readable message.
object
Example
{ "type": "https://docs.dockt.com/errors/internal", "title": "Internal server error", "status": 500, "detail": "Retry the request safely or contact Dockt support with the request ID.", "instance": "req_example1042"}Problem Details response for HTTP 503. The type URI is the stable machine-readable error code.
Standard error response with a stable status, human-readable detail, and optional validation errors.
object
Structured request validation issues.
object
One request validation issue with a stable field path and human-readable message.
object
Example
{ "instance": "req_example1042"}