Workflows

How do I use webhooks with HubSpot workflows?

Last updated: November 1, 2017

Available For:

Marketing: Pro, Enterprise
Sales: Professional

You can use the webhooks feature of 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 have created your workflow with a webhook action, you can do a really quick test with a dummy webhook URL. Go to http://requestb.in/ and create a Request Bin. Please note that requestb.in may truncate your results if over a certain character limit. Use that URL as the webhook URL in your webhook action.

Here is an example of the Request Body of the webhook from above, which reveals meta information about the specific contact, including contact information, form submissions, list memberships, etc. When the workflow action is triggered, HubSpot sent the Contact's entire record formatted in JSON to the specified URL.

User-added image
User-added image

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, please reach out on developers.hubspot.com/forum.

Was this article helpful?