Welcome to Knowledge Base!

KB at your finger tips

This is one stop global knowledge base where you can learn about all the products, solutions and support features.

Categories
All
CRM-Salesforce
Salesforce Developers

Object Field References

  • Requests create , update , and upsert manipulate fields marked as 'Editable'.
  • 'Required' means that the specified field can't be left without a value during insert and some upsert requests. Pardot declines any update request that clears a required field.
  • During update requests, unless otherwise specified the parameter names submitted to the API and tag names in the API's response match field names within the Pardot user interface.
Field Name Data Type Required Editable Description
<id> integer Pardot ID for this account.
<level> string The level of product for the account.
<website> string Account website.
<vanity_domain> string Custom vanity domain name.
<plugin_campaign_id> integer Plugin ID for account campaign.
<tracking_code_template> string Markup and code for use in tracking templates.
<address1> string Account contact address, line 1.
<address2> string Account contact address, line 2.
<city> string Account contact city.
<state> string Account contact state.
<territory> string Account contact territory.
<zip> integer Account contact ZIP code.
<country> string Account contact country (full string).
<phone> string Account contact phone number.
<fax> string Account contact fax number.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this campaign.
<name> string X Campaign's name.
<cost> integer X Cost related to the campaign.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this custom field.
<name> string X Custom field's name.
<field_id> string API ID for custom field
<type> string X Type of field.
<type_id> integer Pardot ID for custom field's type.
<created_at> timestamp Time custom field is created in Pardot. Time is reported in API user's preferred timezone.
<updated_at> timestamp Last time custom field was updated. Time is reported in API user's preferred timezone.
<is_record_multiple_responses> boolean X If true, this custom field records multiple responses.
<crm_id> string X The CRM ID of the field you want to map to this custom field.
<is_use_values> boolean X If true, this custom field uses predefined values.
<is_analytics_synced> boolean If true, this custom field is marked to sync with Tableau CRM.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this custom redirect.
<name> string Custom redirect's name.
<Url> string URL for the custom redirect.
<destination> string URL the custom redirect leads to
<campaign> string The campaign associated with this custom redirect.
<created_at> timestamp Time custom redirect is created in Pardot. Time is reported in API user's preferred timezone.
<updated_at> timestamp Last time custom redirect was updated. Time is reported in API user's preferred timezone.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this dynamic content.
<name> string Dynamic content's name.
<embedCode> string Code to embed this dynamic content onto your webpage.
<embedUrl> string URL to embed this dynamic content.
<baseContent> string The default dynamic content.
<basedOn> string Field that this dynamic content is based on.
<variation> node The variation of content that the prospect sees based on the field's value. Note: Information about a variation is returned in a <variation> node in the XML response. It contains the value of the field in the <comparison> tag and the content of the variation in the <content> tag.
<created_at> timestamp Time dynamic content is created in Pardot. Time is reported in API user's preferred timezone.
<updated_at> timestamp Last time dynamic content was updated. Time is reported in API user's preferred timezone.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this email.
<name> string Name of this email.
<subject> string Email subject.
<message> XML Object Contains text and html elements of different formats.
<created_at> Timestamp Time the email is created.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this email click.
<prospect_id> integer Pardot ID for the associated prospect.
<url> string URL of the email click.
<list_email_id> integer Pardot ID for the associated list email. Value not present if null.
<drip_program_action_id> integer Pardot ID for the associated drip program action. Value not present if null.
<email_template_id> integer Pardot ID for the associated email template. Value not present if null.
<tracker_redirect_id> integer Pardot ID for the associated tracker redirect. Value not present if null.
<created_at> timestamp Time that email click occurs. Time is reported in API user's preferred timezone.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this form.
<name> string Form's name.
<campaign_id> string Pardot ID of the campaign associated with this form.
<embed_code> string The code used to embed the form on your webpage.
<created_at> timestamp Time form is created in Pardot. Time is reported in API user's preferred timezone.
<updated_at> timestamp Last time form was updated. Time is reported in API user's preferred timezone.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this identified company.
<name> string Identified Company's name.
<street_address> string Identified Company's street address.
<city> string Identified Company's city.
<state> string Identified Company's state.
<postal_code> string Identified Company's postal code.
<country> string Identified Company's country.
<email> string Identified Company's email address.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID of this lifecycle history.
<prospect_id> integer Pardot's ID for the prospect in this stage.
<previous_stage_id> integer Pardot ID of the stage this prospect previously was in.
<next_stage_id> integer Pardot ID of the stage this prospect is in next.
<seconds_elapsed> integer Number of seconds for prospect to get to current stage.
<created_at> timestamp Time lifecycle history is created in Pardot. Time is reported in API user's preferred timezone.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID of this lifecycle stage.
<name> string Lifecycle stage's name.
<position> integer Lifecycle stage's position in lifecycle.
<is_locked> boolean If true, lifecycle stage is locked.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID of this list.
<name> string X List's name (internal to Pardot).
<is_public> boolean X If true, list shows on EPC pages to prospects.
<is_dynamic> boolean If true, list has prospects dynamically added to it via a set of chosen rules.
<title> string X List's title (visible to subscribers)
<description> string X List's description.
<is_crm_visible> boolean X If true, list is visible in CRM, and can be added to, or removed from.
<created_at> timestamp Time list is created in Pardot. Time is reported in API user's preferred timezone.
<updated_at> timestamp Last time list was updated. Time is reported in API user's preferred timezone.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this list membership.
<list_id> integer X Pardot ID of the list for this membership.
<prospect_id> integer X Pardot ID of the prospect for this membership.
<opted_out> integer X If value is 1, the prospect is unsubscribed from receiving emails from this list.
<created_at> timestamp Time that this membership is created in Pardot. Time is reported in API user's preferred timezone.
<updated_at> timestamp Last time that this membership was updated. Time is reported in API user's preferred timezone.

Additional prospect fields available for Export

When using the v3 Export API or v4 Export API to export list membership, the following fields are selectable for export in addition to the list membership fields listed above.
Note : The following fields are only available via the Export API and are only exported if selected via fields parameter specified in export create request.

Field Name Data Type Description
<created_by> integer Pardot ID for the user who created this object.
<updated_by> integer Pardot ID for the user who last updated this object.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this opportunity.
<campaign_id> integer X X Pardot ID of the campaign associated with this opportunity.
Note : Information about an opportunity's campaign association is returned in a <campaign> node in the XML response. However, updates to campaign associations are made by providing campaign_id= <campaign_id> during an <UPDATE> request. See XML Response in the Campaign documentation for more details.
<name> string X X Opportunity's name
<value> float X X Opportunity's value.
Restrictions : The value must be a positive numeric value.
<probability> integer X X Opportunity's probability.
Restrictions : The value must be a positive integer from 0 through 100, inclusive.
<type> string X Opportunity's type.
<stage> string X Opportunity's stage.
<status> string X Opportunity's status.
Restrictions : status must be either won, lost, or open.
<closed_at> timestamp X Opportunity's closed date.
Note If this field is left blank, the closed_at timestamp (Closed Date within the app) is not set, even when the Opportunity's stage, status, or probability are set to indicate opportunity closure.
<created_at> timestamp Time opportunity is created in Pardot. Time is reported in API user's preferred timezone.
<updated_at> timestamp Last time opportunity was updated in Pardot. Time is reported in the API user's preferred timezone.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this profile.
<name> string Profile's name.
Field Name Data Type Required Editable Description
<id> integer X Required. Pardot ID for this profile criteria.
<name> string Profile criteria's name.
<matches> string X The matching status of this profile criteria with the current prospect.
Restrictions: Updates can be performed by using the values match , nomatch , or unknown .
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this prospect.
<campaign_id> integer X Pardot ID of the campaign associated with this prospect
Note : Information about a prospect's campaign association is returned in a <campaign> node in the XML response. However, updates to campaign associations are made by providing campaign_id= <campaign_id> during an <UPDATE> request. See XML Response Formats in Prospects for more details.
<salutation> string X Prospect's formal prefix.
<first_name> string X Prospect's first name.
<last_name> string X Prospect's last name.
<email> string X X Prospect's email address.
<password> string X Prospect's password.
<company> string X Prospect's company.
<prospect_account_id> integer X Prospect's account ID.
<website> string X Prospect's website URL.
<job_title> string X Prospect's job title.
<department> string X Prospect's department.
<country> string X Prospect's country.
<address_one> string X Prospect's address, line 1.
<address_two> string X Prospect's address, line 2.
<city> string X Prospect's city.
<state> string X Prospect's US state.
<territory> string X Prospect's territory.
<zip> string X Prospect's postal code.
<phone> string X Prospect's phone number.
<fax> string X Prospect's fax number.
<source> string X Prospect's source.
<annual_revenue> string X Prospect's annual revenue.
<employees> string X Prospect's number of employees.
<industry> string X Prospect's industry.
<years_in_business> string X Prospect's number of years in business.
<comments> string X Comments about this prospect.
<notes> string X Notes about this prospect
Note : Available for export, but only exported if selected via fields parameter specified in export create request.
<score> integer X Prospect's score.
<grade> string Prospect's letter grade
Note : Available for export, but only exported if selected via fields parameter specified in export create request.
<last_activity_at> timestamp Time stamp of this prospect's latest visitor activity; Time is reported in API user's preferred timezone.
<recent_interaction> string Describes the prospect's most recent interaction with Pardot (Not available for V3/V4 export) .
<crm_lead_fid> string Prospect's lead ID in a supported CRM system.
<crm_contact_fid> string Prospect's contact ID in a supported CRM system.
<crm_owner_fid> string Prospect's owner ID in a supported CRM system.
<crm_account_fid> string Account ID in a supported CRM system.
<crm_last_sync> timestamp Last time this prospect was synced with a supported CRM system.
<crm_url> string URL to view the prospect within the CRM system (Not available for V3/V4 export) .
<is_do_not_email> boolean X If value is 1, prospect prefers not to be emailed.
<is_do_not_call> boolean X If value is 1, prospect prefers not to be called.
<opted_out> boolean If value is 1, prospect has opted out of marketing communications.
<is_reviewed> boolean X If value is 1, prospect has been reviewed.
<is_starred> boolean X If value is 1, prospect has been starred.
<is_archived> boolean X If value is 1, prospect has been archived.
<created_at> timestamp Time prospect is created in Pardot; Time is reported in API user's preferred timezone.
<updated_at> timestamp Last time prospect was updated in Pardot; Time is reported in API user's preferred timezone.

Additional prospect fields available for Export

When using the v3 Export API or v4 Export API to export prospects, the following prospect fields are selectable for export in addition to the prospect fields listed above.
Note : The following fields are only available via the Export API and are only exported if selected via fields parameter specified in export create request.

Field Name Data Type Description
<converted_at> timestamp Time when prospect was converted from visitor; Time is reported in API user's preferred timezone
<converted_from_object_type> string Type of object associated with visitor activity that resulted in prospect being converted from visitor. Supported values include 'Form', 'FormHandler', 'LandingPage', 'MultivariateTestVariation', and 'Video'.
<converted_from_object_name> string Name of object associated with visitor activity that resulted in prospect being converted from visitor.
<do_not_sell> boolean Indicates whether the visitor recorded an activity with the Global Privacy Control Header enabled.
<is_email_hard_bounced> boolean if value is 1, prospect email address has hard bounced.
<email_bounced_at> timestamp Time when prospect email address hard bounced; Time is reported in API user's preferred timezone.
<email_bounced_reason> string Reason why prospect email address hard bounced.
<first_assigned_at> timestamp Time prospect was first assigned to a user; Time is reported in API user's preferred timezone.
<first_activity_at> timestamp Time when first visitor activity occurred for this prospect; Time is reported in API user's preferred timezone.
<first_referrer_url> string First referrer's URL.
<first_referrer_type> string First referrer's vendor and type (such as 'Google Natural Search').
<first_referrer_query> string First referrer's search query.
<campaign_parameter> string Prospect's campaign parameter utm_campaign from Google Analytics.
<medium_parameter> string Prospect's medium parameter utm_medium from Google Analytics.
<source_parameter> string Prospect's source parameter utm_source from Google Analytics.
<content_parameter> string Prospect's content parameter utm_content from Google Analytics.
<term_parameter> string Prospect's term parameter utm_term from Google Analytics.
<created_by> integer Pardot ID for the user who created this object.
<updated_by> integer Pardot ID for the user who last updated this object.
x

Note: Prospect account fields are fully customizable. To get the most accurate field metadata for your Pardot account, use the describe operation on the prospectAccount API endpoint.

Field Name Data Type Required Editable Description
<id> integer X Pardot ID of the prospect account.
<name> string X The name of the prospect account.

Additional prospect account fields available for Export

When using the v3 Export API or v4 Export API to export prospect account, the following fields are selectable for export in addition to the prospect account fields listed above.
Note : The following fields are only available via the Export API and are only exported if selected via fields parameter specified in export create request.

Field Name Data Type Description
<created_by> integer Pardot ID for the user who created this object.
<updated_by> integer Pardot ID for the user who last updated this object.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this tag.
<name> string Tag's name.
<created_at> timestamp Time tag is created in Pardot. Time is reported in API user's preferred timezone.
<updated_at> timestamp Last time tag was updated. Time is reported in API user's preferred timezone.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID of the tag object.
<tag_id> integer The Pardot ID of the tag.
<type> string The type of object associated with the tag.
<object_id> integer The Pardot ID of the object.
<created_at> timestamp Time tag is associated with the object in Pardot. Time is reported in API user's preferred timezone.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID of the user.
<email> string User's email address.
<first_name> string User's first name.
<last_name> string User's last name.
<job_title> string User's job title
<role> string User's role.
<created_at> timestamp Time user is created in Pardot. Time is reported in the API user's preferred timezone.
<updated_at> timestamp Last time user was updated in Pardot. Time is reported in the API user's preferred timezone.
Field Name Data Type Required Editable Description
<id> integer Pardot ID for this visit.
<visitor_id> integer Pardot ID for the associated visitor.
<prospect_id> integer Pardot ID for the associated prospect.
<visitor_page_view_count> integer Number of page views for this visit.
<first_visitor_page_view_at> timestamp Time of first page view for this visit. Time is reported in API user's preferred timezone
<last_visitor_page_view_at> timestamp Time of last page view for this visit. Time is reported in API user's preferred timezone.
<duration_in_seconds> integer Length of this visit.
<campaign_parameter> string Visit's campaign parameter utm_campaign from Google Analytics.
<medium_parameter> string Visit's medium parameter utm_medium from Google Analytics.
<source_parameter> string Visit's source parameter utm_source from Google Analytics.
<content_parameter> string Visit's content parameter utm_content from Google Analytics.
<term_parameter> string Visit's term parameter utm_term from Google Analytics.
<created_at> timestamp Time visit is created in Pardot. Time is reported in API user's preferred timezone.
<updated_at> timestamp Last time visit was updated in Pardot. Time is reported in API user's preferred timezone.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this visitor.
<page_view_count> integer Number of page views by this visitor.
<ip_address> string Visitor's IP address.
<hostname> string Visitor's hostname.
<campaign_parameter> string Visitor's campaign parameter utm_campaign from Google Analytics
<medium_parameter> string Visitor's medium parameter utm_medium from Google Analytics.
<source_parameter> string Visitor's source parameter utm_source from Google Analytics.
<content_parameter> string Visitor's content parameter utm_content from Google Analytics
<term_parameter> string Visitor's term parameter utm_term from Google Analytics.
<created_at> timestamp Time visitor is created in Pardot. Time is reported in API user's preferred timezone.
<updated_at> timestamp Last time visitor was updated in Pardot. Time is reported in API user's preferred timezone.

When using either the v3 Export API or the v4 Export API to export visitors, the following prospect fields are selectable for export in addition to the Visitor fields listed earlier.

Field Name Data Type Description
< do_not_sell > boolean Indicates whether the visitor recorded an activity with the Global Privacy Control Header enabled.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this visitor activity
<prospect_id> integer Pardot ID for the associated prospect
<visitor_id> integer Pardot ID for the associated visitor
<type> integer Visitor activity's type number. See the listing that follows.
<type_name> string Visitor activity's type name. See the listing that follows.
<details> string Details about this visitor activity. Examples include:
- The name of the object associated with this activity.
- The search phrase used in a site search query.
- Others as your needs require.
<email_id> integer Pardot ID of the email associated with this visitor activity.
Note: This node appears only if this visitor activity has an email associated with it.
<email_template_id> integer Pardot ID of the email template associated with this visitor activity.
Note: This node appears only if this visitor activity has an email associated with it.
<list_email_id> integer Pardot ID of the list email associated with this visitor activity.
Note: This node appears only if this visitor activity has an email associated with it.
<form_id> integer Pardot ID of the form associated with this visitor activity.
Note: This node appears only if this visitor activity has a form associated with it.
<form_handler_id> integer Pardot ID of the form handler associated with this visitor activity.
Note: This node appears only if this visitor activity has a form handler associated with it.
<site_search_query_id> integer Pardot ID of the site search query associated with this visitor activity.
Note: This node appears only if this visitor activity has a site search query associated with it.
<landing_page_id> integer Pardot ID of the landing page associated with this visitor activity.
Note: This node appears only if this visitor activity has a landing page associated with it.
<paid_search_ad_id> integer Pardot ID of the paid search ad associated with this visitor activity.
Note: This node appears only if this visitor activity has a paid search ad associated with it.
<multivariate_test_variation_id> integer Pardot ID of the multivariate test variation associated with this visitor activity.
Note: This node appears only if this visitor activity has a multivariate test variation associated with it.
<file_id> integer Pardot ID of the file associated with this visitor activity.
Note: This node appears only if this visitor activity has a file associated with it.
<custom_redirect_id> integer Pardot ID of the custom redirect associated with this visitor activity. Note: This node appears only if this visitor activity has a custom redirect associated with it.
<campaign> object Campaign information including id, name, and cost. (Not available for V3/V4 export) .
<created_at> timestamp Time that visitor activity occurred. Time is reported in API user's preferred timezone.
<updated_at> timestamp Time that visitor activity update occurred. Time is reported in API user's preferred timezone.

Visitor Activity Types

Visitor Activities have the following values for <type>

  • 1 - Click
  • 2 - View
  • 3 - Error
  • 4 - Success
  • 5 - Session (Omitted from Synchronous and Export endpoints)
  • 6 - Sent
  • 7 - Search
  • 8 - New Opportunity
  • 9 - Opportunity Won
  • 10 - Opportunity Lost
  • 11 - Open
  • 12 - Unsubscribe Page
  • 13 - Bounced
  • 14 - Spam Complaint
  • 15 - Email Preference Page
  • 16 - Resubscribed
  • 17 - Click (Third Party)
  • 18 - Opportunity Reopened
  • 19 - Opportunity Linked
  • 20 - Visit
  • 21 - Custom URL click
  • 22 - Olark Chat
  • 23 - Invited to Webinar
  • 24 - Attended Webinar
  • 25 - Registered for Webinar
  • 26 - Social Post Click
  • 27 - Video View
  • 28 - Event Registered
  • 29 - Event Checked In
  • 30 - Video Conversion
  • 31 - UserVoice Suggestion
  • 32 - UserVoice Comment
  • 33 - UserVoice Ticket
  • 34 - Video Watched (≥ 75% watched)
  • 35 - Indirect Unsubscribe Open
  • 36 - Indirect Bounce
  • 37 - Indirect Resubscribed
  • 38 - Opportunity Unlinked
  • Other - Unknown
Field Name Data Type Required Editable Description
<id> integer Pardot ID for this visitor page view.
<url> string Page view. URL
<title> string Page title.
<created_at> timestamp Time page view occurred. Time is reported in API user's preferred timezone.
Field Name Data Type Required Editable Description
<id> integer X Pardot ID for this visitor referrer.
<referrer> string Referrer's URL.
<vendor> string Referrer's vendor (such as 'Google' or 'Yahoo').
<type> string Referrer's type (such as 'Natural Search').
<query> string Referrer's search query.
Salesforce Developers

Pardot API Quick Start

Getting started can be daunting, especially if you're not an experienced developer. This tutorial walks you through a few real-life tasks so you can start automating and extending Pardot.

In this guide:

  • We implement authentication using an OAuth2.0 flow.
  • Make some example calls and complete a basic task.

Before you begin, make sure you have:

  • A Salesforce admin to create a connected app and gather information.
  • A Salesforce user with SSO enabled for Pardot.
  • A configured Pardot Business Unit.
  • Selected which OAuth flow works best for your case. This tutorial uses the Web Server OAuth flow.

This tutorial requires background knowledge of connected apps and authentication. If you're unfamiliar with these topics, we strongly recommend that you check out these resources first:

  • Salesforce Help: Connected App and OAuth Terminology
  • Trailhead module: Connected App Basics
  • Trailhead module: Build a Connected App for API Integration

After you familiarize yourself with the basics, come back to this tutorial.

Warning

The calls you make during this tutorial have the potential to impact both your Salesforce and Pardot settings and data. If you’re just testing the API, make sure that you’re using a sandbox account. If you’re using this tutorial to set up your production account, use caution.

To authenticate to use Pardot APIs, you must use an SSO-enabled Salesforce user who has Pardot access, and an OAuth flow with a connected app. Implementing authentication can be tricky, so we walk through an example here.

Step 1: Create the Connected App

The first step in authentication is creating a connected app. A connected app is a framework that enables an external application to integrate with Salesforce using APIs and standard protocols like OAuth. Connected apps use these protocols to authenticate, authorize, and provide single sign-on (SSO) for external apps. To put it simply, a connected app represents an integration.

To set up a connected app, have a Salesforce admin follow these steps:

  1. From Salesforce Setup, in the Quick Find box, enter App Manager , and then select App Manager .
  2. Click New Connected App .
  3. Name the connected app, and enter contact details for the app owner.
  4. In the API section, select the Enable OAuth Flows .
  5. Enter a Callback URL. The callback URL is used to redirect users after authentication in browser-based flows. In this example, we use https://my.example.com/myapp . If you’re using a browser-based flow (such as Web Server Flow or User Agent Flow), the URL must match the URL you pass as a callback to OAuth endpoints. If you aren’t using a browser-based flow, the URL entered isn't used.
  6. Under Selected OAuth Scopes , add Access Pardot services , which give the app access to Pardot. For more complex scenarios, such as using refresh tokens, select other scopes as well.
  7. Save the connected app.

This just scratches the surface of connected apps. If you’d like to learn more, like how to restrict access to certain users, check out these resources:

  • Connected App Salesforce Help
  • Connected App Trailhead

Step 2: Gather Important Information

Now that you have a connected app, let’s gather some important information you need handy to finish setting up authentication.

The primary details are:

  • Connected App Consumer Key: a unique identifier for your connected app.
  • Connected App Consumer Secret: a password for the connected app.
  • Business Unit IDs: Because a Salesforce org can have multiple business units, the ID routes the API request to the correct business unit. You need the ID even if you have only one business unit.
  • Salesforce User: A Salesforce user with SSO enabled for Pardot.

Since all this information is sensitive, carefully consider how to securely share these details with other team members.

Find the Consumer Key and Secret

  1. From Salesforce Setup, in the Quick Find box, enter App Manager , and then select App Manager .
  2. Go to your connected app and select View .
  3. Copy your consumer key.
  4. Reveal and copy your consumer secret.

Find the Pardot Business Unit IDs

  1. From Marketing Setup, in the Quick Find box, enter Pardot , and then select Pardot Account Setup .
  2. Copy the business unit ID for the Pardot instance you want to use.

Choose the Integration User

For the integration user, we recommend that you create a unique user for each specific app integration. The user must be SSO-enabled and have access to Pardot.

Step 3: Implement OAuth Flow

Salesforce has several OAuth flows to meet your unique security and integration needs. In this tutorial, we use the Web Server OAuth flow. This flow is ideal for when you don't want to store the end user's credentials in your system. To learn more about your options and how to choose the best OAuth flow for your integration, check out Salesforce OAuth Help Documentation.

  1. Have your integration direct the user to Salesforce’s OAuth authorization endpoint:

    https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=https://my.example.com/myapp

    • Replace CLIENT_ID with your connected app consumer key.
    • Replace https://my.example.com/myapp with your redirect URI.
  2. If the user doesn't have an active session, they’re prompted to log into Salesforce.

  3. The user grants the app permission.

  4. After the user has logged in and allowed the app, Salesforce redirects you back to the redirect_uri passed in to the authorize endpoint: https://my.example.com/myapp?code=<CODE>

  5. Your server-side code exchanges this code for an access token by making a POST request to the Salesforce OAuth token endpoint:

  1. After Salesforce validates the connected app credentials and authorization code, the endpoint responds with an access token:

The access token can be used to make calls to the Pardot API. The code was exchanged for the access token on the server side and not from the user’s browser. Because of how the code was exchanged, there's no opportunity for malicious JavaScript to steal the access token.

After you've implemented authorization, you can start working with the Pardot API.

The Pardot API lets your application access current data within Pardot. Through the API, you can perform several common operations on Pardot objects including the following:

  • create : Creates an instance of the object with the specified parameters.
  • read : Retrieves information about the specified object.
  • query : Retrieves objects that match specified criteria.
  • update : Updates elements of an existing object.
  • upsert : Updates elements of an existing object if it exists. If the object doesn’t exist, one is created using the supplied parameters.

Developers must authenticate using a Salesforce OAuth endpoint or the Pardot API login endpoint before issuing Pardot API requests. Refer to the Authentication section for details about this procedure.

Keep in mind a few considerations when you perform requests. For update requests, only the fields specified in the request are updated. All others are left unchanged. If a required field is cleared during an update, the request is declined.

Request Format

All requests to the API must:

  • Use either HTTP GET or POST. Version 5 also supports PUT and DELETE requests.
  • Pass access token in an HTTP Authorization header.
  • Pass Pardot Business Unit ID in an HTTP Pardot-Business-Unit-Id header.
  • Use the correct URL for your Pardot environment.

Our First GET Request

In this example, we want to get a list of all custom fields in a business unit.

Before you begin, make sure you've authenticated and have a valid access token. For simplicity in this example, these calls are written in HTTP.

Breaking Down the Request

Let's break down the call and identify its parts, starting with the uniform resource identifier (URI). GET 'https://<ENVIRONMENT_URL>/api/<OBJECT>/version/<API_VERSION>/do/<OPERATION>?format=<FORMAT>

  • Environment URL : In the example, we use pi.pardot.com, but you use the URL that matches your environment type. Demos, developer orgs, and sandbox environments are hosted on the domain pi.demo.pardot.com. Training and production environments are hosted on the domain pi.pardot.com.
  • Object : The object we're requesting data for. In our example, we're querying the CustomField object.
  • API version : The version of the API you're using. Here, we use v4.
  • Operation : The operation you're performing. Here, we use query .
  • Format : The output format, either XML or JSON. Here, we use json .

Now that we've explained the URI, let's examine the header lines in the call.

  • 'Authorization: Bearer <ACCESS TOKEN>' lets Pardot know that you’ve authenticated and have permission to access data.
  • 'Pardot-Business-Unit-Id: <BUSINESS UNIT ID>' lets Pardot know which business unit you want data from.
  • Host : The URL for your Pardot environment.

Breaking Down the Response

The call returns the business unit's custom fields and their metadata.

Learn more about each object's fields in the Object Field Reference documentation.

Our First POST Request

Warning: If you’re following along with your Pardot account, this next example creates a list in your account. Either use a sandbox account, or tailor the example to fit your needs.

In this example, we create a list for a spring nurturing campaign.

Before you begin, make sure you've authenticated and have a valid access token.

Breaking Down the Request

We went over the URI and the authorization and business unit headers in the GET example. Let's cover the other components:

  • Content-Type: application/x-www-form-urlencoded : Lets the server know what kind of data the request includes.
  • name=Spring Leads Nurture : Sets the list's internal name to "Spring Leads Nurture".
  • title=Spring Leads : Titles the list "Spring Leads".
  • description=A list to nurture spring leads : Adds a text description to the list.

Breaking Down the Response

When we send this request to the server, Pardot responds by creating a list with the criteria that we specified. The response looks like this:

Going Further

Let's take the example a step further and add a prospect to our new list. Remember that completing this task changes data in Pardot, so proceed with caution.

Before you begin, make sure you've authorized and have a valid access token. For simplicity in this example, we make these calls in our command-line interface using cURL.

First, copy the list ID for the list you want to add a prospect to. Then, find the IDs for the prospect you want to add to the list. You can use query on the Prospect object to get ID.

  • List ID: 1000
  • Prospect ID: XXXXX

Notice that the URI includes the prospect's ID: XXXXX. When we send this request, Pardot adds that prospect to the list with the ID 1000.

That's a wrap! Now that you've made some basic calls, we hope you feel confident about using the Pardot API to extend and automate your business!

  • Connected Apps
  • Authorize Apps with OAuth
  • Connected App and OAuth Terminology
  • Find a Trailblazer Community Group near you and talk with other Pardot developers about how they use APIs.
Read article
Salesforce Developers

Version 3 Home

Version 3 of Pardot APIs are for accounts that don't have the allow multiple prospects with the same email address (AMPSEA) feature enabled. See Version 3 and 4 Overview to learn more.

Object APIs Description
Accounts View information about the Pardot account the API user is logged in to
Batch Email Clicks View email link click statistics
Campaigns Work with Pardot Campaigns
Custom Fields Work with user-created fields for tracking prospect data
Custom Redirects View custom Pardot links that track link clicks
Dynamic Content Work with personalized content that displays based on what you know about the viewer
Email Templates View information about reusable email layouts
Emails Send emails to prospects and view data about those emails
Forms View information about forms that collect visitor data
Lifecycle History View how a prospect moves through the sales journey
Lifecycle Stage View which stage a prospect is in during the sales journey
List Membership Add and remove prospects to and from lists
Lists Work with lists of prospects used to send list emails or to feed engagement programs
Opportunities View Pardot read-only opportunities
Prospect Accounts Group prospects that work for the same company
Prospects Work with identified visitors
Tags View tags used to organize Pardot assets and prospects
TagObject Identify objects that are tagged
Users Work with Pardot users in your organization
Visitors Work with people who interact with your website and other assets
Visits Work with visits to your website and other assets
Visitor Activities View how visitors have interacted with your website and other assets
Other APIs Description
Export Lets you retrieve large amounts of Pardot data
Import Lets you add or update large amounts of Pardot data
Read article
Salesforce Developers

Account Object

Use the account resource to learn about the current user's Pardot account, such as the address, website URL, and account level. Learn more about accounts in Salesforce Help.

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

Resource Name Operation Description
Account Read GET Request information about the Pardot account for the current user.

Request information about the Pardot account for the current user.

URI

Example

Request information about the Pardot account for the current user.

XML Response

Tag Description
<account> Parent tag. Contains information about the current user's Pardot account. For more information about account fields, see Account.
Read article
Salesforce Developers

Email Click Object

Pardot emails can contain links to download files. Use email click resources to learn more about how your prospects interact with the email links. Learn more about email clicks in Salesforce Help.

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

Resource Name Operation Description
Email Clicks Query GET Request information for the email clicks that matches the specified criteria.

Request information for email clicks that match the specified criteria. You can specify the email clicks and the fields to request. A maximum of 200 are returned.

URI

Parameters to Select Email Clicks

Use these parameters to specify which email clicks are returned. Parameters can be used in any combination and in any order unless otherwise specified.

Notes:

  • Parameters must be URL-encoded.
  • Dates and times must use GNU Date Input Syntax (yyyy-mm-dd:hh:ss ).
  • For a full listing of email clicks fields see Object Field References.
Parameter Type Possible Values Description
created_after string today , yesterday , last_7_days , this_month , last_month , <custom_time> Request email clicks created after the specified time. Example: To request forms created in 2020, use /api/emailClicks/version/3/do/query?created_after=2019-12-31 24:59:59 .
created_before string today , yesterday , last_7_days , this_month , last_month , <custom_time> Request email clicks created before the specified time. Doesn’t include email clicks created at the specified time. Example : To request email clicks created before today (but not created today), use /api/emailClicks/version/3/do/query?created_before=today .
id_greater_than integer Any positive integer Request email clicks that have a Pardot ID greater than the specified number. Example: to request email clicks resulting from emails that were sent by the email list with Pardot ID 126xx, and that have a Pardot ID greater than 123, use api/emailClick/version/3/do/query?id_greater_than=123&list_email_id=126xx .
list_email_id integer Any positive integer Selects only email clicks generated by assets whose list email matches the specified Pardot ID. Example: to request email clicks from emails that were sent by the email list with Pardot ID 1263xx, use /api/emailClick/version/3/do/query?list_email_id=1263xx
drip_program_action_id integer Any positive integer Deprecated. Selects only email clicks generated by an engagement program action with the specified Pardot ID.
email_template_id integer Any positive integer Selects only email clicks generated by the email template with the specified Pardot ID.
tracker_redirect_id integer Any positive integer Selects only email clicks generated by the tracker redirect with the specified Pardot ID.
Tag Description
<result> Parent tag. Contains information about the email clicks that match the parameters specified in your query.
<total_results> Contains the number of email clicks selected by the query. Note: The query request returns a maximum of 200 email clicks. If your query matches more than 200 email clicks, you can make several requests to retrieve all matching records.
<emailClick> The information for a single email click. See Email Clicks in Object Field References.
Read article
Salesforce Developers

Campaign Object

A Pardot campaign tracks the first interaction that a person has with your online marketing materials. Associate your assets to a Pardot campaign to organize and track your marketing efforts. Learn more about Pardot campaigns in Salesforce Help.

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

Resource Name Operations Description
Campaign Create POST Create a campaign record.
Campaign Read GET Request information for a single campaign.
Campaign Query GET Request information for the campaigns that match the specified criteria.
Campaign Update POST Update a campaign's information, including campaign fields.

Note: We recommend using Salesforce Connected Campaigns. When Connected Campaigns is enabled, only Campaign Read and Campaign Query are available.

Create a campaign with the specified fields.

URI

Parameters

You can use any campaign field as a parameter. For a list of campaign fields, see Campaign.

Example

Create a campaign with the name New Campaign and a cost of 2,000.

Request information for a single campaign.

URI

Replace <ID> with the Pardot ID of the campaign.

Example

Request information for the campaign with ID 12341xxx.

Request information about the campaigns that match the specified criteria. You can specify which campaigns and which fields to request. A maximum of 200 campaigns are returned, unless you specify the output as mobile. If you specify the output as mobile, then all campaigns are returned.

Note: To request information about a specific campaign, use Campaign Read.

URI

Parameters to Select Campaigns

Use these parameters to specify which campaigns are returned. Parameters can be used in any combination and in any order unless otherwise specified.

Notes:

  • Parameters must be URL-encoded.
  • Dates and times must use GNU Date Input Syntax (yyyy-mm-dd:hh:ss ).
  • For a full listing of campaign fields see Object Field References.
Parameter Type Possible Values Description
created_after string today , yesterday , last_7_days , this_month , last_month , <custom_time> Request campaigns created after the specified date and time. Example: To request forms created in 2020, use /api/campaigns/version/3/do/query?created_after=2019-12-31 24:59:59 .
created_before string today , yesterday , last_7_days , this_month , last_month , <custom_time> Request campaigns created before the specified date and time. Doesn’t include campaigns created at the specified time. <custom_time> Example : to request campaigns created before today (but not created today), use /api/campaign/version/3/do/query?created_before=today .
id_greater_than integer Any positive integer Request campaigns that have a Pardot ID greater than the specified number.
id_less_than integer Any positive integer Returns campaigns that have a Pardot ID less than the specified number.
name string string Request campaigns with the specified name.
updated_after string today , yesterday , last_7_days , this_month , last_month , <custom_time> Request campaigns that were last updated after the specified date and time.
updated_before string today , yesterday , last_7_days , this_month , last_month , <custom_time> Request campaigns that were last updated before the specified date and time.

Parameters to Specify Which Results Are Returned

Use these parameters to specify which campaign fields are returned, and how the campaigns are sorted.

Parameter Type Possible Values Description
limit integer Any integer from 1 through 200. The number of campaigns to return. Default value is 200.
offset integer Any positive integer The number of campaigns to omit from the response (the number to "skip over"). Example: Retrieve a list of campaigns, omitting the 50 most recently updated campaigns. Sort the query by the updated_at field and use offset=50: api/campaign/version/3/do/query?sort_by=updated_at&offset=50
sort_by string created_at , id , name , updated_at , cost The field by which the results are sorted. See Sort Order.
sort_order string ascending, descending The sort order. The default value depends on which sort_by value you specify. See Sort Order.

Sort Order

Use sort_by to specify which field Pardot uses to sort the results. Different fields have different default sort orders.

Value Default Sort Order Description
created_at descending Sort the results by the campaigns' created_at timestamps.
id ascending Sort the results by the campaigns' id fields.
name ascending Sort the results by the campaigns' name fields.
updated_at descending Sort the results by the campaigns' updated_at timestamps.
cost descending Sort the results by the campaigns' cost fields.

Example

Request a list of campaigns, sorted in ascending order by cost.

Update a campaign's information, including campaign fields. Fields that aren’t specified in the request aren’t changed. To clear a field, use a null value.

Returns an updated version of the campaign.

URI

Replace <ID> with the Pardot ID of the campaign.

Parameters

You can use any campaign field as a parameter. For a list of campaign fields, see Object Field References.

Example

To update a campaign's name to "March Webinar" and reset the cost as blank, use the following POST command:

The XML response for a query request contains information about multiple campaigns. The XML response for a read request contains information about a single campaign.

XML Response for Campaign Query

Tag Description
<result> Parent tag. Contains the campaigns that match the parameters specified in your query.
<total_results> The number of campaigns selected by the query. Note: The query request returns a maximum of 200 campaigns. If your query matches more than 200 campaigns, you can make several requests to retrieve all matching records.
<campaign> The information for a single campaign. For information about campaign fields, see Campaign.

XML Response for Campaign Read

Tag Description
<campaign> The information for a single campaign. For information about campaign fields, see Campaign.
Read article