Skip to main content
Version: 7.x

Webhook

The Webhook module provides a middleware that allows you to upload the output file from multipart/form-data routes to the destination of your choice.

Properties

--webhook-allow-list       string  Set the allowed URLs for the webhook feature using a regular expression
--webhook-deny-list string Set the denied URLs for the webhook feature using a regular expression
--webhook-error-allow-list string Set the allowed URLs in case of an error for the webhook feature using a regular expression
--webhook-error-deny-list string Set the denied URLs in case of an error for the webhook feature using a regular expression
caution

--api-webhook-* properties are deprecated.

Middleware

The middleware reads the following headers:

  • Gotenberg-Webhook-Url - the callback to use - required
  • Gotenberg-Webhook-Error-Url - the callback to use if error - required
  • Gotenberg-Webhook-Method - the HTTP method to use (POST, PATCH, or PUT - default POST).
  • Gotenberg-Webhook-Error-Method - the HTTP method to use if error (POST, PATCH, or PUT - default POST).
  • Gotenberg-Webhook-Extra-Http-Headers - the extra HTTP headers to send to both URLs (JSON format).

For instance:

curl \
--request POST 'http://localhost:3000/forms/chromium/convert/url' \
--header 'Gotenberg-Webhook-Extra-Http-Headers: {"MyHeader": "MyValue"}' \
--header 'Gotenberg-Webhook-Url: https://my.webhook.url' \
--header 'Gotenberg-Webhook-Method: PUT' \
--header 'Gotenberg-Webhook-Error-Url: https://my.webhook.error.url' \
--header 'Gotenberg-Webhook-Error-Method: POST' \
--form 'url="https://my.url"'
Status: 204 No Content
tip

PipeDream provides an excellent platform if you wish to test the webhook feature.