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

Last updated: March 22, 2017

Available For:

Marketing: Basic, Pro, Enterprise
Sales: N/A

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 To integrate your form, you will want to use the Submit Form Data endpoint.

  • Create a form in HubSpot and get the form GUID from the URL (this is 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 Developer Forum where your developers may ask questions. You can also more about the Developer Forum here.

Was this article helpful?