Skip to main content
Querying the get tasks endpoint returns all tasks that have not been deleted. This unfiltered list may be difficult to parse in large projects. This guide shows you how to use query parameters to filter tasks and obtain a more readable list of asynchronous operations.
Filtering batches with the /batches route follows the same rules as filtering tasks. Keep in mind that many /batches parameters such as uids target the tasks included in batches, instead of the batches themselves.

Filtering tasks with a single parameter

Use the get tasks endpoint to fetch all canceled tasks:
curl \
  -X GET 'MEILISEARCH_URL/tasks?statuses=failed'
Use a comma to separate multiple values and fetch both canceled and failed tasks:
curl \
  -X GET 'MEILISEARCH_URL/tasks?statuses=failed,canceled'
You may filter tasks based on uid, status, type, indexUid, canceledBy, or date. Consult the API reference for a full list of task filtering parameters.

Available filter parameters

All parameters below accept comma-separated values. Filters of different types are combined with a logical AND.
ParameterDescription
uidsFilter tasks by their uid. Separate multiple uids with a comma (,).
batchUidsFilter tasks by their batchUid. Separate multiple batchUids with a comma (,).
statusesFilter tasks by their status: enqueued, processing, succeeded, failed, or canceled.
typesFilter tasks by their type, for example documentAdditionOrUpdate or indexDeletion.
indexUidsFilter tasks by their indexUid. Case-sensitive.
canceledByFilter tasks by their canceledBy field. Separate multiple task uids with a comma (,).

Date filters

Use the following parameters to filter tasks by one of their timestamp fields. All values must be valid RFC 3339 dates.
ParameterFilters tasks whose…
beforeEnqueuedAtenqueuedAt is earlier than the provided date
afterEnqueuedAtenqueuedAt is later than the provided date
beforeStartedAtstartedAt is earlier than the provided date
afterStartedAtstartedAt is later than the provided date
beforeFinishedAtfinishedAt is earlier than the provided date
afterFinishedAtfinishedAt is later than the provided date
Date filters are equivalent to < or > operations. There is currently no way to perform or comparisons with a date filter.

Pagination parameters

Combine the filters above with the following parameters to paginate results.
ParameterDescription
limitNumber of tasks to return. Defaults to 20.
fromuid of the first task returned. Defaults to the uid of the last created task.
reverseIf true, returns results in reverse order, from oldest to most recent. Defaults to false.

Combining filters

Use the ampersand character (&) to combine filters, equivalent to a logical AND:
curl \
  -X GET 'MEILISEARCH_URL/tasks?indexUids=movies&types=documentAdditionOrUpdate,documentDeletion&statuses=processing'
This code sample returns all tasks in the movies index that have the type documentAdditionOrUpdate or documentDeletion and have the status of processing.
OR operations between different filters are not supported. For example, you cannot view tasks which have a type of documentAddition or a status of failed.

Next steps

Monitor tasks

Check the status of asynchronous operations in real time.

Manage the task database

Navigate long task lists with pagination and query parameters.

Asynchronous operations

Understand how Meilisearch processes tasks in the background.