Indices

An index is a collection of documents with a defined schema. It specifies which fields are searchable, filterable, and sortable.

POST /v1/indices Admin key

Create a new index with a UID and field configuration.

Request body

ParameterTypeDescription
uid requiredstringUnique index identifier. Alphanumeric, dashes, and underscores only. 1–128 characters.
primary_key optionalstringField name used as the unique document identifier.
Default: "id"
display_name optionalstringHuman-readable name for the index.
Default: Same as uid
searchable_attributes optionalobject[]Fields for full-text search. Each has a name (string), optional weight (number, default 1.0), and optional language (string) to override the index default tokenizer for that field.
filterable_attributes optionalobject[]Fields for filtering and faceting. Each has a name (string) and optional field_type ("string", "number", or "boolean").
sortable_attributes optionalstring[]Field names that can be used for sorting search results.

Example

text
curl -X POST https://search.example.com/v1/indices \
  -H "Authorization: Bearer sk_search_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "uid": "products",
    "primary_key": "id",
    "searchable_attributes": [
      { "name": "title", "weight": 3.0 },
      { "name": "description", "weight": 1.0 }
    ],
    "filterable_attributes": [
      { "name": "brand", "field_type": "string" },
      { "name": "price", "field_type": "number" }
    ],
    "sortable_attributes": ["price", "created_at"]
  }'

Response 201 Created

text
{
  "uid": "products",
  "primary_key": "id",
  "display_name": "products",
  "number_of_documents": 0,
  "field_config": { /* echoed configuration */ },
  "created_at": "2026-01-15T10:30:00Z",
  "updated_at": "2026-01-15T10:30:00Z"
}
GET /v1/indices Admin key

List all indices for the authenticated account.

Example

text
curl https://search.example.com/v1/indices \
  -H "Authorization: Bearer sk_search_live_..."

Response 200 OK

text
{
  "results": [
    {
      "uid": "products",
      "primary_key": "id",
      "display_name": "Product Catalog",
      "number_of_documents": 12500,
      "created_at": "2026-01-15T10:30:00Z",
      "updated_at": "2026-01-15T10:30:00Z"
    }
  ]
}
GET /v1/indices/{uid} Admin key

Get details about a specific index.

Path parameters

ParameterTypeDescription
uid requiredstringThe index UID.

Response 200 OK

text
{
  "uid": "products",
  "primary_key": "id",
  "display_name": "Product Catalog",
  "number_of_documents": 12500,
  "field_config": {
    "primary_key": "id",
    "searchable_attributes": [
      { "name": "title", "weight": 3.0 }
    ],
    "filterable_attributes": [
      { "name": "brand", "field_type": "string" }
    ],
    "sortable_attributes": ["price"]
  },
  "created_at": "2026-01-15T10:30:00Z",
  "updated_at": "2026-01-15T10:30:00Z"
}
DELETE /v1/indices/{uid} Admin key

Delete an index and all its documents, settings, and analytics data.

Path parameters

ParameterTypeDescription
uid requiredstringThe index UID.
Irreversible
This permanently deletes the index, all documents, settings, and search analytics. This action cannot be undone.

Response 204 No Content


The index object

ParameterTypeDescription
uid requiredstringUnique index identifier.
primary_key requiredstringField used as the unique document key.
display_name requiredstringHuman-readable name.
number_of_documents requirednumberTotal documents in the index.
field_config requiredobjectSchema configuration (searchable, filterable, sortable attributes).
created_at requiredstringISO 8601 creation timestamp.
updated_at requiredstringISO 8601 last-updated timestamp.