Skip to content

Using the Verify API

Upload a document, create a Verify job, retrieve its authenticity assessment, and inspect supporting evidence with the Verify Preview API from the SDKs or REST.

Preview

The Verify API runs an asynchronous authenticity review for a document or image. API access is limited during the Preview and the API may change.

To call the Verify API, you need:

  • A LlamaCloud API key with access to Verify
  • The ID of the LlamaCloud project that will own the job
  • A PDF, DOCX, PNG, JPEG, or WebP file to review

Set the API key and project ID as environment variables:

Terminal window
export LLAMA_CLOUD_API_KEY="llx-..."
export PROJECT_ID="YOUR_PROJECT_ID"

The SDKs expose Verify as client.alpha.verify, starting in Python and TypeScript 2.18.0, Java 1.9.0 and Go 1.10.0. The alpha namespace means these methods can change between minor releases. Each step below also shows the equivalent REST call.

Terminal window
pip install "llama-cloud>=2.18"
import os
import time
from llama_cloud import LlamaCloud
client = LlamaCloud(api_key=os.environ["LLAMA_CLOUD_API_KEY"])

Download a sample PDF with edited totals to review:

Terminal window
curl -fL -o document.pdf https://cloud.llamaindex.ai/assets/demos/verify/overrun-totals-fraud.pdf

Upload the document with the Files API:

file_obj = client.files.create(file="document.pdf", purpose="user_data")
file_id = file_obj.id

Save the file’s id as FILE_ID.

Create a Verify job for the uploaded file:

job = client.alpha.verify.create(
file_input=file_id,
configuration={"tier": "agentic"},
)
print(job.id, job.status)

The response includes the Verify job id and its initial status. Save the id as JOB_ID.

The request body accepts:

Field Description
file_input Required. The ID of the uploaded file to review. Files are currently the only supported input, and the job’s document_input_type always reflects a file input.
configuration Optional review configuration; defaults apply when omitted.
transaction_id Optional idempotency key, scoped to the project. Reusing a key returns the original job; the new request body is ignored.
webhook_configurations Optional list of outbound webhook endpoints to notify on job status changes. Verify jobs send verify.* events; see Webhooks for the event list and payload.
webhook_configuration_ids Optional list of up to 4 saved webhook configuration IDs to notify for this job. See Reusing a saved configuration.

The configuration object accepts:

Field Description
tier fast for a quick initial screen or agentic for a more comprehensive review. The default is agentic. The fast tier is designed for scans and born-digital documents; photographed documents, such as phone captures, should use the agentic tier for reliable results.
target_pages Optional comma-separated, 1-based PDF page numbers or ranges, such as 1,3,5-7. Omit it to review every page. This field is ignored for other file types.

Verify jobs move through PENDING and RUNNING before reaching COMPLETED, FAILED, or CANCELLED. Poll the job until it leaves those states, asking for the result with expand=result:

job = client.alpha.verify.get(job.id, expand=["result"])
while job.status in ("PENDING", "RUNNING"):
time.sleep(5)
job = client.alpha.verify.get(job.id, expand=["result"])
if job.status == "COMPLETED" and job.result:
print(job.result.verdict, job.result.overall_score)

When the status is COMPLETED, the result object includes:

Field Description
verdict The overall authenticity assessment.
overall_score The document’s doctoring likelihood from 0 to 1.
confidence How strongly the available evidence supports the verdict, from 0 to 1.
tampering_score Likelihood that a real document was edited locally, from 0 to 1.
synthetic_score Likelihood that the document was fabricated as a whole, from 0 to 1.
reasoning A plain-language explanation of the verdict.
composite_scores Scores for the different authenticity questions that applied to the document.
suspect_regions Ranked document areas that contributed to the assessment, when findings can be localized.

See Interpreting Verify findings for guidance on using these fields in a review workflow.

After a job completes, retrieve the detailed findings behind the result:

details = client.alpha.verify.get_details(job.id)
for heatmap in details.heatmaps or []:
print(heatmap.page, heatmap.kind, heatmap.url, heatmap.expires_at)

The details include supporting evidence, grouped scores, localized regions, visual overlays, and checks that could not run. A check listed as unavailable did not produce a clean result; it did not run successfully for that file.

Each entry in evidence describes one finding: the tool that produced it, its signal family, a machine-readable code, a human-readable detail, a score, and hard, which is true when the finding is conclusive on its own. metadata holds the raw values from that tool. Its keys vary by tool, so treat it as supporting detail for display or audit rather than a fixed shape.

The page field on regions, heatmaps, page_dimensions, and suspect_regions counts from 0: the first page of a PDF, or a standalone image, is page 0. target_pages counts from 1, so a job whose configuration sets target_pages to "3" reports those regions on page 2. Page numbers inside metadata or a detail message come from the individual tool and can count from 1.

Each localized region carries a review field with the reviewer’s verdict on that candidate: confirmed, dismissed, or unsure, or an empty string when the region was not individually reviewed. A review_note explains the verdict. Dismissed candidates are excluded from the curated suspect_regions list in the job result but remain visible here.

Visual overlays are returned as presigned URLs that expire about an hour after the response is generated; each overlay’s expires_at gives the exact time. Treat them as temporary download links: if you need overlays for an audit trail or later review, download the image bytes and store them yourself. Do not persist the URLs — a stored URL will stop working. Re-requesting the details endpoint issues fresh URLs for as long as the job is retained.

Action Method and path
Create a job POST /api/alpha/verify
Retrieve a job GET /api/alpha/verify/{job_id}
Retrieve supporting evidence GET /api/alpha/verify/{job_id}/details
List jobs GET /api/alpha/verify
Cancel a running job POST /api/alpha/verify/{job_id}/cancel

project_id selects the project; without it, requests use the API key’s project. List requests can be filtered by status, job ID, or creation time and use page_size and page_token for pagination.

List the jobs that are still running, and cancel one by ID. Only PENDING and RUNNING jobs can be cancelled:

for listed in client.alpha.verify.list(status="RUNNING"):
print(listed.id, listed.file_input)
client.alpha.verify.cancel("JOB_ID")

Creating and cancelling a job need write access to the project. A user or API key with read-only access gets 403 Forbidden from those two requests and can still retrieve, list, and inspect jobs.

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/