Skip to main content
GET
/
tasks
/
{taskUid}
cURL
curl \
  -X GET 'MEILISEARCH_URL/tasks/1'
{
  "uid": 1,
  "indexUid": "movies",
  "status": "succeeded",
  "type": "indexCreation",
  "canceledBy": null,
  "details": null,
  "error": null,
  "duration": "PT1S",
  "enqueuedAt": "2021-01-01T09:39:00.000000Z",
  "startedAt": "2021-01-01T09:39:01.000000Z",
  "finishedAt": "2021-01-01T09:39:02.000000Z"
}

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'
});

Path Parameters

taskUid
string<u-int32>
required

The task identifier.

Response

Task successfully retrieved.

Represents the current state and details of an asynchronous task.

Tasks are created when you perform operations like adding documents, updating settings, or creating indexes. Use this view to monitor task progress and check for errors.

uid
integer<u-int32>
required

The unique sequential identifier assigned to this task. Task UIDs are assigned in order of creation and can be used to retrieve specific task information or track task dependencies.

Required range: x >= 0
Example:

4312

status
enum<string>
required

The current processing status of the task. Possible values are: enqueued (waiting), processing (executing), succeeded, failed, or canceled.

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

"processing"

type
enum<string>
required

The type of operation this task performs. Examples include documentAdditionOrUpdate, documentDeletion, settingsUpdate, indexCreation, indexDeletion, dumpCreation, etc.

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

"documentAdditionOrUpdate"

enqueuedAt
string
required

The timestamp when this task was added to the queue, formatted as an RFC 3339 date-time string. All tasks have an enqueued timestamp as it's set when the task is created.

Example:

"2024-08-08_14:12:09.393Z"

batchUid
integer<u-int32> | null

The unique identifier of the batch that processed this task. Multiple tasks may share the same batch UID if they were processed together for efficiency. This is null for tasks that haven't been processed.

Required range: x >= 0
Example:

12

indexUid
string | null

The unique identifier of the index this task operates on. This is null for global tasks like dumpCreation or taskDeletion that don't target a specific index.

canceledBy
integer<u-int32> | null

If this task was canceled, this field contains the UID of the taskCancelation task that canceled it. This is null for tasks that were not canceled.

Required range: x >= 0
Example:

4326

details
object

Contains type-specific information about the task, such as the number of documents processed, settings that were applied, or filters that were used. The structure varies depending on the task type.

error
object

If the task failed, this field contains detailed error information including an error message, error code, error type, and a link to documentation. This is null for tasks that succeeded or are still processing.

duration
string | null

The total time spent processing this task, formatted as an ISO-8601 duration (e.g., PT0.5S for 0.5 seconds). This is null for tasks that haven't finished processing yet.

Example:

null

startedAt
string

The timestamp when Meilisearch began processing this task, formatted as an RFC 3339 date-time string. This is null for tasks that are still in the queue waiting to be processed.

Example:

"2024-08-08_14:12:09.393Z"

finishedAt
string

The timestamp when this task finished processing (whether successfully or with an error), formatted as an RFC 3339 date-time string. This is null for tasks that haven't finished yet.

Example:

"2024-08-08_14:12:09.393Z"

network
object

Network topology information for distributed deployments. Contains details about which nodes are involved in processing this task. This is only present when running Meilisearch in a distributed config.

customMetadata
string | null

Custom metadata string that was attached to this task when it was created. This can be used to associate tasks with external systems, track task origins, or add any application-specific information.