If you are using Meilisearch Cloud or need to configure multiple webhooks, use the
/webhooks
API route instead.Requirements
- a command-line console
- a self-hosted Meilisearch instance
- a server configured to receive
POST
requests with an ndjson payload
Configure the webhook URL
Restart your Meilisearch instance and provide the webhook URL to--task-webhook-URL
:
MEILI_TASK_WEBHOOK_URL
.
Optional: configure an authorization header
Depending on your setup, you may need to provide an authorization header. Provide it totask-webhook-authorization-header
:
Test the webhook
A common asynchronous operation is adding or updating documents to an index. The following example adds a test document to ourbooks
index:
POST
request the URL you configured with --task-webhook-url
. The request body will be one or more task objects in ndjson format: