Index R2 File

Index a single file from a Cloudflare R2 bucket into a collection. Returns a job_id for tracking progress.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

X-Organization-IDstring
API Key authentication via header

Path parameters

collection_namestringRequired

Request

This endpoint expects an object.
bucket_namestringRequired
Name of the R2 bucket
file_uristringRequired

R2 URI format: r2://bucket-name/path/to/file.pdf

account_idstringRequired

Cloudflare account ID (found in your R2 dashboard URL)

access_key_idstringRequired
R2 S3 API token Access Key ID
secret_access_keystringRequired
R2 S3 API token Secret Access Key
processing_typeenumRequired

Document processing type. ‘advanced’ uses agentic OCR with AI-enhanced extraction for complex layouts, tables, figures, charts, and documents containing images. ‘basic’ provides reliable OCR optimized for general document indexing and high-volume processing.

Allowed values:
jurisdictionenumOptionalDefaults to default

R2 jurisdiction. ‘default’ for global, ‘eu’ for EU-only storage, ‘fedramp’ for FedRAMP-compliant storage.

Allowed values:
custom_metadatamap from strings to anyOptional

Custom metadata to attach to all chunks from this file. Keys must be strings. Values: str, int, float, bool, or array of strings.

Response

Indexing Job Started
job_idstring
statusenum
Allowed values: