Galon Cloud
Galon API v1

/search/indexes

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

GET /search/indexes

List search indexes

List the search indexes of this project. Use when choosing an index to search or fill. Before: nothing. Returns data: the indexes with name, language, fields and document count. Scope: search:query.

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

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 GET "$GALON_API_BASE/search/indexes" \
  -H "Authorization: Bearer $GALON_API_KEY"

POST /search/indexes

Create a search index

Create a search index from typed fields, or from a first batch of documents (schema inferred). Use when the app needs search over its own records (products, articles, tickets). Before: search_list_indexes (needs search query access), to reuse an existing index. Returns the index with its idx_ id (replayed with the same idempotency_key and fields). Scope: search:write. Reuse the same idempotency_key on retry.

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

Parameters

NameInTypeDescription
Idempotency-Keyheaderstring · required

Request body

application/json

FieldTypeDescription
namestring · requiredIndex name: 1-63 chars, a-z 0-9 _ -, unique in the project.
language"en" | "fr" | "simple"Text language: en, fr, or simple (no stemming). Default en.
typo_tolerancebooleanMatch small typos by default. Default true.
fieldsarray<object>The fields: at least one searchable. Every document field must be declared here. Required unless `documents` is given.
documentsarray<object>A first batch of documents, without `fields`: the schema is inferred from them and the batch is written in the same call, all or nothing.

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" \
  -H "Authorization: Bearer $GALON_API_KEY" \
  -H "Idempotency-Key: <unique-key>" \
  -H "Content-Type: application/json" \
  -d '{"name": "string"}'