Core concepts
Five ideas cover almost everything you’ll do with the API.
Models
Section titled “Models”A model is a document type plus the schema you want back (the same thing the app
UI calls a parser). You submit to POST /api/v1/documents and pass a model
id to parse against it. Prefer to skip schema design? Pass schemaless: true
and LangParse infers the fields for you (or auto: true to detect the best
model automatically).
Async by design
Section titled “Async by design”Submitting a document returns an id immediately (HTTP 202). Poll
GET /api/v1/documents/{id} until status is processed — no long-held
connections. The status moves through queued → processing → processed (or
failed).
Response envelope
Section titled “Response envelope”Every response is wrapped in a top-level data. A single resource is
{ "data": { … } }; a list is { "data": [ … ], "meta": { "pagination": … } };
errors are { "statusCode", "statusMessage" }. For a parsed document that means
two data levels — the outer envelope, and an inner data holding the
extracted values.
Fields & confidence
Section titled “Fields & confidence”Each extracted field comes back with a confidence of high, medium, low,
or flagged, plus bounding boxes — so you can auto-accept high-confidence
values or route the rest to human review. This is how you measure accuracy
rather than assume it.
Routers
Section titled “Routers”Classify an incoming file and split multi-document PDFs, then send each part to the right model automatically — so a mixed upload becomes cleanly separated, correctly-typed results.
Keys & scopes
Section titled “Keys & scopes”API keys carry scopes:
parse— submit documents and read results (new keys are parse-only).manage— configure models, routers, and sources.admin— organization administration.
Use a separate key per environment so usage is attributable and revocation is surgical.