Document uploads
Upload files to the Person or Company they are about:
POST /v1/persons/{personId}/documentsPOST /v1/companies/{companyId}/documents
Both take multipart/form-data with one file and return the Document.
Accepted file formats
Section titled “Accepted file formats”Upload one non-empty file no larger than 10 MB:
| Format | Media type |
|---|---|
application/pdf |
|
| JPEG | image/jpeg |
| PNG | image/png |
| WebP | image/webp |
Dockt checks the file signature on every upload. Declare the matching media type when you can. With application/octet-stream or no media type, Dockt uses the format it detects. SVG, other formats, and declarations that disagree with the bytes are rejected with invalid-document-upload.
| Part | Required | Notes |
|---|---|---|
file |
Yes | Exactly one file. |
document_type |
No | A code from GET /v1/document-types. An unknown code is rejected. |
workplace |
No | A JSON reference object, such as {"external_ref":"plant-antwerp"} or {"id":"wpl_8Tn1"}. |
external_ref |
No | Your reference for the file. |
Other parts are rejected.
Responses
Section titled “Responses”| Status | Meaning |
|---|---|
202 Accepted |
Dockt stored the file and created a Document in processing. |
200 OK |
The owner already has a Document with the same file, or with the same external_ref. Dockt returns it unchanged. |
Dockt recognises the same file by its content, so uploading it again never creates a second Document for the same owner. The same file uploaded for two different owners creates one Document for each.
Send an Idempotency-Key as well, so a retry after a timeout replays the first response.
Document types
Section titled “Document types”GET /v1/document-types lists every type a rule can accept:
{ "object": "document_type", "code": "a1", "title": "A1 certificate", "family": "social", "readable": true, "expiry_warning_days": 30}readablesays whether Dockt reads this type. For other types, Dockt can’t extract facts; declare the type on upload so the Document counts as that type for a reviewer to confirm.expiry_warning_daysis the default warning period before a document of this type expires. A Policy can override it. It isnullfor types Dockt doesn’t read, because Dockt can’t know their dates.
Declare document_type when you know it. Dockt classifies every file either way. When it reads a different type than you declared, document_type shows what it read and declared_document_type what you declared. When it can’t read the file, Dockt uses the declared type as evidence and marks the requirement review_required. This is a requirement status in the Decision, not a Document processing status.
The origin Workplace
Section titled “The origin Workplace”The workplace part records where the file was submitted, as origin_workplace. It doesn’t limit where the Document counts. A Person’s Document counts for all their work that it fits, at every Workplace.
After upload
Section titled “After upload”Processing is asynchronous. Wait for document.processed or document.failed, or read GET /v1/documents/{documentId}. The Document’s facts describe what Dockt read; the Decisions of the owner’s work say whether it counted.