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
--webhook-max-retry int Set the maximum number of retries for the webhook feature (default 4)
--webhook-retry-min-wait duration Set the minimum duration to wait before trying to call the webhook again (default 1s)
--webhook-retry-max-wait duration Set the maximum duration to wait before trying to call the webhook again (default 30s)
--webhook-disable bool Disable the webhook feature
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.