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

Last updated: April 4, 2018

If you need additional functionality that is not available with standard HubSpot forms, you can work with your developer to integrate your external forms with HubSpot's Forms API.

  • Create a form in HubSpot and get the form GUID from the URL (this appears 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.

You can find documentation on the submit form data endpoint hereFor additional resources, please check out our Developers Forum.

Was this article helpful?

If you still need help you can get answers from the , or to contact support.