/tasks route gives information about the progress of asynchronous operations.
Task object
uid
Type: IntegerDescription: Unique sequential identifier of the task.
The task 
uid is incremented across all indexes in an instance.batchUid
Type: IntegerDescription: Unique sequential identifier of the batch this task belongs to.
The batch 
uid is incremented across all indexes in an instance.indexUid
Type: StringDescription: Unique identifier of the targeted index
This value is always 
null for global tasks.status
Type: StringDescription: Status of the task. Possible values are
enqueued, processing, succeeded, failed, and canceled
type
Type: StringDescription: Type of operation performed by the task. Possible values are
indexCreation, indexUpdate, indexDeletion, indexSwap, documentAdditionOrUpdate, documentDeletion, settingsUpdate, dumpCreation, taskCancelation, taskDeletion, upgradeDatabase, documentEdition, and snapshotCreation
canceledBy
Type: IntegerDescription: If the task was canceled,
canceledBy contains the uid of a taskCancelation task. If the task was not canceled, canceledBy is always null
details
Type: ObjectDescription: Detailed information on the task payload. This object’s contents depend on the task’s
type
documentAdditionOrUpdate
| Name | Description | 
|---|---|
| receivedDocuments | Number of documents received | 
| indexedDocuments | Number of documents indexed. nullwhile the task status isenqueuedorprocessing | 
documentDeletion
| Name | Description | 
|---|---|
| providedIds | Number of documents queued for deletion | 
| originalFilter | The filter used to delete documents. nullif it was not specified | 
| deletedDocuments | Number of documents deleted. nullwhile the task status isenqueuedorprocessing | 
indexCreation
| Name | Description | 
|---|---|
| primaryKey | Value of the primaryKeyfield supplied during index creation.nullif it was not specified | 
indexUpdate
| Name | Description | 
|---|---|
| primaryKey | Value of the primaryKeyfield supplied during index update.nullif it was not specified | 
indexDeletion
| Name | Description | 
|---|---|
| deletedDocuments | Number of deleted documents. This should equal the total number of documents in the deleted index. nullwhile the task status isenqueuedorprocessing | 
indexSwap
| Name | Description | 
|---|---|
| swaps | Object containing the payload for the indexSwaptask | 
settingsUpdate
| Name | Description | 
|---|---|
| rankingRules | List of ranking rules | 
| filterableAttributes | List of filterable attributes | 
| distinctAttribute | The distinct attribute | 
| searchableAttributes | List of searchable attributes | 
| displayedAttributes | List of displayed attributes | 
| sortableAttributes | List of sortable attributes | 
| stopWords | List of stop words | 
| synonyms | List of synonyms | 
| typoTolerance | The typoToleranceobject | 
| pagination | The paginationobject | 
| faceting | The facetingobject | 
dumpCreation
| Name | Description | 
|---|---|
| dumpUid | The generated uidof the dump. This is also the name of the generated dump file.nullwhen the task status isenqueued,processing,canceled, orfailed | 
taskCancelation
| Name | Description | 
|---|---|
| matchedTasks | The number of matched tasks. If the API key used for the request doesn’t have access to an index, tasks relating to that index will not be included in matchedTasks | 
| canceledTasks | The number of tasks successfully canceled. If the task cancellation fails, this will be 0.nullwhen the task status isenqueuedorprocessing | 
| originalFilter | The filter used in the cancel task request | 
Task cancellation can be successful and still have 
canceledTasks: 0. This happens when matchedTasks matches finished tasks (succeeded, failed, or canceled).taskDeletion
| Name | Description | 
|---|---|
| matchedTasks | The number of matched tasks. If the API key used for the request doesn’t have access to an index, tasks relating to that index will not be included in matchedTasks | 
| deletedTasks | The number of tasks successfully deleted. If the task deletion fails, this will be 0.nullwhen the task status isenqueuedorprocessing | 
| originalFilter | The filter used in the delete task request | 
Task deletion can be successful and still have 
deletedTasks: 0. This happens when matchedTasks matches enqueued or processing tasks.snapshotCreation
The details object is set to null for snapshotCreation tasks.
error
Type: ObjectDescription: If the task has the
failed status, then this object contains the error definition. Otherwise, set to null
| Name | Description | 
|---|---|
| message | A human-readable description of the error | 
| code | The error code | 
| type | The error type | 
| link | A link to the relevant section of the documentation | 
network
Type: ObjectDescription: If the task was replicated from another remote or to other remotes,
network will contain information about the remote task uids corresponding to this task. Otherwise, missing in task object.
network either has a single key that is either origin or remotes.
| Name | Description | 
|---|---|
| origin | The task and remote from which this task was replicated from | 
| remotes | This task was replicated to these tasks and remotes | 
origin is itself an object with keys:
| Name | Description | 
|---|---|
| remoteName | The name of the remote | 
| taskUid | The uid of the task of origin | 
remotes is itself an object whose keys are the remotes and values an object with a single key that is either task_uid or error:
| Name | Description | 
|---|---|
| task_uid | The uid of the replicated task | 
| error | A human-readable error message indicating why the task could not be replicated to that remote | 
This is an experimental feature. Use the Meilisearch Cloud UI or the experimental features endpoint to activate it:
duration
Type: StringDescription: The total elapsed time the task spent in the
processing state, in ISO 8601 format
enqueuedAt
Type: StringDescription: The date and time when the task was first
enqueued, in RFC 3339 format
startedAt
Type: StringDescription: The date and time when the task began
processing, in RFC 3339 format
finishedAt
Type: StringDescription: The date and time when the task finished
processing, whether failed, succeeded, or canceled, in RFC 3339 format
Summarized task object
When an API request triggers an asynchronous process, Meilisearch returns a summarized task object. This object contains the following fields:| Field | Type | Description | 
|---|---|---|
| taskUid | Integer | Unique sequential identifier | 
| indexUid | String | Unique index identifier (always nullfor global tasks) | 
| status | String | Status of the task. Value is enqueued | 
| type | String | Type of task | 
| enqueuedAt | String | Represents the date and time in the RFC 3339 format when the task has been enqueued | 
taskUid to get more details on the status of the task.
Get tasks
GET
/tasks
task objects are contained in the results array.
Tasks are always returned in descending order of uid. This means that by default, the most recently created task objects appear first.
Task results are paginated and can be filtered.
Query parameters
| Query Parameter | Default Value | Description | 
|---|---|---|
| uids | *(all uids) | Filter tasks by their uid. Separate multiple taskuidswith a comma (,) | 
| batchUids | *(all batch uids) | Filter tasks by their batchUid. Separate multiplebatchUidswith a comma (,) | 
| statuses | *(all statuses) | Filter tasks by their status. Separate multiple taskstatuseswith a comma (,) | 
| types | *(all types) | Filter tasks by their type. Separate multiple tasktypeswith a comma (,) | 
| indexUids | *(all indexes) | Filter tasks by their indexUid. Separate multiple taskindexUidswith a comma (,). Case-sensitive | 
| limit | 20 | Number of tasks to return | 
| from | uidof the last created task | uidof the first task returned | 
| reverse | false | If true, returns results in the reverse order, from oldest to most recent | 
| canceledBy | N/A | Filter tasks by their canceledByfield. Separate multiple taskuidswith a comma (,) | 
| beforeEnqueuedAt | *(all tasks) | Filter tasks by their enqueuedAtfield | 
| beforeStartedAt | *(all tasks) | Filter tasks by their startedAtfield | 
| beforeFinishedAt | *(all tasks) | Filter tasks by their finishedAtfield | 
| afterEnqueuedAt | *(all tasks) | Filter tasks by their enqueuedAtfield | 
| afterStartedAt | *(all tasks) | Filter tasks by their startedAtfield | 
| afterFinishedAt | *(all tasks) | Filter tasks by their finishedAtfield | 
Response
| Name | Type | Description | 
|---|---|---|
| results | Array | An array of task objects | 
| total | Integer | Total number of tasks matching the filter or query | 
| limit | Integer | Number of tasks returned | 
| from | Integer | uidof the first task returned | 
| next | Integer | Value passed to fromto view the next “page” of results. When the value ofnextisnull, there are no more tasks to view | 
Example
Response: 200 Ok
Get one task
GET
/tasks/{task_uid}
If you try retrieving a deleted task, Meilisearch will return a 
task_not_found error.Path parameters
| Name | Type | Description | 
|---|---|---|
| task_uid* | String | uidof the requested task | 
Example
Response: 200 Ok
Cancel tasks
POST
/tasks/cancel?{query_parameter}
enqueued or processing tasks based on their uid, status, type, indexUid, or the date at which they were enqueued (enqueuedAt) or processed (startedAt).
Task cancellation is an atomic transaction: either all tasks are successfully canceled or none are.
To prevent users from accidentally canceling all enqueued and processing tasks, Meilisearch throws the 
missing_task_filters error if this route is used without any filters (POST /tasks/cancel).You can also cancel 
taskCancelation type tasks as long as they are in the enqueued or processing state. This is possible because taskCancelation type tasks are processed in reverse order, such that the last one you enqueue will be processed first.Query parameters
A validuids, statuses, types, indexUids, or date(beforeXAt or afterXAt) parameter is required.
| Query Parameter | Description | 
|---|---|
| uids | Cancel tasks based on uid. Separate multipleuidswith a comma (,). Useuids=*for alluids | 
| statuses | Cancel tasks based on status. Separate multiplestatuseswith a comma (,). Usestatuses=*for allstatuses | 
| types | Cancel tasks based on type. Separate multipletypeswith a comma (,). Usetypes=*for alltypes | 
| indexUids | Cancel tasks based on indexUid. Separate multipleuidswith a comma (,). UseindexUids=*for allindexUids. Case-sensitive | 
| beforeEnqueuedAt | Cancel tasks before a specified enqueuedAtdate. UsebeforeEnqueuedAt=*to cancel all tasks | 
| beforeStartedAt | Cancel tasks before a specified startedAtdate. UsebeforeStartedAt=*to cancel all tasks | 
| afterEnqueuedAt | Cancel tasks after a specified enqueuedAtdate. UseafterEnqueuedAt=*to cancel all tasks | 
| afterStartedAt | Cancel tasks after a specified startedAtdate. UseafterStartedAt=*to cancel all tasks | 
Date filters are equivalent to 
< or > operations. At this time, there is no way to perform a ≤ or ≥ operations with a date filter.Example
Response: 200 Ok
Since 
taskCancelation is a global task, its indexUid is always null.taskUid to get more details on the status of the task.
Cancel all tasks
You can cancel allprocessing and enqueued tasks using the following filter:
POST
/tasks/cancel?statuses=processing,enqueued
"indexes": [*]) and the task.cancel action.
Delete tasks
DELETE
/tasks?{query_parameter}
succeeded, failed, or canceled) task based on uid, status, type, indexUid, canceledBy, or date. Task deletion is an atomic transaction: either all tasks are successfully deleted, or none are.
To prevent users from accidentally deleting the entire task history, Meilisearch throws the 
missing_task_filters error if this route is used without any filters (DELETE /tasks).Query parameters
A validuids, statuses, types, indexUids, canceledBy, or date(beforeXAt or afterXAt) parameter is required.
| Query Parameter | Description | 
|---|---|
| uids | Delete tasks based on uid. Separate multipleuidswith a comma (,). Useuids=*for alluids | 
| statuses | Delete tasks based on status. Separate multiplestatuseswith a comma (,). Usestatuses=*for allstatuses | 
| types | Delete tasks based on type. Separate multipletypeswith a comma (,). Usetypes=*for alltypes | 
| indexUids | Delete tasks based on indexUid. Separate multipleuidswith a comma (,). UseindexUids=*for allindexUids. Case-sensitive | 
| canceledBy | Delete tasks based on the canceledByfield | 
| beforeEnqueuedAt | Delete tasks before a specified enqueuedAtdate. UsebeforeEnqueuedAt=*to delete all tasks | 
| beforeStartedAt | Delete tasks before a specified startedAtdate. UsebeforeStartedAt=*to delete all tasks | 
| beforeFinishedAt | Delete tasks before a specified finishedAtdate. UsebeforeFinishedAt=*to delete all tasks | 
| afterEnqueuedAt | Delete tasks after a specified enqueuedAtdate. UseafterEnqueuedAt=*to delete all tasks | 
| afterStartedAt | Delete tasks after a specified startedAtdate. UseafterStartedAt=*to delete all tasks | 
| afterFinishedAt | Delete tasks after a specified finishedAtdate. UseafterFinishedAt=*to delete all tasks | 
Date filters are equivalent to 
< or > operations. At this time, there is no way to perform a ≤ or ≥ operations with a date filter.Example
Response: 200 Ok
Since 
taskDeletion is a global task, its indexUid is always null.taskUid to get more details on the status of the task.
Delete all tasks
You can delete all finished tasks by using the following filter:DELETE
/tasks?statuses=failed,canceled,succeeded
"indexes": [*]) and the task.delete action.