Galon Cloud
Galon API v1

/search/indexes/{name}/documents

Base URL https://api.galon.ai/v1 · export GALON_API_BASE="https://api.galon.ai/v1"

POST /search/indexes/{name}/documents

Add or update documents

Add or replace up to 1,000 documents in an index, all or nothing. Use when loading or syncing the app's records into an index. Before: search_get_index (needs search query access) for the fields. Returns the task: indexed, unchanged and stale counts, and the receipt. Scope: search:write. Reuse the same idempotency_key on retry.

API key (Bearer), on the public API endpoint.

Parameters

NameInTypeDescription
namepathstring · requiredIndex name.
Idempotency-Keyheaderstring · required

Request body

application/json

FieldTypeDescription
documentsarray<object> · requiredThe documents. A document with an existing id replaces it.

Responses

StatusDescriptionBody
2XXSuccess: the JSON body the route returns (see the description for its fields).object
401Key missing or invalidError
4XXRefused: act on detail.code, then follow detail.next_action (404 not_found while the service is not open to the account).Error

Examples

curl

curl -X POST "$GALON_API_BASE/search/indexes/<name>/documents" \
  -H "Authorization: Bearer $GALON_API_KEY" \
  -H "Idempotency-Key: <unique-key>" \
  -H "Content-Type: application/json" \
  -d '{"documents": [{}]}'