Form Object

Use forms to collect visitor information and create identified prospects. Learn more about forms in Salesforce Help.

The API to access the Form object collection follows the conventions described in Version 5 Overview.

Include the authentication header with every request. For information on how to authenticate, see Authentication.

Note

Supported Operations 

OperationHTTP VerbURL FormatAbility Requirements
Add TagPOSThttps://pi.pardot.com/api/v5/objects/forms/<id>/do/addTagMarketing > Forms > Forms > Create AND Marketing > Segmentation > Tags > Create
Copy to CMSPOSThttps://pi.pardot.com/api/v5/objects/forms/<id>/do/copyToCmsMarketing > Forms > Forms > Copy to CMS
CreatePOSThttps://pi.pardot.com/api/v5/objects/formsMarketing > Forms > Forms > Create
DeleteDELETEhttps://pi.pardot.com/api/v5/objects/forms/<id>Marketing > Forms > Forms > Delete
QueryGEThttps://pi.pardot.com/api/v5/objects/forms?<params>Marketing > Forms > Forms > View
ReadGEThttps://pi.pardot.com/api/v5/objects/forms/<id>?<params>Marketing > Forms > Forms > View
Remove TagPOSThttps://pi.pardot.com/api/v5/objects/forms/<id>/do/removeTagMarketing > Forms > Forms > Create AND Marketing > Segmentation > Tags > Create
Reorder Form FieldsPOSThttps://pi.pardot.com/api/v5/objects/forms/<id>/do/reorderFormFieldsMarketing > Forms > Forms > Create
UndeletePOSThttps://pi.pardot.com/api/v5/objects/forms/do/undeleteMarketing > Forms > Forms > Delete

Fields 

Required Editable Fields 

FieldTypeDescription
campaignIdIntegerThe ID of the campaign related to this object.
layoutTemplateIdIntegerThe ID of the layout template related to this object.
nameStringThe name of the object for identification in Account Engagement.

Optional Editable Fields 

FieldTypeDescription
afterFormContentStringThe HTML text displayed below the form.
beforeFormContentStringThe HTML text displayed above the form.
checkboxAlignmentStringPossible values: default, horizontal, stacked.
folderIdIntegerThe ID of the folder containing this object.
fontColorString6-digit number in hexadecimal format such as #123456.
fontFamilyStringPossible values: default, “Helvetica, Arial, Sans-serif”, “Georgia, Times, Times New Roman, Serif”, “Tahoma, Trebuchet MS, Verdana, Helvetica, Arial, Sans-serif”, “Courier New, Courier, Monospace”.
fontSizeStringPossible values: default, 8pt, 10pt, 12pt, 14pt, 18pt, 24pt, 36pt.
isAlwaysDisplayBooleanAlways display the form after submission. When enabled, the form displays after submission. When disabled, a 10-minute waiting period hides the form after submission.
isCaptchaEnabledBooleanEnable explicit bot protection using reCAPTCHA.
isCookielessBooleanKiosk/Data Entry Mode: Don’t use browser cookies to create prospects.
labelAlignmentStringPossible values: default, above, left.
radioAlignmentStringPossible values: default, horizontal, stacked.
redirectLocationStringRedirect to this URL instead of showing the “thank you” content.
requiredCharacterStringPossible values: default, *.
showNotProspectBooleanInclude “Not you?” link to allow visitors to reset the form. Valid when isCookieless isn’t set.
submitButtonTextStringThe label used for the submit button.
thankYouCodeStringThank you code is typically JavaScript used to call other systems like Google Conversion Tracking.
thankYouContentStringThe HTML text displayed after the form is submitted.
trackerDomainIdIntegerThe ID of the tracker domain related to this object.

Read-Only Fields 

FieldTypeDescription
campaignCampaignCampaign object representing the campaign related to this object. See documentation for Campaign for fields.
createdAtDateTimeDate and time that the object was created.
createdByUserUser object representing the user who created this object. See documentation for User for fields.
createdByIdIntegerThe ID of the user who created this object.
embedCodeStringThe HTML code to embed this form in an iframe.
folderFolderFolder object representing the folder containing this object. See documentation for Folder for fields.
idIntegerThe ID of the object.
isDeletedBooleanThis value is true if the object is in the recycle bin in Account Engagement.
isUseRedirectLocationBooleanThis value is true when the redirect location is valid and enabled.
layoutTemplateLayoutTemplateLayout Template object representing the layout template related to this object. See documentation for Layout Template for fields.
salesforceCmsIdStringThe ID of the copied form when using copyToCms. If the form isn’t successfully copied, the value is null.
salesforceIdStringSalesforce ID of the object.
trackerDomainTrackerDomainTracker Domain object representing the tracker domain related to this object. See documentation for Tracker Domain for fields. A null value indicates that the object uses the default tracker domain for the account.
updatedAtDateTimeDate and time that the object was updated.
updatedByUserUser object representing the user who last updated this object. See documentation for User for fields.
updatedByIdIntegerThe ID of the user who last updated this object.
urlStringThe URL of the form.

Form Create 

Create a single form following the conventions described in the Version 5 Overview.

Example Request:

1POST /api/v5/objects/forms HTTP/1.1
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4
5{
6    "name": "First API Form",
7    "campaignId": 10,
8    "layoutTemplateId": 8,
9    "submitButtonText": "Submit",
10    "fontSize": "default",
11    "fontFamily": "default",
12    "labelAlignment": "default",
13    "radioAlignment": "default",
14    "checkboxAlignment": "default",
15    "requiredCharacter": "default",
16    "showNotProspect": false,
17    "isAlwaysDisplay": false,
18    "isCaptchaEnabled": false,
19    "isCookieless": false,
20    "trackerDomainId": 15,
21    "folderId": 6
22}

Example response:

201 Created

1{
2  "name": "First API Form",
3  "campaignId": 10,
4  "layoutTemplateId": 8,
5  "submitButtonText": "Submit",
6  "fontSize": "default",
7  "fontFamily": "default",
8  "labelAlignment": "default",
9  "radioAlignment": "default",
10  "checkboxAlignment": "default",
11  "requiredCharacter": "default",
12  "showNotProspect": false,
13  "isAlwaysDisplay": false,
14  "isCaptchaEnabled": false,
15  "isCookieless": false,
16  "trackerDomainId": 15,
17  "folderId": 6
18}

Form Read 

Retrieve a single form object following the conventions described in the Version 5 Overview.

Example request:

1GET /api/v5/objects/forms/101?fields=id,name,isDeleted,thankYouContent,submitButtonText,campaign.name,createdBy.username,updatedBy.username,createdAt,updatedAt
2Host: pi.pardot.com
3Authorization: Bearer <access-token>

Example response:

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "id": 101,
5    "name": "Standard Form",
6    "isDeleted": false,
7    "thankYouContent": "<p>Thank you for filling out the form. We will get back to you shortly.</p>",
8    "submitButtonText": "Submit",
9    "campaign": {
10        "name": "My Campaign"
11    },
12    "createdAt": "2020-09-29T09:36:56-04:00",
13    "updatedAt": "2020-09-29T09:36:56-04:00",
14    "createdBy": {
15        "username": "jsmith@example.com"
16    },
17    "updatedBy": {
18        "username": "jsmith@example.com"
19    }
20}

Form Query 

Retrieving a collection of forms follows the conventions described in Version 5 Overview.

Sortable Fields 

When executing a query, these fields can be specified. See the conventions for query described in the Version 5 Overview.

  • id

Example request:

1GET /api/v5/objects/forms?fields=id,name,isDeleted,thankYouContent,submitButtonText,campaign.name,createdBy.username,updatedBy.username,createdAt,updatedAt
2Host: pi.pardot.com
3Authorization: Bearer <access-token>

Example response:

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "values": [
5        {
6            "id": 101,
7            "name": "Standard Form",
8            "isDeleted": false,
9            "thankYouContent": "<p>Thank you for filling out the form. We will get back to you shortly.</p>",
10            "submitButtonText": "Submit",
11            "campaign": {
12                "name": "My Campaign"
13            },
14            "createdAt": "2020-09-29T09:36:56-04:00",
15            "updatedAt": "2020-09-29T09:36:56-04:00",
16            "createdBy": {
17                "username": "jsmith@example.com"
18            },
19            "updatedBy": {
20                "username": "jsmith@example.com"
21            }
22        }
23    ]
24}

Filtering Results 

When executing a query, these parameters are used to filter the returned results. These parameters can be specified in the request along with any shared parameters defined in Version 5 Overview. When specifying more than one parameter, all parameters must match the record in order for it to be returned in the results.

ParameterDescription
deletedDetermines whether to return deleted records. The value can be false (default), true, or all.
idReturns any forms where the ID is equal to the given integer value.
idGreaterThanReturns any forms where the ID is greater than the specified value, non-inclusive.
idGreaterThanOrEqualToReturns any forms where the ID is greater than or equal to the specified value.
idLessThanReturns any forms where the ID is less than the specified value, non-inclusive.
idLessThanOrEqualToReturns any forms where the ID is less than or equal to the specified value.
idListReturns any forms where the ID is included in the given list of values.
nameReturns any forms where Name is equal to the given string value.

Example request:

1GET /api/v5/objects/forms?fields=id,name&orderBy=id desc&idGreaterThan=150&idLessThan=200
2Host: pi.pardot.com
3Authorization: Bearer <access-token>

Example response:

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "values": [
5        {
6            "id": 168,
7            "name": "Spring Intake Form"
8        },
9        {
10            "id": 151,
11            "name": "Contact Form"
12        }
13    ]
14}

Form Delete 

Deleting a form follows the conventions described in the Version 5 Overview.

Form Undelete 

Restore a single form from the Account Engagement Recycle Bin.

Example Request

By Form ID

1POST /api/v5/objects/forms/do/undelete HTTP/1.1
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4
5{
6	"id": 200
7}

Example Response

1{
2  "id": 200,
3  "isDeleted": false
4}

Reorder Form Fields 

Reorder a list of form fields for a given form, this changes a Form Fields sortOrder. When this action is taken, the new order of fields are seen when querying or reading Form Fields.

Example Request

1POST /api/v5/objects/forms/6/do/reorderFormFields
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4Content-Type: application/json
5
6{
7    "formFieldIds": [51,50,52,53]
8}

Example Response

1HTTP/1.1 204 No Content

Add Tag 

Adds a Tag to the Form object, which creates a TaggedObject.

Example Request

1POST https://pi.pardot.com/api/v5/objects/forms/1000/do/addTag
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4Content-Type: application/json
5
6{
7    "tagId": 100
8}

Example Response

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "id": 610,
5    "createdAt": "2024-09-23T18:26:49-04:00",
6    "createdById": 250,
7    "objectId": 1000,
8    "objectType": "form",
9    "tagId": 100
10}

Remove Tag 

Remove a tag from a Form object. When you remove a tag, the associated TaggedObject record is deleted.

Example Request

1POST `https://pi.pardot.com/api/v5/objects/forms/1000/do/removeTag`
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4Content-Type: application/json
5
6{
7    "tagId": 100
8}

Example Response

Returns code 204 no content.

Copy to CMS 

Copy a form to your Salesforce CMS Marketing workspace.

Example Request

1POST https://pi.pardot.com/api/v5/objects/forms/1000/do/copyToCms
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4Content-Type: application/json
5
6{
7    "ids": [1, 2]
8}

Example Response

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "numRecordsQueued": 2
5}

Enums 

Font Size 

  • Default
  • 8pt
  • 10pt
  • 12pt
  • 14pt
  • 18pt
  • 24pt
  • 36pt

Font Family 

  • Default
  • Helvetica
  • Arial
  • Tahoma
  • Trebuchet MS
  • Verdana
  • Sans-serif
  • Georgia
  • Times
  • Times New Roman
  • Serif
  • Courier New
  • Courier
  • Monospace

Label Alignment 

  • Default
  • Above
  • Left

Radio Alignment 

  • Default
  • Horizontal
  • Stacked

Checkbox Alignment 

  • Default
  • Horizontal
  • Stacked

Required Character 

  • Default
  • *