Skip to content

Create Extract Job

client.extract.create(ExtractCreateParams { type, value, organization_id, 4 more } params, RequestOptionsoptions?): ExtractV2Job { id, created_at, parameters, 9 more }
POST/api/v2/extract

Create a new extraction job.

Provide exactly one of configuration_id (saved configuration) or inline config.

ParametersExpand Collapse
params: ExtractCreateParams { type, value, organization_id, 4 more }
type: "url" | "file_id" | "parse_job_id"

Body param: Type of document input.

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

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

organization_id?: string | null

Query param

formatuuid
project_id?: string | null

Query param

formatuuid
config?: ExtractConfiguration { extract_options, parse_config_id, parse_tier } | null

Body param: Extraction configuration combining parse and extract settings.

extract_options: ExtractOptions { data_schema, cite_sources, confidence_scores, 4 more }

Extract-specific configuration options including the data schema

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

JSON schema used for extraction

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

Include citations in results

confidence_scores?: boolean

Include confidence scores in results

extract_version?: string

Extraction algorithm version to use (e.g., '2026-01-08', 'latest')

extraction_target?: "per_doc" | "per_page" | "per_table_row"

Extraction scope: per_doc, per_page, or per_table_row

Accepts one of the following:
"per_doc"
"per_page"
"per_table_row"
system_prompt?: string | null

Custom system prompt for extraction

tier?: "cost_effective" | "agentic"

Extraction tier: cost_effective (10 credits) or agentic (20 credits)

Accepts one of the following:
"cost_effective"
"agentic"
parse_config_id?: string | null

Parse config ID used for extraction

parse_tier?: string | null

Parse tier to use for extraction (e.g. fast, cost_effective, agentic).

configuration_id?: string | null

Body param: Saved extract configuration ID (mutually exclusive with config)

webhook_configurations?: Array<WebhookConfiguration { webhook_events, webhook_headers, webhook_output_format, webhook_url } > | null

Body param: The outbound webhook configurations

webhook_events?: Array<"extract.pending" | "extract.success" | "extract.error" | 14 more> | null

List of event names to subscribe to

Accepts one of the following:
"extract.pending"
"extract.success"
"extract.error"
"extract.partial_success"
"extract.cancelled"
"parse.pending"
"parse.running"
"parse.success"
"parse.error"
"parse.partial_success"
"parse.cancelled"
"classify.pending"
"classify.success"
"classify.error"
"classify.partial_success"
"classify.cancelled"
"unmapped_event"
webhook_headers?: Record<string, string> | null

Custom HTTP headers to include with webhook requests.

webhook_output_format?: string | null

The output format to use for the webhook. Defaults to string if none supplied. Currently supported values: string, json

webhook_url?: string | null

The URL to send webhook notifications to.

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

Create Extract Job

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
});

const extractV2Job = await client.extract.create({ type: 'url', value: 'value' });

console.log(extractV2Job.id);
{
  "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"
    }
  }
}
Returns Examples
{
  "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"
    }
  }
}