The /tasks route allows you to manage and monitor Meilisearch’s asynchronous operations.
/tasks
route gives information about the progress of asynchronous operations.
uid
uid
is incremented across all indexes in an instance.batchUid
uid
is incremented across all indexes in an instance.indexUid
null
for global tasks.status
enqueued
, processing
, succeeded
, failed
, and canceled
type
indexCreation
, indexUpdate
, indexDeletion
, indexSwap
, documentAdditionOrUpdate
, documentDeletion
, settingsUpdate
, dumpCreation
, taskCancelation
, taskDeletion
, databaseUpgrade
, documentEdition
, and snapshotCreation
canceledBy
canceledBy
contains the uid
of a taskCancelation
task. If the task was not canceled, canceledBy
is always null
details
type
documentAdditionOrUpdate
Name | Description |
---|---|
receivedDocuments | Number of documents received |
indexedDocuments | Number of documents indexed. null while the task status is enqueued or processing |
documentDeletion
Name | Description |
---|---|
providedIds | Number of documents queued for deletion |
originalFilter | The filter used to delete documents. null if it was not specified |
deletedDocuments | Number of documents deleted. null while the task status is enqueued or processing |
indexCreation
Name | Description |
---|---|
primaryKey | Value of the primaryKey field supplied during index creation. null if it was not specified |
indexUpdate
Name | Description |
---|---|
primaryKey | Value of the primaryKey field supplied during index update. null if it was not specified |
indexDeletion
Name | Description |
---|---|
deletedDocuments | Number of deleted documents. This should equal the total number of documents in the deleted index. null while the task status is enqueued or processing |
indexSwap
Name | Description |
---|---|
swaps | Object containing the payload for the indexSwap task |
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 typoTolerance object |
pagination | The pagination object |
faceting | The faceting object |
dumpCreation
Name | Description |
---|---|
dumpUid | The generated uid of the dump. This is also the name of the generated dump file. null when the task status is enqueued , processing , canceled , or failed |
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 . null when the task status is enqueued or processing |
originalFilter | The filter used in the cancel task request |
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 . null when the task status is enqueued or processing |
originalFilter | The filter used in the delete task request |
deletedTasks: 0
. This happens when matchedTasks
matches enqueued
or processing
tasks.snapshotCreation
details
object is set to null
for snapshotCreation
tasks.
error
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 |
duration
processing
state, in ISO 8601 format
enqueuedAt
enqueued
, in RFC 3339 format
startedAt
processing
, in RFC 3339 format
finishedAt
processing
, whether failed
, succeeded
, or canceled
, in RFC 3339 format
Field | Type | Description |
---|---|---|
taskUid | Integer | Unique sequential identifier |
indexUid | String | Unique index identifier (always null for 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.
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 Parameter | Default Value | Description |
---|---|---|
uids | * (all uids) | Filter tasks by their uid . Separate multiple task uids with a comma (, ) |
batchUids | * (all batch uids) | Filter tasks by their batchUid . Separate multiple batchUids with a comma (, ) |
statuses | * (all statuses) | Filter tasks by their status . Separate multiple task statuses with a comma (, ) |
types | * (all types) | Filter tasks by their type . Separate multiple task types with a comma (, ) |
indexUids | * (all indexes) | Filter tasks by their indexUid . Separate multiple task indexUids with a comma (, ). Case-sensitive |
limit | 20 | Number of tasks to return |
from | uid of the last created task | uid of 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 canceledBy field. Separate multiple task uids with a comma (, ) |
beforeEnqueuedAt | * (all tasks) | Filter tasks by their enqueuedAt field |
beforeStartedAt | * (all tasks) | Filter tasks by their startedAt field |
beforeFinishedAt | * (all tasks) | Filter tasks by their finishedAt field |
afterEnqueuedAt | * (all tasks) | Filter tasks by their enqueuedAt field |
afterStartedAt | * (all tasks) | Filter tasks by their startedAt field |
afterFinishedAt | * (all tasks) | Filter tasks by their finishedAt field |
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 | uid of the first task returned |
next | Integer | Value passed to from to view the next “page” of results. When the value of next is null , there are no more tasks to view |
200 Ok
task_not_found
error.Name | Type | Description |
---|---|---|
task_uid * | String | uid of the requested task |
200 Ok
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.
missing_task_filters
error if this route is used without any filters (POST /tasks/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.uids
, statuses
, types
, indexUids
, or date(beforeXAt
or afterXAt
) parameter is required.
Query Parameter | Description |
---|---|
uids | Cancel tasks based on uid . Separate multiple uids with a comma (, ). Use uids=* for all uids |
statuses | Cancel tasks based on status . Separate multiple statuses with a comma (, ). Use statuses=* for all statuses |
types | Cancel tasks based on type . Separate multiple types with a comma (, ). Use types=* for all types |
indexUids | Cancel tasks based on indexUid . Separate multiple uids with a comma (, ). Use indexUids=* for all indexUids . Case-sensitive |
beforeEnqueuedAt | Cancel tasks before a specified enqueuedAt date. Use beforeEnqueuedAt=* to cancel all tasks |
beforeStartedAt | Cancel tasks before a specified startedAt date. Use beforeStartedAt=* to cancel all tasks |
afterEnqueuedAt | Cancel tasks after a specified enqueuedAt date. Use afterEnqueuedAt=* to cancel all tasks |
afterStartedAt | Cancel tasks after a specified startedAt date. Use afterStartedAt=* to cancel all tasks |
<
or >
operations. At this time, there is no way to perform a ≤
or ≥
operations with a date filter.200 Ok
taskCancelation
is a global task, its indexUid
is always null
.taskUid
to get more details on the status of the task.
processing
and enqueued
tasks using the following filter:
"indexes": [*]
) and the task.cancel
action.
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.
missing_task_filters
error if this route is used without any filters (DELETE /tasks
).uids
, statuses
, types
, indexUids
, canceledBy
, or date(beforeXAt
or afterXAt
) parameter is required.
Query Parameter | Description |
---|---|
uids | Delete tasks based on uid . Separate multiple uids with a comma (, ). Use uids=* for all uids |
statuses | Delete tasks based on status . Separate multiple statuses with a comma (, ). Use statuses=* for all statuses |
types | Delete tasks based on type . Separate multiple types with a comma (, ). Use types=* for all types |
indexUids | Delete tasks based on indexUid . Separate multiple uids with a comma (, ). Use indexUids=* for all indexUids . Case-sensitive |
canceledBy | Delete tasks based on the canceledBy field |
beforeEnqueuedAt | Delete tasks before a specified enqueuedAt date. Use beforeEnqueuedAt=* to delete all tasks |
beforeStartedAt | Delete tasks before a specified startedAt date. Use beforeStartedAt=* to delete all tasks |
beforeFinishedAt | Delete tasks before a specified finishedAt date. Use beforeFinishedAt=* to delete all tasks |
afterEnqueuedAt | Delete tasks after a specified enqueuedAt date. Use afterEnqueuedAt=* to delete all tasks |
afterStartedAt | Delete tasks after a specified startedAt date. Use afterStartedAt=* to delete all tasks |
afterFinishedAt | Delete tasks after a specified finishedAt date. Use afterFinishedAt=* to delete all tasks |
<
or >
operations. At this time, there is no way to perform a ≤
or ≥
operations with a date filter.200 Ok
taskDeletion
is a global task, its indexUid
is always null
.taskUid
to get more details on the status of the task.
"indexes": [*]
) and the task.delete
action.