Skip to content

Migration Guide: Extract v1 to v2

Migrate from Extract v1 to v2 across UI, SDK, and REST API with endpoint and parameter mappings.

You only need this page if you already have Extract v1 integrations. If you are starting fresh, use the v2 Overview and SDK guide.

Extract v2 keeps the same core idea (schema-driven extraction) but changes how you configure and run jobs:

  • v1 centered on long-lived Extraction Agents and job runs tied to extraction_agent_id.
  • v2 centers on Extraction Configurations (saved or inline) and jobs created directly with file_input + configuration.
  • v2 also accepts a Parse job ID (pjb-...) as input, so you can parse once and extract many times.
  • Replace v1 agent/job endpoints with v2 extract endpoints.
  • Replace extraction_agent_id + file_id with file_input and either configuration_id or inline configuration.
  • Replace v1 config.extraction_mode values (FAST, BALANCED, MULTIMODAL, PREMIUM) with v2 configuration.tier (cost_effective, agentic) plus optional parse_tier.
  • Update status handling: v1 SUCCESS/ERROR/PARTIAL_SUCCESS becomes v2 COMPLETED/FAILED.
  • If you currently manage agents, migrate to saved product configurations (product_type=extract_v2).
  • Update SDK code from client.extraction.* patterns to client.extract.* patterns.
Extract v1 Extract v2 What changed
Extraction Agent Extraction Configuration Agent CRUD replaced by reusable configuration objects
extraction_agent_id configuration_id (saved) or configuration (inline) v2 job request always specifies config source
file_id file_input v2 accepts file ID (dfl-...) or parse job ID (pjb-...)
config.extraction_mode configuration.tier (+ optional parse_tier) v2 separates extract and parse choices
/jobs/{id}/result GET /api/v2/extract/{id} v2 returns extract_result on job resource
v1 v2
POST /api/v1/extraction/jobs POST /api/v2/extract?project_id=...
GET /api/v1/extraction/jobs/{job_id} GET /api/v2/extract/{job_id}?project_id=...
GET /api/v1/extraction/jobs/{job_id}/result GET /api/v2/extract/{job_id}?project_id=...
No equivalent cancel endpoint POST /api/v2/extract/{job_id}/cancel?project_id=...
v1 v2
POST /api/v1/extraction/extraction-agents POST /api/v1/beta/configurations?project_id=... with product_type=extract_v2
GET /api/v1/extraction/extraction-agents GET /api/v1/beta/configurations?project_id=...&product_type=extract_v2
POST /api/v1/extraction/extraction-agents/schema/validation POST /api/v2/extract/schema/validation
POST /api/v1/extraction/extraction-agents/schema/generate POST /api/v2/extract/schema/generate?project_id=...
v1 (POST /api/v1/extraction/jobs) v2 (POST /api/v2/extract)
extraction_agent_id configuration_id or configuration
file_id file_input
data_schema_override include schema in inline configuration.data_schema
config_override inline configuration fields
v1 status v2 status
PENDING PENDING or RUNNING
SUCCESS COMPLETED
PARTIAL_SUCCESS COMPLETED (inspect result/metadata for details)
ERROR FAILED
CANCELLED CANCELLED

v1 used extraction_mode; v2 uses extract and parse tiers explicitly.

v1 extraction_mode v2 configuration.tier Typical v2 parse choice
FAST cost_effective parse_tier: "cost_effective"
BALANCED cost_effective (or agentic for quality) parse_tier: "agentic"
MULTIMODAL agentic parse_tier: "agentic"
PREMIUM agentic parse_tier: "agentic_plus"
from llama_cloud import LlamaCloud
client = LlamaCloud(api_key="...")
agent = client.extraction.extraction_agents.create(
name="invoice-agent",
data_schema=schema,
config={"extraction_mode": "BALANCED"},
)
job = client.extraction.jobs.create(
extraction_agent_id=agent.id,
file_id=file_id,
)

Download a sample invoice:

Terminal window
curl -fL -o invoice.pdf https://media.githubusercontent.com/media/run-llama/llama-datasets/main/llama_agents/invoice-contracts/invoice-2-1.pdf
from llama_cloud import LlamaCloud
client = LlamaCloud() # reads LLAMA_CLOUD_API_KEY from the environment
schema = {
"type": "object",
"properties": {
"invoice_number": {"type": "string"},
"total_amount": {"type": "number"},
},
}
file = client.files.create(file="./invoice.pdf", purpose="extract")
job = client.extract.create(
file_input=file.id, # or parse_job.id
configuration={
"data_schema": schema,
"tier": "agentic",
"parse_tier": "agentic",
"extraction_target": "per_doc",
"cite_sources": True,
},
)
job = client.extract.wait_for_completion(job.id)
print(job.extract_result)

Go, Java, and the CLI never shipped an Extract v1 surface, so there is no v1 code to migrate in those SDKs — start from the v2 pattern in the Extract SDK guide.

In the v2 UI, you work with Extraction Configurations rather than Extraction Agents.

  • v1 users who need the legacy UI can set Extract API to v1 under Settings → Preferences. The preference is saved in that browser only, and only organizations with legacy v1 access see it.
  • For v2 migration, recreate or import your schemas as configurations, then run jobs from those configurations.
  • If you manage many recurring pipelines, save configs and reference them by configuration_id.
  1. Pick one existing v1 agent and port its schema/settings to a v2 configuration.
  2. Run the same sample files in v1 and v2; compare extracted fields and metadata.
  3. Update client code to treat job states as PENDING/RUNNING/COMPLETED/FAILED/CANCELLED.
  4. Migrate batch flows to pass configuration_id in v2 job creation.
  5. After validation, switch traffic to /api/v2/extract and keep v1 as fallback during rollout.
Note for AI agents: this documentation is built for programmatic access. - Overview of all docs: https://developers.llamaindex.ai/llms.txt - Any page is available as raw Markdown by appending index.md to its URL — e.g. https://developers.llamaindex.ai/llamaparse/parse/getting_started/index.md - Agent-friendly REST search APIs live under https://developers.llamaindex.ai/api/ — search (BM25 full-text), grep (regex), read (fetch a page), and list (browse the doc tree). See https://developers.llamaindex.ai/llms.txt for parameters. - A hosted documentation MCP server is available at https://developers.llamaindex.ai/mcp. If you support MCP, you can ask the user to install it for browsing these docs directly (an alternative to the REST API). Setup: https://developers.llamaindex.ai/for-agents/mcp/ - Other LlamaIndex tooling for agents — the LlamaParse Platform MCP server, agent skills and plugins, and the n8n node — is mapped at https://developers.llamaindex.ai/for-agents/