# Extract

## Create Extract Job

`ExtractV2Job extract().create(ExtractCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/api/v2/extract`

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.

### Parameters

- `ExtractCreateParams params`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

  - `ExtractV2JobCreate extractV2JobCreate`

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

### Returns

- `class ExtractV2Job:`

  An extraction job.

  - `String id`

    Unique job identifier (job_id)

  - `LocalDateTime createdAt`

    Creation timestamp

  - `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

  - `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.

      - `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

      - `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.

    - `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)

      - `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.

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<List<PageMetadata>> pageMetadata`

        Per-page metadata when extraction_target is per_page

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<List<RowMetadata>> rowMetadata`

        Per-row metadata when extraction_target is per_table_row

        - `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.

    - `class UnionMember0:`

      - `class InnerUnionMember0:`

      - `List<JsonValue>`

      - `String`

      - `double`

      - `boolean`

    - `List<UnnamedSchemaWithArrayParent0>`

      - `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

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.extract.ExtractCreateParams;
import com.llamacloud_prod.api.models.extract.ExtractV2Job;
import com.llamacloud_prod.api.models.extract.ExtractV2JobCreate;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        ExtractV2JobCreate params = ExtractV2JobCreate.builder()
            .fileInput("dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
            .build();
        ExtractV2Job extractV2Job = client.extract().create(params);
    }
}
```

#### Response

```json
{
  "id": "ext-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "created_at": "2019-12-27T18:11:19.117Z",
  "file_input": "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "project_id": "prj-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "status": "COMPLETED",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "configuration": {
    "data_schema": {
      "foo": {
        "foo": "bar"
      }
    },
    "cite_sources": true,
    "confidence_scores": true,
    "extraction_target": "per_doc",
    "max_pages": 10,
    "parse_config_id": "cfg-11111111-2222-3333-4444-555555555555",
    "parse_tier": "fast",
    "system_prompt": "Extract all monetary values in USD. If a currency is not specified, assume USD.",
    "target_pages": "1,3,5-7",
    "tier": "cost_effective",
    "version": "latest"
  },
  "configuration_id": "cfg-11111111-2222-3333-4444-555555555555",
  "error_message": "error_message",
  "extract_metadata": {
    "field_metadata": {
      "document_metadata": {
        "items": [
          {
            "amount": {
              "citation": [
                {
                  "matching_text": "$10.00",
                  "page": 1
                }
              ],
              "confidence": 1
            },
            "description": {
              "citation": [
                {
                  "matching_text": "$10/month",
                  "page": 1
                }
              ],
              "confidence": 0.998
            }
          }
        ],
        "total": {
          "citation": "bar",
          "confidence": "bar"
        },
        "vendor": {
          "citation": "bar",
          "confidence": "bar",
          "extraction_confidence": "bar",
          "parsing_confidence": "bar"
        }
      },
      "page_metadata": [
        {
          "foo": {
            "foo": "bar"
          }
        }
      ],
      "row_metadata": [
        {
          "foo": {
            "foo": "bar"
          }
        }
      ]
    },
    "parse_job_id": "parse_job_id",
    "parse_tier": "parse_tier"
  },
  "extract_result": {
    "foo": {
      "foo": "bar"
    }
  },
  "metadata": {
    "usage": {
      "num_pages_extracted": 0
    }
  }
}
```

## List Extract Jobs

`ExtractListPage extract().list(ExtractListParamsparams = ExtractListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**get** `/api/v2/extract`

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.

### Parameters

- `ExtractListParams params`

  - `Optional<String> configurationId`

    Filter by configuration ID

  - `Optional<LocalDateTime> createdAtOnOrAfter`

    Include items created at or after this timestamp (inclusive)

  - `Optional<LocalDateTime> createdAtOnOrBefore`

    Include items created at or before this timestamp (inclusive)

  - `Optional<String> documentInputType`

    Filter by document input type (file_id or parse_job_id)

  - `Optional<String> documentInputValue`

    Deprecated: use file_input instead

  - `Optional<List<String>> expand`

    Additional fields to include: configuration, extract_metadata

  - `Optional<String> fileInput`

    Filter by file input value

  - `Optional<List<String>> jobIds`

    Filter by specific job IDs

  - `Optional<String> organizationId`

  - `Optional<Long> pageSize`

    Number of items per page

  - `Optional<String> pageToken`

    Token for pagination

  - `Optional<String> projectId`

  - `Optional<Status> status`

    Filter by status

    - `PENDING("PENDING")`

    - `THROTTLED("THROTTLED")`

    - `RUNNING("RUNNING")`

    - `COMPLETED("COMPLETED")`

    - `FAILED("FAILED")`

    - `CANCELLED("CANCELLED")`

### Returns

- `class ExtractV2Job:`

  An extraction job.

  - `String id`

    Unique job identifier (job_id)

  - `LocalDateTime createdAt`

    Creation timestamp

  - `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

  - `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.

      - `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

      - `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.

    - `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)

      - `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.

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<List<PageMetadata>> pageMetadata`

        Per-page metadata when extraction_target is per_page

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<List<RowMetadata>> rowMetadata`

        Per-row metadata when extraction_target is per_table_row

        - `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.

    - `class UnionMember0:`

      - `class InnerUnionMember0:`

      - `List<JsonValue>`

      - `String`

      - `double`

      - `boolean`

    - `List<UnnamedSchemaWithArrayParent0>`

      - `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

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.extract.ExtractListPage;
import com.llamacloud_prod.api.models.extract.ExtractListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        ExtractListPage page = client.extract().list();
    }
}
```

#### Response

```json
{
  "items": [
    {
      "id": "ext-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "created_at": "2019-12-27T18:11:19.117Z",
      "file_input": "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "project_id": "prj-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "status": "COMPLETED",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "configuration": {
        "data_schema": {
          "foo": {
            "foo": "bar"
          }
        },
        "cite_sources": true,
        "confidence_scores": true,
        "extraction_target": "per_doc",
        "max_pages": 10,
        "parse_config_id": "cfg-11111111-2222-3333-4444-555555555555",
        "parse_tier": "fast",
        "system_prompt": "Extract all monetary values in USD. If a currency is not specified, assume USD.",
        "target_pages": "1,3,5-7",
        "tier": "cost_effective",
        "version": "latest"
      },
      "configuration_id": "cfg-11111111-2222-3333-4444-555555555555",
      "error_message": "error_message",
      "extract_metadata": {
        "field_metadata": {
          "document_metadata": {
            "items": [
              {
                "amount": {
                  "citation": [
                    {
                      "matching_text": "$10.00",
                      "page": 1
                    }
                  ],
                  "confidence": 1
                },
                "description": {
                  "citation": [
                    {
                      "matching_text": "$10/month",
                      "page": 1
                    }
                  ],
                  "confidence": 0.998
                }
              }
            ],
            "total": {
              "citation": "bar",
              "confidence": "bar"
            },
            "vendor": {
              "citation": "bar",
              "confidence": "bar",
              "extraction_confidence": "bar",
              "parsing_confidence": "bar"
            }
          },
          "page_metadata": [
            {
              "foo": {
                "foo": "bar"
              }
            }
          ],
          "row_metadata": [
            {
              "foo": {
                "foo": "bar"
              }
            }
          ]
        },
        "parse_job_id": "parse_job_id",
        "parse_tier": "parse_tier"
      },
      "extract_result": {
        "foo": {
          "foo": "bar"
        }
      },
      "metadata": {
        "usage": {
          "num_pages_extracted": 0
        }
      }
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
```

## Get Extract Job

`ExtractV2Job extract().get(ExtractGetParamsparams = ExtractGetParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**get** `/api/v2/extract/{job_id}`

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.

### Parameters

- `ExtractGetParams params`

  - `Optional<String> jobId`

  - `Optional<List<String>> expand`

    Additional fields to include: configuration, extract_metadata

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

### Returns

- `class ExtractV2Job:`

  An extraction job.

  - `String id`

    Unique job identifier (job_id)

  - `LocalDateTime createdAt`

    Creation timestamp

  - `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

  - `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.

      - `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

      - `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.

    - `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)

      - `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.

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<List<PageMetadata>> pageMetadata`

        Per-page metadata when extraction_target is per_page

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<List<RowMetadata>> rowMetadata`

        Per-row metadata when extraction_target is per_table_row

        - `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.

    - `class UnionMember0:`

      - `class InnerUnionMember0:`

      - `List<JsonValue>`

      - `String`

      - `double`

      - `boolean`

    - `List<UnnamedSchemaWithArrayParent0>`

      - `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

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.extract.ExtractGetParams;
import com.llamacloud_prod.api.models.extract.ExtractV2Job;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        ExtractV2Job extractV2Job = client.extract().get("job_id");
    }
}
```

#### Response

```json
{
  "id": "ext-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "created_at": "2019-12-27T18:11:19.117Z",
  "file_input": "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "project_id": "prj-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "status": "COMPLETED",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "configuration": {
    "data_schema": {
      "foo": {
        "foo": "bar"
      }
    },
    "cite_sources": true,
    "confidence_scores": true,
    "extraction_target": "per_doc",
    "max_pages": 10,
    "parse_config_id": "cfg-11111111-2222-3333-4444-555555555555",
    "parse_tier": "fast",
    "system_prompt": "Extract all monetary values in USD. If a currency is not specified, assume USD.",
    "target_pages": "1,3,5-7",
    "tier": "cost_effective",
    "version": "latest"
  },
  "configuration_id": "cfg-11111111-2222-3333-4444-555555555555",
  "error_message": "error_message",
  "extract_metadata": {
    "field_metadata": {
      "document_metadata": {
        "items": [
          {
            "amount": {
              "citation": [
                {
                  "matching_text": "$10.00",
                  "page": 1
                }
              ],
              "confidence": 1
            },
            "description": {
              "citation": [
                {
                  "matching_text": "$10/month",
                  "page": 1
                }
              ],
              "confidence": 0.998
            }
          }
        ],
        "total": {
          "citation": "bar",
          "confidence": "bar"
        },
        "vendor": {
          "citation": "bar",
          "confidence": "bar",
          "extraction_confidence": "bar",
          "parsing_confidence": "bar"
        }
      },
      "page_metadata": [
        {
          "foo": {
            "foo": "bar"
          }
        }
      ],
      "row_metadata": [
        {
          "foo": {
            "foo": "bar"
          }
        }
      ]
    },
    "parse_job_id": "parse_job_id",
    "parse_tier": "parse_tier"
  },
  "extract_result": {
    "foo": {
      "foo": "bar"
    }
  },
  "metadata": {
    "usage": {
      "num_pages_extracted": 0
    }
  }
}
```

## Delete Extract Job

`JsonValue extract().delete(ExtractDeleteParamsparams = ExtractDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**delete** `/api/v2/extract/{job_id}`

Delete an extraction job and its results.

### Parameters

- `ExtractDeleteParams params`

  - `Optional<String> jobId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

### Returns

- `class ExtractDeleteResponse:`

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.extract.ExtractDeleteParams;
import com.llamacloud_prod.api.models.extract.ExtractDeleteResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        ExtractDeleteResponse extract = client.extract().delete("job_id");
    }
}
```

#### Response

```json
{}
```

## Validate Extraction Schema

`ExtractV2SchemaValidateResponse extract().validateSchema(ExtractValidateSchemaParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/api/v2/extract/schema/validation`

Validate a JSON schema for extraction.

### Parameters

- `ExtractValidateSchemaParams params`

  - `ExtractV2SchemaValidateRequest extractV2SchemaValidateRequest`

    Request schema for validating an extraction schema.

### Returns

- `class ExtractV2SchemaValidateResponse:`

  Response schema for schema validation.

  - `DataSchema dataSchema`

    Validated JSON Schema, ready for use in extract jobs

    - `class UnionMember0:`

    - `List<JsonValue>`

    - `String`

    - `double`

    - `boolean`

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.core.JsonValue;
import com.llamacloud_prod.api.models.extract.ExtractV2SchemaValidateRequest;
import com.llamacloud_prod.api.models.extract.ExtractV2SchemaValidateResponse;
import com.llamacloud_prod.api.models.extract.ExtractValidateSchemaParams;
import java.util.List;
import java.util.Map;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        ExtractV2SchemaValidateRequest params = ExtractV2SchemaValidateRequest.builder()
            .dataSchema(ExtractV2SchemaValidateRequest.DataSchema.builder()
                .putAdditionalProperty("properties", JsonValue.from(Map.of(
                  "vendor_name",
                  "bar",
                  "invoice_number",
                  "bar",
                  "total_amount",
                  "bar",
                  "line_items",
                  "bar"
                )))
                .putAdditionalProperty("required", JsonValue.from(List.of(
                  "vendor_name",
                  "invoice_number",
                  "total_amount"
                )))
                .putAdditionalProperty("type", JsonValue.from("object"))
                .build())
            .build();
        ExtractV2SchemaValidateResponse extractV2SchemaValidateResponse = client.extract().validateSchema(params);
    }
}
```

#### Response

```json
{
  "data_schema": {
    "foo": {
      "foo": "bar"
    }
  }
}
```

## Generate Extraction Schema

`ConfigurationCreate extract().generateSchema(ExtractGenerateSchemaParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/api/v2/extract/schema/generate`

Generate a JSON schema and return a product configuration request.

### Parameters

- `ExtractGenerateSchemaParams params`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

  - `ExtractV2SchemaGenerateRequest extractV2SchemaGenerateRequest`

    Request schema for generating an extraction schema.

### Returns

- `class ConfigurationCreate:`

  Request body for creating a product configuration.

  - `String name`

    Human-readable name for this configuration.

  - `Parameters parameters`

    Product-specific configuration parameters.

    - `class SplitV1Parameters:`

      Typed parameters for a *split v1* product configuration.

      - `List<SplitCategory> categories`

        Categories to split documents into.

        - `String name`

          Name of the category.

        - `Optional<String> description`

          Optional description of what content belongs in this category.

      - `JsonValue; productType "split_v1"constant`

        Product type.

        - `SPLIT_V1("split_v1")`

      - `Optional<SplittingStrategy> splittingStrategy`

        Strategy for splitting documents.

        - `Optional<AllowUncategorized> allowUncategorized`

          Controls handling of pages that don't match any category. 'include': pages can be grouped as 'uncategorized' and included in results. 'forbid': all pages must be assigned to a defined category. 'omit': pages can be classified as 'uncategorized' but are excluded from results.

          - `INCLUDE("include")`

          - `FORBID("forbid")`

          - `OMIT("omit")`

    - `class ExtractV2Parameters:`

      Typed parameters for an *extract v2* product configuration.

      - `DataSchema dataSchema`

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

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `JsonValue; productType "extract_v2"constant`

        Product type.

        - `EXTRACT_V2("extract_v2")`

      - `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

        - `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.

      - `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)

        - `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 ClassifyV2Parameters:`

      Typed parameters for a *classify v2* product configuration.

      - `JsonValue; productType "classify_v2"constant`

        Product type.

        - `CLASSIFY_V2("classify_v2")`

      - `List<Rule> rules`

        Classify rules to evaluate against the document (at least one required)

        - `String description`

          Natural language criteria for matching this rule

        - `String type`

          Document type to assign when rule matches

      - `Optional<Mode> mode`

        Classify execution mode

        - `FAST("FAST")`

      - `Optional<ParsingConfiguration> parsingConfiguration`

        Parsing configuration for classify jobs.

        - `Optional<String> lang`

          ISO 639-1 language code for the document

        - `Optional<Long> maxPages`

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

        - `Optional<String> targetPages`

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

    - `class ParseV2Parameters:`

      Configuration for LlamaParse v2 document parsing.

      Includes tier selection, processing options, output formatting,
      page targeting, and webhook delivery. Refer to the LlamaParse
      documentation for details on each field.

      - `JsonValue; productType "parse_v2"constant`

        Product type.

        - `PARSE_V2("parse_v2")`

      - `Tier tier`

        Parsing tier: 'fast' (rule-based, cheapest), 'cost_effective' (balanced), 'agentic' (AI-powered with custom prompts), or 'agentic_plus' (premium AI with highest accuracy)

        - `FAST("fast")`

        - `COST_EFFECTIVE("cost_effective")`

        - `AGENTIC("agentic")`

        - `AGENTIC_PLUS("agentic_plus")`

      - `Version version`

        Version for the selected tier. Use `latest`, or pin one of that tier's dated versions.

        Current `latest` by tier:

        - `fast`: `2025-12-11`
        - `cost_effective`: `2026-06-05`
        - `agentic`: `2026-06-04`
        - `agentic_plus`: `2026-06-04`

        Full list: `GET /api/v2/parse/versions`.

        - `LATEST("latest")`

        - `_2026_06_05("2026-06-05")`

        - `_2026_06_04("2026-06-04")`

        - `_2025_12_11("2025-12-11")`

      - `Optional<AgenticOptions> agenticOptions`

        Options for AI-powered parsing tiers (cost_effective, agentic, agentic_plus).

        These options customize how the AI processes and interprets document content.
        Only applicable when using non-fast tiers.

        - `Optional<String> customPrompt`

          Custom instructions for the AI parser. Use to guide extraction behavior, specify output formatting, or provide domain-specific context. Example: 'Extract financial tables with currency symbols. Format dates as YYYY-MM-DD.'

      - `Optional<String> clientName`

        Identifier for the client/application making the request. Used for analytics and debugging. Example: 'my-app-v2'

      - `Optional<CropBox> cropBox`

        Crop boundaries to process only a portion of each page. Values are ratios 0-1 from page edges

        - `Optional<Double> bottom`

          Bottom boundary as ratio (0-1). 0=top edge, 1=bottom edge. Content below this line is excluded

        - `Optional<Double> left`

          Left boundary as ratio (0-1). 0=left edge, 1=right edge. Content left of this line is excluded

        - `Optional<Double> right`

          Right boundary as ratio (0-1). 0=left edge, 1=right edge. Content right of this line is excluded

        - `Optional<Double> top`

          Top boundary as ratio (0-1). 0=top edge, 1=bottom edge. Content above this line is excluded

      - `Optional<Boolean> disableCache`

        Bypass result caching and force re-parsing. Use when document content may have changed or you need fresh results

      - `Optional<JsonValue> fastOptions`

        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.

      - `Optional<InputOptions> inputOptions`

        Format-specific options (HTML, PDF, spreadsheet, presentation). Applied based on detected input file type

        - `Optional<Html> html`

          HTML/web page parsing options (applies to .html, .htm files)

          - `Optional<Boolean> makeAllElementsVisible`

            Force all HTML elements to be visible by overriding CSS display/visibility properties. Useful for parsing pages with hidden content or collapsed sections

          - `Optional<Boolean> removeFixedElements`

            Remove fixed-position elements (headers, footers, floating buttons) that appear on every page render

          - `Optional<Boolean> removeNavigationElements`

            Remove navigation elements (nav bars, sidebars, menus) to focus on main content

        - `Optional<JsonValue> pdf`

          PDF-specific parsing options (applies to .pdf files)

        - `Optional<Presentation> presentation`

          Presentation parsing options (applies to .pptx, .ppt, .odp, .key files)

          - `Optional<Boolean> outOfBoundsContent`

            Extract content positioned outside the visible slide area. Some presentations have hidden notes or content that extends beyond slide boundaries

          - `Optional<Boolean> skipEmbeddedData`

            Skip extraction of embedded chart data tables. When true, only the visual representation of charts is captured, not the underlying data

        - `Optional<Spreadsheet> spreadsheet`

          Spreadsheet parsing options (applies to .xlsx, .xls, .csv, .ods files)

          - `Optional<Boolean> detectSubTablesInSheets`

            Detect and extract multiple tables within a single sheet. Useful when spreadsheets contain several data regions separated by blank rows/columns

          - `Optional<Boolean> forceFormulaComputationInSheets`

            Compute formula results instead of extracting formula text. Use when you need calculated values rather than formula definitions

          - `Optional<Boolean> includeHiddenSheets`

            Parse hidden sheets in addition to visible ones. By default, hidden sheets are skipped

      - `Optional<OutputOptions> outputOptions`

        Output formatting options for markdown, text, and extracted images

        - `Optional<List<String>> additionalOutputs`

          Optional additional output artifacts to save alongside the primary parse output. Each value opts in to generating and persisting one extra file; the empty list (default) saves none. The three accepted values are: 'stripped_md' — per-page markdown stripped of formatting (links, bold/italic, images, HTML), saved as JSON for full-text-search indexing; fetch via `expand=stripped_markdown_content_metadata`. 'concatenated_stripped_txt' — all stripped pages concatenated into a single plain-text file with `\n\n---\n\n` between pages, useful for feeding the document into search or embedding pipelines as one blob; fetch via `expand=concatenated_stripped_markdown_content_metadata`. 'word_bbox' — raw word-level bounding boxes (one JSON object per word, with page number and x/y/w/h coordinates) saved as JSONL, useful for highlighting or grounding extracted answers back to the source document; fetch via `expand=raw_words_content_metadata`.

        - `Optional<Boolean> extractPrintedPageNumber`

          Extract the printed page number as it appears in the document (e.g., 'Page 5 of 10', 'v', 'A-3'). Useful for referencing original page numbers

        - `Optional<List<GranularBbox>> granularBboxes`

          Bounding-box granularity levels to compute for the parse. 'word' computes one bounding box per detected word; 'line' computes one per text line; 'cell' computes one per table cell. Multiple levels can be requested. Empty list (default) disables granular bboxes — only item-level layout boxes are returned on the result. When set, the computed boxes are not inlined on the result items; they are written to a separate `grounded_items` sidecar (JSONL, one row per page) and exposed as `result_content_metadata.grounded_items` (a presigned download URL) on the parse result. Each row matches the `GroundedJsonItem` shape.

          - `CELL("cell")`

          - `LINE("line")`

          - `WORD("word")`

        - `Optional<List<ImagesToSave>> imagesToSave`

          Image categories to extract and save. Options: 'screenshot' (full page renders useful for visual QA), 'embedded' (images found within the document), 'layout' (cropped regions from layout detection like figures and diagrams). Empty list saves no images

          - `SCREENSHOT("screenshot")`

          - `EMBEDDED("embedded")`

          - `LAYOUT("layout")`

        - `Optional<Markdown> markdown`

          Markdown formatting options including table styles and link annotations

          - `Optional<Boolean> annotateLinks`

            Add link annotations to markdown output in the format [text](url). When false, only the link text is included

          - `Optional<Boolean> inlineImages`

            Embed images directly in markdown as base64 data URIs instead of extracting them as separate files. Useful for self-contained markdown output

          - `Optional<Tables> tables`

            Table formatting options including markdown vs HTML format and merging behavior

            - `Optional<Boolean> compactMarkdownTables`

              Remove extra whitespace padding in markdown table cells for more compact output

            - `Optional<String> markdownTableMultilineSeparator`

              Separator string for multiline cell content in markdown tables. Example: '<br>' to preserve line breaks, ' ' to join with spaces

            - `Optional<Boolean> mergeContinuedTables`

              Automatically merge tables that span multiple pages into a single table. The merged table appears on the first page with merged_from_pages metadata

            - `Optional<Boolean> outputTablesAsMarkdown`

              Output tables as markdown pipe tables instead of HTML <table> tags. Markdown tables are simpler but cannot represent complex structures like merged cells

        - `Optional<SpatialText> spatialText`

          Spatial text output options for preserving document layout structure

          - `Optional<Boolean> doNotUnrollColumns`

            Keep multi-column layouts intact instead of linearizing columns into sequential text. Automatically enabled for non-fast tiers

          - `Optional<Boolean> preserveLayoutAlignmentAcrossPages`

            Maintain consistent text column alignment across page boundaries. Automatically enabled for document-level parsing modes

          - `Optional<Boolean> preserveVerySmallText`

            Include text below the normal size threshold. Useful for footnotes, watermarks, or fine print that might otherwise be filtered out

        - `Optional<TablesAsSpreadsheet> tablesAsSpreadsheet`

          Options for exporting tables as XLSX spreadsheets

          - `Optional<Boolean> enable`

            Whether this option is enabled

          - `Optional<Boolean> guessSheetName`

            Automatically generate descriptive sheet names from table context (headers, surrounding text) instead of using generic names like 'Table_1'

      - `Optional<PageRanges> pageRanges`

        Page selection: limit total pages or specify exact pages to process

        - `Optional<Long> maxPages`

          Maximum number of pages to process. Pages are processed in order starting from page 1. If both max_pages and target_pages are set, target_pages takes precedence

        - `Optional<String> targetPages`

          Comma-separated list of specific pages to process using 1-based indexing. Supports individual pages and ranges. Examples: '1,3,5' (pages 1, 3, 5), '1-5' (pages 1 through 5 inclusive), '1,3,5-8,10' (pages 1, 3, 5-8, and 10). Pages are sorted and deduplicated automatically. Duplicate pages cause an error

      - `Optional<ProcessingControl> processingControl`

        Job execution controls including timeouts and failure thresholds

        - `Optional<JobFailureConditions> jobFailureConditions`

          Quality thresholds that determine when a job should fail vs complete with partial results

          - `Optional<Double> allowedPageFailureRatio`

            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%)

          - `Optional<Boolean> failOnBuggyFont`

            Fail the job if a problematic font is detected that may cause incorrect text extraction. Buggy fonts can produce garbled or missing characters

          - `Optional<Boolean> failOnImageExtractionError`

            Fail the entire job if any embedded image cannot be extracted. By default, image extraction errors are logged but don't fail the job

          - `Optional<Boolean> failOnImageOcrError`

            Fail the entire job if OCR fails on any image. By default, OCR errors result in empty text for that image

          - `Optional<Boolean> failOnMarkdownReconstructionError`

            Fail the entire job if markdown cannot be reconstructed for any page. By default, failed pages use fallback text extraction

        - `Optional<Timeouts> timeouts`

          Timeout settings for job execution. Increase for large or complex documents

          - `Optional<Long> baseInSeconds`

            Base timeout for the job in seconds (max 7200 = 2 hours). This is the minimum time allowed regardless of document size

          - `Optional<Long> extraTimePerPageInSeconds`

            Additional timeout per page in seconds (max 300 = 5 minutes). Total timeout = base + (this value × page count)

      - `Optional<ProcessingOptions> processingOptions`

        Document processing options including OCR, table extraction, and chart parsing

        - `Optional<Boolean> aggressiveTableExtraction`

          Use aggressive heuristics to detect table boundaries, even without visible borders. Useful for documents with borderless or complex tables

        - `Optional<List<AutoModeConfiguration>> autoModeConfiguration`

          Conditional processing rules that apply different parsing options based on page content, document structure, or filename patterns. Each entry defines trigger conditions and the parsing configuration to apply when triggered

          - `ParsingConf parsingConf`

            Parsing configuration to apply when trigger conditions are met

            - `Optional<Boolean> adaptiveLongTable`

              Whether to use adaptive long table handling

            - `Optional<Boolean> aggressiveTableExtraction`

              Whether to use aggressive table extraction

            - `Optional<CropBox> cropBox`

              Crop box options for auto mode parsing configuration.

              - `Optional<Double> bottom`

                Bottom boundary of crop box as ratio (0-1)

              - `Optional<Double> left`

                Left boundary of crop box as ratio (0-1)

              - `Optional<Double> right`

                Right boundary of crop box as ratio (0-1)

              - `Optional<Double> top`

                Top boundary of crop box as ratio (0-1)

            - `Optional<String> customPrompt`

              Custom AI instructions for matched pages. Overrides the base custom_prompt

            - `Optional<Boolean> extractLayout`

              Whether to extract layout information

            - `Optional<Boolean> highResOcr`

              Whether to use high resolution OCR

            - `Optional<Ignore> ignore`

              Ignore options for auto mode parsing configuration.

              - `Optional<Boolean> ignoreDiagonalText`

                Whether to ignore diagonal text in the document

              - `Optional<Boolean> ignoreHiddenText`

                Whether to ignore hidden text in the document

            - `Optional<String> language`

              Primary language of the document

            - `Optional<Boolean> outlinedTableExtraction`

              Whether to use outlined table extraction

            - `Optional<Presentation> presentation`

              Presentation-specific options for auto mode parsing configuration.

              - `Optional<Boolean> outOfBoundsContent`

                Extract out of bounds content in presentation slides

              - `Optional<Boolean> skipEmbeddedData`

                Skip extraction of embedded data for charts in presentation slides

            - `Optional<SpatialText> spatialText`

              Spatial text options for auto mode parsing configuration.

              - `Optional<Boolean> doNotUnrollColumns`

                Keep column structure intact without unrolling

              - `Optional<Boolean> preserveLayoutAlignmentAcrossPages`

                Preserve text alignment across page boundaries

              - `Optional<Boolean> preserveVerySmallText`

                Include very small text in spatial output

            - `Optional<SpecializedChartParsing> specializedChartParsing`

              Enable specialized chart parsing with the specified mode

              - `AGENTIC_PLUS("agentic_plus")`

              - `AGENTIC("agentic")`

              - `EFFICIENT("efficient")`

            - `Optional<Tier> tier`

              Override the parsing tier for matched pages. Must be paired with version

              - `FAST("fast")`

              - `COST_EFFECTIVE("cost_effective")`

              - `AGENTIC("agentic")`

              - `AGENTIC_PLUS("agentic_plus")`

            - `Optional<Version> version`

              Version for the override tier. Required when `tier` is set. Use `latest`, or pin one of that tier's dated versions.

              Current `latest` by tier:

              - `fast`: `2025-12-11`
              - `cost_effective`: `2026-06-05`
              - `agentic`: `2026-06-04`
              - `agentic_plus`: `2026-06-04`

              Full list: `GET /api/v2/parse/versions`.

              - `LATEST("latest")`

              - `_2026_06_05("2026-06-05")`

              - `_2026_06_04("2026-06-04")`

              - `_2025_12_11("2025-12-11")`

          - `Optional<String> filenameMatchGlob`

            Single glob pattern to match against filename

          - `Optional<List<String>> filenameMatchGlobList`

            List of glob patterns to match against filename

          - `Optional<String> filenameRegexp`

            Regex pattern to match against filename

          - `Optional<String> filenameRegexpMode`

            Regex mode flags (e.g., 'i' for case-insensitive)

          - `Optional<Boolean> fullPageImageInPage`

            Trigger if page contains a full-page image (scanned page detection)

          - `Optional<FullPageImageInPageThreshold> fullPageImageInPageThreshold`

            Threshold for full page image detection (0.0-1.0, default 0.8)

            - `double`

            - `String`

          - `Optional<Boolean> imageInPage`

            Trigger if page contains non-screenshot images

          - `Optional<String> layoutElementInPage`

            Trigger if page contains this layout element type

          - `Optional<LayoutElementInPageConfidenceThreshold> layoutElementInPageConfidenceThreshold`

            Confidence threshold for layout element detection

            - `double`

            - `String`

          - `Optional<PageContainsAtLeastNCharts> pageContainsAtLeastNCharts`

            Trigger if page has more than N charts

            - `long`

            - `String`

          - `Optional<PageContainsAtLeastNImages> pageContainsAtLeastNImages`

            Trigger if page has more than N images

            - `long`

            - `String`

          - `Optional<PageContainsAtLeastNLayoutElements> pageContainsAtLeastNLayoutElements`

            Trigger if page has more than N layout elements

            - `long`

            - `String`

          - `Optional<PageContainsAtLeastNLines> pageContainsAtLeastNLines`

            Trigger if page has more than N lines

            - `long`

            - `String`

          - `Optional<PageContainsAtLeastNLinks> pageContainsAtLeastNLinks`

            Trigger if page has more than N links

            - `long`

            - `String`

          - `Optional<PageContainsAtLeastNNumbers> pageContainsAtLeastNNumbers`

            Trigger if page has more than N numeric words

            - `long`

            - `String`

          - `Optional<PageContainsAtLeastNPercentNumbers> pageContainsAtLeastNPercentNumbers`

            Trigger if page has more than N% numeric words

            - `long`

            - `String`

          - `Optional<PageContainsAtLeastNTables> pageContainsAtLeastNTables`

            Trigger if page has more than N tables

            - `long`

            - `String`

          - `Optional<PageContainsAtLeastNWords> pageContainsAtLeastNWords`

            Trigger if page has more than N words

            - `long`

            - `String`

          - `Optional<PageContainsAtMostNCharts> pageContainsAtMostNCharts`

            Trigger if page has fewer than N charts

            - `long`

            - `String`

          - `Optional<PageContainsAtMostNImages> pageContainsAtMostNImages`

            Trigger if page has fewer than N images

            - `long`

            - `String`

          - `Optional<PageContainsAtMostNLayoutElements> pageContainsAtMostNLayoutElements`

            Trigger if page has fewer than N layout elements

            - `long`

            - `String`

          - `Optional<PageContainsAtMostNLines> pageContainsAtMostNLines`

            Trigger if page has fewer than N lines

            - `long`

            - `String`

          - `Optional<PageContainsAtMostNLinks> pageContainsAtMostNLinks`

            Trigger if page has fewer than N links

            - `long`

            - `String`

          - `Optional<PageContainsAtMostNNumbers> pageContainsAtMostNNumbers`

            Trigger if page has fewer than N numeric words

            - `long`

            - `String`

          - `Optional<PageContainsAtMostNPercentNumbers> pageContainsAtMostNPercentNumbers`

            Trigger if page has fewer than N% numeric words

            - `long`

            - `String`

          - `Optional<PageContainsAtMostNTables> pageContainsAtMostNTables`

            Trigger if page has fewer than N tables

            - `long`

            - `String`

          - `Optional<PageContainsAtMostNWords> pageContainsAtMostNWords`

            Trigger if page has fewer than N words

            - `long`

            - `String`

          - `Optional<PageLongerThanNChars> pageLongerThanNChars`

            Trigger if page has more than N characters

            - `long`

            - `String`

          - `Optional<Boolean> pageMdError`

            Trigger on pages with markdown extraction errors

          - `Optional<PageShorterThanNChars> pageShorterThanNChars`

            Trigger if page has fewer than N characters

            - `long`

            - `String`

          - `Optional<String> regexpInPage`

            Regex pattern to match in page content

          - `Optional<String> regexpInPageMode`

            Regex mode flags for regexp_in_page

          - `Optional<Boolean> tableInPage`

            Trigger if page contains a table

          - `Optional<String> textInPage`

            Trigger if page text/markdown contains this string

          - `Optional<String> triggerMode`

            How to combine multiple trigger conditions: 'and' (all conditions must match, this is the default) or 'or' (any single condition can trigger)

        - `Optional<CostOptimizer> costOptimizer`

          Cost optimizer configuration for reducing parsing costs on simpler pages.

          When enabled, the parser analyzes each page and routes simpler pages to faster,
          cheaper processing while preserving quality for complex pages. Only works with
          'agentic' or 'agentic_plus' tiers.

          - `Optional<Boolean> enable`

            Enable cost-optimized parsing. Routes simpler pages to faster processing while complex pages use full AI analysis. May reduce speed on some documents. IMPORTANT: Only available with 'agentic' or 'agentic_plus' tiers

        - `Optional<Boolean> disableHeuristics`

          Disable automatic heuristics including outlined table extraction and adaptive long table handling. Use when heuristics produce incorrect results

        - `Optional<Ignore> ignore`

          Options for ignoring specific text types (diagonal, hidden, text in images)

          - `Optional<Boolean> ignoreDiagonalText`

            Skip text rotated at an angle (not horizontal/vertical). Useful for ignoring watermarks or decorative angled text

          - `Optional<Boolean> ignoreHiddenText`

            Skip text marked as hidden in the document structure. Some PDFs contain invisible text layers used for accessibility or search indexing

          - `Optional<Boolean> ignoreTextInImage`

            Skip OCR text extraction from embedded images. Use when images contain irrelevant text (watermarks, logos) that shouldn't be in the output

        - `Optional<OcrParameters> ocrParameters`

          OCR configuration including language detection settings

          - `Optional<List<ParsingLanguages>> languages`

            Languages to use for OCR text recognition. Specify multiple languages if document contains mixed-language content. Order matters - put primary language first. Example: ['en', 'es'] for English with Spanish

            - `AF("af")`

            - `AZ("az")`

            - `BS("bs")`

            - `CS("cs")`

            - `CY("cy")`

            - `DA("da")`

            - `DE("de")`

            - `EN("en")`

            - `ES("es")`

            - `ET("et")`

            - `FR("fr")`

            - `GA("ga")`

            - `HR("hr")`

            - `HU("hu")`

            - `ID("id")`

            - `IS("is")`

            - `IT("it")`

            - `KU("ku")`

            - `LA("la")`

            - `LT("lt")`

            - `LV("lv")`

            - `MI("mi")`

            - `MS("ms")`

            - `MT("mt")`

            - `NL("nl")`

            - `NO("no")`

            - `OC("oc")`

            - `PI("pi")`

            - `PL("pl")`

            - `PT("pt")`

            - `RO("ro")`

            - `RS_LATIN("rs_latin")`

            - `SK("sk")`

            - `SL("sl")`

            - `SQ("sq")`

            - `SV("sv")`

            - `SW("sw")`

            - `TL("tl")`

            - `TR("tr")`

            - `UZ("uz")`

            - `VI("vi")`

            - `AR("ar")`

            - `FA("fa")`

            - `UG("ug")`

            - `UR("ur")`

            - `BN("bn")`

            - `AS("as")`

            - `MNI("mni")`

            - `RU("ru")`

            - `RS_CYRILLIC("rs_cyrillic")`

            - `BE("be")`

            - `BG("bg")`

            - `UK("uk")`

            - `MN("mn")`

            - `ABQ("abq")`

            - `ADY("ady")`

            - `KBD("kbd")`

            - `AVA("ava")`

            - `DAR("dar")`

            - `INH("inh")`

            - `CHE("che")`

            - `LBE("lbe")`

            - `LEZ("lez")`

            - `TAB("tab")`

            - `TJK("tjk")`

            - `HI("hi")`

            - `MR("mr")`

            - `NE("ne")`

            - `BH("bh")`

            - `MAI("mai")`

            - `ANG("ang")`

            - `BHO("bho")`

            - `MAH("mah")`

            - `SCK("sck")`

            - `NEW("new")`

            - `GOM("gom")`

            - `SA("sa")`

            - `BGC("bgc")`

            - `TH("th")`

            - `CH_SIM("ch_sim")`

            - `CH_TRA("ch_tra")`

            - `JA("ja")`

            - `KO("ko")`

            - `TA("ta")`

            - `TE("te")`

            - `KN("kn")`

        - `Optional<SpecializedChartParsing> specializedChartParsing`

          Enable AI-powered chart analysis. Modes: 'efficient' (fast, lower cost), 'agentic' (balanced), 'agentic_plus' (highest accuracy). Automatically enables extract_layout and precise_bounding_box when set

          - `AGENTIC_PLUS("agentic_plus")`

          - `AGENTIC("agentic")`

          - `EFFICIENT("efficient")`

      - `Optional<List<WebhookConfiguration>> webhookConfigurations`

        Webhook endpoints for job status notifications. Multiple webhooks can be configured for different events or services

        - `Optional<List<String>> webhookEvents`

          Events that trigger this webhook. Options: 'parse.success' (job completed), 'parse.error' (job failed), 'parse.partial_success' (some pages failed), 'parse.pending', 'parse.running', 'parse.cancelled'. If not specified, webhook fires for all events

        - `Optional<WebhookHeaders> webhookHeaders`

          Custom HTTP headers to include in webhook requests. Use for authentication tokens or custom routing. Example: {'Authorization': 'Bearer xyz'}

        - `Optional<WebhookOutputFormat> webhookOutputFormat`

          Format of the webhook payload body. 'string' (default) sends the payload as a JSON-encoded string; 'json' sends it as a JSON object.

          - `STRING("string")`

          - `JSON("json")`

        - `Optional<String> webhookUrl`

          HTTPS URL to receive webhook POST requests. Must be publicly accessible

    - `class SpreadsheetV1:`

      Typed parameters for a *spreadsheet v1* product configuration.

      - `JsonValue; productType "spreadsheet_v1"constant`

        Product type.

        - `SPREADSHEET_V1("spreadsheet_v1")`

      - `Optional<String> extractionRange`

        A1 notation of the range to extract a single region from. If None, the entire sheet is used.

      - `Optional<Boolean> flattenHierarchicalTables`

        Return a flattened dataframe when a detected table is recognized as hierarchical.

      - `Optional<Boolean> generateAdditionalMetadata`

        Whether to generate additional metadata (title, description) for each extracted region.

      - `Optional<Boolean> includeHiddenCells`

        Whether to include hidden cells when extracting regions from the spreadsheet.

      - `Optional<List<String>> sheetNames`

        The names of the sheets to extract regions from. If empty, all sheets will be processed.

      - `Optional<String> specialization`

        Optional specialization mode for domain-specific extraction. Supported values: 'financial-standard', 'financial-enhanced', 'financial-precise'. Default None uses the general-purpose pipeline.

      - `Optional<TableMergeSensitivity> tableMergeSensitivity`

        Influences how likely similar-looking regions are merged into a single table. Useful for spreadsheets that either have sparse tables (strong merging) or many distinct tables close together (weak merging).

        - `STRONG("strong")`

        - `WEAK("weak")`

      - `Optional<Boolean> useExperimentalProcessing`

        Enables experimental processing. Accuracy may be impacted.

    - `class UntypedParameters:`

      Catch-all for configurations without a dedicated typed schema.

      Accepts arbitrary JSON fields alongside `product_type`.

      - `JsonValue; productType "unknown"constant`

        Product type.

        - `UNKNOWN("unknown")`

### Example

```java
package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.configurations.ConfigurationCreate;
import com.llamacloud_prod.api.models.extract.ExtractGenerateSchemaParams;
import com.llamacloud_prod.api.models.extract.ExtractV2SchemaGenerateRequest;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        ExtractV2SchemaGenerateRequest params = ExtractV2SchemaGenerateRequest.builder().build();
        ConfigurationCreate configurationCreate = client.extract().generateSchema(params);
    }
}
```

#### Response

```json
{
  "name": "x",
  "parameters": {
    "categories": [
      {
        "name": "x",
        "description": "x"
      }
    ],
    "product_type": "split_v1",
    "splitting_strategy": {
      "allow_uncategorized": "include"
    }
  }
}
```

## Domain Types

### Extract Configuration

- `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.

    - `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

    - `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.

  - `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)

    - `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.

### Extract Job Metadata

- `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.

      - `class UnionMember0:`

      - `List<JsonValue>`

      - `String`

      - `double`

      - `boolean`

    - `Optional<List<PageMetadata>> pageMetadata`

      Per-page metadata when extraction_target is per_page

      - `class UnionMember0:`

      - `List<JsonValue>`

      - `String`

      - `double`

      - `boolean`

    - `Optional<List<RowMetadata>> rowMetadata`

      Per-row metadata when extraction_target is per_table_row

      - `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

### Extract Job Usage

- `class ExtractJobUsage:`

  Extraction usage metrics.

  - `Optional<Long> numPagesExtracted`

    Number of pages extracted

### Extract V2 Job

- `class ExtractV2Job:`

  An extraction job.

  - `String id`

    Unique job identifier (job_id)

  - `LocalDateTime createdAt`

    Creation timestamp

  - `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

  - `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.

      - `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

      - `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.

    - `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)

      - `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.

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<List<PageMetadata>> pageMetadata`

        Per-page metadata when extraction_target is per_page

        - `class UnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `Optional<List<RowMetadata>> rowMetadata`

        Per-row metadata when extraction_target is per_table_row

        - `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.

    - `class UnionMember0:`

      - `class InnerUnionMember0:`

      - `List<JsonValue>`

      - `String`

      - `double`

      - `boolean`

    - `List<UnnamedSchemaWithArrayParent0>`

      - `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

### Extract V2 Job Create

- `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

  - `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.

      - `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

      - `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.

    - `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)

      - `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.

      - `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

### Extract V2 Job Query Response

- `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

    - `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

    - `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.

        - `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

        - `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.

      - `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)

        - `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.

          - `class UnionMember0:`

          - `List<JsonValue>`

          - `String`

          - `double`

          - `boolean`

        - `Optional<List<PageMetadata>> pageMetadata`

          Per-page metadata when extraction_target is per_page

          - `class UnionMember0:`

          - `List<JsonValue>`

          - `String`

          - `double`

          - `boolean`

        - `Optional<List<RowMetadata>> rowMetadata`

          Per-row metadata when extraction_target is per_table_row

          - `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.

      - `class UnionMember0:`

        - `class InnerUnionMember0:`

        - `List<JsonValue>`

        - `String`

        - `double`

        - `boolean`

      - `List<UnnamedSchemaWithArrayParent0>`

        - `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.

### Extract V2 Schema Generate Request

- `class ExtractV2SchemaGenerateRequest:`

  Request schema for generating an extraction schema.

  - `Optional<DataSchema> dataSchema`

    Optional schema to validate, refine, or extend

    - `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)

  - `Optional<String> prompt`

    Natural language description of the data structure to extract

### Extract V2 Schema Validate Request

- `class ExtractV2SchemaValidateRequest:`

  Request schema for validating an extraction schema.

  - `DataSchema dataSchema`

    JSON Schema to validate for use with extract jobs

    - `class UnionMember0:`

    - `List<JsonValue>`

    - `String`

    - `double`

    - `boolean`

### Extract V2 Schema Validate Response

- `class ExtractV2SchemaValidateResponse:`

  Response schema for schema validation.

  - `DataSchema dataSchema`

    Validated JSON Schema, ready for use in extract jobs

    - `class UnionMember0:`

    - `List<JsonValue>`

    - `String`

    - `double`

    - `boolean`

### Extracted Field Metadata

- `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.

    - `class UnionMember0:`

    - `List<JsonValue>`

    - `String`

    - `double`

    - `boolean`

  - `Optional<List<PageMetadata>> pageMetadata`

    Per-page metadata when extraction_target is per_page

    - `class UnionMember0:`

    - `List<JsonValue>`

    - `String`

    - `double`

    - `boolean`

  - `Optional<List<RowMetadata>> rowMetadata`

    Per-row metadata when extraction_target is per_table_row

    - `class UnionMember0:`

    - `List<JsonValue>`

    - `String`

    - `double`

    - `boolean`
