Extract a document (schemaless)
POST
/api/v1/extract
const url = 'https://api.langparse.dev/api/v1/extract';const options = { method: 'POST', headers: {'X-Api-Key': '<X-Api-Key>', 'Content-Type': 'application/json'}, body: '{"fileBase64":"example","fileName":"invoice.pdf","hint":"Pull line items with description, qty, unit price.","model":"example","pages":[3,5],"workflowId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”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.pdfhint
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
Responses
Section titled “Responses”Extract job accepted
Media typeapplication/json
object
id
string
status
string
debugId
string
pollUrl
string
Example
{ "status": "queued"}Missing or invalid API key
Insufficient credits