Skip to content

Get started with Dockt

This guide takes you from an API key to your first Decision. You will:

  1. Check your API key.
  2. Create a Policy and a Workplace that uses it.
  3. Register a webhook endpoint for decision.created.
  4. Announce a worker with an Assignment.
  5. Upload the worker’s documents.
  6. Receive the Decision and read what is missing.

The examples use curl and jq against the production API. Use fictional worker data, or data you are allowed to process, in an Account meant for development.

You need:

  • Access to the Dockt console for your Account.
  • An API key with account:read and account:write. Create it in the console under API credentials. Dockt shows the key once.
  • A backend that can keep the key and uploaded files private. Never put API keys, webhook secrets or document files in browser or mobile code.
  • curl and jq installed on the machine where you run the commands.
  • An identity document for a test worker. The upload example expects a PDF named identity-card.pdf in your working directory. For a JPEG, PNG, or WebP file, change the filename and media type in the upload command.

Run the commands in order in the same shell so later steps can use the IDs saved by earlier steps. The site, worker, and company in the examples are fictional. Replace them with your own test records; the resulting requirements depend on the data and Policy you send.

Export the base URL and your key:

Terminal window
export DOCKT_API_BASE_URL='https://api.dockt.com'
export DOCKT_API_TOKEN='REPLACE_WITH_API_KEY'

Call GET /v1/auth/me:

Terminal window
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $DOCKT_API_TOKEN" \
"$DOCKT_API_BASE_URL/v1/auth/me" | jq '.data | {auth_type, principal_scope_type, permissions, account: .active_scope.name}'

The filtered response looks like this; your Account name and permissions can differ:

{
"auth_type": "api_credential",
"principal_scope_type": "account",
"permissions": ["account:read", "account:write"],
"account": "Example Construction"
}

Confirm that permissions includes account:read and account:write. Every response carries an x-request-id header. Log it with your own correlation ID; include it when you contact hello@dockt.com.

A Workplace is a site where work happens. Each Workplace has a Policy: the rules that apply there. This example uses the Belgian construction package, a set of rules maintained by Dockt. For another country or sector, use Write a Policy to choose the rules you need.

A Policy’s rules live in a version. Create a draft version, then activate it before using the Policy for work.

Read the package’s current release:

Terminal window
package_version="$(
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $DOCKT_API_TOKEN" \
"$DOCKT_API_BASE_URL/v1/compliance-packages/social_construction_be_v1" | jq -r '.data.version'
)"

Create the Policy, add a draft version that selects the package, and activate it:

Terminal window
export DOCKT_POLICY_ID="$(
curl --fail-with-body --silent --show-error \
-X POST "$DOCKT_API_BASE_URL/v1/policies" \
-H "Authorization: Bearer $DOCKT_API_TOKEN" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: getting-started-policy' \
--data '{ "name": "Belgium construction" }' | jq -r '.data.id'
)"
policy_version_id="$(
curl --fail-with-body --silent --show-error \
-X POST "$DOCKT_API_BASE_URL/v1/policies/$DOCKT_POLICY_ID/versions" \
-H "Authorization: Bearer $DOCKT_API_TOKEN" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: getting-started-policy-version' \
--data "$(jq -n --arg version "$package_version" \
'{ definition: { packages: [{ code: "social_construction_be_v1", version: $version }] } }')" | jq -r '.data.id'
)"
curl --fail-with-body --silent --show-error \
-X POST "$DOCKT_API_BASE_URL/v1/policy-versions/$policy_version_id/activate" \
-H "Authorization: Bearer $DOCKT_API_TOKEN" | jq '.data | {id, number, status}'

Create a Workplace that uses the Policy. Your own external_ref lets you refer to it later without storing Dockt’s ID:

Terminal window
curl --fail-with-body --silent --show-error \
-X POST "$DOCKT_API_BASE_URL/v1/workplaces" \
-H "Authorization: Bearer $DOCKT_API_TOKEN" \
-H 'Content-Type: application/json' \
--data "$(jq -n --arg policy "$DOCKT_POLICY_ID" '{
external_ref: "plant-antwerp",
name: "Plant Antwerp",
country: "BE",
address: { line1: "Haven 1200", postal_code: "2030", city: "Antwerpen", country: "BE" },
policy: { id: $policy },
attributes: { "workplace.is_construction": true }
}')" | jq '.data | {id, external_ref, timezone, policy}'

Sending the same external_ref again updates the Workplace instead of creating another one.

Workplaces and Policies

Dockt evaluates work in the background and sends every new Decision as a decision.created event. Register the HTTPS endpoint that will receive it. Replace https://example.com/webhooks/dockt with your receiver’s URL before running the request:

Terminal window
curl --fail-with-body --silent --show-error \
-X POST "$DOCKT_API_BASE_URL/v1/notification-destinations" \
-H "Authorization: Bearer $DOCKT_API_TOKEN" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: getting-started-webhook' \
--data '{
"url": "https://example.com/webhooks/dockt",
"event_types": ["decision.created", "document.processed", "document.failed"]
}' | jq '.data | {id, url, event_types, signing_secret}'

Store signing_secret in your secret manager now; create and rotation responses are the only times Dockt returns it. Receive webhooks shows how to verify each delivery.

If you don’t have an endpoint yet, skip this step. You can read the result with the API in step 6.

Create an Assignment: a Person working at a Workplace, for an employer, for a period. You don’t need to create the Person or the employer first. Dockt creates them from the details you send. In this example, local means the worker is employed locally rather than posted from another country:

Terminal window
assignment="$(
curl --fail-with-body --silent --show-error \
-X POST "$DOCKT_API_BASE_URL/v1/assignments" \
-H "Authorization: Bearer $DOCKT_API_TOKEN" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: getting-started-assignment' \
--data '{
"external_ref": "preannouncement-9031",
"workplace": { "external_ref": "plant-antwerp" },
"person": {
"external_ref": "worker-4821",
"attributes": {
"person.first_name": "Jan",
"person.last_name": "Peeters",
"person.date_of_birth": "1988-04-02",
"person.nationality": ["BE"]
}
},
"employer": {
"external_ref": "comp-77",
"name": "Alfa Welding BV",
"country": "BE",
"registration_number": "BE0123456789"
},
"period": { "start": "2026-11-03", "end": null },
"attributes": {
"assignment.employment_relationship": "employee",
"assignment.posting_status": "local"
}
}'
)"
export DOCKT_ASSIGNMENT_ID="$(printf '%s' "$assignment" | jq -r '.data.id')"
export DOCKT_PERSON_ID="$(printf '%s' "$assignment" | jq -r '.data.person.id')"
printf '%s' "$assignment" | jq '.data | {id, status, person, employer, engagement, latest_decision}'

For a new Assignment, the filtered response looks like this. The status depends on the start date:

{
"id": "asg_6Pw3",
"status": "upcoming",
"person": { "id": "per_7Hq2", "external_ref": "worker-4821", "namespace": "api" },
"employer": { "id": "cmp_3Lp9", "external_ref": "comp-77", "namespace": "api" },
"engagement": { "id": "eng_4Rx2" },
"latest_decision": null
}

latest_decision is null because evaluation runs in the background. Store the Assignment and Person IDs with your own record.

Assignments and Engagements

Upload each file to the Person it is about. A Person’s documents count at every Workplace where they work, so you upload a passport once:

Terminal window
curl --fail-with-body --silent --show-error \
-X POST "$DOCKT_API_BASE_URL/v1/persons/$DOCKT_PERSON_ID/documents" \
-H "Authorization: Bearer $DOCKT_API_TOKEN" \
-H 'Idempotency-Key: getting-started-identity-document' \
-F 'file=@identity-card.pdf;type=application/pdf' \
-F 'document_type=passport_id' \
-F 'workplace={"external_ref":"plant-antwerp"}' | jq '.data | {id, status, document_type}'

The response is 202 Accepted with status: "processing". Dockt reads the file, asks the relevant registries, and evaluates the worker’s open work again.

document_type is optional. It declares what the file is, using a code from GET /v1/document-types. Dockt classifies the file either way.

Documents

When the evaluation creates a Decision, your endpoint receives decision.created. The following example illustrates the payload; your IDs, requirements, and result depend on your records:

{
"id": "evt_9Qa2",
"type": "decision.created",
"created_at": "2026-11-02T09:00:05Z",
"data": {
"decision": { "id": "dec_91Kp", "result": "incomplete", "summary": "1 requirement missing: Dimona registration." },
"target": { "type": "assignment", "id": "asg_6Pw3", "external_ref": "preannouncement-9031" },
"workplace": { "id": "wpl_8Tn1", "external_ref": "plant-antwerp" },
"person": { "id": "per_7Hq2", "external_ref": "worker-4821" },
"company": { "id": "cmp_3Lp9", "external_ref": "comp-77" },
"changed_requirements": ["employment_registration", "identity_document"],
"changed_findings": []
}
}

Without an endpoint, read the Assignment until latest_decision is set. Wait between reads and respect Retry-After if Dockt returns 429:

Terminal window
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $DOCKT_API_TOKEN" \
"$DOCKT_API_BASE_URL/v1/assignments/$DOCKT_ASSIGNMENT_ID" | jq '.data.latest_decision'

Fetch the full Decision:

Terminal window
# Use the Decision ID from the event or from latest_decision.
export DOCKT_DECISION_ID='dec_REPLACE_ME'
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $DOCKT_API_TOKEN" \
"$DOCKT_API_BASE_URL/v1/decisions/$DOCKT_DECISION_ID" | jq '.data | {
result,
summary,
requirements: [.requirements[] | {rule_code, status, provided_by, accepts, missing}],
findings: [.findings[] | {code, severity, title}],
input_requests: [.input_requests[] | {owner, attribute, field, label}]
}'
  • result is compliant, incomplete, review_required or non_compliant.
  • requirements list every rule that applies. A missing requirement says in accepts which document types would satisfy it and in provided_by who has to provide them.
  • findings list issues that aren’t a single requirement.
  • input_requests list attributes or fields Dockt still needs.

Upload the missing documents or send the missing values. Each change can create a new Decision and another decision.created. Dockt also evaluates again when a document is about to expire, a registry answers differently, or the Policy changes, until the Assignment ends.

Decisions and Outcomes