Extract a document
This is the Docmind core: send a business document, get structured data back. Product-wise it is document analysis — classify, then extract. Architecturally it is an asynchronous job, not a synchronous OCR RPC.
POST a PDF or image. The API returns 202 with a documentId. Wait for PROCESSING_FINALISED, then GET. Do not poll.
/v1/workspaces/{workspaceId}/documentsUse stage (idp-stage.docpier.com) while integrating. Keep the Stage server
selected in Try It.
Authentication
AuthorizationstringheaderrequiredBearer token. Scope docmind.capture (deprecated idp.capture still accepted).
Path parameters
workspaceIdstringpathrequiredYour Docpier workspace ULID.
Body
multipart/form-data
filefilebodyrequiredPDF, JPEG, PNG, or TIFF. Maximum 200 MB.
extRefstring | nullbodyPartner-supplied stable id for the file (max 70 characters). Echoed in webhooks.
optionsstring | nullbodyJSON string of processing options (ProcessingInstruction). Split, OCR, retention,
and related keys: OpenAPI models.
Response
202 returns a documentId used to retrieve results and correlate webhooks.
Then:
/v1/workspaces/{workspaceId}/documents/{documentId}Each extracted document in data[] is typed (INVOICE, RECEIPT, …). See document types.
When processing fails
202 means accepted, not extracted. PROCESSING_FAILED is a domain outcome. GET the document if you need stored status. Do not replay the multipart until you know the file was the problem (a 400 on the original POST is different).
When the file is refused
Docmind judges the file by its bytes, not by its declared content type or extension. A file it cannot process is refused with 400 before anything is stored, and code says why: UNSUPPORTED_FILE_TYPE, PDF_UNREADABLE, PDF_NO_PAGES, PDF_PASSWORD_PROTECTED, PDF_TEXT_TRANSCODED or PDF_CONTENT_UNDECODABLE. The full list is on Errors.
A PDF that arrives with extra bytes in front of its header, for example a wrapped HTTP response, is accepted without those bytes. The document then carries the warning PDF_PREFIX_STRIPPED in process.warnings, whose meta holds the hash and size of the file as it was sent.
Dedupe on webhookId. Envelope: Webhooks.