Skip to main content
Use the /webhooks to trigger automatic workflows when Meilisearch finishes processing tasks.

The webhook object

{
  "uuid": "V4_UUID_GENERATED_BY_MEILISEARCH",
  "url": "WEBHOOK_NOTIFICATION_TARGET_URL",
  "headers": {
    "HEADER": "VALUE",
  },
  "isEditable": false
}
  • uuid: a v4 uuid Meilisearch automatically generates when you create a new webhook
  • url: a string indication the URL Meilisearch should notify whenever it completes a task, required
  • headers: an object with HTTP headers and their values, optional, often used for authentication
    • Authorization headers: the value of authorization headers is redacted in webhook responses. Do not use authorization header values as returned by Meilisearch to update a webhook
  • isEditable: read-only Boolean field indicating whether you can edit the webhook. Meilisearch automatically sets this to true for all webhooks created via the API and to false for reserved webhooks

The webhook payload

When Meilisearch finishes processing a task, it sends the relevant task object to all configured webhooks.

Get all webhooks

GET
/webhooks
Get a list of all webhooks configured in the current Meilisearch instance.

Example

curl \
  -X GET 'MEILISEARCH_URL/webhooks'

Response: 200 OK

{
  "results": [
    {
      "uuid": "UUID_V4",
      "url": "WEBHOOK_TARGET_URL",
      "headers": {
        "HEADER": "VALUE",
      },
      "isEditable": false
    },
    {
      "uuid": "UUID_V4",
      "url": "WEBHOOK_TARGET_URL",
      "headers": null,
      "isEditable": true
    }
  ]
}

Get a single webhook

GET
/webhooks/{uuid}
Get a single webhook configured in the current Meilisearch instance.

Example

Response: 200 OK

{
  "uuid": "UUID_V4",
  "url": "WEBHOOK_TARGET_URL",
  "headers": {
    "HEADER": "VALUE",
  },
  "isEditable": false
}

Create a webhook

POST
/webhooks
Create a new webhook. When Meilisearch finishes processing a task, it sends the relevant task object to all configured webhooks. You can create up to 20 webhooks. Having multiple webhooks active at the same time may negatively impact performance.

Example

curl \
  -X POST 'MEILISEARCH_URL/webhooks' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "url": "WEBHOOK_TARGET_URL",
    "headers": {
      "authorization": "SECURITY_KEY",
      "referer": "https://example.com"
    }
  }'

Response: 200 OK

{
  "uuid": "627ea538-733d-4545-8d2d-03526eb381ce",
  "url": "WEBHOOK_TARGET_URL",
  "headers": {
    "authorization": "SECURITY_KEY",
    "referer": "https://example.com",
  },
  "isEditable": true
}

Update a webhook

PATCH
/webhooks/{uuid}
Update the configuration for the specified webhook. To remove a field, set its value to null. When updating the headers field, Meilisearch only changes the headers you have explicitly submitted. All other headers remain unaltered.
It is not possible to edit webhooks whose isEditable field is set to false.Meilisearch Cloud may create internal webhooks to support features such as Analytics and monitoring. These webhooks are always isEditable: false.

Example

curl \
  -X PATCH 'MEILISEARCH_URL/webhooks/WEBHOOK_UUID' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "header": {
      "referer": null
    }
  }'

Response: 200 OK

{
  "uuid": "627ea538-733d-4545-8d2d-03526eb381ce",
  "url": "WEBHOOK_TARGET_URL",
  "headers": {
    "authorization": "SECURITY_KEY"
  },
  "isEditable": true
}

Delete a webhook

DELETE
/webhooks/{uuid}
Delete a webhook and stop sending task completion data to the target URL.
It is not possible to delete webhooks whose isEditable field is set to false.

Example

curl \
  -X DELETE 'MEILISEARCH_URL/webhooks/WEBHOOK_UUID'

Response: 204 No Content