Skip to content

Check a Policy version without activating it

POST
/v1/policy-versions/{policyVersionId}/check
curl --request POST \
--url https://api.dockt.com/v1/policy-versions/plv_example/check \
--header 'Authorization: Bearer <token>'
policyVersionId
required

Dockt Policy version identifier.

string
x-dockt-expected-user

Rejects the request with 401 unless the browser session belongs to this auth_user_id. This assertion does not grant authority.

string
>= 1 characters

Envelope for a single resource response.

Media typeapplication/json

Envelope for a single resource response.

object
object
required
string
Allowed values: single
data
required

A version compiled as activation would, without activating it.

object
object
required
string
Allowed values: policy_check
policy_version
required
object
id
required

Dockt Policy version identifier.

string
valid
required

Whether the version would activate.

boolean
issues
required
Array<object>
object
code
required
string
message
required
string
path
required
string
location
required

Where in the version’s source the problem was written, when it can be found there.

Any of:
object
from
required

Character offset where the problem starts.

integer
>= -9007199254740991 <= 9007199254740991
to
required
integer
>= -9007199254740991 <= 9007199254740991
line
required

1-based line.

integer
>= -9007199254740991 <= 9007199254740991
column
required

1-based column.

integer
>= -9007199254740991 <= 9007199254740991
rules
required

The rules for all work as this version would apply them. Empty when it does not compile.

Array<object>

A rule as evaluation applies it, in the shape of Policy rules.

object
rule_code
required
string
label
required

Human-readable name shown in Dockt and customer systems.

string
>= 1 characters <= 120 characters
applies_when
required
Any of:
object
kind
required
string
Allowed values: always
expectation
required
enforcement
required
string
Allowed values: required advisory waived
applies_to
required

Who a rule is about: a worker’s Assignment, or a company’s Engagement at the Workplace.

string
Allowed values: assignment engagement
source
required

The package release or the Policy version the rule comes from.

Any of:
object
type
required
string
Allowed values: package
package
required
string
version
required
string
adjustments
required

Overrides already applied; applies_when, expectation and enforcement include them.

Array<object>
object
operation
required

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

string
Allowed values: change_enforcement require_also accept_also apply_only_when apply_also_when set_qualification_comparison_policy replace_applies_when replace_expectation remove_alternatives
direction
required

replaced means a part of the rule was replaced; like weakening, it needs a reason.

string
Allowed values: strengthened weakened waived replaced
reason
required
Any of:
string
policy_version
required

The Policy version whose override made the change.

Any of:
object
id
required

Dockt Policy version identifier.

string
number
required
integer
>= -9007199254740991 <= 9007199254740991
allowed_overrides
required

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.

Array<string>
Allowed values: change_enforcement require_also accept_also apply_only_when apply_also_when set_qualification_comparison_policy replace_applies_when replace_expectation remove_alternatives
examples
required
Array<object>
object
name
required
string
passed
required
boolean
failures
required
Array<object>
object
rule
required
string
expected
required
string
Allowed values: applies does_not_apply
actual
required
string
Allowed values: applies does_not_apply unknown_rule needs_input
needs
required
Array<string>
message
required
string
applying
required

Every rule that applies to the example.

Array<string>

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.

Media typeapplication/problem+json

Standard error response with a stable status, human-readable detail, and optional validation errors.

object
type
required
string
title
required
string
status
required
number
detail
required
string
instance
required
Any of:

Request identifier that Dockt support can use to trace an API call.

string
errors

Structured request validation issues.

object
issues
required
Array<object>

One request validation issue with a stable field path and human-readable message.

object
path
required
Array
message
required
string

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.

Media typeapplication/problem+json

Standard error response with a stable status, human-readable detail, and optional validation errors.

object
type
required
string
title
required
string
status
required
number
detail
required
string
instance
required
Any of:

Request identifier that Dockt support can use to trace an API call.

string
errors

Structured request validation issues.

object
issues
required
Array<object>

One request validation issue with a stable field path and human-readable message.

object
path
required
Array
message
required
string

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.

Media typeapplication/problem+json

Standard error response with a stable status, human-readable detail, and optional validation errors.

object
type
required
string
title
required
string
status
required
number
detail
required
string
instance
required
Any of:

Request identifier that Dockt support can use to trace an API call.

string
errors

Structured request validation issues.

object
issues
required
Array<object>

One request validation issue with a stable field path and human-readable message.

object
path
required
Array
message
required
string

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.

Media typeapplication/problem+json

Standard error response with a stable status, human-readable detail, and optional validation errors.

object
type
required
string
title
required
string
status
required
number
detail
required
string
instance
required
Any of:

Request identifier that Dockt support can use to trace an API call.

string
errors

Structured request validation issues.

object
issues
required
Array<object>

One request validation issue with a stable field path and human-readable message.

object
path
required
Array
message
required
string

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.

Media typeapplication/problem+json

Standard error response with a stable status, human-readable detail, and optional validation errors.

object
type
required
string
title
required
string
status
required
number
detail
required
string
instance
required
Any of:

Request identifier that Dockt support can use to trace an API call.

string
errors

Structured request validation issues.

object
issues
required
Array<object>

One request validation issue with a stable field path and human-readable message.

object
path
required
Array
message
required
string

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.

Media typeapplication/problem+json

Standard error response with a stable status, human-readable detail, and optional validation errors.

object
type
required
string
title
required
string
status
required
number
detail
required
string
instance
required
Any of:

Request identifier that Dockt support can use to trace an API call.

string
errors

Structured request validation issues.

object
issues
required
Array<object>

One request validation issue with a stable field path and human-readable message.

object
path
required
Array
message
required
string

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.

Media typeapplication/problem+json

Standard error response with a stable status, human-readable detail, and optional validation errors.

object
type
required
string
title
required
string
status
required
number
detail
required
string
instance
required
Any of:

Request identifier that Dockt support can use to trace an API call.

string
errors

Structured request validation issues.

object
issues
required
Array<object>

One request validation issue with a stable field path and human-readable message.

object
path
required
Array
message
required
string

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.

Media typeapplication/problem+json

Standard error response with a stable status, human-readable detail, and optional validation errors.

object
type
required
string
title
required
string
status
required
number
detail
required
string
instance
required
Any of:

Request identifier that Dockt support can use to trace an API call.

string
errors

Structured request validation issues.

object
issues
required
Array<object>

One request validation issue with a stable field path and human-readable message.

object
path
required
Array
message
required
string

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.

Media typeapplication/problem+json

Standard error response with a stable status, human-readable detail, and optional validation errors.

object
type
required
string
title
required
string
status
required
number
detail
required
string
instance
required
Any of:

Request identifier that Dockt support can use to trace an API call.

string
errors

Structured request validation issues.

object
issues
required
Array<object>

One request validation issue with a stable field path and human-readable message.

object
path
required
Array
message
required
string

Example

{
"instance": "req_example1042"
}