LlamaParse Extract API
The Extract API from LlamaParse — 5 operation(s) for extract.
The Extract API from LlamaParse — 5 operation(s) for extract.
openapi: 3.0.3
info:
title: Llama Platform Agent Data Extract API
version: 0.1.0
tags:
- name: Extract
paths:
/api/v2/extract/schema/validation:
post:
tags:
- Extract
summary: Validate Extraction Schema
description: Validate a JSON schema for extraction.
operationId: validate_extraction_schema_api_v2_extract_schema_validation_post
security:
- HTTPBearer: []
parameters:
- name: session
in: cookie
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Session
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractV2SchemaValidateRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractV2SchemaValidateResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v2/extract/schema/generate:
post:
tags:
- Extract
summary: Generate Extraction Schema
description: Generate a JSON schema and return a product configuration request.
operationId: generate_extraction_schema_api_v2_extract_schema_generate_post
security:
- HTTPBearer: []
parameters:
- name: project_id
in: query
required: false
schema:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Project Id
- name: organization_id
in: query
required: false
schema:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Organization Id
- name: session
in: cookie
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Session
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractV2SchemaGenerateRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ConfigurationCreateRequest'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v2/extract:
post:
tags:
- Extract
summary: Create Extract Job
description: 'Create an extraction job.
Extracts structured data from a document using either a saved
configuration or an inline JSON Schema.
## Input
Provide exactly one of:
- `configuration_id` — reference a saved extraction config
- `configuration` — inline configuration with a `data_schema`
## Document input
Set `file_input` to a file ID (`dfl-...`) or a
completed parse job ID (`pjb-...`).
The job runs asynchronously. Poll `GET /extract/{job_id}` or
register a webhook to monitor completion.'
operationId: create_extract_job_api_v2_extract_post
security:
- HTTPBearer: []
parameters:
- name: project_id
in: query
required: false
schema:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Project Id
- name: organization_id
in: query
required: false
schema:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Organization Id
- name: session
in: cookie
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Session
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractV2JobCreate'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractV2Job'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
get:
tags:
- Extract
summary: List Extract Jobs
description: 'List extraction jobs with optional filtering and pagination.
Filter by `configuration_id`, `status`, `file_input`,
or creation date range. Results are returned newest-first.
Use `expand=configuration` to include the full configuration used,
and `expand=extract_metadata` for per-field metadata.'
operationId: list_extract_jobs_api_v2_extract_get
security:
- HTTPBearer: []
parameters:
- name: document_input_type
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by document input type (file_id or parse_job_id)
title: Document Input Type
description: Filter by document input type (file_id or parse_job_id)
- name: file_input
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by file input value
title: File Input
description: Filter by file input value
- name: document_input_value
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: 'Deprecated: use file_input instead'
deprecated: true
title: Document Input Value
description: 'Deprecated: use file_input instead'
deprecated: true
- name: status
in: query
required: false
schema:
anyOf:
- enum:
- PENDING
- THROTTLED
- RUNNING
- COMPLETED
- FAILED
- CANCELLED
type: string
- type: 'null'
description: Filter by status
title: Status
description: Filter by status
- name: page_size
in: query
required: false
schema:
anyOf:
- type: integer
- type: 'null'
description: Number of items per page
title: Page Size
description: Number of items per page
- name: page_token
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Token for pagination
title: Page Token
description: Token for pagination
- name: job_ids
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: Filter by specific job IDs
title: Job Ids
description: Filter by specific job IDs
- name: expand
in: query
required: false
schema:
type: array
items:
type: string
description: 'Additional fields to include: configuration, extract_metadata'
title: Expand
description: 'Additional fields to include: configuration, extract_metadata'
- name: project_id
in: query
required: false
schema:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Project Id
- name: organization_id
in: query
required: false
schema:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Organization Id
- name: configuration_id
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by configuration ID
examples:
- cfg-11111111-2222-3333-4444-555555555555
title: Configuration Id
description: Filter by configuration ID
- name: created_at_on_or_after
in: query
required: false
schema:
anyOf:
- type: string
format: date-time
- type: 'null'
description: Include items created at or after this timestamp (inclusive)
title: Created At On Or After
description: Include items created at or after this timestamp (inclusive)
- name: created_at_on_or_before
in: query
required: false
schema:
anyOf:
- type: string
format: date-time
- type: 'null'
description: Include items created at or before this timestamp (inclusive)
title: Created At On Or Before
description: Include items created at or before this timestamp (inclusive)
- name: session
in: cookie
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Session
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractV2JobQueryResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v2/extract/{job_id}:
get:
tags:
- Extract
summary: Get Extract Job
description: 'Get a single extraction job by ID.
Returns the job status and results when complete.
Use `expand=configuration` to include the full configuration used,
and `expand=extract_metadata` for per-field metadata.'
operationId: get_extract_job_api_v2_extract__job_id__get
security:
- HTTPBearer: []
parameters:
- name: job_id
in: path
required: true
schema:
type: string
title: Job Id
- name: expand
in: query
required: false
schema:
type: array
items:
type: string
description: 'Additional fields to include: configuration, extract_metadata'
title: Expand
description: 'Additional fields to include: configuration, extract_metadata'
- name: project_id
in: query
required: false
schema:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Project Id
- name: organization_id
in: query
required: false
schema:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Organization Id
- name: session
in: cookie
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Session
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractV2Job'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Extract
summary: Delete Extract Job
description: Delete an extraction job and its results.
operationId: delete_extract_job_api_v2_extract__job_id__delete
security:
- HTTPBearer: []
parameters:
- name: job_id
in: path
required: true
schema:
type: string
title: Job Id
- name: project_id
in: query
required: false
schema:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Project Id
- name: organization_id
in: query
required: false
schema:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Organization Id
- name: session
in: cookie
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Session
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v2/extract/{job_id}/cancel:
post:
tags:
- Extract
summary: Cancel Extract Job
description: 'Cancel a running extraction job.
Stops processing and marks the job as CANCELLED. Returns the updated job. Jobs already in a terminal state (COMPLETED, FAILED, CANCELLED) cannot be cancelled.'
operationId: cancel_extract_job_api_v2_extract__job_id__cancel_post
security:
- HTTPBearer: []
parameters:
- name: job_id
in: path
required: true
schema:
type: string
title: Job Id
- name: project_id
in: query
required: false
schema:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Project Id
- name: organization_id
in: query
required: false
schema:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Organization Id
- name: session
in: cookie
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Session
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractV2Job'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
ExtractV2Parameters:
properties:
target_pages:
anyOf:
- type: string
- type: 'null'
title: Target Pages
description: Comma-separated page numbers or ranges to process (1-based). Omit to process all pages.
examples:
- 1,3,5-7
- 1-3,8-10
max_pages:
anyOf:
- type: integer
minimum: 1.0
- type: 'null'
title: Max Pages
description: Maximum number of pages to process. Omit for no limit.
examples:
- 10
tier:
type: string
enum:
- cost_effective
- agentic
title: Tier
description: 'Extract tier: cost_effective (5 credits/page) or agentic (15 credits/page)'
default: cost_effective
examples:
- cost_effective
- agentic
version:
type: string
title: Version
description: Use 'latest' for the latest release for the selected tier or a date string (YYYY-MM-DD format) to pin to the nearest release at or before that date.
default: latest
examples:
- latest
data_schema:
additionalProperties:
anyOf:
- additionalProperties: true
type: object
- items: {}
type: array
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
type: object
title: Data Schema
description: JSON Schema defining the fields to extract. Validate with the /schema/validate endpoint first.
extraction_target:
type: string
enum:
- per_doc
- per_page
- per_table_row
title: Extraction Target
description: 'Granularity of extraction: per_doc returns one object per document, per_page returns one object per page, per_table_row returns one object per table row'
default: per_doc
examples:
- per_doc
- per_page
- per_table_row
system_prompt:
anyOf:
- type: string
- type: 'null'
title: System Prompt
description: Custom system prompt to guide extraction behavior
examples:
- Extract all monetary values in USD. If a currency is not specified, assume USD.
cite_sources:
type: boolean
title: Cite Sources
description: Include citations in results
default: false
confidence_scores:
type: boolean
title: Confidence Scores
description: Include confidence scores in results
default: false
parse_tier:
anyOf:
- type: string
- type: 'null'
title: Parse Tier
description: Parse tier to use before extraction. Defaults to the extract tier if not specified.
examples:
- fast
- cost_effective
parse_config_id:
anyOf:
- type: string
- type: 'null'
title: Parse Config Id
description: Saved parse configuration ID to control how the document is parsed before extraction
examples:
- cfg-11111111-2222-3333-4444-555555555555
product_type:
type: string
const: extract_v2
title: Product Type
description: Product type.
type: object
required:
- data_schema
- product_type
title: ExtractV2Parameters
description: Typed parameters for an *extract v2* product configuration.
SplitV1Parameters:
properties:
categories:
items:
$ref: '#/components/schemas/SplitCategory'
type: array
maxItems: 50
minItems: 1
title: Categories
description: Categories to split documents into.
splitting_strategy:
$ref: '#/components/schemas/SplitStrategy'
description: Strategy for splitting documents.
product_type:
type: string
const: split_v1
title: Product Type
description: Product type.
type: object
required:
- categories
- product_type
title: SplitV1Parameters
description: Typed parameters for a *split v1* product configuration.
ExtractV2SchemaGenerateRequest:
properties:
name:
anyOf:
- type: string
maxLength: 255
- type: 'null'
title: Name
description: Name for the generated configuration (auto-generated if omitted)
examples:
- invoice_extraction
prompt:
anyOf:
- type: string
- type: 'null'
title: Prompt
description: Natural language description of the data structure to extract
examples:
- Extract vendor name, invoice number, line items, and total amount
file_id:
anyOf:
- type: string
- type: 'null'
title: File Id
description: Optional file ID to analyze for schema generation
examples:
- dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
data_schema:
anyOf:
- additionalProperties:
anyOf:
- additionalProperties: true
type: object
- items: {}
type: array
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
type: object
- type: 'null'
title: Data Schema
description: Optional schema to validate, refine, or extend
type: object
title: ExtractV2SchemaGenerateRequest
description: Request schema for generating an extraction schema.
examples:
- name: invoice_extraction
prompt: Extract vendor name, invoice number, date, line items with descriptions and amounts, and total amount from invoices.
ClassifyV2Rule:
properties:
type:
type: string
maxLength: 50
minLength: 1
title: Type
description: Document type to assign when rule matches
examples:
- invoice
- receipt
- contract
- report
- proposal
description:
type: string
maxLength: 500
minLength: 10
title: Description
description: Natural language criteria for matching this rule
examples:
- contains invoice number, line items, and total amount
- purchase receipt with transaction info and merchant details
- legal contract with terms, conditions, and signatures
type: object
required:
- type
- description
title: ClassifyV2Rule
description: A rule for classifying documents.
ExtractV2JobMetadata:
properties:
usage:
anyOf:
- $ref: '#/components/schemas/ExtractJobUsage'
- type: 'null'
description: Usage metrics
additionalProperties: true
type: object
title: ExtractV2JobMetadata
description: Job-level metadata.
UntypedParameters:
properties:
product_type:
type: string
const: unknown
title: Product Type
description: Product type.
additionalProperties: true
type: object
required:
- product_type
title: UntypedParameters
description: 'Catch-all for configurations without a dedicated typed schema.
Accepts arbitrary JSON fields alongside ``product_type``.'
LlamaParseSpatialTextOptions:
properties:
preserve_layout_alignment_across_pages:
anyOf:
- type: boolean
- type: 'null'
title: Preserve Layout Alignment Across Pages
description: Maintain consistent text column alignment across page boundaries. Automatically enabled for document-level parsing modes
preserve_very_small_text:
anyOf:
- type: boolean
- type: 'null'
title: Preserve Very Small Text
description: Include text below the normal size threshold. Useful for footnotes, watermarks, or fine print that might otherwise be filtered out
do_not_unroll_columns:
anyOf:
- type: boolean
- type: 'null'
title: Do Not Unroll Columns
description: Keep multi-column layouts intact instead of linearizing columns into sequential text. Automatically enabled for non-fast tiers
additionalProperties: false
type: object
title: LlamaParseSpatialTextOptions
description: 'Spatial text output options for preserving document layout.
Spatial text maintains the visual positioning of text elements, useful for
documents where layout conveys meaning (forms, tables, multi-column layouts).'
LlamaParseProcessingControl:
properties:
timeouts:
$ref: '#/components/schemas/LlamaParseTimeouts'
description: Timeout settings for job execution. Increase for large or complex documents
job_failure_conditions:
$ref: '#/components/schemas/LlamaParseJobFailureConditions'
description: Quality thresholds that determine when a job should fail vs complete with partial results
additionalProperties: false
type: object
title: LlamaParseProcessingControl
description: Job processing controls for timeouts and failure handling.
LlamaParseFastOptions:
properties: {}
additionalProperties: false
type: object
title: LlamaParseFastOptions
description: 'Options for fast tier parsing (rule-based, no AI).
Fast tier uses deterministic algorithms for text extraction without AI enhancement.
It''s the fastest and most cost-effective option, best suited for simple documents
with standard layouts. Currently has no configurable options but reserved for
future expansion.'
LlamaParseInputOptions:
properties:
html:
$ref: '#/components/schemas/LlamaParseHtmlOptions'
description: HTML/web page parsing options (applies to .html, .htm files)
pdf:
$ref: '#/components/schemas/LlamaParsePdfOptions'
description: PDF-specific parsing options (applies to .pdf files)
spreadsheet:
$ref: '#/components/schemas/LlamaParseSpreadsheetOptions'
description: Spreadsheet parsing options (applies to .xlsx, .xls, .csv, .ods files)
presentation:
$ref: '#/components/schemas/LlamaParsePresentationOptions'
description: Presentation parsing options (applies to .pptx, .ppt, .odp, .key files)
additionalProperties: false
type: object
title: LlamaParseInputOptions
description: 'Input format-specific parsing options.
These options only apply when parsing documents of the corresponding format.
LlamaParse automatically detects the input format based on file extension and content.'
ExtractJobUsage:
properties:
num_pages_extracted:
anyOf:
- type: integer
- type: 'null'
title: Num Pages Extracted
description: Number of pages extracted
type: object
title: ExtractJobUsage
description: Extraction usage metrics.
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
LlamaParseTables:
properties:
compact_markdown_tables:
anyOf:
- type: boolean
- type: 'null'
title: Compact Markdown Tables
description: Remove extra whitespace padding in markdown table cells for more compact output
output_tables_as_markdown:
anyOf:
- type: boolean
- type: 'null'
title: Output Tables As Markdown
description: Output tables as markdown pipe tables instead of HTML <table> tags. Markdown tables are simpler but cannot represent complex structures like merged cells
markdown_table_multiline_separator:
anyOf:
- type: string
- type: 'null'
title: Markdown Table Multiline Separator
description: 'Separator string for multiline cell content in markdown tables. Example: ''<br>'' to preserve line breaks, '' '' to join with spaces'
merge_continued_tables:
anyOf:
- type: boolean
- type: 'null'
title: Merge Continued Tables
description: Automatically merge tables that span multiple pages into a single table. The merged table appears on the first page with merged_from_pages metadata
additionalProperties: false
type: object
title: LlamaParseTables
description: Table formatting options for markdown output.
ExtractV2SchemaValidateRequest:
properties:
data_schema:
additionalProperties:
anyOf:
- additionalProperties: true
type: object
- items: {}
type: array
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
type: object
title: Data Schema
description: JSON Schema to validate for use with extract jobs
type: object
required:
- data_schema
title: ExtractV2SchemaValidateRequest
description: Request schema for validating an extraction schema.
examples:
- data_schema:
properties:
vendor_name:
description: Name of the vendor or supplier
type: string
invoice_number:
description: Unique invoice identifier
type: string
total_amount:
description: Total invoice amount in dollars
type: number
line_items:
description: List of invoice line items
items:
properties:
description:
type: string
quantity:
type: integer
unit_price:
type: number
required:
- description
- quantity
- unit_price
type: object
type: array
required:
- vendor_name
- invoice_number
- total_amount
type: object
LlamaParsePresentationOptions:
properties:
out_of_bounds_content:
anyOf:
- type: boolean
- type: 'null'
title: Out Of Bounds Content
description: Extract content positioned outside the visible slide area. Some presentations have hidden notes or content that extends beyond slide boundaries
skip_embedded_data:
anyOf:
- type: boolean
- type: 'null'
title: Skip Embedded Data
description: Skip extraction of embedded chart data tables. When true, only the visual representation of charts is captured, not the underlying data
additionalProperties: false
type: object
title: LlamaParsePresentationOptions
description: Presentation (PowerPoint, Keynote, ODP) parsing options.
LlamaParseJobFailureConditions:
properties:
allowed_page_failure_ratio:
anyOf:
- type: number
maximum: 1.0
exclusiveMinimum: 0.0
- type: 'null'
title: Allowed Page Failure Ratio
description: 'Maximum ratio of pages allowed to fail before the job fails (0-1). Example: 0.1 means job fails if more than 10% of pages fail. Default is 0.05 (5%)'
fail_on_image_extraction_error:
anyOf:
- type: boolean
- type: 'null'
title: Fail On Image Extraction Error
description: Fail the entire job if any embedded image cannot be extracted. By default, image extraction errors are logged but don't fail the job
fail_on_image_ocr_error:
anyOf:
- type: boolean
- type: 'null'
title: Fail On Image Ocr Error
description: Fail the entire job if OCR fails on any image. By default, OCR errors result in empty text for that image
fail_on_markdown_reconstruction_error:
anyOf:
- type: boolean
- type: 'null'
title: Fail On Markdown Reconstruction Error
description: Fail the entire job if markdown cannot be reconstructed for any page. By default, failed pages use fallback text extraction
fail_on_buggy_font:
anyOf:
- type: boolean
- type: 'null'
title: Fail On Buggy Font
description: Fail the job if a problematic font is detected that may cause incorrect text extraction. Buggy fonts can produce garbled or missing characters
additionalProperties: false
type: object
title: LlamaParseJobFailureConditions
description: 'Conditions that determine when a parsing job should fail vs complete with partial results.
By default, jobs complete successfully even if some pages fail to parse.
Use these settings to enforce stricter quality requirements.'
LlamaParseOcrParameters:
properties:
languages:
anyOf:
- items:
$ref: '#/components/schemas/ParserLanguages'
type: array
- type: 'null'
title: Language
# --- truncated at 32 KB (95 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/llamaparse/refs/heads/main/openapi/llamaparse-extract-api-openapi.yml