Skip to main content
POST
/
1
/
tasks
curl
curl --request POST \
  --url https://data.us.algolia.com/1/tasks \
  --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 '{"sourceID":"6c02aeb1-775e-418e-870b-1faccd4b2c0f","destinationID":"6c02aeb1-775e-418e-870b-1faccd4b2c0f","trigger":{"type":"onDemand"},"action":"replace","enabled":true,"failureThreshold":0,"input":{"mapping":{"format":"mappingkit/v1","actions":[{"id":"lorem","enabled":true,"trigger":"lorem","fieldDirectives":[{"fieldKey":"lorem","value":{}}]}]}},"cursor":"lorem"}'
{
  "taskID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
  "createdAt": "<string>"
}

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.

Body

application/json

Request body for creating a task.

API request body for creating a task using the V1 shape, please use methods and types that don't contain the V1 suffix.

sourceID
string
required

Universally uniqud identifier (UUID) of a source.

Example:

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

destinationID
string
required

Universally unique identifier (UUID) of a destination resource.

Example:

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

trigger
object
required

Trigger information for manually-triggered tasks.

  • Option 1
  • Option 2
  • Option 3
  • Option 4
action
enum<string>
required

Action to perform on the Algolia index.

Available options:
replace,
save,
partial,
partialNoCreate,
append
enabled
boolean

Whether the task is enabled.

failureThreshold
integer

Maximum accepted percentage of failures for a task run to finish successfully.

Required range: 0 <= x <= 100
input
object

Configuration of the task, depending on its type. Input for a streaming task whose source is of type ga4BigqueryExport and for which extracted data is continuously streamed.

  • Option 1
  • Option 2
  • Option 3
cursor
string

Date of the last cursor in RFC 3339 format.

Response

OK

API response for creating a task.

taskID
string
required

Universally unique identifier (UUID) of a task.

Example:

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

createdAt
string
required

Date of creation in RFC 3339 format.

I