GET/api/v1/projects/{project_id}/campaigns
list_campaigns
Lists the campaigns of a project, oldest first, at most 100 per call, optionally of one status.
- Call it
- to find a campaign’s id or the drafts still to launch.
- Needs
- an admin key with
project_id, or a project key with scoperead(its own project; the argument is ignored). - Returns
items(campaigns asget_campaignreturns them) andnext_cursor: pass it ascursorfor the next page; null on the last page. The same asGET /api/v1/projects/{project_id}/campaigns.
Arguments
- object
-
cursorstring | nullnext_cursorof the previous page; leave it out for the first. -
limitinteger · int64 | nullPage size, 1 to 100; default 50.
1–100
-
project_idstring · uuid | nullThe project whose campaigns to list. An admin key must pass it; a project key’s own project is used and this is ignored.
-
statusstring | nullOnly campaigns in this status:
draft,scheduled,launching,sending,paused,completed,cancelled,failed.
No other arguments are accepted.
Result
The result comes back as structuredContent, with the same JSON as a text block.
- object · all fields required
-
itemsarray of CampaignIn creation order.
23 fields
- Campaign object · all fields required
-
completed_atstring · date-time | null -
created_atstring · date-time -
from_emailstring | nullnull: the project’ssettings.from_email. -
from_namestring | nullnull: the project’ssettings.from_name. -
idstring · uuid -
last_errorstring | nullWhy the launch failed;
nullunlessfailed. -
launched_atstring · date-time | null -
list_idsarray of stringThe lists it goes to, in the order given.
-
namestring -
partial_versionsmap of string → integer · uint32The versions of the partials fixed at launch, by name;
{}before. -
project_idstring · uuid -
reply_tostring | nullnull: the project’ssettings.reply_to. -
scheduled_atstring · date-time | nullWhen a scheduled campaign launches;
nullunless scheduled. -
shard_countinteger · uint32 | nullFixed at launch;
nullbefore.≥ 0
-
statusstringdraft,scheduled,launching,sending,paused,completed,cancelledorfailed. -
subject_overridestring | nullnull: the template’s subject. -
template_idstring · uuid -
template_versioninteger · uint32 | nullThe template’s version fixed at launch;
nullbefore.≥ 0
-
throttle_per_hourinteger · uint32 | nullnull: the project’sdefault_throttle_per_hour, or no limit.≥ 0
-
total_recipientsinteger · uint64 | nullRecipients of the launch’s snapshot;
nullbefore.≥ 0
-
tracking_overrideTrackingOverride | nullnull: the project’ssettings.tracking.2 fields
- TrackingOverride object · all fields required
-
clicksboolean -
opensboolean
-
transport_overridestring | nullnull: the project’s transport, then the node’s default. -
updated_atstring · date-timeThe latest change: creation, fields, status.
-
next_cursorstring | nullPass as
cursorfor the next page;nullon the last page.
Definitions
Campaign
A campaign of a project (create_campaign, get_campaign,
update_campaign; GET /api/v1/projects/{project_id}/campaigns/{campaign_id}).
- object · all fields required
-
completed_atstring · date-time | null -
created_atstring · date-time -
from_emailstring | nullnull: the project’ssettings.from_email. -
from_namestring | nullnull: the project’ssettings.from_name. -
idstring · uuid -
last_errorstring | nullWhy the launch failed;
nullunlessfailed. -
launched_atstring · date-time | null -
list_idsarray of stringThe lists it goes to, in the order given.
-
namestring -
partial_versionsmap of string → integer · uint32The versions of the partials fixed at launch, by name;
{}before. -
project_idstring · uuid -
reply_tostring | nullnull: the project’ssettings.reply_to. -
scheduled_atstring · date-time | nullWhen a scheduled campaign launches;
nullunless scheduled. -
shard_countinteger · uint32 | nullFixed at launch;
nullbefore.≥ 0
-
statusstringdraft,scheduled,launching,sending,paused,completed,cancelledorfailed. -
subject_overridestring | nullnull: the template’s subject. -
template_idstring · uuid -
template_versioninteger · uint32 | nullThe template’s version fixed at launch;
nullbefore.≥ 0
-
throttle_per_hourinteger · uint32 | nullnull: the project’sdefault_throttle_per_hour, or no limit.≥ 0
-
total_recipientsinteger · uint64 | nullRecipients of the launch’s snapshot;
nullbefore.≥ 0
-
tracking_overrideTrackingOverride | nullnull: the project’ssettings.tracking.see TrackingOverride
-
transport_overridestring | nullnull: the project’s transport, then the node’s default. -
updated_atstring · date-timeThe latest change: creation, fields, status.
TrackingOverride
What a campaign tracks in place of the project’s.
- object · all fields required
-
clicksboolean -
opensboolean
Errors
A failed call answers isError: true with a code from the same table as the HTTP API, and detail. How tools report errors
HTTP API
The same operation over HTTP: GET /api/v1/projects/{project_id}/campaigns