Optional: configure an authorization header and allow requests on private networks
Depending on your setup, you may need to provide an authorization header and allow requests on private networks.
Provide these using task-webhook-authorization-header and experimental-allowed-ip-networks:
A common asynchronous operation is adding or updating documents to an index. The following example adds a test document to our movies index:
curl \ -X POST 'MEILISEARCH_URL/indexes/movies/documents' \ -H 'Content-Type: application/json' \ --data-binary '[ { "id": 287947, "title": "Shazam", "poster": "https://image.tmdb.org/t/p/w1280/xnopI5Xtky18MPhK40cZAGAOVeV.jpg", "overview": "A boy is given the ability to become an adult superhero in times of need with a single magic word.", "release_date": "2019-03-23" } ]'
When Meilisearch finishes indexing this document, it will send a POST request the URL you configured with --task-webhook-url. The request body will be one or more task objects in ndjson format:
If Meilisearch has batched multiple tasks, it will only trigger the webhook once all tasks in a batch are finished. In this case, the response payload will include all tasks, each separated by a new line: