Skip to content

Extract a document (schemaless)

POST
/api/v1/extract
curl --request POST \
--url https://api.langparse.dev/api/v1/extract \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <X-Api-Key>' \
--data '{ "fileBase64": "example", "fileName": "invoice.pdf", "hint": "Pull line items with description, qty, unit price.", "model": "example", "pages": [ 3, 5 ], "workflowId": "example" }'

Parse WITHOUT a model — the parser infers the best structure and returns it as JSON. Returns a job id; poll GET /api/v1/documents/{id} for the result.

Provide fileBase64 (inline). Optional hint steers the shape; model overrides the extractor.

Media typeapplication/json
object
fileBase64
required

Base64-encoded file bytes (≤ ~12 MB).

string format: byte
fileName
string
Example
invoice.pdf
hint

Free-text guidance for the structure to infer.

string
Example
Pull line items with description, qty, unit price.
model

Extractor model id (else the default vision model).

string
pages

Only extract these 1-indexed pages (e.g. [3,5]). Omit for all pages.

Array<integer>
Example
[
3,
5
]
workflowId

Run this workflow on the file after the document is created.

string

Extract job accepted

Media typeapplication/json
object
id
string
status
string
Allowed values: queued
debugId
string
pollUrl
string
Example
{
"status": "queued"
}

Missing or invalid API key

Insufficient credits