Skip to main content
POST
/
1
/
indexes
/
{indexName}
curl
curl --request POST \
  --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-algolia-api-key: ALGOLIA_API_KEY' \
  --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
  --data '
{
  "objectID": "blackTShirt",
  "name": "Black T-shirt",
  "color": "#000000"
}
'
{
  "createdAt": "2023-07-04T12:49:15Z",
  "taskID": 1514562690001,
  "objectID": "test-record-123"
}
  • If the record doesn’t have an object ID, a new record with an auto-generated object ID is added to your index.
  • If a record with the specified object ID exists, the existing record is replaced.
  • If a record with the specified object ID doesn’t exist, a new record is added to your index.
  • If you add a record to an index that doesn’t exist yet, a new index is created.
To update some attributes of a record, use the partial operation. To add, update, or replace multiple records, use the batch operation. This operation is subject to indexing rate limits. Required ACL: addObject

Authorizations

x-algolia-application-id
string
header
required

Your Algolia application ID.

x-algolia-api-key
string
header
required

Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference.

Path Parameters

indexName
string
required

Name of the index on which to perform the operation.

Example:

"ALGOLIA_INDEX_NAME"

Body

application/json

The record. A schemaless object with attributes that are useful in the context of search and discovery.

The body is of type object.

Response

Created

createdAt
string
required

Date and time when the object was created, in RFC 3339 format.

Example:

"2023-07-04T12:49:15Z"

taskID
integer<int64>
required

Unique identifier of a task.

A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the task operation and this task ID.

Example:

1514562690001

objectID
string

Unique record identifier.

Example:

"test-record-123"

Last modified on March 23, 2026