Skip to main content
POST
/
2
/
tasks
/
{taskID}
/
push
curl
curl --request POST \
  --url 'https://data.us.algolia.com/2/tasks/6c02aeb1-775e-418e-870b-1faccd4b2c0f/push?watch=true' \
  --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 '{"action":"addObject","records":[{"objectID":"test-record-123"}]}'
{
  "runID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
  "eventID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
  "data": [
    {}
  ],
  "events": [
    {
      "eventID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
      "runID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
      "status": "created",
      "type": "fetch",
      "batchSize": 10,
      "data": {},
      "publishedAt": "<string>"
    }
  ],
  "message": "<string>",
  "createdAt": "<string>"
}
Required ACL: addObject, deleteIndex, editSettings See also: Pre-indexing data transformation

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

taskID
string
required

Unique identifier of a task.

Example:

"6c02aeb1-775e-418e-870b-1faccd4b2c0f"

Query Parameters

watch
boolean

When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.

Body

application/json
action
enum<string>
required

Which indexing operation to perform:

  • addObject: adds records to an index. Equivalent to the "Add a new record (with auto-generated object ID)" operation.
  • updateObject: adds or replaces records in an index. Equivalent to the "Add or replace a record" operation.
  • partialUpdateObject: adds or updates attributes within records. Equivalent to the "Add or update attributes" operation with the createIfNoExists parameter set to true. (If a record with the specified objectID doesn't exist in the specified index, this action creates adds the record to the index)
  • partialUpdateObjectNoCreate: same as partialUpdateObject, but with createIfNoExists set to false. (A record isn't added to the index if its objectID doesn't exist)
  • deleteObject: delete records from an index. Equivalent to the "Delete a record" operation.
  • delete. Delete an index. Equivalent to the "Delete an index" operation.
  • clear: delete all records from an index. Equivalent to the "Delete all records from an index operation".
Available options:
addObject,
updateObject,
partialUpdateObject,
partialUpdateObjectNoCreate,
deleteObject,
delete,
clear
records
pushTaskRecords · object[]
required

Response

OK

runID
string
required

Universally unique identifier (UUID) of a task run.

Example:

"6c02aeb1-775e-418e-870b-1faccd4b2c0f"

eventID
string

Universally unique identifier (UUID) of an event.

Example:

"6c02aeb1-775e-418e-870b-1faccd4b2c0f"

data
object[]

This field is always null when used with the Push endpoint. When used for a source discover or source validate run, it will include the sampled data of the source.

events
object[]

in case of error, observability events will be added to the response.

message
string

a message describing the outcome of the operation that has been ran (push, discover or validate) run.

createdAt
string

Date of creation in RFC 3339 format.

I