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>"
}
]
}
'import requests
url = "https://api.hubapi.com/forms/v2/forms"
payload = {
"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>"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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>'
}
]
})
};
fetch('https://api.hubapi.com/forms/v2/forms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/forms/v2/forms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/forms/v2/forms"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"action\": \"<string>\",\n \"method\": \"<string>\",\n \"cssClass\": \"<string>\",\n \"redirect\": \"<string>\",\n \"submitText\": \"<string>\",\n \"followUpId\": \"<string>\",\n \"notifyRecipients\": \"<string>\",\n \"leadNurturingCampaignId\": \"<string>\",\n \"formFieldGroups\": [\n {\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"fieldType\": \"<string>\",\n \"description\": \"<string>\",\n \"groupName\": \"<string>\",\n \"displayOrder\": 123,\n \"required\": true,\n \"selectedOptions\": [\n \"<string>\"\n ],\n \"options\": [\n {}\n ],\n \"validation\": {\n \"name\": \"<string>\",\n \"message\": \"<string>\",\n \"data\": \"<string>\",\n \"useDefaultBlockList\": true,\n \"blockedEmailAddresses\": [\n \"<string>\"\n ]\n },\n \"enabled\": true,\n \"hidden\": true,\n \"defaultValue\": \"<string>\",\n \"isSmartField\": true,\n \"unselectedLabel\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ],\n \"default\": true,\n \"isSmartGroup\": true\n }\n ],\n \"selectedExternalOptions\": [\n {\n \"referenceType\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"propertyName\": \"<string>\",\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hubapi.com/forms/v2/forms")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"action\": \"<string>\",\n \"method\": \"<string>\",\n \"cssClass\": \"<string>\",\n \"redirect\": \"<string>\",\n \"submitText\": \"<string>\",\n \"followUpId\": \"<string>\",\n \"notifyRecipients\": \"<string>\",\n \"leadNurturingCampaignId\": \"<string>\",\n \"formFieldGroups\": [\n {\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"fieldType\": \"<string>\",\n \"description\": \"<string>\",\n \"groupName\": \"<string>\",\n \"displayOrder\": 123,\n \"required\": true,\n \"selectedOptions\": [\n \"<string>\"\n ],\n \"options\": [\n {}\n ],\n \"validation\": {\n \"name\": \"<string>\",\n \"message\": \"<string>\",\n \"data\": \"<string>\",\n \"useDefaultBlockList\": true,\n \"blockedEmailAddresses\": [\n \"<string>\"\n ]\n },\n \"enabled\": true,\n \"hidden\": true,\n \"defaultValue\": \"<string>\",\n \"isSmartField\": true,\n \"unselectedLabel\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ],\n \"default\": true,\n \"isSmartGroup\": true\n }\n ],\n \"selectedExternalOptions\": [\n {\n \"referenceType\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"propertyName\": \"<string>\",\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/forms/v2/forms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"action\": \"<string>\",\n \"method\": \"<string>\",\n \"cssClass\": \"<string>\",\n \"redirect\": \"<string>\",\n \"submitText\": \"<string>\",\n \"followUpId\": \"<string>\",\n \"notifyRecipients\": \"<string>\",\n \"leadNurturingCampaignId\": \"<string>\",\n \"formFieldGroups\": [\n {\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"fieldType\": \"<string>\",\n \"description\": \"<string>\",\n \"groupName\": \"<string>\",\n \"displayOrder\": 123,\n \"required\": true,\n \"selectedOptions\": [\n \"<string>\"\n ],\n \"options\": [\n {}\n ],\n \"validation\": {\n \"name\": \"<string>\",\n \"message\": \"<string>\",\n \"data\": \"<string>\",\n \"useDefaultBlockList\": true,\n \"blockedEmailAddresses\": [\n \"<string>\"\n ]\n },\n \"enabled\": true,\n \"hidden\": true,\n \"defaultValue\": \"<string>\",\n \"isSmartField\": true,\n \"unselectedLabel\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ],\n \"default\": true,\n \"isSmartGroup\": true\n }\n ],\n \"selectedExternalOptions\": [\n {\n \"referenceType\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"propertyName\": \"<string>\",\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"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>"
}{
"category": "<string>",
"correlationId": "<string>",
"message": "<string>",
"subCategory": "<string>",
"errors": [
{
"message": "<string>",
"in": "<string>",
"code": "<string>",
"subCategory": "<string>",
"context": {}
}
],
"context": {},
"links": {}
}{
"category": "<string>",
"correlationId": "<string>",
"message": "<string>",
"subCategory": "<string>",
"errors": [
{
"message": "<string>",
"in": "<string>",
"code": "<string>",
"subCategory": "<string>",
"context": {}
}
],
"context": {},
"links": {}
}Create a new form
This endpoint is used to create a new form in a given HubSpot account.
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>"
}
]
}
'import requests
url = "https://api.hubapi.com/forms/v2/forms"
payload = {
"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>"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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>'
}
]
})
};
fetch('https://api.hubapi.com/forms/v2/forms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/forms/v2/forms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/forms/v2/forms"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"action\": \"<string>\",\n \"method\": \"<string>\",\n \"cssClass\": \"<string>\",\n \"redirect\": \"<string>\",\n \"submitText\": \"<string>\",\n \"followUpId\": \"<string>\",\n \"notifyRecipients\": \"<string>\",\n \"leadNurturingCampaignId\": \"<string>\",\n \"formFieldGroups\": [\n {\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"fieldType\": \"<string>\",\n \"description\": \"<string>\",\n \"groupName\": \"<string>\",\n \"displayOrder\": 123,\n \"required\": true,\n \"selectedOptions\": [\n \"<string>\"\n ],\n \"options\": [\n {}\n ],\n \"validation\": {\n \"name\": \"<string>\",\n \"message\": \"<string>\",\n \"data\": \"<string>\",\n \"useDefaultBlockList\": true,\n \"blockedEmailAddresses\": [\n \"<string>\"\n ]\n },\n \"enabled\": true,\n \"hidden\": true,\n \"defaultValue\": \"<string>\",\n \"isSmartField\": true,\n \"unselectedLabel\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ],\n \"default\": true,\n \"isSmartGroup\": true\n }\n ],\n \"selectedExternalOptions\": [\n {\n \"referenceType\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"propertyName\": \"<string>\",\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hubapi.com/forms/v2/forms")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"action\": \"<string>\",\n \"method\": \"<string>\",\n \"cssClass\": \"<string>\",\n \"redirect\": \"<string>\",\n \"submitText\": \"<string>\",\n \"followUpId\": \"<string>\",\n \"notifyRecipients\": \"<string>\",\n \"leadNurturingCampaignId\": \"<string>\",\n \"formFieldGroups\": [\n {\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"fieldType\": \"<string>\",\n \"description\": \"<string>\",\n \"groupName\": \"<string>\",\n \"displayOrder\": 123,\n \"required\": true,\n \"selectedOptions\": [\n \"<string>\"\n ],\n \"options\": [\n {}\n ],\n \"validation\": {\n \"name\": \"<string>\",\n \"message\": \"<string>\",\n \"data\": \"<string>\",\n \"useDefaultBlockList\": true,\n \"blockedEmailAddresses\": [\n \"<string>\"\n ]\n },\n \"enabled\": true,\n \"hidden\": true,\n \"defaultValue\": \"<string>\",\n \"isSmartField\": true,\n \"unselectedLabel\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ],\n \"default\": true,\n \"isSmartGroup\": true\n }\n ],\n \"selectedExternalOptions\": [\n {\n \"referenceType\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"propertyName\": \"<string>\",\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/forms/v2/forms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"action\": \"<string>\",\n \"method\": \"<string>\",\n \"cssClass\": \"<string>\",\n \"redirect\": \"<string>\",\n \"submitText\": \"<string>\",\n \"followUpId\": \"<string>\",\n \"notifyRecipients\": \"<string>\",\n \"leadNurturingCampaignId\": \"<string>\",\n \"formFieldGroups\": [\n {\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"fieldType\": \"<string>\",\n \"description\": \"<string>\",\n \"groupName\": \"<string>\",\n \"displayOrder\": 123,\n \"required\": true,\n \"selectedOptions\": [\n \"<string>\"\n ],\n \"options\": [\n {}\n ],\n \"validation\": {\n \"name\": \"<string>\",\n \"message\": \"<string>\",\n \"data\": \"<string>\",\n \"useDefaultBlockList\": true,\n \"blockedEmailAddresses\": [\n \"<string>\"\n ]\n },\n \"enabled\": true,\n \"hidden\": true,\n \"defaultValue\": \"<string>\",\n \"isSmartField\": true,\n \"unselectedLabel\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ],\n \"default\": true,\n \"isSmartGroup\": true\n }\n ],\n \"selectedExternalOptions\": [\n {\n \"referenceType\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"propertyName\": \"<string>\",\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"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>"
}{
"category": "<string>",
"correlationId": "<string>",
"message": "<string>",
"subCategory": "<string>",
"errors": [
{
"message": "<string>",
"in": "<string>",
"code": "<string>",
"subCategory": "<string>",
"context": {}
}
],
"context": {},
"links": {}
}{
"category": "<string>",
"correlationId": "<string>",
"message": "<string>",
"subCategory": "<string>",
"errors": [
{
"message": "<string>",
"in": "<string>",
"code": "<string>",
"subCategory": "<string>",
"context": {}
}
],
"context": {},
"links": {}
}Scope requirements
Scope requirements
Body
The name of the form
The action URL for the form
The HTTP method for the form
The CSS class for the form
The redirect URL after form submission
The text for the submit button
The follow-up ID
The notification recipients
The lead nurturing campaign ID
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Form created successfully
The portal ID
The unique identifier for the form
The name of the form
The action URL for the form
The HTTP method for the form
The CSS class for the form
The redirect URL after form submission
The text for the submit button
The follow-up ID
The notification recipients
The lead nurturing campaign ID
Show child attributes
Show child attributes
The timestamp when the form was created
The timestamp when the form was last updated
The performable HTML
What the form was migrated from
Whether to ignore current values
Whether the form is deletable
The inline message
The TMS ID
Whether CAPTCHA is enabled
The campaign GUID
Whether the form is cloneable
Whether the form is editable
The type of the form
The timestamp when the form was deleted
The theme name
The parent ID
The form style
Whether the form is published
The publish timestamp
The unpublish timestamp
The published timestamp
The custom UID
Whether to create marketable contacts
The edit version
The thank you message JSON
The theme color
Whether to always create new companies
The internal updated timestamp
The business unit ID
The portable key
Show child attributes
Show child attributes
The embed version
Was this page helpful?