Skip to content

Parse a document

POST
/api/v1/models/{modelId}/parse
curl --request POST \
--url https://api.langparse.dev/api/v1/models/example/parse \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <X-Api-Key>' \
--data '{ "fileBase64": "example", "sourceKey": "example", "fileName": "invoice.pdf", "pages": [ 3, 5 ], "workflowId": "example" }'
modelId
required
string

Provide fileBase64 (inline) OR sourceKey (from /uploads).

Media typeapplication/json
object
fileBase64

Base64-encoded file bytes (≤ ~12 MB). Provide this OR sourceKey.

string format: byte
sourceKey

Key from POST /uploads after you PUT the file to its URL. No size limit.

string
fileName
string
Example
invoice.pdf
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

Parse 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

Model not found