curl \
-X POST 'MEILISEARCH_URL/tasks/cancel?uids=1,2' \
-H 'Authorization: Bearer API_KEY'{
"taskUid": 147,
"indexUid": null,
"status": "enqueued",
"type": "taskCancelation",
"enqueuedAt": "2024-08-08T17:05:55.791772Z"
}{
"message": "Query parameters to filter the tasks to cancel are missing. Available query parameters are: `uids`, `indexUids`, `statuses`, `types`, `canceledBy`, `beforeEnqueuedAt`, `afterEnqueuedAt`, `beforeStartedAt`, `afterStartedAt`, `beforeFinishedAt`, `afterFinishedAt`.",
"code": "missing_task_filters",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#missing_task_filters"
}{
"message": "The Authorization header is missing. It must use the bearer authorization method.",
"code": "missing_authorization_header",
"type": "auth",
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}Cancel tasks
Cancel enqueued and/or processing tasks. You must provide at least one filter (e.g. uids, indexUids, statuses) to specify which tasks to cancel.
Note: Task cancellation is atomic — either all matched tasks are canceled or none are.
Note: Each filter parameter accepts * to match all values (e.g., statuses=*).
Tip: You can cancel taskCancelation type tasks as long as they are enqueued or processing,
because cancellation tasks are processed in reverse order of enqueueing.
curl \
-X POST 'MEILISEARCH_URL/tasks/cancel?uids=1,2' \
-H 'Authorization: Bearer API_KEY'{
"taskUid": 147,
"indexUid": null,
"status": "enqueued",
"type": "taskCancelation",
"enqueuedAt": "2024-08-08T17:05:55.791772Z"
}{
"message": "Query parameters to filter the tasks to cancel are missing. Available query parameters are: `uids`, `indexUids`, `statuses`, `types`, `canceledBy`, `beforeEnqueuedAt`, `afterEnqueuedAt`, `beforeStartedAt`, `afterStartedAt`, `beforeFinishedAt`, `afterFinishedAt`.",
"code": "missing_task_filters",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#missing_task_filters"
}{
"message": "The Authorization header is missing. It must use the bearer authorization method.",
"code": "missing_authorization_header",
"type": "auth",
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}Authorizations
An API key is a token that you provide when making API calls. Read more about how to secure your project.
Include the API key to the Authorization header, for instance:
-H 'Authorization: Bearer 6436fc5237b0d6e0d64253fbaac21d135012ecf1'
If you use a SDK, ensure you instantiate the client with the API key, for instance with JS SDK:
const client = new MeiliSearch({ host: 'MEILISEARCH_URL', apiKey: '6436fc5237b0d6e0d64253fbaac21d135012ecf1' });
Query Parameters
Permits to filter tasks by their related type. By default, when types
query parameter is not set, all task types are returned. It's possible
to specify several types by separating them with the , character.
The type of the task.
documentAdditionOrUpdate, documentEdition, documentDeletion, settingsUpdate, indexCreation, indexDeletion, indexUpdate, indexSwap, taskCancelation, taskDeletion, dumpCreation, snapshotCreation, export, upgradeDatabase, indexCompaction, networkTopologyChange, dsrUpdate, dsrClear Permits to filter tasks by their status. By default, when statuses
query parameter is not set, all task statuses are returned. It's
possible to specify several statuses by separating them with the ,
character.
The status of a task.
enqueued, processing, succeeded, failed, canceled Response
Task successfully enqueued.
A summarized view of a task, returned when a task is enqueued
Type of operation performed by the task.
documentAdditionOrUpdate, documentEdition, documentDeletion, settingsUpdate, indexCreation, indexDeletion, indexUpdate, indexSwap, taskCancelation, taskDeletion, dumpCreation, snapshotCreation, export, upgradeDatabase, indexCompaction, networkTopologyChange, dsrUpdate, dsrClear "documentAdditionOrUpdate"