Get the rules that apply at a Workplace
const url = 'https://api.dockt.com/v1/workplaces/wpl_example/effective-policy';const options = {method: 'GET', 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 GET \ --url https://api.dockt.com/v1/workplaces/wpl_example/effective-policy \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Dockt Workplace 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
What applies at a Workplace: its Policy compiled on its base, with overrides applied. Read-only.
object
object
Dockt Workplace identifier.
object
Dockt Policy identifier.
The active versions applied: the Workplace Policy’s, then its base’s. Empty while either has no active version; no rules apply then.
object
Dockt Policy version identifier.
object
Dockt Policy identifier.
object
Rules for all work at the Workplace.
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.
Rules that Assignments with one of the job’s role codes get as well.
object
Human-readable name shown in Dockt and customer systems.
object
Dockt Policy identifier.
object
Dockt Policy version identifier.
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.
Warning periods the Policy sets, its own over its base’s.
How many days before a document of this type expires its requirement counts as expiring soon, overriding the document type’s default.
object
Validity periods the Policy sets, its own over its base’s.
How long a document of this type counts, from its issue date, for example an A1 request acknowledgement you accept for 60 days.
object
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.
Example
{ "object": "single", "data": { "object": "effective_policy", "workplace": { "id": "wpl_example" }, "policy": { "id": "pol_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" ] } ], "jobs": [ { "source": { "type": "policy", "policy": "pol_example", "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" ] } ] } ], "document_validity": [ { "counts_from": "each_document" } ] }}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"}