Skip to content
Framework Docs

Extract

Create Extract Job
ExtractV2Job extract().create(ExtractCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/api/v2/extract
List Extract Jobs
ExtractListPage extract().list(ExtractListParamsparams = ExtractListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/api/v2/extract
Get Extract Job
ExtractV2Job extract().get(ExtractGetParamsparams = ExtractGetParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/api/v2/extract/{job_id}
Delete Extract Job
JsonValue extract().delete(ExtractDeleteParamsparams = ExtractDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
DELETE/api/v2/extract/{job_id}
Validate Extraction Schema
ExtractV2SchemaValidateResponse extract().validateSchema(ExtractValidateSchemaParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/api/v2/extract/schema/validation
Generate Extraction Schema
ConfigurationCreate extract().generateSchema(ExtractGenerateSchemaParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/api/v2/extract/schema/generate
ModelsExpand Collapse
class ExtractConfiguration:

Extract configuration combining parse and extract settings.

DataSchema dataSchema

JSON Schema defining the fields to extract. Validate with the /schema/validate endpoint first.

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<Boolean> citeSources

Include citations in results

Optional<Boolean> confidenceScores

Include confidence scores in results

Optional<ExtractionTarget> extractionTarget

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

One of the following:
PER_DOC("per_doc")
PER_PAGE("per_page")
PER_TABLE_ROW("per_table_row")
Optional<Long> maxPages

Maximum number of pages to process. Omit for no limit.

minimum1
Optional<String> parseConfigId

Saved parse configuration ID to control how the document is parsed before extraction

Optional<String> parseTier

Parse tier to use before extraction. Defaults to the extract tier if not specified.

Optional<String> systemPrompt

Custom system prompt to guide extraction behavior

Optional<String> targetPages

Comma-separated page numbers or ranges to process (1-based). Omit to process all pages.

Optional<Tier> tier

Extract tier: cost_effective (5 credits/page) or agentic (15 credits/page)

One of the following:
COST_EFFECTIVE("cost_effective")
AGENTIC("agentic")
Optional<String> version

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.

class ExtractJobMetadata:

Extraction metadata.

Optional<ExtractedFieldMetadata> fieldMetadata

Metadata for extracted fields including document, page, and row level info.

Optional<DocumentMetadata> documentMetadata

Per-field metadata keyed by field name from your schema. Scalar fields (e.g. vendor) map to a FieldMetadataEntry with citation and confidence. Array fields (e.g. items) map to a list where each element contains per-sub-field FieldMetadataEntry objects, indexed by array position. Nested objects contain sub-field entries recursively.

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<List<PageMetadata>> pageMetadata

Per-page metadata when extraction_target is per_page

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<List<RowMetadata>> rowMetadata

Per-row metadata when extraction_target is per_table_row

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<String> parseJobId

Reference to the ParseJob ID used for parsing

Optional<String> parseTier

Parse tier used for parsing the document

class ExtractJobUsage:

Extraction usage metrics.

Optional<Long> numPagesExtracted

Number of pages extracted

class ExtractV2Job:

An extraction job.

String id

Unique job identifier (job_id)

LocalDateTime createdAt

Creation timestamp

formatdate-time
String fileInput

File ID or parse job ID that was extracted

String projectId

Project this job belongs to

String status

Current job status.

  • PENDING — queued, not yet started
  • RUNNING — actively processing
  • COMPLETED — finished successfully
  • FAILED — terminated with an error
  • CANCELLED — cancelled by user
LocalDateTime updatedAt

Last update timestamp

formatdate-time
Optional<ExtractConfiguration> configuration

Extract configuration combining parse and extract settings.

DataSchema dataSchema

JSON Schema defining the fields to extract. Validate with the /schema/validate endpoint first.

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<Boolean> citeSources

Include citations in results

Optional<Boolean> confidenceScores

Include confidence scores in results

Optional<ExtractionTarget> extractionTarget

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

One of the following:
PER_DOC("per_doc")
PER_PAGE("per_page")
PER_TABLE_ROW("per_table_row")
Optional<Long> maxPages

Maximum number of pages to process. Omit for no limit.

minimum1
Optional<String> parseConfigId

Saved parse configuration ID to control how the document is parsed before extraction

Optional<String> parseTier

Parse tier to use before extraction. Defaults to the extract tier if not specified.

Optional<String> systemPrompt

Custom system prompt to guide extraction behavior

Optional<String> targetPages

Comma-separated page numbers or ranges to process (1-based). Omit to process all pages.

Optional<Tier> tier

Extract tier: cost_effective (5 credits/page) or agentic (15 credits/page)

One of the following:
COST_EFFECTIVE("cost_effective")
AGENTIC("agentic")
Optional<String> version

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.

Optional<String> configurationId

Saved extract configuration ID used for this job, if any

Optional<String> errorMessage

Error details when status is FAILED

Optional<ExtractJobMetadata> extractMetadata

Extraction metadata.

Optional<ExtractedFieldMetadata> fieldMetadata

Metadata for extracted fields including document, page, and row level info.

Optional<DocumentMetadata> documentMetadata

Per-field metadata keyed by field name from your schema. Scalar fields (e.g. vendor) map to a FieldMetadataEntry with citation and confidence. Array fields (e.g. items) map to a list where each element contains per-sub-field FieldMetadataEntry objects, indexed by array position. Nested objects contain sub-field entries recursively.

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<List<PageMetadata>> pageMetadata

Per-page metadata when extraction_target is per_page

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<List<RowMetadata>> rowMetadata

Per-row metadata when extraction_target is per_table_row

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<String> parseJobId

Reference to the ParseJob ID used for parsing

Optional<String> parseTier

Parse tier used for parsing the document

Optional<ExtractResult> extractResult

Extracted data conforming to the data_schema. Returns a single object for per_doc, or an array for per_page / per_table_row.

One of the following:
class UnionMember0:
class InnerUnionMember0:
List<JsonValue>
String
double
boolean
List<UnnamedSchemaWithArrayParent0>
One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<Metadata> metadata

Job-level metadata.

Optional<ExtractJobUsage> usage

Extraction usage metrics.

Optional<Long> numPagesExtracted

Number of pages extracted

class ExtractV2JobCreate:

Request to create an extraction job. Provide configuration_id or inline configuration.

String fileInput

File ID or parse job ID to extract from

maxLength200
Optional<ExtractConfiguration> configuration

Extract configuration combining parse and extract settings.

DataSchema dataSchema

JSON Schema defining the fields to extract. Validate with the /schema/validate endpoint first.

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<Boolean> citeSources

Include citations in results

Optional<Boolean> confidenceScores

Include confidence scores in results

Optional<ExtractionTarget> extractionTarget

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

One of the following:
PER_DOC("per_doc")
PER_PAGE("per_page")
PER_TABLE_ROW("per_table_row")
Optional<Long> maxPages

Maximum number of pages to process. Omit for no limit.

minimum1
Optional<String> parseConfigId

Saved parse configuration ID to control how the document is parsed before extraction

Optional<String> parseTier

Parse tier to use before extraction. Defaults to the extract tier if not specified.

Optional<String> systemPrompt

Custom system prompt to guide extraction behavior

Optional<String> targetPages

Comma-separated page numbers or ranges to process (1-based). Omit to process all pages.

Optional<Tier> tier

Extract tier: cost_effective (5 credits/page) or agentic (15 credits/page)

One of the following:
COST_EFFECTIVE("cost_effective")
AGENTIC("agentic")
Optional<String> version

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.

Optional<String> configurationId

Saved configuration ID

Optional<List<WebhookConfiguration>> webhookConfigurations

Outbound webhook endpoints to notify on job status changes

Optional<List<WebhookEvent>> webhookEvents

Events to subscribe to (e.g. ‘parse.success’, ‘extract.error’). If null, all events are delivered.

One of the following:
EXTRACT_PENDING("extract.pending")
EXTRACT_SUCCESS("extract.success")
EXTRACT_ERROR("extract.error")
EXTRACT_PARTIAL_SUCCESS("extract.partial_success")
EXTRACT_CANCELLED("extract.cancelled")
PARSE_PENDING("parse.pending")
PARSE_RUNNING("parse.running")
PARSE_SUCCESS("parse.success")
PARSE_ERROR("parse.error")
PARSE_PARTIAL_SUCCESS("parse.partial_success")
PARSE_CANCELLED("parse.cancelled")
CLASSIFY_PENDING("classify.pending")
CLASSIFY_RUNNING("classify.running")
CLASSIFY_SUCCESS("classify.success")
CLASSIFY_ERROR("classify.error")
CLASSIFY_PARTIAL_SUCCESS("classify.partial_success")
CLASSIFY_CANCELLED("classify.cancelled")
SHEETS_PENDING("sheets.pending")
SHEETS_SUCCESS("sheets.success")
SHEETS_ERROR("sheets.error")
SHEETS_PARTIAL_SUCCESS("sheets.partial_success")
SHEETS_CANCELLED("sheets.cancelled")
UNMAPPED_EVENT("unmapped_event")
Optional<WebhookHeaders> webhookHeaders

Custom HTTP headers sent with each webhook request (e.g. auth tokens)

Optional<String> webhookOutputFormat

Response format sent to the webhook: ‘string’ (default) or ‘json’

Optional<String> webhookUrl

URL to receive webhook POST notifications

class ExtractV2JobQueryResponse:

Paginated list of extraction jobs.

List<ExtractV2Job> items

The list of items.

String id

Unique job identifier (job_id)

LocalDateTime createdAt

Creation timestamp

formatdate-time
String fileInput

File ID or parse job ID that was extracted

String projectId

Project this job belongs to

String status

Current job status.

  • PENDING — queued, not yet started
  • RUNNING — actively processing
  • COMPLETED — finished successfully
  • FAILED — terminated with an error
  • CANCELLED — cancelled by user
LocalDateTime updatedAt

Last update timestamp

formatdate-time
Optional<ExtractConfiguration> configuration

Extract configuration combining parse and extract settings.

DataSchema dataSchema

JSON Schema defining the fields to extract. Validate with the /schema/validate endpoint first.

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<Boolean> citeSources

Include citations in results

Optional<Boolean> confidenceScores

Include confidence scores in results

Optional<ExtractionTarget> extractionTarget

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

One of the following:
PER_DOC("per_doc")
PER_PAGE("per_page")
PER_TABLE_ROW("per_table_row")
Optional<Long> maxPages

Maximum number of pages to process. Omit for no limit.

minimum1
Optional<String> parseConfigId

Saved parse configuration ID to control how the document is parsed before extraction

Optional<String> parseTier

Parse tier to use before extraction. Defaults to the extract tier if not specified.

Optional<String> systemPrompt

Custom system prompt to guide extraction behavior

Optional<String> targetPages

Comma-separated page numbers or ranges to process (1-based). Omit to process all pages.

Optional<Tier> tier

Extract tier: cost_effective (5 credits/page) or agentic (15 credits/page)

One of the following:
COST_EFFECTIVE("cost_effective")
AGENTIC("agentic")
Optional<String> version

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.

Optional<String> configurationId

Saved extract configuration ID used for this job, if any

Optional<String> errorMessage

Error details when status is FAILED

Optional<ExtractJobMetadata> extractMetadata

Extraction metadata.

Optional<ExtractedFieldMetadata> fieldMetadata

Metadata for extracted fields including document, page, and row level info.

Optional<DocumentMetadata> documentMetadata

Per-field metadata keyed by field name from your schema. Scalar fields (e.g. vendor) map to a FieldMetadataEntry with citation and confidence. Array fields (e.g. items) map to a list where each element contains per-sub-field FieldMetadataEntry objects, indexed by array position. Nested objects contain sub-field entries recursively.

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<List<PageMetadata>> pageMetadata

Per-page metadata when extraction_target is per_page

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<List<RowMetadata>> rowMetadata

Per-row metadata when extraction_target is per_table_row

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<String> parseJobId

Reference to the ParseJob ID used for parsing

Optional<String> parseTier

Parse tier used for parsing the document

Optional<ExtractResult> extractResult

Extracted data conforming to the data_schema. Returns a single object for per_doc, or an array for per_page / per_table_row.

One of the following:
class UnionMember0:
class InnerUnionMember0:
List<JsonValue>
String
double
boolean
List<UnnamedSchemaWithArrayParent0>
One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<Metadata> metadata

Job-level metadata.

Optional<ExtractJobUsage> usage

Extraction usage metrics.

Optional<Long> numPagesExtracted

Number of pages extracted

Optional<String> nextPageToken

A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

Optional<Long> totalSize

The total number of items available. This is only populated when specifically requested. The value may be an estimate and can be used for display purposes only.

class ExtractV2SchemaGenerateRequest:

Request schema for generating an extraction schema.

Optional<DataSchema> dataSchema

Optional schema to validate, refine, or extend

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<String> fileId

Optional file ID to analyze for schema generation

Optional<String> name

Name for the generated configuration (auto-generated if omitted)

maxLength255
Optional<String> prompt

Natural language description of the data structure to extract

class ExtractV2SchemaValidateRequest:

Request schema for validating an extraction schema.

DataSchema dataSchema

JSON Schema to validate for use with extract jobs

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
class ExtractV2SchemaValidateResponse:

Response schema for schema validation.

DataSchema dataSchema

Validated JSON Schema, ready for use in extract jobs

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
class ExtractedFieldMetadata:

Metadata for extracted fields including document, page, and row level info.

Optional<DocumentMetadata> documentMetadata

Per-field metadata keyed by field name from your schema. Scalar fields (e.g. vendor) map to a FieldMetadataEntry with citation and confidence. Array fields (e.g. items) map to a list where each element contains per-sub-field FieldMetadataEntry objects, indexed by array position. Nested objects contain sub-field entries recursively.

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<List<PageMetadata>> pageMetadata

Per-page metadata when extraction_target is per_page

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean
Optional<List<RowMetadata>> rowMetadata

Per-row metadata when extraction_target is per_table_row

One of the following:
class UnionMember0:
List<JsonValue>
String
double
boolean