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
| Parameter | Type | Description |
|---|---|---|
| uid required | string | Unique index identifier. Alphanumeric, dashes, and underscores only. 1–128 characters. |
| primary_key optional | string | Field name used as the unique document identifier. Default: "id" |
| display_name optional | string | Human-readable name for the index. Default: Same as uid |
| searchable_attributes optional | object[] | 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 optional | object[] | Fields for filtering and faceting. Each has a name (string) and optional field_type ("string", "number", or "boolean"). |
| sortable_attributes optional | string[] | 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
| Parameter | Type | Description |
|---|---|---|
| uid required | string | The 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
| Parameter | Type | Description |
|---|---|---|
| uid required | string | The 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
| Parameter | Type | Description |
|---|---|---|
| uid required | string | Unique index identifier. |
| primary_key required | string | Field used as the unique document key. |
| display_name required | string | Human-readable name. |
| number_of_documents required | number | Total documents in the index. |
| field_config required | object | Schema configuration (searchable, filterable, sortable attributes). |
| created_at required | string | ISO 8601 creation timestamp. |
| updated_at required | string | ISO 8601 last-updated timestamp. |