Skip to content

Idempotency

Send Idempotency-Key on supported POST requests. The key lets you retry safely when you don’t know whether Dockt completed the first request, for example after a timeout.

Use your own external_ref to identify records over time, and an idempotency key to identify one request. For collections that support upsert, reusing the reference updates the matching record. For a Document upload, it returns the existing Document unchanged. An idempotency key replays the first successful response rather than applying the request again.

Dockt applies idempotency to:

  • POST /v1/persons
  • POST /v1/companies
  • POST /v1/workplaces
  • POST /v1/policies
  • POST /v1/policies/{policyId}/versions
  • POST /v1/assignments
  • POST /v1/engagements
  • POST /v1/persons/{personId}/documents
  • POST /v1/companies/{companyId}/documents
  • POST /v1/outcomes
  • POST /v1/corrections
  • POST /v1/notification-destinations
  • POST /v1/account/invitations
  • POST /v1/account/invitations/{invitationId}/resend

The OpenAPI operation includes the header when it is supported. Do not assume every POST accepts it, including source intake, secret rotation, and Policy activation. Creating an API credential is never replayed, because a replay would return its secret again.

Use a stable key that stands for one logical operation in your system:

Idempotency-Key: assignment-preannouncement-9031

Keep personal data, filenames, bearer tokens and other secrets out of the key. A random value stored with your operation record also works.

Use the same key only when you retry the same method, path and body with the same credential. Use a new key for a different operation or a changed request.

Keys are scoped to the authenticated principal, method and path, and kept for 24 hours.

  • The same key with an equivalent body replays the successful response.
  • The replay carries the request ID of the current retry.
  • A key reused with a different body returns 409 idempotency conflict.
  • A key reused while the first request is still running returns 409 as well.

For JSON, key order doesn’t matter. For uploads, the file content and the other parts are part of the request identity. Idempotent request bodies can be at most 11 MB, a 10 MB file plus multipart headers.

  1. Create and store the idempotency key before the first request.
  2. Send the request with explicit client timeouts.
  3. If the connection fails or a retryable server error occurs, retry with the same key and body.
  4. If Dockt returns an idempotency conflict, don’t generate a new key automatically. Find out whether the request changed or the first one is still running.
  5. Store the returned Dockt ID with the key after success.