Skip to main content
POST
Python

Body

Input to V2ExtractOperationWorkflow.

Provide the markdown as an inline markdown string, as a multipart file part named markdown (for large inputs — the gateway stages the upload internally), or via a public markdown_url. Exactly one source must be supplied.

schema
Schema · object
required

JSON Schema describing the fields to extract. The schema must be an object type with a properties map of field names to their types and descriptions.

Example:
markdown
string | null

Markdown string to extract from, or a multipart FILE part carrying the markdown (large inputs — uploads are staged by the gateway). Can come from any source — LandingAI parse output, a third-party parser, or hand-authored text. When the markdown was produced by POST /v2/parse, it ends with a <!-- doc_id=<id> --> comment that the service reads automatically and echoes as metadata.doc_id.

markdown_url
string | null

URL to fetch the markdown from. Must be a public http(s) URL; private/loopback IPs are rejected at submit time.

model
string | null

The version of the model to use for extraction. Use extract-latest to use the latest version.

options
V2ExtractOptions · object | null

Extraction options (strict). Omit for defaults.

Response

v2-extract result

Result returned by V2ExtractOperationWorkflow — the /v2/extract response body (docs/extract-v2-proposal.md → Response).

extraction and extraction_metadata mirror each other structurally: leaf values in extraction are replaced by ExtractionFieldMetadata objects in extraction_metadata.

extraction
Extraction · object
required

Extracted values conforming to the request schema.

extraction_metadata
Extraction Metadata · object
required

Per-field metadata, mirroring extraction with leaf values replaced by {value, ranges} objects.

markdown
string
required

Echoed input markdown.

metadata
V2ExtractMetadata · object
required

Request metadata (job_id, model_version, duration_ms, doc_id, billing).

schema_violation_error
string | null

Set when options.strict is false and the schema contained fields the model could not extract — the extraction is partial.

warnings
Warnings · object[]

Non-fatal warnings emitted during extraction.