Forms

How do I create a custom form to work with HubSpot?

Last updated: October 6, 2015

If you need additional functionality, not available with standard HubSpot forms, you can integrate external forms with HubSpot's Forms API.

Our API documentation can be found on developers.hubspot.com. You will want to use the Submit Form Data endpoint.

  • Create a form in HubSpot and get the form GUID from the URL (available in the address bar while editing the form). Add the form GUID and your HUB ID to the API Post URL that you will submit the form results to via your server-side form action script.
  • Our API requires the use of a server-side script that executes when a user submits the form. This custom script's url would be added to the action attribute of your HTML form.
  • This custom server side script would post to this endpoint. The POST url should be updated with your Hub ID and form GUID.
  • In addition to sending the url encoded form data collected from your HTML form fields, the server side script needs to request the user's hubspotutk cookie and other visitor data used to populate the hs_context parameter. With this additional data, HubSpot will be able to record the visitors analytic information.

We also have a Support Forum for API related questions, where your developers may ask questions. This is the best way to get specific HubSpot API-related questions answered.