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 token authentication using API key
Path parameters
collection_name
Headers
X-Organization-ID
Request
This endpoint expects an object.
bucket_name
Name of the R2 bucket
file_uri
R2 URI format: r2://bucket-name/path/to/file.pdf
account_id
Cloudflare account ID (found in your R2 dashboard URL)
access_key_id
R2 S3 API token Access Key ID
secret_access_key
R2 S3 API token Secret Access Key
processing_type
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:
jurisdiction
R2 jurisdiction. ‘default’ for global, ‘eu’ for EU-only storage, ‘fedramp’ for FedRAMP-compliant storage.
Allowed values:
custom_metadata
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_id
status
Allowed values: