Skip to content

Get the rules a Decision was made with

GET
/v1/decisions/{decisionId}/effective-policy
curl --request GET \
--url https://api.dockt.com/v1/decisions/dec_example/effective-policy \
--header 'Authorization: Bearer <token>'

The Policy versions, packages and rules as they applied when the Decision was made. Fails with 404 for a Decision made without rules.

decisionId
required

Dockt Decision 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

The rules a Decision was made with, as stored when it was made: not what the Policy says now.

object
object
required
string
Allowed values: decision_policy
decision
required
object
id
required

Dockt Decision identifier.

string
policy_versions
required

The active versions applied: the Workplace Policy’s, then its base’s. Empty while either has no active version; no rules apply then.

Array<object>
object
id
required

Dockt Policy version identifier.

string
number
required
integer
>= -9007199254740991 <= 9007199254740991
policy
required
object
id
required

Dockt Policy identifier.

string
packages
required
Array<object>
object
code
required
string
>= 1 characters
version
required
string
>= 1 characters
roles
required

The role codes the rules were compiled for; their job rules are among rules.

Array<string>
rules
required

Every rule the Decision was evaluated against, with overrides applied. allowed_overrides is empty: a past Decision’s rules are not adjusted.

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
expiry_warnings
required

Warning periods the Policy sets, its own over its base’s.

Array<object>

How many days before a document of this type expires its requirement counts as expiring soon, overriding the document type’s default.

object
document_type
required
string
days
required
integer
>= 1 <= 365
document_validity
required

Validity periods the Policy sets, its own over its base’s.

Array<object>

How long a document of this type counts, from its issue date, for example an A1 request acknowledgement you accept for 60 days.

object
document_type
required
string
days_after_issue
required
integer
>= 1 <= 3650
counts_from

first_document counts every document of the type from the worker’s first one, so a later one, such as a second A1 request, cannot extend the period. Defaults to each_document.

string
Allowed values: each_document first_document

Example

{
"object": "single",
"data": {
"object": "decision_policy",
"decision": {
"id": "dec_example"
},
"policy_versions": [
{
"id": "plv_example",
"policy": {
"id": "pol_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"
]
}
],
"document_validity": [
{
"counts_from": "each_document"
}
]
}
}

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"
}