Cancel tasks

POST /tasks/cancel

Cancel enqueued and/or processing tasks

Query parameters

  • uids number

    Permits to filter tasks by their uid. By default, when the uids query parameter is not set, all task uids are returned. It's possible to specify several uids by separating them with the , character.

  • Permits to filter tasks by their related index. By default, when indexUids query parameter is not set, the tasks of all the indexes are returned. It is possible to specify several indexes by separating them with the , character.

  • statuses string

    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.

  • types string

    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.

  • Permits to filter tasks using the uid of the task that canceled them. It's possible to specify several task uids by separating them with the , character.

  • Permits to filter tasks based on their enqueuedAt time. Matches tasks enqueued before the given date. Supports RFC 3339 date format.

  • Permits to filter tasks based on their enqueuedAt time. Matches tasks enqueued after the given date. Supports RFC 3339 date format.

  • Permits to filter tasks based on their startedAt time. Matches tasks started before the given date. Supports RFC 3339 date format.

  • Permits to filter tasks based on their startedAt time. Matches tasks started after the given date. Supports RFC 3339 date format.

  • Permits to filter tasks based on their finishedAt time. Matches tasks finished before the given date. Supports RFC 3339 date format.

  • Permits to filter tasks based on their finishedAt time. Matches tasks finished after the given date. Supports RFC 3339 date format.

Responses

  • 202 application/json

    Accepted

    Hide response attributes Show response attributes object
    • taskUid integer

      The unique sequential identifier of the task. This taskUid allows you to track the current task.

    • indexUid string Required

      The unique identifier of the index where this task is operated

    • status string Required

      The status of the task

      Value is enqueued.

    • type string Required

      The type of the task

      Values are documentAdditionOrUpdate, documentDeletion, indexCreation, indexUpdate, indexDeletion, indexSwap, settingsUpdate, dumpCreation, taskCancelation, or taskDeletion.

    • enqueuedAt string Required

      An RFC 3339 format for date/time/duration.

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
POST /tasks/cancel
curl \
 -X POST https://example.meilisearch.com:7700/tasks/cancel \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (202)
{
  "taskUid": 0,
  "indexUid": null,
  "status": "enqueued",
  "type": "taskCancelation",
  "enqueuedAt": "2021-01-01T09:39:00.000000Z"
}
Response examples (400)
{
  "message": "string",
  "code": "string",
  "type": "string",
  "link": "string"
}
Response examples (401)
{
  "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"
}