There's a new version of the HubSpot API

As of November 30, 2022, HubSpot API Keys are being deprecated and are no longer supported. Continued use of HubSpot API Keys is a security risk to your account and data. Your API Keys could be deactivated at any time after Nov. 30th, and we recommend that you migrate to Private Apps as soon as possible so you do not lose business-critical functionality.

Get campaign data for a given campaign

Last updated December 2, 2022

GET /email/public/v1/campaigns/:campaign_id

Method Details

HTTP Methods:

GET

Response Format:

json

Requires Authentication?

Yes

Rate Limited?

Yes

Headers

User-Agent

Products:

Marketing

Required Scope:

content

This endpoint provides a way to query data associated with a given email campaign.

To find the campaign_id that corresponds to a specific email:

  • In your HubSpot account, navigate to Marketing > Email.
  • Locate the sent email you want to retrieve campaign data for, then click the email name.
  • Under the Sent date, click See details.
  • In the right panel, the campaign_id will be listed under Internal HubSpot ID.

legacy-marketing-email-api-find-campaign-id

The campaign_id will also be provided within the allEmailCampaignIds field in the response of the Marketing Email Statistics API.

Required Parameters How to use Description
OAuth Access Token or API Key Authorization: Bearer {token} header
or hapikey={key} query parameter.
Used to authenticate the request. Please see this page for more details about authentication.
Campaign ID /:campaign_id
 Used in the request URL
The Internal HubSpot ID of the email that you want to get the details for. Consult the section above this table to learn how to locate this ID. 

Example URL: https://api.hubapi.com/email/public/v1/campaigns/13054799?hapikey=demo