Sent Campaigns

When you send a campaign draft, a new campaign object is automatically created. Use the resources below to retrieve information about campaigns, mark selected campaigns as starred or delete them.

get

Get detailed information about all campaigns

get

Get detailed information about a specific campaign

get

/campaign

Retrieve details about a list of sent campaigns - creation and sending time, sender, subject, tracking options enabled etc. Each e-mail going through Mailjet is attached to a Campaign. This object is automatically generated by Mailjet.

Note: If no query parameters are used, only campaigns sent since 00:00 UTC on the current day will be returned.

Full API path

https://api.mailjet.com/v3/REST/campaign

Query string parameters

CampaignID

integer

Retrieves only the campaign details for the specified Campaign ID.

ContactsListID

integer

Retrieves only details for campaigns sent to the specified Contact List ID.

CustomCampaign

string

Retrieves only details for the campaign with the specified custom value assigned to it.

From

string

Retrieves only details for campaigns, which used the specified sender email address.

FromDomain

string

Retrieves only details for campaigns, which used the specified sender email domain.

FromID

integer

Retrieve only details for campaigns, which used the specified sender ID.

FromTS

string

Retrieves only details for campaigns sent after the specified timestamp.

FromType

integer

Retrieves only details for campaigns of the specified type:

  • 1 - Transactional
  • 2 - Marketing
  • 3 - Unknown

IsDeleted

boolean

When true, only details for deleted campaigns will be returned. When false, deleted campaigns will be excluded from the response.

IsNewsletterTool

boolean

When true, will return only details for campaigns created by the Newsletter tool (legacy template builder). When false, newsletter campaigns will be excluded from the response.

IsStarred

boolean

When true, will return only details for campaigns marked as starred. When false, starred campaigns will be excluded from the response.

Period

string

Retrieves only details for campaigns sent between the start of the selected period and the current timestamp.

  • Day - since the start of the current day
  • Week - since the start of the current week
  • Month - since the start of the current month
  • Year - since the start of the current year

ToTS

string

Retrieves only details for campaigns sent before this timestamp.

WorkflowID

integer

Retrieves only details for campaigns that were triggered by this automation workflow ID.

Limit

integer

Limit the response to a select number of returned objects.

Default value: 10. Maximum value: 1000

Offset

integer

Retrieve a list of objects starting from a certain offset. Combine this query parameter with Limit to retrieve a specific section of the list of objects.

Default value: 0

countOnly

boolean

Set the value of this query parameter to 1 to retrieve the overall number of objects returned by this request for your API Key. No list of results will be returned - the objects will simply be counted.

Default value: 0

Note: When you send a request without the countOnly query parameter, Count and Total will only return the number of extracted elements and not the overall number.

Sort

string

Specify a property name for this query parameter to sort the objects in Data. By default the sorting is ascending. When a property name is postfixed with DESC (i.e. property_name DESC), the sort order will be descending.

Note: Both the Sort query parameter and the option to select a descending order are not available for every property.

Responses

Note: You can find all the errors related to API in the error page

Count

integer

Data

array

IsDeleted

boolean

Indicates whether this campaign is deleted or not.

IsStarred

boolean

Indicates whether this campaign is marked as starred or not.

CampaignType

integer

Type of campaign:

  • 1 - Transactional
  • 2 - Marketing
  • 3 - Unknown

ClickTracked

integer

Indicates whether click tracking has been enabled for this campaign (1) or not (2).

CreatedAt

string

Timestamp indicating when the campaign was created.

CustomValue

string

Custom unique tag for this campaign.

FirstMessageID

integer

Unique numeric ID of the first sent message for this campaign.

FromEmail

string

Sender email address for this campaign.

FromID

integer

Unique numeric ID for the sender email address.

FromName

string

Sender name selected for this campaign.

HasHtmlCount

integer

Indicates whether the emails in this campaign have HTML content (1) or not (0).

HasTxtCount

integer

Indicates whether the emails in this campaign have plain text content (1) or not (0).

ID

integer

Unique numeric ID of this campaign.

ListID

integer

Unique numeric ID of the contact list, to which this campaign was sent.

NewsLetterID

integer

Unique numeric ID of this campaign draft object linked to this campaign.

OpenTracked

integer

Indicates whether click tracking has been enabled for this campaign (1) or not (2).

SegmentationID

integer

Unique numeric ID for the segmentation used for this campaign (see /contactfilter). Returned only if a segmentation is used for the campaign.

SendEndAt

string

Timestamp indicating when last message in this campaign was sent.

SendStartAt

string

Timestamp indicating when first message in this campaign was sent.

SpamassScore

number

SpamAssassin score for this campaign.

Status

integer

Status of this campaign.

Subject

string

Subject line used for the emails in this campaign.

UnsubscribeTrackedCount

integer

Indicates whether unsubscribe tracking has been enabled for this campaign (1) or not (0).

WorkflowID

integer

Unique numeric ID of the automation workflow that triggered this campaign. Returned only if a workflow is used for the campaign.

Total

integer

get

/campaign/{campaign_ID or CustomCampaign}

Retrieve details about a specific campaign - creation and sending time, sender, subject, tracking options enabled etc. Each e-mail going through Mailjet is attached to a Campaign. This object is automatically generated by Mailjet.

Full API path

https://api.mailjet.com/v3/REST/campaign/{campaign_ID}

Path parameters

campaign_ID

integer, required

Unique numeric ID of the campaign you want to retrieve.

CustomCampaign

The CustomValue of the campaign you want to retrieve.

Responses

Note: You can find all the errors related to API in the error page

Count

integer

Data

array

IsDeleted

boolean

Indicates whether this campaign is deleted or not.

IsStarred

boolean

Indicates whether this campaign is marked as starred or not.

CampaignType

integer

Type of campaign:

  • 1 - Transactional
  • 2 - Marketing
  • 3 - Unknown

ClickTracked

integer

Indicates whether click tracking has been enabled for this campaign (1) or not (2).

CreatedAt

string

Timestamp indicating when the campaign was created.

CustomValue

string

Custom unique tag for this campaign.

FirstMessageID

integer

Unique numeric ID of the first sent message for this campaign.

FromEmail

string

Sender email address for this campaign.

FromID

integer

Unique numeric ID for the sender email address.

FromName

string

Sender name selected for this campaign.

HasHtmlCount

integer

Indicates whether the emails in this campaign have HTML content (1) or not (0).

HasTxtCount

integer

Indicates whether the emails in this campaign have plain text content (1) or not (0).

ID

integer

Unique numeric ID of this campaign.

ListID

integer

Unique numeric ID of the contact list, to which this campaign was sent.

NewsLetterID

integer

Unique numeric ID of this campaign draft object linked to this campaign.

OpenTracked

integer

Indicates whether click tracking has been enabled for this campaign (1) or not (2).

SegmentationID

integer

Unique numeric ID for the segmentation used for this campaign (see /contactfilter). Returned only if a segmentation is used for the campaign.

SendEndAt

string

Timestamp indicating when last message in this campaign was sent.

SendStartAt

string

Timestamp indicating when first message in this campaign was sent.

SpamassScore

number

SpamAssassin score for this campaign.

Status

integer

Status of this campaign.

Subject

string

Subject line used for the emails in this campaign.

UnsubscribeTrackedCount

integer

Indicates whether unsubscribe tracking has been enabled for this campaign (1) or not (0).

WorkflowID

integer

Unique numeric ID of the automation workflow that triggered this campaign. Returned only if a workflow is used for the campaign.

Total

integer