Skip to Content
Indexing

Indexing

These endpoints add documents to a docset and let you automate ingestion pipelines. A docset is indexed from a source — S3 (default), SharePoint, or Google Drive.

Index a docset

POST /index

FieldTypeRequiredDescription
docSetNamestringThe docset to index into.
sourceTypeenumS3 (default), SHAREPOINT, or GOOGLEDRIVE.
credentialsobjectSource credentials; shape depends on sourceType. Omit for S3 when the API is configured with bucket access.
indexOptionsobject{ targetIndexTypes?, forceReindex? }.
asyncbooleanQueue the job (true, default) or block until done (false).
accountNamestringOptional account/tenant label.
summaryModelstringLLM used for document summarization.
curl -X POST "$API_URL/index" \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "docSetName": "company-policies", "sourceType": "S3" }'

By default indexing runs asynchronously and returns a job id; poll /index/progress to follow it:

{ "message": "Indexing queued", "docSetName": "company-policies", "jobId": "..." }

For non-S3 sources, the API probes the source synchronously before accepting the request and returns 422 if it can’t connect or finds 0 files while documents already exist. Check the source first to surface credential problems early.

Check a source before indexing

POST /index/check-source

Validates connectivity and reports how many supported files the source has, without indexing anything.

curl -X POST "$API_URL/index/check-source" \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "docSetName": "company-policies", "sourceType": "S3" }'
{ "sourceFileCount": 12, "existingDocumentCount": 0, "message": "Found 12 supported files." }

Track progress

GET /index/progress/{docSetName}

Returns document status counts and an isIndexing flag. For SharePoint, you can scope progress to a folder by passing siteId, driveId, and folderPath together.

curl "$API_URL/index/progress/company-policies" \ -H "Authorization: Bearer $API_TOKEN"
{ "pendingCount": 3, "indexingCount": 1, "completedCount": 8, "errorCount": 0, "isIndexing": true }

Other indexing operations

OperationEndpoint
Cancel an in-progress runPOST /index/cancel/{docSetName}
Retry a single failed documentPOST /index/retry/{documentId}
Delete docsetsDELETE /index/docsets (body: { "docSetNames": [...] })

See the API Reference for full request and response shapes.