Skip to main content
POST
/
tasks
/
cancel
cURL
curl \
  -X POST 'MEILISEARCH_URL/tasks/cancel?uids=1,2'
{
  "taskUid": 147,
  "indexUid": null,
  "status": "enqueued",
  "type": "taskCancelation",
  "enqueuedAt": "2024-08-08T17:05:55.791772Z"
}

Authorizations

Authorization
string
header
required

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

uids
integer<u-int32>[]

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.

Required range: x >= 0
batchUids
integer<u-int32>[]

Lets you filter tasks by their batchUid.

Required range: x >= 0
canceledBy
integer<u-int32>[]

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.

Required range: x >= 0
types
enum<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.

The type of the task.

Available options:
documentAdditionOrUpdate,
documentEdition,
documentDeletion,
settingsUpdate,
indexCreation,
indexDeletion,
indexUpdate,
indexSwap,
taskCancelation,
taskDeletion,
dumpCreation,
snapshotCreation,
export,
upgradeDatabase,
indexCompaction,
networkTopologyChange
statuses
enum<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.

The status of a task.

Available options:
enqueued,
processing,
succeeded,
failed,
canceled
indexUids
string[]

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.

afterEnqueuedAt
string

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

beforeEnqueuedAt
string

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

afterStartedAt
string

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

beforeStartedAt
string

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

afterFinishedAt
string

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

beforeFinishedAt
string

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

Response

Task successfully enqueued.

A summarized view of a task, returned when a task is enqueued

taskUid
integer<u-int32>
required

Unique sequential identifier of the task.

Required range: x >= 0
status
enum<string>
required

Status of the task. Possible values are enqueued, processing, succeeded, failed, and canceled.

Available options:
enqueued,
processing,
succeeded,
failed,
canceled
Example:

"processing"

type
enum<string>
required

Type of operation performed by the task.

Available options:
documentAdditionOrUpdate,
documentEdition,
documentDeletion,
settingsUpdate,
indexCreation,
indexDeletion,
indexUpdate,
indexSwap,
taskCancelation,
taskDeletion,
dumpCreation,
snapshotCreation,
export,
upgradeDatabase,
indexCompaction,
networkTopologyChange
Example:

"documentAdditionOrUpdate"

enqueuedAt
string<date-time>
required

Date and time when the task was enqueued.

indexUid
string | null

Unique identifier of the targeted index. Null for global tasks.

customMetadata
string | null

Custom metadata attached to this task at creation. Use it to associate tasks with external systems or add application-specific information.