Skip to content

Documents

A Document is one PDF or image about a Person or a Company, and everything Dockt read from it. Upload each file to the subject it is about. Dockt processes it once and uses it at every Workplace where it applies.

Upload a file as multipart/form-data:

  • POST /v1/persons/{personId}/documents for a Person’s file.
  • POST /v1/companies/{companyId}/documents for a Company’s file.
Part Required Notes
file Yes One PDF, JPEG, PNG or WebP file, up to 10 MB.
document_type No The type you declare, as a code from GET /v1/document-types. Dockt classifies the file either way.
workplace No A JSON reference to the Workplace where the file was submitted, such as {"external_ref":"plant-antwerp"}. Recorded as its origin; it doesn’t limit where the Document counts.
external_ref No Your reference for the file. Sending it again returns the same Document.

The response is 202 Accepted with the Document in processing. Uploading the same file again for the same owner returns the existing Document with 200 OK.

A 202 means Dockt stored the file. It doesn’t mean the file is valid. Wait for document.processed or document.failed, or for the next decision.created of the work it affects.

Document uploads reference

Status Meaning
processing Dockt is reading the file. Requirements that may use it show as pending.
processed Dockt finished reading the file. Its facts and findings are available.
failed Dockt couldn’t process the file. error says why.
withdrawn You withdrew the Document. It no longer counts.

processed says that reading finished, not that the document satisfies a requirement. The Decision of each piece of work says whether the Document counted there.

  • document_type: the type Dockt read, or the declared type when it couldn’t read the file.
  • declared_document_type: the type you declared on upload, or null.
  • facts: every value Dockt read, keyed by fact name, each with a confidence. See Document facts.
  • registry_checks: what the document’s issuer or a registry said about it, such as an A1 or certificate check. null when no check applies.
  • findings: issues with the file itself, such as authenticity signals.
  • owner: the Person or Company it belongs to, with your reference.
  • origin_workplace: the Workplace where it was submitted, if you sent one.

Dockt reads many document types, but not every type a rule accepts. GET /v1/document-types lists every type a rule can accept and marks with readable the ones Dockt reads.

Declare a type when you know it, especially for a type Dockt doesn’t read. When Dockt can’t read the file, Dockt uses the declared type as evidence and marks the requirement review_required for a person to review. While the file is processing, the declared type makes its requirement pending.

A Person’s Document counts for all their work, at every Workplace. For each piece of work, Dockt checks that the Document fits:

  • It is about the same worker.
  • Its period covers the work’s period.
  • Its employer and worksite country match the work.

A Document that names another employer, or doesn’t cover the period, doesn’t count for that work and goes to review. So a worker’s A1 counts only for the work of the employer and period it names.

While work is open, Dockt asks the issuer of an A1, Limosa declaration or certificate again on the Policy’s re-check interval. When the issuer no longer stands behind a Document, the Document counts as invalid and the Decision adds a document_no_longer_confirmed finding naming it. The Document itself keeps the result from processing.

POST /v1/documents/{documentId}/reprocess makes Dockt read a Document’s file again from scratch, without reusing an earlier result. Use it when a Document failed or was read wrongly and you want a fresh reading. The response is 202 Accepted with the Document back in processing; the new result replaces the current one, and Decisions that use the Document update when it finishes. Read GET /v1/documents/{documentId} to see when it is done: document.processed and document.failed are sent at most once per Document, so a reprocessing that ends as before sends no event.

Only a processed or failed Document whose file is still stored can be reprocessed. A Document that is withdrawn, still processing, one part of a file Dockt split, or whose file was deleted returns 409 with type document-not-reprocessable.

DELETE /v1/documents/{documentId} withdraws a Document. Use it when someone uploaded the wrong file. The Document stops counting as evidence and Dockt re-evaluates the affected work. It stays readable for audit, with withdrawn_at set.

To erase all of a Person’s Documents for privacy reasons, erase the Person.

GET /v1/documents/{documentId}/file returns the original file. When the Account’s document file retention has deleted the file, the response is 410 Gone with type file-deleted. The Document, its facts and the Decisions that used it remain.

GET /v1/persons/{personId}/documents and GET /v1/companies/{companyId}/documents list a subject’s Documents. Filter by status and by document_type.

  • document.processed when processing finishes.
  • document.failed when processing fails.

Both carry the Document’s ID, type and status, and its owner with your references. Webhook events