Create a new form

Last updated December 30, 2019

POST /forms/v2/forms

Method Details

HTTP Methods:

POST

Content Type:

application/json

Response Format:

json

Requires Authentication?

Yes

Rate Limited?

Yes

Headers

User-Agent

Products:

Marketing

Required Scope:

forms

This endpoint is used to create a new form in a given HubSpot account.

Use case for this endpoint: Forms are standard website tools that are used to generate leads. This capability might be useful for an integration with an external system that has its own form-building interface.

Form fields and groups

Forms may have a set of associated fields or field groups. When creating a new form using this API, you can specify the fields that you want included.

Field groups are used to group fields together in a row. All fields in the same fieldgroup will be displayed on the same row.

Response details

All forms should have a unique name. If you attempt to create a new form using the same name as an existing form, we will return a 409.

 

Required parameters How to use Description
OAuth Access Token or API Key Authorization: Bearer {token} header
or hapikey={key} query parameter.
Used to authenticate the request. Please see this page for more details about authentication.
Form data Used in the request body The data for the form that you're creating. This can include any number of data points or fields. For an example of this data, please see the JSON code sample for POSTing and creating a new form below.
Optional parameters How to use Description
Form fields and groups Used in the request body When creating a new form, you have the ability to also add some fields that you'd like to be a part of the form you're creating. These fields will show up in the form through the HubSpot user interface, where you can customize your forms further. For an example of the data structure for adding form fields to your form on creation with this method, please see the example below.

Example URL:  https://api.hubapi.com/forms/v2/forms?hapikey=demo