Many Meilisearch operations are processed asynchronously in a task. Asynchronous tasks allow you to make resource-intensive changes to your Meilisearch project without any downtime for users. In this tutorial, you’ll use the Meilisearch API to add documents to an index, and then monitor its status.Documentation Index
Fetch the complete documentation index at: https://www.meilisearch.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Adding a task to the task queue
Operations that require indexing, such as adding and updating documents or changing an index’s settings, will always generate a task. Start by creating an index, then add a large number of documents to this index:taskUid.
You can add documents to a new Meilisearch Cloud index using the Cloud interface. To get the
taskUid of this task, visit the “Task” overview and look for a “Document addition or update” task associated with your newly created index.Monitoring task status
Meilisearch processes tasks in the order they were added to the queue. You can check the status of a task using the Meilisearch Cloud interface or the Meilisearch API.Monitoring task status in the Meilisearch Cloud interface
Log into your Meilisearch Cloud account and navigate to your project. Click the “Tasks” link in the project menu:

status to succeeded, Meilisearch has finished processing your request.
If the status changes to failed, Meilisearch was not able to fulfill your request. Check the object’s error field for more information.
Monitoring task status with the Meilisearch API
Use thetaskUid from your request’s response to check the status of a task:
enqueued or processing, wait a few moments and query the database once again. You may also set up a webhook listener.
When status changes to succeeded, Meilisearch has finished processing your request.
If the task status changes to failed, Meilisearch was not able to fulfill your request. Check the task object’s error field for more information.
Interpreting timestamps and duration
A task object includes three timestamp fields, each formatted as an RFC 3339 date. Each field remains null until the task reaches the corresponding state.
| Field | Description |
|---|---|
enqueuedAt | Date and time when the task was first enqueued. Always present once the task exists. |
startedAt | Date and time when the task began processing. null while the task is still enqueued. |
finishedAt | Date and time when the task finished processing, whether it succeeded, failed, or was canceled. null until the task reaches a finished state. |
duration field is formatted according to the ISO 8601 duration format (for example, "PT1S" for one second). It represents the total elapsed time the task spent in the processing state. Time spent waiting in the queue is not included. duration is null until the task finishes.
The error object
When a task fails, its error field is populated with an object describing what went wrong. For succeeded, enqueued, processing, and canceled tasks, error is null.
| Field | Description |
|---|---|
message | Human-readable description of the error. |
code | The error code. |
type | The error type, for example invalid_request or internal. |
link | A URL pointing to the relevant section of the documentation. |
error object returned for a failed document addition:
Track tasks with custom metadata
You can attach acustomMetadata query parameter to document operations. This metadata string appears in task responses and webhook payloads, making it easier to track which batch of data triggered a specific task.