Built-in apps

Webhooks

21min

With the Webhooks app in Make, you can create custom webhooks, custom mailhooks, and webhook responses.

Custom webhook module

To create a custom webhook, you can add the Custom webhook module in a .

Each must use its own webhook. You can not use one webhook in multiple .

Adding a custom webhook to your

1

Insert the Custom Webhook module from the Webhooks app.

2

In the module's settings, click Add.

3

Set the webhook's name and other settings, then click Save.

 generates a URL and starts listening for requests to this URL. Send a request to this URL to have automatically determine the data structure for this webhook. See setting up webhook data structure below for more details.

You can access the webhook's details and change the webhook's settings in the Webhooks section in the left menu.

Setting up webhook data structure

Optionally, you can let know what data structure to expect in the webhook request payload. can use data structures to validate the incoming data. If you do not set up a data structure, will pass the incoming data to subsequent modules in your without any validation.

To enable validating incoming data, set up the webhook's data structure in one of the following ways:

  • Create a new data structure manually in the Data structures section.
  • Use an existing data structure.

You can also use the following methods to let know what data structure to expect.

Note that these methods do not enable data validation. The data structure set up in this way only helps with mapping the webhook data to subsequent modules in your .

  • Create a data structure immediately after creating the webhook by calling the webhook URL with sample data in the request body.
  • Re-determine the data structure of an existing webhook going to the Webhook module settings, clicking Re-determine data structure, and calling the webhook URL with sample data in the request body.

If you call the webhook URL to automatically determine or re-determine the data structure, does not create a reusable data structure in the Data structures section. The data structure determined in this way is stored internally with the particular webhook. In this case, does not validate incoming data.

Supported incoming data formats

 supports the following formats of incoming data:

  • Query string
  • Form data
  • JSON

If a webhook receives data in both the query string and either form data or JSON data at the same time, the system combines the data into a single bundle. If the request contains duplicate data in different formats, the query string takes precedence and overwrites the data that was received in the other formats. We recommend you do not duplicate data in query strings, form data, and JSON.

Query String

Text


Form Data

Text


Multipart

JSON


In order to receive files encoded with multipart/form-data, it is necessary to configure a data structure with a  collection type field that contains the nested fields   namemime and data. The field name is a text type and contains the name of the uploaded file. The mime is a text type and contains a file in the [MIME] format. The field data is a buffer type and contains binary data for the file being transferred.

JSON

JSON


To access the original JSON, open the webhook's settings and enable the JSON pass-through option:

Document image


The maximum allowed webhook's payload size (Content-Length) is 5 MB (5.242.880 bytes) regardless of the subscription tier.

Webhook headers

To access the webhook's headers, enable the Get request headers option in the webhook's setup:

Document image


You can then extract a particular header value with the combination of map() & get() functions. The example below shows a formula that extracts the value of the authorization header from the Headers[] array. The formula is used in a filter that compares the extracted value with the given text to pass only webhooks if there is a match.

Document image




Editing custom webhook settings

To adjust a custom webhook's settings, click Webhooks in the left menu and Edit a webhook. This is only applicable for Make's Custom Webhooks module.

Setting

Description

IP restrictions

A allow list of IP addresses delimited by comma. Only webhook requests that come from the specified IPs will be processed. Use CIDR notation to allow list a subnet. Leave empty if you want to allow requests from all IPs.

Data structure

Select an existing data structure or create a new data structure for the webhook. will use the data structure to validate the incoming data. Requests that don't pass validation will be rejected with HTTP status code 400.

Get request headers

Extracts headers data from the webhook request and makes the data available for mapping in the scenario.

Get request HTTP method

Extracts the HTTP method from the request and makes the method available for mapping in the scenario.

JSON pass-through

Passes JSON payloads to subsequent modules in the scenario as a text string, as opposed to breaking the payload down into mappable fields.

Custom mailhook module

Custom mailhook is an instant trigger module that can be triggered by sending an email to the email address generated by this module.

The maximum size of an email, including its attachments, that you send to a mailhook is 25 MB.

Example of use

The Custom mailhook module will monitor your incoming emails without the need to have a scheduled run of the .

1

Add the Custom mailhook to your (Webhooks > Custom mailhook).

Document image

2

Generate a mailhook email address, and copy the address to the clipboard.

Document image

3

Save and run the .

4

Open your email account settings, and configure forwarding. Use the email address generated by the Custom mailhook module in step 2 (above) as the forwarding address.

For Gmail:

1

Click the cogwheel in the top-right corner, and then click See all settings.

2

Open the Forwarding and POP/IMAP tab.

Document image

3

Click the Add a forwarding address button.

4

Enter the email address you have generated and copied in step 2 above, and click Next.

Document image

5

After that, a popup window will appear. Click Proceed.

6

A confirmation link has been sent to your mailhook. Run the custom mailhook module to see this code in the output under Bundle > Text.

Document image


If you use Gmail for work or school, you don't need to verify the forwarding address.

7

Enable the forwarding, and save changes.

Document image


Add other desired modules to the . Then save and activate the .

Now, every time a new email is received in your email account, the Custom mailhook module in your is triggered and receives the email message data.

The sender and various recipient addresses (To: CC: and BCC:) are resolved in the data structure of the incoming mail. Reply-To: can be found in the Header section.

Webhook response module

The default response to a webhook call contains just a simple text, "Accepted". The response is returned to the webhook's caller right away during the execution of the Custom Webhook module. You can easily test it like this:

1

Place the Custom Webhook module in your .

2

Add a new webhook in the module's configuration.

3

Copy the webhook's URL to your clipboard.

4

Run the - the Custom Webhook module should be waiting for the webhook call (see on the right)

5

Open a new browser window, paste the copied URL in the address bar and press Enter.

6

The Custom Webhook module will be triggered and the browser will display the following page:

These are default responses when the does not contain the Webhook Response module:



HTTP status code

Body

Webhook accepted in the queue

200

Accepted

Webhook queue full

400

Queue is full.

If you wish to customize the webhook's response, employ the module Webhook Response. The configuration of the module contains two fields: Status and Body. The Status field should contain HTTP response status codes like 2xx for Success (e.g.200 for OK), 3xx for Redirection (e.g.307 for Temporary Redirect), 4xx for Client errors (e.g. 400 for Bad Request), etc. The Body field should contain anything that will be accepted by the webhook's call. It can be a simple text, HTML, XML, JSON, etc. It is advisable to set the Content-Type header to the corresponding mime type: text/plain for plain text, text/html for HTML, application/json for JSON, application/xml for XML, etc.

These are additional default responses when the does contain the Webhook Response module:



HTTP status code

Body

 encounters an error

500

 failed to complete.

The timeout for sending a response is 180 seconds. If the response is not available within that period, returns a '200 Accepted' status.

HTML Response example

Configure the Webhook Response module as follows:

Status

Body

HTML code, e.g.:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Thank you!</title> </head> <body>Thank you, {{1.name}}, for your request! </body> </html>

Custom headers

  • Key - Content-type
  • Value - text/html
Document image


It will produce an HTML response that will be displayed like this in a web browser:

Document image


Redirect example

Configure the Webhook Response module as follows:

Status

Custom headers

  • Key - Location
  • Value - The URL you would like to redirect to.



Document image


Troubleshooting Webhooks

Missing items in the mapping panel

If some items are missing in the mapping panel in the setup of the modules following the Webhooks > Custom Webhook module, click the Webhooks > Custom Webhook module to open its setup and click Re-determine data structure:

Document image


Then follow the steps described in the section Determine the webhook's data structure.