Workplaces and Policies
A Workplace is a place where work happens, such as a construction site or a plant. Each Workplace has one Policy: the rules that apply to the work there.
One Policy can serve many Workplaces. For example, sites that use the same Policy apply the same requirements to a worker with the welder role. Documents and registry results belong to Persons and Companies rather than the Workplace.
Workplaces
Section titled “Workplaces”Create a Workplace with POST /v1/workplaces. With an external_ref, the call creates the Workplace or updates the one with that reference.
{ "external_ref": "plant-antwerp", "name": "Plant Antwerp", "country": "BE", "address": { "line1": "Haven 1200", "postal_code": "2030", "city": "Antwerpen", "country": "BE" }, "timezone": "Europe/Brussels", "policy": { "id": "pol_2Kd4" }, "attributes": { "workplace.is_construction": true }}name,countryandpolicyare required.timezoneis an IANA timezone. It defaults from the country. Dockt reads every period date at the Workplace in this timezone.addresscan be compared with the worksite named in a document. In the Belgian construction package, a Limosa declaration with a different Belgian postal code needs review. Missing or unclear address details do not fail the declaration on their own. An A1 with a mismatched address also needs review; an address mismatch alone never makes it invalid.attributesuseworkplace.*codes, such asworkplace.is_constructionorworkplace.be.region. Some are derived; for example, Dockt derives the Belgian region from the address.
Changing a Workplace’s Policy, address or attributes with PATCH /v1/workplaces/{workplaceId} re-evaluates the open work there.
Policies and versions
Section titled “Policies and versions”A Policy is a named rule set. Its content lives in versions:
- A version starts as a
draft. Edit it withPATCH /v1/policy-versions/{policyVersionId}. POST /v1/policy-versions/{policyVersionId}/activatevalidates the draft and makes itactive. The previous active version becomesretired.- A Policy has at most one active version. Active and retired versions never change. Editing them returns
policy-not-editable. - A Policy without an active version applies no rules.
Create a draft empty, from a definition, or copied from another version of the same Policy with copy_from. Activation fails with policy-invalid, listing every item that failed. A successful activation re-evaluates the open work at every Workplace that uses the Policy.
DELETE /v1/policies/{policyId} deletes a Policy and its versions. It fails with policy-in-use while a Workplace uses the Policy or another Policy builds on it, so move each Workplace to another Policy first. Decisions made under a deleted Policy stay, but GET /v1/decisions/{decisionId}/effective-policy no longer shows their rules.
The definition
Section titled “The definition”A Policy version’s definition is a JSON object with these fields:
| Field | Holds |
|---|---|
packages |
Compliance package releases, as { "code", "version" }. Only on a Policy without a base. |
rules |
Your own rules. |
overrides |
Adjustments to package rules, within what each rule allows. |
jobs |
Requirements for Assignments with certain roles. |
expiry_warnings |
How many days before expiry a document type counts as expiring soon. |
document_validity |
How long a document type counts from its issue date. |
recheck_interval_days |
Days between registry re-checks of open work. Defaults to 7. |
Packages
Section titled “Packages”A compliance package is a set of rules Dockt maintains for a country or sector, such as social_construction_be_v1 for Belgian construction. A Policy can adjust a package rule only within the overrides that rule allows. Review the selected package’s scope and rules before using it for your sites.
GET /v1/compliance-packageslists packages with their current release and rules.GET /v1/compliance-packages/{code}/versions/{version}lists a release’s rules, the document types each accepts, whom each rule is about, and the overrides it allows.
Select a release in the base Policy’s packages. To adopt a new release, create a new Policy version that selects it.
Your own rules use the same policy language as package rules:
{ "rule_code": "vca_for_every_worker", "label": "VCA certificate", "applies_when": { "kind": "always" }, "expectation": { "kind": "uploaded_document", "document_types": ["vca"] }, "enforcement": "required", "applies_to": "assignment"}applies_whensays when the rule applies:always, afact_comparison, orallandanyof other conditions. Package rules show the facts you can compare.expectationsays what satisfies the rule: anuploaded_documentof certain types, atechnical_requirementwith accepted qualifications, afact_comparison, orallandanyof other expectations.enforcementisrequired,advisoryorwaived. An advisory rule shows in the Decision but doesn’t change the result.applies_toisassignment(the default) for a worker, orengagementfor a company at the Workplace.
Document types come from GET /v1/document-types. Qualifications come from GET /v1/qualifications; a rule names one by scheme_code (its family) and qualification_code, or by qualification_definition_id. Set equivalents on an accepted qualification to also accept qualifications Dockt compares as equivalent from their specifications: accept, review or review_when_unclear. Until Dockt has compared the two, the rule stays unresolved. scheme.registry_backed says whether a register confirms a family’s qualifications; a rule with minimum_assurance: authority_verified is only met by those.
Overrides
Section titled “Overrides”An override adjusts one package rule. It names the rule and one of the operations the rule allows:
{ "target": { "source": "compliance_package", "source_id": "social_construction_be_v1", "rule_code": "social_security_coverage" }, "accept_also": [{ "kind": "uploaded_document", "document_types": ["a1_request_acknowledgement"] }], "reason": "We accept an A1 request as temporary proof."}| Operation | Field | Effect |
|---|---|---|
change_enforcement |
enforcement |
Make the rule required, advisory or waived. |
require_also |
require_also |
Require more evidence. |
accept_also |
accept_also |
Accept other evidence too. |
apply_only_when |
apply_only_when |
Apply the rule in fewer situations. |
apply_also_when |
apply_also_when |
Apply the rule in more situations. |
set_qualification_comparison_policy |
qualification_comparison_policy |
Deprecated. Set equivalents on the accepted qualifications instead. |
A rule takes one override across a Policy and its base. Always give a reason; it shows in the effective policy.
Jobs and roles
Section titled “Jobs and roles”A job lists the role codes it recognises and the rules that apply to Assignments with one of those roles:
{ "codes": ["welder", "WLD-01"], "title": "Welder", "rules": [{ "rule_code": "welder_certificate", "label": "Welding certificate", "applies_when": { "kind": "always" }, "expectation": { "kind": "uploaded_document", "document_types": ["technical_certificate"] }, "enforcement": "required" }], "proof_required": true}- Use your own job codes in
codes. Dockt doesn’t translate them. - An Assignment gets the Policy’s general rules plus the rules of every job its
rolesmatch. - An Assignment without roles gets only the general rules.
- A role that matches no job makes the Decision
incomplete, with arole_unknownfinding. Dockt never ignores an unknown role. proof_required: truemeans an uploaded document must prove the job’s qualifications. A registry entry alone isn’t enough.
Expiry warnings and document validity
Section titled “Expiry warnings and document validity”A met requirement that relies on a document is expiring_soon once the document’s warning period starts, while the work continues past its expiry. Each document type has a default warning period, listed as expiry_warning_days in GET /v1/document-types. Override it per type:
{ "expiry_warnings": [{ "document_type": "a1", "days": 45 }] }document_validity sets how long a document type counts from its issue date, replacing what the document states. Use it for evidence without an end date, such as an A1 request acknowledgement you accept for 60 days:
{ "document_validity": [{ "document_type": "a1_request_acknowledgement", "days_after_issue": 60 }] }Base Policies
Section titled “Base Policies”A Policy can build on one base Policy and hold only what is different. For example:
| Policy | Builds on | Contains |
|---|---|---|
| Belgium | — | The Belgian construction package; VCA for every worker. |
| Belgium, client X | Belgium | An override that accepts A1 requests; a welder job. |
Workplaces of client X use “Belgium, client X”. Other Belgian Workplaces use “Belgium”. A change to the Belgian baseline is made once.
- Set
base_policywhen you create the Policy:{ "name": "Belgium, client X", "base_policy": { "id": "pol_1Be0" } }. - One level only. A base Policy can’t build on another Policy.
- Only the base selects packages. A Policy that builds on another adds rules, overrides and jobs. Its
expiry_warningsanddocument_validityreplace the base’s settings for the same document type; other types keep the base’s settings. Itsrecheck_interval_daysreplaces the base’s interval when set. - Activating a base version re-evaluates the Workplaces that use the base and every Policy built on it.
- Decisions record both versions in
inputs.policy_versions.
See what applies at a Workplace
Section titled “See what applies at a Workplace”GET /v1/workplaces/{workplaceId}/effective-policy compiles the active versions of the Workplace’s Policy and its base. It returns, read-only:
rules: the rules for all work at the Workplace.jobs: per job, the rules that Assignments with one of its roles get as well.- For each rule, its
source(a package release or a Policy version), theadjustmentsalready applied, and the overrides it still allows.
Use it to check the active rules before assigning the Policy to more Workplaces, and to explain why a requirement applies. This endpoint reads active versions; it does not preview a draft. If the Policy or its base has no active version, it returns no rules.