Skip to content

List Extract Jobs

client.extract.list(ExtractListParams { configuration_id, document_input_type, document_input_value, 5 more } query?, RequestOptionsoptions?): PaginatedCursor<ExtractV2Job { id, created_at, parameters, 9 more } >
GET/api/v2/extract

List extraction jobs with optional filtering and pagination.

ParametersExpand Collapse
query: ExtractListParams { configuration_id, document_input_type, document_input_value, 5 more }
configuration_id?: string | null

Filter by configuration ID

document_input_type?: string | null

Filter by document input type (file_id or parse_job_id)

document_input_value?: string | null

Filter by document input value

organization_id?: string | null
page_size?: number | null

Number of items per page

page_token?: string | null

Token for pagination

project_id?: string | null
status?: "PENDING" | "THROTTLED" | "RUNNING" | 3 more | null

Filter by status

Accepts one of the following:
"PENDING"
"THROTTLED"
"RUNNING"
"COMPLETED"
"FAILED"
"CANCELLED"
ReturnsExpand Collapse
ExtractV2Job { id, created_at, parameters, 9 more }

An extraction job.

id: string

Unique job identifier (job_id)

created_at: string

Creation timestamp

formatdate-time
parameters: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>

Job configuration parameters (includes parse_config_id, extract_options)

Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
project_id: string

Project this job belongs to

status: "PENDING" | "THROTTLED" | "RUNNING" | 3 more

Current status of the job

Accepts one of the following:
"PENDING"
"THROTTLED"
"RUNNING"
"COMPLETED"
"FAILED"
"CANCELLED"
type: "url" | "file_id" | "parse_job_id"

Type of document input.

Accepts one of the following:
"url"
"file_id"
"parse_job_id"
updated_at: string

Last update timestamp

formatdate-time
value: string

Document identifier (URL, file ID, or parse job ID).

configuration_id?: string | null

Extract configuration ID (ProductConfiguration) used for this job (if any)

error_message?: string | null

Error message if failed

extract_metadata?: ExtractJobMetadata { field_metadata, parse_job_id, parse_tier, usage } | null

Extraction metadata.

field_metadata?: ExtractedFieldMetadata { document_metadata, page_metadata, row_metadata } | null

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

document_metadata?: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null> | null
Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
page_metadata?: Array<Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>> | null
Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
row_metadata?: Array<Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>> | null
Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
parse_job_id?: string | null

Reference to the ParseJob ID used for parsing

parse_tier?: string | null

Parse tier used for parsing the document

usage?: ExtractJobUsage { num_document_tokens, num_output_tokens, num_pages_extracted } | null

Extraction usage metrics.

num_document_tokens?: number | null

Number of document tokens

num_output_tokens?: number | null

Number of output tokens

num_pages_extracted?: number | null

Number of pages extracted

extract_result?: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null> | Array<Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>> | null

Extracted data (object or array depending on extraction_target)

Accepts one of the following:
Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>
Record<string, unknown>
Array<unknown>
string
number
boolean
Array<Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>>
Record<string, unknown>
Array<unknown>
string
number
boolean

List Extract Jobs

import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const extractV2Job of client.extract.list()) {
  console.log(extractV2Job.id);
}
{
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "parameters": {
        "foo": {
          "foo": "bar"
        }
      },
      "project_id": "project_id",
      "status": "PENDING",
      "type": "url",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "value": "value",
      "configuration_id": "configuration_id",
      "error_message": "error_message",
      "extract_metadata": {
        "field_metadata": {
          "document_metadata": {
            "foo": {
              "foo": "bar"
            }
          },
          "page_metadata": [
            {
              "foo": {
                "foo": "bar"
              }
            }
          ],
          "row_metadata": [
            {
              "foo": {
                "foo": "bar"
              }
            }
          ]
        },
        "parse_job_id": "parse_job_id",
        "parse_tier": "parse_tier",
        "usage": {
          "num_document_tokens": 0,
          "num_output_tokens": 0,
          "num_pages_extracted": 0
        }
      },
      "extract_result": {
        "foo": {
          "foo": "bar"
        }
      }
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
Returns Examples
{
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "parameters": {
        "foo": {
          "foo": "bar"
        }
      },
      "project_id": "project_id",
      "status": "PENDING",
      "type": "url",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "value": "value",
      "configuration_id": "configuration_id",
      "error_message": "error_message",
      "extract_metadata": {
        "field_metadata": {
          "document_metadata": {
            "foo": {
              "foo": "bar"
            }
          },
          "page_metadata": [
            {
              "foo": {
                "foo": "bar"
              }
            }
          ],
          "row_metadata": [
            {
              "foo": {
                "foo": "bar"
              }
            }
          ]
        },
        "parse_job_id": "parse_job_id",
        "parse_tier": "parse_tier",
        "usage": {
          "num_document_tokens": 0,
          "num_output_tokens": 0,
          "num_pages_extracted": 0
        }
      },
      "extract_result": {
        "foo": {
          "foo": "bar"
        }
      }
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}