This tutorial guides you through how to set up webhooks to send HTTP requests to external systems.
This tutorial will walk through creating a REST API source and a webhook associated with that source. If you have already created a source, you can skip ahead to the Create a webhook step.
If you are trying to connect to a system that is not accessible from the internet, you must follow additional steps to configure an agent proxy or agent worker runtime and add certificates. Agent runtimes are an advanced concept and come with additional complexity to configure and manage. Where possible, we recommended using direct connections.
For more information on how to get started with agent runtimes, refer to these guides:
When using webhooks with an agent runtime in production, we recommend provisioning a dedicated agent for webhooks. Agents execute tasks in the order received, and if bulk syncs and webhooks are executed on the same agent, short-running webhook tasks may end up queued behind long-running bulk syncs.
Ensure that you have a Project to manage permissions for the source you will create in this tutorial. If you have not yet created a Project, learn how in the Project documentation.
This tutorial assumes you will be using a REST API for a system available over the open internet.
Some sources, including SAP, legacy Salesforce, and legacy magritte-rest-v2
use a more complex task configuration. For more information on configuring webhook tasks, see the webhooks reference.
Start by navigating to Data Connection and selecting the Sources tab. Then, select New source and REST API.
Use the source editor to fill in configuration details for the REST API to which you are connecting. More details on the REST API source type can be found in the source type reference.
The source is meant to contain the minimal set of secrets and connection details required to establish a connection. When configuring individual webhooks using this source, you will have an opportunity to add additional request details, including the relative path, query parameters, headers, and body content.
Some other source types also support webhooks. For more details, review the reference page for the specific source type.
Once the source has been created, select the Webhooks tab and select New webhook.
Follow the steps in the New webhook wizard to create a webhook that makes an external request. The example below illustrates a POST
request to the /api/v1/createItem
endpoint on our example domain. The body is constructed as Raw JSON and, in this case, is configured to accept two string input parameters.
Alternatively, you can also create a request Call by directly importing a cURL command. To do this, choose the Import from cURL option and put your cURL command in the TextArea. If your cURL uses the supported options and relates to a domain already in Source, selecting Import cURL will create a new Call.
After saving, you will be able to run a test request to see if your configuration is correct. This may be done at any time by using the Test Connection side panel.
After a test request is made, you may use the response to parse output parameters. For more information on output parameters, see the webhooks reference page.
In this tutorial, you learned how to create a Source and create a Webhook associated with that Source. Here are some resources we recommend to learn more: