Document Extraction
Document Insights extracts structured field values from a document. The flow is asynchronous: you submit a document, receive an extraction ID, then read the result once processing finishes.
A typical integration looks like this:
- Submit a document.
- Poll or subscribe for the terminal state.
- Read the output.
- Optionally submit feedback.
All requests require an API key in the Authorization header. See Authentication for how to obtain and send one.
Submit a document
Choose one of two submission styles, depending on whether you want to manage the file separately.
Option A: Extract from a file or URL
Use this when the document already lives in Plextera File Service or is reachable at an HTTPS URL. This is also the right choice when you want a reusable fileId you can extract from more than once.
Stored file
Document URL
To extract from a stored file, first upload it with POST /files, then reference the returned id.
Option B: Upload and extract in one request
Use this when you do not need a reusable fileId and want a single round trip. Send the file as multipart/form-data to POST /document-insights/extractions/upload.
The file part is required. The optional tags part is a JSON object with string values.
What you get back
Every submission method returns the same extraction object, accepted asynchronously with status QUEUED.
Store the id. This is the extractionId you use to poll for results, submit feedback, and correlate events.
All timestamps in extraction responses are UTC ISO 8601 strings, for example 2026-04-07T10:22:00Z.
Tags and docType
Both submission methods accept optional tags: string key-value pairs that Plextera returns on every response and event for the extraction. Use them to correlate results with records in your own system, such as a case ID or source system.
docType is a reserved tag that drives document-type routing. Only send it when Plextera has configured routing for your workspace; otherwise omit it.
You can attach up to 50 tags. Keys are limited to 64 characters and values to 512 characters; keys and values must be non-empty after trimming.
Get the result
An extraction moves through one of these lifecycles:
COMPLETED, FAILED, and REJECTED are terminal. You can receive the result by polling or by subscribing to events.
Poll for output
Call GET /document-insights/extractions/{extractionId} until the status is terminal. A reasonable cadence: poll every 2–5 seconds for the first minute, then back off to every 15–30 seconds. Most documents finish within a couple of minutes; large or multi-page documents can take longer.
When status is COMPLETED, outputAvailable is true and the response carries the output object. When status is FAILED or REJECTED, it carries an error object instead.
Read the output
A completed extraction returns output.fieldCount and an output.fields array. Each field carries its extracted value plus extraction details such as confidence, page, and placement.
Each field’s id is what you pass as fieldId when submitting feedback. For the full field schema, see the API reference.
Download the source document
The document object carries file metadata plus contentUrl - a short-lived pre-signed link to download the original document straight from storage. This link is minted on each Get extraction request and expires, so fetch it promptly and don’t persist it; request the extraction again to get a fresh one. contentUrl is returned only by Get extraction (this endpoint), not by List extractions, and is omitted when the link cannot be resolved. The Files guide shows the same download pattern for files fetched by fileId.
Delete an extraction
Delete an extraction you no longer need with DELETE /document-insights/extractions/{extractionId}.
A successful delete returns 204 No Content. Only terminal extractions can be deleted - deleting one that is still QUEUED or PROCESSING returns 409 CONFLICT; wait for a terminal status first. Deletion is permanent: the extraction disappears from GET and list responses and from Plextera review tooling.
Handle failures
FAILED and REJECTED both return an error object with a machine-readable code and a human-readable message. The distinction matters when deciding whether to retry.
Rejected
Failed
Receive events instead of polling
If your application exposes a webhook endpoint, subscribe to extraction events and let Plextera push the terminal result to you. The completed event payload contains the same extraction model returned by GET /document-insights/extractions/{extractionId}, including output.
Recommended event types:
document-insights.extraction.completedincludesoutput.document-insights.extraction.failedincludeserror.document-insights.extraction.rejectedincludeserror.
See Event Subscriptions for endpoint setup, signature verification, and retry behavior.
List extractions
Use GET /document-insights/extractions to review history or build a status view. It returns a paged summary of each extraction without the full output, and the document summary here does not include the contentUrl download link. Fetch a single extraction by ID when you need the field values or a download link.
Filter by status, narrow by a from / to created-time window, and order with sortBy and sort. Results are paged with zero-based page and size, and every response includes a pageInfo object. See the API reference for the complete parameter list and defaults.
Filter by tags
Filter on the tags you submitted with each extraction using the tags[key]=value parameter. Use tags[key]= (empty value) to match extractions that have the tag, or tags[key]=value for an exact match. Multiple keys are combined with AND.
This returns extractions tagged docType=lab-result and customerDocumentId=lab-42. Tag filters combine with the other filters above.
Submit feedback
When an extracted value is wrong or needs review, submit feedback against the extraction. Feedback is surfaced to the team that configures your workspace and is used to improve extraction quality.