Skip to main content
POST
/
forms
/
v2
/
forms
Create a new form
curl --request POST \
  --url https://api.hubapi.com/forms/v2/forms \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "action": "<string>",
  "method": "<string>",
  "cssClass": "<string>",
  "redirect": "<string>",
  "submitText": "<string>",
  "followUpId": "<string>",
  "notifyRecipients": "<string>",
  "leadNurturingCampaignId": "<string>",
  "formFieldGroups": [
    {
      "fields": [
        {
          "name": "<string>",
          "label": "<string>",
          "type": "<string>",
          "fieldType": "<string>",
          "description": "<string>",
          "groupName": "<string>",
          "displayOrder": 123,
          "required": true,
          "selectedOptions": [
            "<string>"
          ],
          "options": [
            {}
          ],
          "validation": {
            "name": "<string>",
            "message": "<string>",
            "data": "<string>",
            "useDefaultBlockList": true,
            "blockedEmailAddresses": [
              "<string>"
            ]
          },
          "enabled": true,
          "hidden": true,
          "defaultValue": "<string>",
          "isSmartField": true,
          "unselectedLabel": "<string>",
          "placeholder": "<string>"
        }
      ],
      "default": true,
      "isSmartGroup": true
    }
  ],
  "selectedExternalOptions": [
    {
      "referenceType": "<string>",
      "objectTypeId": "<string>",
      "propertyName": "<string>",
      "id": "<string>"
    }
  ]
}
'
{
  "portalId": 123,
  "guid": "<string>",
  "name": "<string>",
  "action": "<string>",
  "method": "<string>",
  "cssClass": "<string>",
  "redirect": "<string>",
  "submitText": "<string>",
  "followUpId": "<string>",
  "notifyRecipients": "<string>",
  "leadNurturingCampaignId": "<string>",
  "formFieldGroups": [
    {
      "fields": [
        {
          "name": "<string>",
          "label": "<string>",
          "type": "<string>",
          "fieldType": "<string>",
          "description": "<string>",
          "groupName": "<string>",
          "displayOrder": 123,
          "required": true,
          "selectedOptions": [
            "<string>"
          ],
          "options": [
            {}
          ],
          "validation": {
            "name": "<string>",
            "message": "<string>",
            "data": "<string>",
            "useDefaultBlockList": true,
            "blockedEmailAddresses": [
              "<string>"
            ]
          },
          "enabled": true,
          "hidden": true,
          "defaultValue": "<string>",
          "isSmartField": true,
          "unselectedLabel": "<string>",
          "placeholder": "<string>",
          "dependentFieldFilters": [
            {}
          ],
          "labelHidden": true,
          "propertyObjectType": "<string>",
          "metaData": [
            {}
          ],
          "objectTypeId": "<string>"
        }
      ],
      "default": true,
      "isSmartGroup": true,
      "richText": {
        "content": "<string>",
        "type": "<string>"
      },
      "isPageBreak": true
    }
  ],
  "createdAt": 123,
  "updatedAt": 123,
  "performableHtml": "<string>",
  "migratedFrom": "<string>",
  "ignoreCurrentValues": true,
  "metaData": [
    {}
  ],
  "deletable": true,
  "inlineMessage": "<string>",
  "tmsId": "<string>",
  "captchaEnabled": true,
  "campaignGuid": "<string>",
  "cloneable": true,
  "editable": true,
  "formType": "<string>",
  "deletedAt": 123,
  "themeName": "<string>",
  "parentId": 123,
  "style": "<string>",
  "isPublished": true,
  "publishAt": 123,
  "unpublishAt": 123,
  "publishedAt": 123,
  "customUid": "<string>",
  "createMarketableContact": true,
  "editVersion": 123,
  "thankYouMessageJson": "<string>",
  "themeColor": "<string>",
  "alwaysCreateNewCompany": true,
  "internalUpdatedAt": 123,
  "businessUnitId": 123,
  "portableKey": "<string>",
  "paymentSessionTemplateIds": [
    "<string>"
  ],
  "selectedExternalOptions": [
    {
      "referenceType": "<string>",
      "objectTypeId": "<string>",
      "propertyName": "<string>",
      "id": "<string>"
    }
  ],
  "embedVersion": "<string>"
}

Body

application/json
name
string
required

The name of the form

action
string

The action URL for the form

method
string

The HTTP method for the form

cssClass
string

The CSS class for the form

redirect
string

The redirect URL after form submission

submitText
string

The text for the submit button

followUpId
string

The follow-up ID

notifyRecipients
string

The notification recipients

leadNurturingCampaignId
string

The lead nurturing campaign ID

formFieldGroups
object[]
selectedExternalOptions
object[]

Response

Form created successfully

portalId
integer
required

The portal ID

guid
string
required

The unique identifier for the form

name
string
required

The name of the form

action
string

The action URL for the form

method
string

The HTTP method for the form

cssClass
string

The CSS class for the form

redirect
string

The redirect URL after form submission

submitText
string

The text for the submit button

followUpId
string

The follow-up ID

notifyRecipients
string

The notification recipients

leadNurturingCampaignId
string

The lead nurturing campaign ID

formFieldGroups
object[]
createdAt
integer<int64>

The timestamp when the form was created

updatedAt
integer<int64>

The timestamp when the form was last updated

performableHtml
string

The performable HTML

migratedFrom
string

What the form was migrated from

ignoreCurrentValues
boolean

Whether to ignore current values

metaData
object[]
deletable
boolean

Whether the form is deletable

inlineMessage
string

The inline message

tmsId
string

The TMS ID

captchaEnabled
boolean

Whether CAPTCHA is enabled

campaignGuid
string

The campaign GUID

cloneable
boolean

Whether the form is cloneable

editable
boolean

Whether the form is editable

formType
string

The type of the form

deletedAt
integer<int64>

The timestamp when the form was deleted

themeName
string

The theme name

parentId
integer

The parent ID

style
string

The form style

isPublished
boolean

Whether the form is published

publishAt
integer<int64>

The publish timestamp

unpublishAt
integer<int64>

The unpublish timestamp

publishedAt
integer<int64>

The published timestamp

customUid
string

The custom UID

createMarketableContact
boolean

Whether to create marketable contacts

editVersion
integer

The edit version

thankYouMessageJson
string

The thank you message JSON

themeColor
string

The theme color

alwaysCreateNewCompany
boolean

Whether to always create new companies

internalUpdatedAt
integer<int64>

The internal updated timestamp

businessUnitId
integer

The business unit ID

portableKey
string

The portable key

paymentSessionTemplateIds
string[]
selectedExternalOptions
object[]
embedVersion
string

The embed version

Last modified on December 12, 2025