Campaignsrequires confirm HTTP API
POST/api/v1/projects/{project_id}/campaigns/{campaign_id}/launch
launch_campaign
Launches a draft campaign: its recipients’ messages are queued and sending starts.
- Call it
- once the campaign is ready (
preflight_campaignshows no violations). - Needs
- an admin key with
project_id, or a project key with scopesend(its own project; the argument is ignored), a verified sending domain for the sender, a template that renders, live lists with recipients, a transport the node has, andconfirm: true; without it the call checks the same and changes nothing. Every unmet precondition comes back at once (precondition_failed). - Returns
outcome(would_launch,would_resume,launched,failed),effectin words, the preflight (in a dry run of a draft) and the campaign asget_campaignreturns it after the call: the same asPOST /api/v1/projects/{project_id}/campaigns/{campaign_id}/launchanswers when confirmed.
Arguments
- object
-
campaign_idstring · uuidrequiredThe campaign’s id: a draft, or a campaign left
launchingby an interrupted launch. -
confirmbooleantruelaunches the campaign. Without it the call checks what the launch checks, answers the preflight and changes nothing.default
false -
project_idstring · uuid | nullThe campaign’s project. An admin key must pass it; a project key’s own project is used and this is ignored.
No other arguments are accepted.
Result
The result comes back as structuredContent, with the same JSON as a text block.
- object · all fields required
-
campaignCampaignThe campaign after the call, as
get_campaignreturns it: the launch’s answer (POST /api/v1/projects/{project_id}/campaigns/{campaign_id}/launch) when confirmed; unchanged by a dry run.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.
-
effectstringThe outcome in words, for the agent and its user.
-
outcomeLaunchOutcomeWhat a launch did.
would_launchA dry run of a draft that meets every precondition: nothing changed; a call withconfirm: truelaunches it.would_resumeA dry run of a campaign whose launch was interrupted (launching): a call withconfirm: truefinishes it.launchedLaunched: its deliveries are queued; it issending.failedThe launch found no recipient by the time it wrote them: the campaign isfailed,last_errorsays why. -
preflightCampaignPreflight | nullWhat
preflight_campaignanswers for the draft: in a dry run of a draft;nullotherwise.8 fields
- CampaignPreflight object · all fields required
-
campaign_idstring · uuid -
domainCampaignPreflightDomain | nullThe project’s sending domain of the sender;
nullwhen it has none.4 fields
- CampaignPreflightDomain object · all fields required
-
domainstring -
idstring · uuid -
statusstringpending,verifiedorfailed; only averifiedone sends. -
warningsarray of CampaignPreflightWarningChecks that do not decide the status and are not
ok(ptr,tracking_tls): the launch goes ahead, delivery may suffer.3 fields
- CampaignPreflightWarning object · all fields required
-
checkstring -
detailstring | null -
statusstringmissing,mismatchorwarning.
-
estimated_duration_secsinteger · uint64 | nullHow long sending takes at
throttle_per_hour, in seconds;nullwithout a limit or a count.≥ 0
-
from_emailstring | nullThe sender: the campaign’s, else the project’s
settings.from_email;nullwhen neither names one. -
recipientsinteger · uint64 | nullRecipients after deduplication and suppression: the deliveries the launch would write.
nullwhen a list is missing or deleted.≥ 0
-
throttle_per_hourinteger · uint32 | nullMost messages an hour: the campaign’s, else the project’s
default_throttle_per_hour;null: no limit.≥ 0
-
transportstringThe transport the messages go through:
directorrelay:<name>. -
violationsarray of ViolationEvery unmet precondition of the launch, as a
precondition_failederror would list them; empty: it can be launched.3 fields
- Violation object · all fields required
-
codestringWhat is wrong,
snake_case. -
fieldstringThe field it is about (
from_email,list_ids.0,transport). -
messagestring
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.
CampaignPreflight
What launching a draft would do now, and what stops it
(preflight_campaign; POST /api/v1/projects/{project_id}/campaigns/{campaign_id}/preflight).
- object · all fields required
-
campaign_idstring · uuid -
domainCampaignPreflightDomain | nullThe project’s sending domain of the sender;
nullwhen it has none. -
estimated_duration_secsinteger · uint64 | nullHow long sending takes at
throttle_per_hour, in seconds;nullwithout a limit or a count.≥ 0
-
from_emailstring | nullThe sender: the campaign’s, else the project’s
settings.from_email;nullwhen neither names one. -
recipientsinteger · uint64 | nullRecipients after deduplication and suppression: the deliveries the launch would write.
nullwhen a list is missing or deleted.≥ 0
-
throttle_per_hourinteger · uint32 | nullMost messages an hour: the campaign’s, else the project’s
default_throttle_per_hour;null: no limit.≥ 0
-
transportstringThe transport the messages go through:
directorrelay:<name>. -
violationsarray of ViolationEvery unmet precondition of the launch, as a
precondition_failederror would list them; empty: it can be launched.see Violation
CampaignPreflightDomain
The sending domain of a campaign’s sender.
- object · all fields required
-
domainstring -
idstring · uuid -
statusstringpending,verifiedorfailed; only averifiedone sends. -
warningsarray of CampaignPreflightWarningChecks that do not decide the status and are not
ok(ptr,tracking_tls): the launch goes ahead, delivery may suffer.
CampaignPreflightWarning
One check of a preflight’s domain warnings.
- object · all fields required
-
checkstring -
detailstring | null -
statusstringmissing,mismatchorwarning.
LaunchOutcome
What a launch did.
string · enum
would_launch A dry run of a draft that meets every precondition: nothing
changed; a call with confirm: true launches it.
would_resume A dry run of a campaign whose launch was interrupted (launching):
a call with confirm: true finishes it.
launched Launched: its deliveries are queued; it is sending.
failed The launch found no recipient by the time it wrote them: the
campaign is failed, last_error says why.
TrackingOverride
What a campaign tracks in place of the project’s.
- object · all fields required
-
clicksboolean -
opensboolean
Violation
One unmet precondition.
- object · all fields required
-
codestringWhat is wrong,
snake_case. -
fieldstringThe field it is about (
from_email,list_ids.0,transport). -
messagestring
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: POST /api/v1/projects/{project_id}/campaigns/{campaign_id}/launch