POST/api/v1/projects/{project_id}/campaigns/{campaign_id}/preflight
preflight_campaign
Shows what launching a draft campaign would do now: its recipients after deduplication and suppression, its sender’s sending domain with its warnings, its transport, how long sending takes at its throttle, and every precondition it does not meet.
- Call it
- before
launch_campaign, to see who gets the campaign and what to fix. - Needs
- an admin key with
project_id, or a project key with scoperead(its own project; the argument is ignored), and a campaign indraft(otherwiseconflict). Changes nothing. - Returns
recipients,from_email,domain,transport,throttle_per_hour,estimated_duration_secsandviolations(empty: it can be launched), the same asPOST /api/v1/projects/{project_id}/campaigns/{campaign_id}/preflight.
Arguments
- object
-
campaign_idstring · uuidrequiredThe campaign’s id, as
create_campaignorlist_campaignsgave it. -
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
-
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
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.
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}/preflight