Custom Redirects

The API to access Custom Redirects 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/custom-redirects/<id>?<params> Marketing > Content > Custom Redirects > View ability
Create POST https://pi.pardot.com/api/v5/objects/custom-redirects?<params> Marketing > Content > Custom Redirects > Create/Edit ability
Update PATCH https://pi.pardot.com/api/v5/objects/custom-redirects/<id>?<params> Marketing > Content > Custom Redirects > Create/Edit ability
Delete DELETE https://pi.pardot.com/api/v5/objects/custom-redirects/<id> Marketing > Content > Custom Redirects > Delete ability
Query GET https://pi.pardot.com/api/v5/objects/custom-redirects?<params> Marketing > Content > Custom Redirects > View ability

Fields

Required Editable Fields

Field Type Description
name String Name of the object for identification in Pardot.
campaignId Integer Pardot Campaign related to this object.
destinationUrl String A fully qualified URL. The visitor who clicks the custom redirect will be directed to this location. E.g. https://example.com/content.html

Optional Editable Fields

Field Type Description
folderId Integer ID of the folder containing this object. Uses the asset type's uncategorized folder if not specified on create.
trackerDomainId Integer ID of the tracker domain to use in the URL for this object. Uses the primary tracker domain for the account if not specified on create.
vanityUrlPath String Vanity URL path (excluding protocol and host). Must be unique for each tracker domain. E.g. /my-link. The value assumes empty (/) if not specified on create.

Optional Google Analytics Fields

The following fields are only available if a Google Analytics connector is present. For more information, see the Google Analytics documentation.

Field Type Description
gaSource String Campaign source
gaMedium String Campaign medium
gaTerm String Campaign keyword
gaContent String Campaign content
gaCampaign String Campaign ID

Read-Only Fields

Field Type Description
id Integer ID of the object.
salesforceId String ID of the Salesforce object representing this object.
vanityUrl String Fully qualified vanity URL. Includes tracker domain and vanityUrlPath. E.g. https://mytracked.example.com/my-link
trackedUrl String Fully qualified tracked URL. Does not include Vanity URL
bitlyIsPersonalized Boolean True if a custom Bitly URL was set
bitlyShortUrl String If set, a fully qualified Bitly URL
isDeleted Boolean True if the object is in the recycle bin in Pardot.
createdAt DateTime Creation time of the object.
updatedAt DateTime Last update time of the object.
createdById Integer ID of the user who created this object.
updatedById Integer ID of the user who last updated this object.
createdBy User User object representing the user who created this object. See documentation for User for fields.
updatedBy User User object representing the uer who last updated this object. See documentation for User for fields.
trackerDomain TrackerDomain Tracker Domain object representing the tracker domain that was set on Create. See documentation for Tracker Domain for fields. A null value indicates that the object will use the default tracker domain for the account.
campaign Campaign Campaign object representing the campaign that was set on Create. See documentation for Campaign for fields.
folder Folder JSON object representing the folder for this object. See documentation for Folder for fields.

Custom Redirect Create

A custom redirect POST request must have a JSON body with all required fields specified, as described in the Version 5 Overview.

Example request:

POST /api/v5/objects/custom-redirects?fields=id,folderId,name,destinationUrl,campaignId,trackerDomainId,vanityUrlPath,vanityUrl,gaSource,gaMedium,gaTerm,gaContent,gaCampaign,createdAt,updatedAt,isDeleted,createdBy.username,updatedBy.username,trackerDomain.domain,campaign.name HTTP/1.1
Host: pi.localhost.com
Authorization: Bearer <access-token>

{
    "name": "Custom Redirect API",
    "destinationUrl": "https://example.com/destination.html",
    "campaignId": 1,
    "trackerDomainId": 2,
    "vanityUrlPath": "/an-example",
    "gaTerm": "Search Term"
}

Example response

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

HTTP/1.1 201 Created
Content-Type: application/json
Location: https://pi.pardot.com/api/v5/objects/custom-redirects/8736?fields=id,folderId,name,destinationUrl,campaignId,trackerDomainId,vanityUrlPath,vanityUrl,gaSource,gaMedium,gaTerm,gaContent,gaCampaign,createdAt,updatedAt,isDeleted,createdBy.username,updatedBy.username,trackerDomain.domain,campaign.name

{
    "id": 8736,
    "folderId": 22,
    "name": "Custom Redirect API",
    "destinationUrl": "https://example.com/destination.html",
    "campaignId": 1,
    "trackerDomainId": 2,
    "vanityUrlPath": "/an-example",
    "vanityUrl": "https://mycompany.com/an-example",
    "gaSource": null,
    "gaMedium": null,
    "gaTerm": "Search Term",
    "gaContent": null,
    "gaCampaign": null,
    "createdAt": "2020-10-01T10:19:51-04:00",
    "updatedAt": "2020-10-01T10:19:51-04:00",
    "isDeleted": false,
    "createdBy": {
        "username": "jsmith@mycompany.com"
    },
    "updatedBy": {
        "username": "jsmith@mycompany.com"
    },
    "trackerDomain": {
        "domain": "mycompany.com"
    },
    "campaign": {
        "name": "Website Tracking"
    }
}

The fields in the response body and Location header are the same as the fields specified on the example request.

Custom Redirect Update

Updating a custom redirect follows the conventions described in the Version 5 Overview.

Custom Redirect Delete

Deleting a custom redirect follows the conventions described in the Version 5 Overview.

Custom Redirect Query

Retrieving a collection of custom redirects 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/custom-redirects?fields=id,folderId,name,destinationUrl,campaignId,trackerDomainId,vanityUrlPath,vanityUrl,gaSource,gaMedium,gaTerm,gaContent,gaCampaign,createdAt,updatedAt,isDeleted,createdBy.username,updatedBy.username,trackerDomain.domain,campaign.name&orderBy=id
Host: pi.pardot.com
Authorization: Bearer <access-token>

Example response:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "values": [
        {
            "id": 8736,
            "folderId": 22,
            "name": "Custom Redirect API",
            "destinationUrl": "https://example.com/destination.html",
            "campaignId": 1,
            "trackerDomainId": 2,
            "vanityUrlPath": "/an-example",
            "vanityUrl": "https://mycompany.com/an-example",
            "gaSource": null,
            "gaMedium": null,
            "gaTerm": "Search Term",
            "gaContent": null,
            "gaCampaign": null,
            "createdAt": "2020-10-01T10:19:51-04:00",
            "updatedAt": "2020-10-01T10:19:51-04:00",
            "isDeleted": false,
            "createdBy": {
                "username": "jsmith@mycompany.com"
            },
            "updatedBy": {
                "username": "jsmith@mycompany.com"
            },
            "trackerDomain": {
                "domain": "mycompany.com"
            },
            "campaign": {
                "name": "Website Tracking"
            }
        }
    ]
}

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 custom redirects where ID is equal to the given integer value.
idGreaterThan Returns any custom redirects where ID is greater than the specified value, non-inclusive.
idGreaterThanOrEqualTo Returns any custom redirects where ID is greater than or equal to the specified value.
idLessThan Returns any custom redirects where ID is less than the specified value, non-inclusive.
idLessThanOrEqualTo Returns any custom redirects where ID is less than or equal to the specified value.

Example request:

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

Example response:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "values": [
        {
            "id": 168,
            "name": "Spring Flyer Custom Redirect"
        },
        {
            "id": 151,
            "name": "Winter Flyer Custom Redirect"
        }
    ]
}