Skip to main content
The /indexes route allows you to create, manage, and delete your indexes. Learn more about indexes.

Index object

List all indexes

GET
/indexes
List all indexes. Results can be paginated by using the offset and limit query parameters.

Query parameters

Response

Example

Response: 200 Ok

Get one index

GET
/indexes/{index_uid}
Get information about an index.

Path parameters

Example

Response: 200 Ok

Create an index

POST
/indexes
Create an index.

Body

Example

Response: 202 Accepted

You can use the response’s taskUid to track the status of your request.

Update an index

PATCH
/indexes/{index_uid}
Update an index’s primary key. You can freely update the primary key of an index as long as it contains no documents. To change the primary key of an index that already contains documents, you must first delete all documents in that index. You may then change the primary key and index your dataset again.

Path parameters

Body

Example

Response: 202 Accepted

You can use the response’s taskUid to track the status of your request.

Delete an index

DELETE
/indexes/{index_uid}
Delete an index.

Path parameters

Example

Response: 202 Accepted

You can use the response’s taskUid to track the status of your request.

Swap indexes

POST
/swap-indexes
Swap the documents, settings, and task history of two or more indexes. You can only swap indexes in pairs. A single request can swap as many index pairs as you wish. Swapping indexes is an atomic transaction: either all indexes in a request are successfully swapped, or none are. You can swap multiple pairs of indexes with a single request. To do so, there must be one object for each pair of indexes to be swapped. Swapping indexA and indexB will also replace every mention of indexA by indexB and vice-versa in the task history. enqueued tasks are left unmodified. To learn more about index swapping, refer to this short guide.

Body

An array of objects with the following fields: Each indexes array must contain only two elements: the indexUids of the two indexes to be swapped. Sending an empty array ([]) is valid, but no swap operation will be performed. Use rename: false if you are swapping two existing indexes. Use rename: true if the second index in your array does not exist.

Example

Response

Since indexSwap is a global task, the indexUid is always null.
You can use the response’s taskUid to track the status of your request.