Plan your backend integration
Dockt is an API that your backend calls. Before you write code, decide how your records map to Dockt, which endpoints you use, and how your system learns about new Decisions.
You don’t need to reproduce Dockt’s rules. Your backend sends who works where and the documents you have, stores Dockt’s IDs, and acts on the Decisions.
Map your records
Section titled “Map your records”| Your system | Dockt |
|---|---|
| A site, project or location | A Workplace, with your site ID as external_ref |
| The rules for a client or country | A Policy, shared by the Workplaces it applies to |
| A worker | A Person, with your worker ID as external_ref |
| An employer, subcontractor or client | A Company, deduplicated by registration number |
| A pre-announcement or site access request | An Assignment, with your request ID as external_ref |
| A subcontract at a site | An Engagement |
| A file about a worker or company | A Document on the Person or Company |
| A reviewer’s verdict | An Outcome |
Use external_ref for your own IDs. For Persons, Companies, Workplaces and Assignments, sending the same reference again creates or updates the matching record. A Document upload with an existing reference returns that Document unchanged. Use an idempotency key when retrying a request to replay its first response. If you receive records from several systems, give each system its own namespace.
Keep Dockt behind your backend
Section titled “Keep Dockt behind your backend”- Your application collects worker details or a file.
- Your backend sends it to Dockt with your API credential.
- Your backend stores the returned IDs and acts on the result.
Keep API credentials, webhook secrets and document files out of browser and mobile code. If a browser uploads a file to your product, send it to your backend first.
Use the API
Section titled “Use the API”Most integrations use these endpoints:
| Goal | Endpoints |
|---|---|
| Confirm authentication | GET /v1/auth/me |
| Look up packages, document types, qualifications and attributes | /v1/compliance-packages, /v1/document-types, /v1/qualifications, /v1/attribute-definitions |
| Write rules | /v1/policies, /v1/policy-versions |
| Describe sites | /v1/workplaces |
| Describe workers and companies | /v1/persons, /v1/companies |
| Announce work | /v1/assignments, /v1/engagements |
| Upload files | POST /v1/persons/{personId}/documents, POST /v1/companies/{companyId}/documents |
| Read results | /v1/decisions, /v1/registry-checks |
| Record your team’s verdicts | /v1/outcomes |
| Receive events | /v1/notification-destinations |
| Take workers in from a source system | /v1/account/connections, /v1/source-bindings, /v1/source-workers, /v1/source-intakes |
| Report usage | /v1/usage, /v1/account/credits |
Every route starts with /v1: Persons, Companies, Workplaces, Policies, work, Documents and Decisions, as well as browser sign-in and GET /v1/auth/me under /v1/auth, credits under /v1/account/credits, and connection management under /v1/account/connections. OpenAPI JSON describes them all.
The API also has console users under /v1/account/users and API credentials under /v1/api-credentials. You only need these management endpoints if your integration manages console access or creates and rotates credentials.
SDKs and generated clients
Section titled “SDKs and generated clients”Dockt supports its REST API and OpenAPI JSON as the integration surface. Call the API with your HTTP client, or generate types and client code from OpenAPI.
For a TypeScript type file, run:
npx openapi-typescript https://api.dockt.com/openapi.json \ --root-types \ --root-types-no-schema-prefix \ --output src/dockt-schema.d.tsCommit the generated file and review the OpenAPI diff before you replace it. A contract change then can’t silently change your build.
Store what you need later
Section titled “Store what you need later”Store Dockt IDs next to your own records. At minimum, keep:
- The Workplace, Person, Company and Assignment IDs, or the
external_refandnamespaceyou use for them. - Every uploaded Document ID.
- The Decision ID your product acted on, and when.
- The idempotency key of each create or upload.
- The event IDs you have processed.
Don’t use a name, a filename or a date of birth to find a Dockt record. Use Dockt IDs or your own references.
Plan for asynchronous results
Section titled “Plan for asynchronous results”Evaluation and document processing continue after your request returns. A 201 for an Assignment or a 202 for an upload means Dockt accepted the work. It is not a result.
Use this pattern in production:
- Store the returned ID before your backend reports success.
- Register a webhook endpoint and handle
decision.createdas the main signal. - Fetch the Decision before an important action.
- Reconcile with API reads for anything you may have missed. Check both
status=upcomingandstatus=openAssignments, and Engagements if you use them. Follow pagination for each collection. - Apply your own deadline without turning elapsed time into a Dockt result.
Dockt can create new Decisions while work is open. Each earlier Decision stays unchanged. Plan for a decision.created at any time: a document can expire, a registry can answer differently, or a Policy can change.
Choose the next step
Section titled “Choose the next step”- Get started with your first Decision.
- Write a Policy.
- Receive webhooks.
- Prepare for production.