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

Opportunity Resources

When you create a Salesforce opportunity with a contact role that’s associated with a Pardot prospect, we create a read-only opportunity in Pardot. To use Pardot opportunities, first set up the Pardot-Salesforce connector. Learn more about opportunities in Salesforce Help.

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

Resource Name Operation Description
Opportunity Create POST Create an opportunity record. Available only in legacy accounts without a CRM connector.
Opportunity Delete DELETE Delete an opportunity. Available only in legacy accounts without a CRM connector.
Opportunity Read GET Request information for a single opportunity.
Opportunity Query GET Request information for the opportunities that match the specified criteria.
Opportunity Update POST Update an opportunity's information. Available only in legacy accounts without a CRM connector.
Opportunity Undelete GET and POST Restore a deleted opportunity. Available only in legacy accounts without a CRM connector.

Opportunity Create

Create an opportunity with the specified fields. Include either the prospect's email or the prospect's ID.

URI

/api/opportunity/version/3/do/create/prospect_email/<prospect_email>?...

Replace <prospect_email> with the prospect's email address.

/api/opportunity/version/3/do/create/prospect_id/<prospect_id>?...

Replace <prospect_id> with the prospect's Pardot ID.

Parameters

You can use the following parameters when creating an opportunity.

Parameter Type Possible Values Description
name string Any string The name of the opportunity.
value integer Any integer The opportunity's value.
probability integer Any integer from 0 through 100 The probability of winning the opportunity.
prospect_email string The prospect's email address. If you’re creating the opportunity by prospect ID, you can also include the prospect's email address. If both prospect_email and prospect_id are specified, both must correspond to the same prospect. Otherwise, the API will return an error.
prospect_id integer Any valid prospect ID. If you’re creating the opportunity by prospect email, you can also include the prospect's ID. If both prospect_email and prospect_id are specified, both must correspond to the same prospect. Otherwise, the API will return an error.

Example

Use a prospect's email address to create an opportunity with the name "Large Customer Opportunity", a value of 100, a probability of 70%. The prospect's email address is jdoe@company.com.

POST /api/opportunity/version/3/do/create?format=json HTTP/1.1
Host: pi.pardot.com
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer <ACCESS TOKEN>
Pardot-Business-Unit-Id: <BUSINESS UNIT ID>

prospect_email=jdoe@company.com&name=Large Customer Opportunity&value=100&probability=70

Opportunity Delete

Delete the specified opportunity. This request doesn’t delete the visitor activities or score changes for the prospect who is associated with the opportunity.

If this request is successful, it doesn’t return a response.

URI

/api/opportunity/version/3/do/delete/id/<ID>?...

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

Example

Delete the opportunity with Pardot ID 1234.

/api/opportunity/version/3/do/delete/id/1234

Opportunity Read

Request information for a single opportunity.

URI

/api/opportunity/version/3/do/read/id/<ID>?..

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

Example

Request information for the opportunity with Pardot ID 1234.

/api/opportunity/version/3/do/read/id/1234

Opportunity Query

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

Note: To request information about a specific opportunity, use Opportunity Read.

URI

/api/opportunity/version/3/do/query?...

Parameters to Select Opportunities

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

Notes:

Parameter Type Possible Values Description
created_after string today, yesterday, last_7_days, this_month, last_month,<custom_time> Request opportunities created after the specified date and time. Example: To request forms created in 2020, use /api/opportunities/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 opportunities created before the specified date and time. Doesn’t include opportunities created at the specified time. <custom_time> Example: to request opportunities created before today (but not created today), use /api/opportunity/version/3/do/query?created_before=today.
id_greater_than integer Any positive integer Request opportunities that have a Pardot ID greater than the specified number.
id_less_than integer Any positive integer Request opportunities that have a Pardot ID less than the specified number.
probability_greater_than integer Any integer from 1 through 100 Request opportunities that have a probability greater than the specified number.
probability_less_than integer Any integer from 1 through 100 Request opportunities that have a probability less than the specified number.
prospect_email string Any valid prospect email Request opportunities associated with the prospect having the specified email. Note: If you specify a prospect's email and a prospect's ID, ensure the email and ID belong to the same prospect. Otherwise, the request returns an error.
prospect_id integer Any valid prospect ID Request opportunities associated with the prospect having the specified ID. Note: If you specify a prospect's email and a prospect's ID, ensure the email and ID belong to the same prospect. Otherwise, the request returns an error.
value_greater_than integer Any integer Request opportunities that have a value greater than the specified number.
value_less_than integer Any integer Request opportunities that have a value less than the specified number.

Parameters to Specify Which Results Are Returned

Use these parameters to specify which opportunity fields are returned, and how the opportunities are sorted.

Parameter Type Possible Values Description
limit integer Any integer from 1 through 200. The number of opportunities to return. Default value is 200.
offset integer Any positive integer The number of opportunities to omit from the response (the number to "skip over"). Example: Retrieve a list of opportunities, omitting the 50 most recently updated opportunities. Sort the query by the probability field and use offset=50: /api/opportunity/version/3/do/query?offset=50&sort_by=probability
output string simple, mobile, full Specify the level of detail in the XML response. For more information, see XML Response Format.
sort_by string created_at, id, probability, value 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 opportunities' created_at timestamps.
id ascending Sort the results by the opportunities' id fields.
probability descending Sort the results by the opportunities' probability fields.
value descending Sort the results by the opportunities' value fields.

Example

Request a list of opportunities, sorted in ascending order by probability.

/api/opportunity/version/3/do/query?sort_order=ascending&sort_by=probability

Opportunity Undelete

Restores the specified opportunity, which has been deleted. If this request is successful, it doesn’t return a response.

URI

/api/opportunity/version/3/do/undelete/id/<ID>

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

Example

Restore the opportunity with Pardot ID 1234.

/api/opportunity/version/3/do/undelete/id/1234

Opportunity Update

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

URI

/api/opportunity/version/3/do/update/id/<ID>?...

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

Parameters

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

Example

To update an opportunity's name to "Large Opportunity", use the following command:

/api/opportunity/version/3/do/update/id/28234?name=Large Opportunity

XML Response

The XML response for a query request contains information about multiple opportunities. The XML response for a read request contains information about a single opportunity.

XML Response for Opportunity Query

<rsp stat="ok" version="1.0">
    <result>
        <total_results>...</total_results>
        <opportunity>...</opportunity>
        <opportunity>...</opportunity>
        <opportunity>...</opportunity>
    </result>
</rsp>
Tag Description
<result> Parent tag. Contains the opportunities that match the parameters specified in your query.
<total_results> The number of opportunities selected by the query. Note: The query request returns a maximum of 200 opportunities. If your query matches more than 200 opportunities, you can make several requests to retrieve all matching records.
<opportunity> The information for a single opportunity. For information about opportunity fields, see Opportunity.

XML Response for Opportunity Read

For output=full:

<rsp stat="ok" version="1.0">
    <opportunity>
        ...
        <campaign>
            ...
        </campaign>
        <prospects>
            <prospect>
                ...
            </prospect>
        </prospects>
        <opportunity_activities>
            <visitor_activity>
                ...
            </visitor_activity>
        </opportunity_activities>
    </opportunity>
</rsp>

For output=simple:

<rsp stat="ok" version="1.0">
    <opportunity>
        ...
        <campaign>
            ...
        </campaign>
        <prospects>
            <prospect>
                ...
            </prospect>
        </prospects>
    </opportunity>
</rsp>

For output=mobile:

<rsp stat="ok" version="1.0">
    <opportunity>
        ...
    </opportunity>
</rsp>
Tag Description
<opportunity> The information for a single opportunity. For information about opportunity fields, see Opportunity.
<campaign> The Pardot ID and name of the campaign to which this opportunity has been assigned.
<prospects> Contains all prospects associated with this opportunity.
<opportunity_activities> Contains all visitor activities associated with this opportunity.
<visitor_activity> Contains information for a visitor activity. For information about visitor activity fields, see Visitor Activity.