Webhooks let Meilisearch notify an external HTTP endpoint whenever a task completes. Use them to trigger downstream actions automatically, such as purging a cache after a successful index update or alerting your team when a task fails.
Webhooks are configured per project in Project Settings > Webhooks. Up to 20 webhooks can be configured per project.
Adding a webhook
- Go to Project Settings > Webhooks and click + Add webhook.
- Enter the Webhook URL: the endpoint where Meilisearch will send POST requests with task data.
- Optionally, enter an Authorization Header (for example,
Bearer your-secret-token). This header is sent with every webhook request so your endpoint can verify the source.
- Click Add webhook.
How webhooks work
When a task completes, Meilisearch sends an HTTP POST request to your configured URL. The request body is ndjson (newline-delimited JSON), with one task object per line matching the format returned by the Tasks API.
Your endpoint must respond with a 2xx status code. Non-2xx responses are treated as failures and retried with exponential backoff.
Multiple active webhooks may impact performance. Keep only the webhooks you actively use.
Securing your endpoint
Always validate the Authorization header on incoming webhook requests. Set a long random secret and reject requests that do not match.
Example use cases