You can use webhooks in workflows to pass information from HubSpot to another web application.
What are webhooks?
Webhooks are used to send data from one web application to another after an action is completed in the source application. Just as emails are messages between humans, webhooks are messages between software platforms via an HTTP request. You can use webhooks to send data, notifications, alerts, or any other real-time updates. In short, webhooks present a powerful way to automate your marketing, allowing you to send data from one application or system to another.
Examples of popular use cases for webhooks include:
Posting HubSpot contacts data to another system, such as a CRM, when that contact fills out a particular form on your site.
Sending contact data into an external system that creates a trial of the software for the contact.
Chat alerts sent from your external system to your company's chat stream that lets employees know something important has happened.
Setting up a webhook in HubSpot
- Navigate to workflows:
- In your HubSpot Marketing Professional or Enterprise account, navigate to Contacts > Workflows.
- In your HubSpot Sales Professional account, navigate to Sales Tools > Workflows.
- Click the name of the workflow you'd like to edit.
- Click the + icon to add an action and select Trigger a webhook.
- Choose GET or POST from the dropdown.
- GET - sends a GET request to the specified URL
- POST - sends a POST request (submits data) to the specified URL
- Enter the webhook URL.
- If the request to your system requires authentication, check the Use authentication? box and add a username and password. In this case, the user agent employs the authentication header. Basically, the username and password are combined into a string ("username:password"), which is then encoded (Basic Base64).
- Click Save.
Testing your webhook
After you create your workflow with a webhook action, you can run a quick test with a dummy webhook URL. Go to https://webhook.site and copy the unique URL that is automatically created, then paste that URL in the webhook URL field in your webhook action.
Below is an example of the Request Body of the webhook above, which reveals meta information about the specific contact, including contact information, form submissions, list memberships, etc. When the workflow action was triggered, HubSpot sent the contact's entire record formatted in JSON to the specified URL.
The receiving system can then parse that JSON data, and use it for its own application.
For additional information about webhooks, check out the webhooks reference documentation. If you have additional questions about your specific implementation of webhooks with HubSpot, reach out on the HubSpot Developers Forums.