Prepare for production
Use this checklist before you send production traffic.
Credentials and permissions
Section titled “Credentials and permissions”- Call Dockt only from trusted backend code.
- Store API keys, client secrets, access tokens and webhook signing secrets in a secret manager.
- Give each application and environment its own credential.
- Keep development and automated tests in an Account separate from production.
- Grant only the permissions the integration uses: usually
account:readandaccount:write. - Check the Account and permissions with
GET /v1/auth/meduring setup. - Write down how you rotate and delete a credential.
Policies and Workplaces
Section titled “Policies and Workplaces”- Activate every Policy you use, and check each Workplace’s rules with
GET /v1/workplaces/{workplaceId}/effective-policy. - Give every override a
reason. - Map every role code your system sends to a job in the Policy. An unknown role makes Decisions
incomplete. - Set each Workplace’s address, so documents that name a worksite can be compared with it.
- Plan how you roll out a new Policy version: activation re-evaluates all open work at its Workplaces.
References and requests
Section titled “References and requests”- Call every route under
/v1, such asPOST /v1/assignmentsandGET /v1/auth/me. - Send your own IDs as
external_ref, with anamespaceper source system. - Keep personal data out of references, idempotency keys and filenames.
- Send
Idempotency-Keyon supported create and upload operations. Use a new key for each distinct operation. - Set explicit connection and response timeouts in your HTTP client.
- Parse every non-2xx response as
application/problem+json, and branch ontype. - Log
x-request-idand your own correlation ID, without secrets or document contents. - Retry only failures that can succeed later, with exponential backoff and jitter.
Asynchronous Decisions
Section titled “Asynchronous Decisions”- Treat
201for work and202for uploads as accepted, not as results. - Handle every Decision result and requirement status.
- Treat unfamiliar finding codes by their
severity. - Answer
input_requestsfrom your own data before you ask a user. - Store the Decision ID your product acts on, and check
latest_decision.idbefore delayed or important actions. - Set
period.endwhen work ends, so Dockt stops monitoring it. - Expect
decision.createdat any time while work is open: when a document is about to expire, a registry answers differently, or a Policy changes. - Reconcile upcoming and open Assignments and Engagements with scheduled API reads, following pagination.
- Stop waiting at your own deadline without inventing a Dockt result.
Webhooks
Section titled “Webhooks”- Subscribe to
decision.created, and todocument.processedanddocument.failedif you track uploads. - Confirm each production destination is enabled and points to the production receiver.
- Read the raw request body before parsing JSON.
- Verify the timestamp and HMAC signature before trusting an event, and compare signatures in constant time.
- Deduplicate side effects by
X-Dockt-Event-Id. - Accept that delivery is at least once and unordered.
- Store or queue the event before returning
2xx. - Write down how you rotate the signing secret.
Documents and personal data
Section titled “Documents and personal data”- Upload only through trusted backend infrastructure.
- Check file type and size before calling Dockt.
- Upload each file to the Person or Company it is about, and declare
document_typewhen you know it. - Withdraw files that were uploaded by mistake.
- Set the Account’s document file retention with
PATCH /v1/accountto match your retention policy. - Erase a Person with
DELETE /v1/persons/{personId}when they ask to be erased. - Apply your own retention and access rules to the responses you store.
Contract updates
Section titled “Contract updates”- Generate or validate client types against OpenAPI JSON.
- Review contract changes before you update generated clients.
- Ignore unknown response fields, and handle unfamiliar values without failing.
- Keep tests for authentication, references, uploads, Decisions, webhook delivery and Problem Details errors.
Follow API compatibility and updates for the update workflow, and run Test your integration before you send production traffic.