Pardot's developer content is getting a makeover! Starting July 12th, you’ll be redirected to our new site.

Layout Templates

The API to access the Layout Templates object follows the conventions described in Version 5 Overview.

Supported Operations

Operation HTTP Verb URL Format Ability Requirements
Read GET https://pi.pardot.com/api/v5/objects/layout-templates/<id>?<params> Marketing > Landing Pages > Layout Templates > View ability
Create POST https://pi.pardot.com/api/v5/objects/layout-templates?<params> Marketing > Landing Pages > Layout Templates > Create/Edit ability
Update PATCH https://pi.pardot.com/api/v5/objects/layout-templates/<id>?<params> Marketing > Landing Pages > Layout Templates > Create/Edit ability
Delete DELETE https://pi.pardot.com/api/v5/objects/layout-templates/<id> Marketing > Landing Pages > Layout Templates > Delete ability
Query GET https://pi.pardot.com/api/v5/objects/layout-templates?<params> Marketing > Landing Pages > Layout Templates > View ability

Fields

Required Editable Fields

Field Type Description
name String Name of the object for identification in Pardot.
layoutContent String HTML content of this layout template encoded as JSON string.

Optional Editable Fields

Field Type Description
formContent String HTML content encoded as JSON string that controls form display logic. Uses default values if not provided.
siteSearchContent String HTML content encoded as JSON string that controls the site search content. Uses default values if not provided.
isIncludeDefaultCss Boolean True if not supplying custom CSS styling.
folderId Integer ID of the folder containing this object. Uses the asset type's uncategorized folder if not specified on create.

Read-Only Fields

Field Type Description
id Integer ID of this object.
isDeleted Boolean True if this object is in the recycle bin in Pardot.
createdAt DateTime Creation time of this object.
updatedAt DateTime Last updated time for the object.
createdById Integer ID of the user who created the object.
updatedById Integer ID of the user who last updated the object.
createdBy User User object representing the user who created the object. See documentation for User for fields.
updatedBy User User object representing the user who last updated the object. See documentation for User for fields.
folder Folder Folder object representing the folder containing this object. See documentation for Folder for fields.

Defaults

formContent
<form method="post" action="%%form-action-url%%" class="form">
    %%form-opening-general-content%%

   %%form-if-thank-you%%
       %%form-javascript-focus%%
       %%form-thank-you-content%%
       %%form-thank-you-code%%
   %%form-end-if-thank-you%%

   %%form-if-display-form%%

       %%form-before-form-content%%
           %%form-if-error%%
               <p class="errors">Please correct the errors below:</p>
           %%form-end-if-error%%

           %%form-start-loop-fields%%
               <p class="%%form-field-css-classes%% %%form-field-class-required%% %%form-field-class-hidden%% %%form-field-class-no-label%% %%form-field-class-error%%">
                   %%form-if-field-label%%
                       <label for="%%form-field-id%%">%%form-field-label%%</label>
                   %%form-end-if-field-label%%

                   %%form-field-input%%
                   %%form-if-field-description%%
                       <span class="description">%%form-field-description%%</span>
                   %%form-end-if-field-description%%
               </p>
               <div id="error_for_%%form-field-id%%" style="display:none"></div>
               %%form-field-if-error%%
                   <p class="error no-label">%%form-field-error-message%%</p>
               %%form-field-end-if-error%%
           %%form-end-loop-fields%%

           <p class="submit">
               <input type="submit" accesskey="s" value="%%form-submit-button-text%%" onclick="%%form-submit-indicator-on-click%%"/>
               %%form-submit-indicator-tag%%
           </p>

           %%form-spam-trap-field%%
           %%form-javascript-first-input-focus%%
       %%form-after-form-content%%

   %%form-end-if-display-form%%

   %%form-javascript-link-target-top%%
</form>
siteSearchContent
<form method="get" action="%%search-action-url%%" class="form" id="pardot-form">
    <p class="full-width">
        <input type="text" name="q" value="%%search-query%%" size="40" />
        <input type="submit" value="Search" />
    </p>
    <h2>Search results for: %%search-query%%</h2>

    %%search-if-results%%
    <ol start="%%search-result-start-position%%">
        %%search-start-loop-results%%
        <li>
            <strong><a href="%%search-result-url%%">%%search-result-title%%</a></strong><br/>
            %%search-result-description%%<br/>
            <em>%%search-result-url-abbreviation%%</em> %%search-result-file-size%% KB
        </li>
        %%search-end-loop-results%%
    </ol>

    <p class="pager">
        <strong>
        %%search-if-previous-page-available%%
        <a href="%%search-previous-page-url%%">
            Previous (page %%search-previous-page-number%%)
        </a>
        %%search-else-previous-page-not-available%%
            Previous
        %%search-end-if-previous-page-available%% |

        Page %%search-this-page-number%% of %%search-total-pages-number%% |

        %%search-if-next-page-available%%
            <a href="%%search-next-page-url%%">
            Next (page %%search-next-page-number%%)</a>
        %%search-else-next-page-not-available%%
            Next
        %%search-end-if-next-page-available%%
        </strong>
    </p>
    %%search-else-no-results%%
        %%search-no-results-content%%
    %%search-end-if-results%%
</form>

Layout Template Creation

A Layout Template POST request must have a JSON body with all of the required fields specified. Note that all HTML content must be JSON escaped.

Example request:

POST /api/v5/objects/layout-templates?fields=id,name,layoutContent,isIncludeDefaultCss,createdBy.username,updatedBy.username,createdAt,updatedAt HTTP/1.1
Host: pi.pardot.com
Authorization: Bearer <access-token>
Content-Type: application/json

{
    "name":"my template",
    "layoutContent":"<html></html>",
    "isIncludeDefaultCss":true,
    "folderId": 1769
}

Example response:

This example does not show all the headers, and whitespace has been added to make it easier to read.

HTTP/1.1 201 Created
Content-Type: application/json
https://pi.pardot.com/api/v5/objects/layout-templates/6?fields=id,name,layoutContent,isIncludeDefaultCss,createdBy.username,updatedBy.username,createdAt,updatedAt

{
    "id": 4983,
    "name": "my template",
    "layoutContent": "<html></html>",
    "isIncludeDefaultCss": true,
    "createdAt": "2020-09-29T09:36:56-04:00",
    "updatedAt": "2020-09-29T09:36:56-04:00",
    "createdBy": {
        "username": "jsmith@example.com"
    },
    "updatedBy": {
        "username": "jsmith@example.com"
    }
}

Examples include extra spaces for readability and don't always include headers. The fields in the response body and Location header match the fields specified on the example request.

Layout Template Update

Updating a layout template follows the conventions described in the Version 5 Overview.

Layout Template Deletion

Deleting a layout template follows the conventions described in the Version 5 Overview. Layout templates that are in use on Forms and Landing Pages can't be deleted. To successfully delete, remove all usages.

Layout Template Query

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

Sortable Fields

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

Example request:

GET /api/v5/objects/layout-templates?fields=id,name,layoutContent,isIncludeDefaultCss,createdBy.username,updatedBy.username,createdAt,updatedAt&orderBy=id
Host: pi.pardot.com
Authorization: Bearer <access-token>

Example response:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "values": [
        {
            "id": 4983,
            "name": "my template",
            "layoutContent": "<html></html>",
            "isIncludeDefaultCss": true,
            "createdAt": "2020-09-29T09:36:56-04:00",
            "updatedAt": "2020-09-29T09:36:56-04:00",
            "createdBy": {
                "username": "jsmith@example.com"
            },
            "updatedBy": {
                "username": "jsmith@example.com"
            }
        }
    ]
}

Filtering Results

When executing a query, the following parameters can be 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.

Parameter Description
id Returns any layout templates where ID is equal to the given integer value.
idGreaterThan Returns any layout templates where ID is greater than the specified value, non-inclusive.
idGreaterThanOrEqualTo Returns any layout templates where ID is greater than or equal to the specified value.
idLessThan Returns any layout templates where ID is less than the specified value, non-inclusive.
idLessThanOrEqualTo Returns any layout templates where ID is less than or equal to the specified value.

Example request:

GET /api/v5/objects/layout-templates?fields=id,name&orderBy=id desc&idGreaterThan=5100&idLessThan=5200
Host: pi.pardot.com
Authorization: Bearer <access-token>

Example response:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "values": [
        {
            "id": 5196,
            "name": "Winter Sale Template"
        },
        {
            "id": 5149,
            "name": "Spring Sale Template"
        },
        {
            "id": 5132,
            "name": "Promotion Template"
        }
    ]
}