Index GCS File

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

Authentication

AuthorizationBearer
Bearer token authentication using API key

Path parameters

collection_namestringRequired

Headers

X-Organization-IDstringOptional

Request

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

GCS URI format: gs://bucket-name/path/to/file.pdf

service_account_jsonstringRequired
GCP service account JSON key with read access to the bucket
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:
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.

parsing_scriptstringOptional

Relative path to a JavaScript parsing script for JSON files (e.g. ‘research/paper-parser’). When provided, .json files are processed through a sandboxed V8 isolate that executes the script to extract text and metadata. Without this parameter, .json files are indexed as raw text. Scripts are org-scoped and managed in the Parser Studio.

skip_existingbooleanOptionalDefaults to true

When true, files already indexed in the collection are skipped and will not be re-indexed with incoming changes. When false, all incoming files are indexed regardless of whether they already exist.

overwrite_existingbooleanOptionalDefaults to false

When true, files that already exist in the collection will be deleted and re-indexed with the latest changes. Requires skip_existing=false. Setting both to true returns a 400 error.

Response

Indexing Job Started
job_idstring
statusenum
Allowed values: