PATCH/api/v1/projects/{project_id}/campaigns/{campaign_id}
update_campaign
Changes a campaign’s fields: name, lists, template, sender, reply-to, subject, transport, tracking, throttle.
- Call it
- to fix a draft before it is launched.
- Needs
- an admin key with
project_id, or a project key with scopewrite(its own project; the argument is ignored), and a campaign indraftorscheduled(otherwiseconflict); new lists and template are checked ascreate_campaignchecks them. Arguments left out keep their values; null clears what may be empty;list_idsandtracking_overrideare replaced as a whole. - Returns
- the campaign after the change, the same as
PATCH /api/v1/projects/{project_id}/campaigns/{campaign_id}.
Arguments
- object
-
campaign_idstring · uuidrequiredThe campaign’s id.
-
from_emailstring · email | nullThe sender address; null: the project’s
settings.from_email. -
from_namestring | nullThe sender name, 1 to 128 characters; null: the project’s
settings.from_name.example
Acme News -
list_idsarray of stringThe new lists, replaced as a whole: 1 to 16 distinct ids of live lists of the project; leave it out to keep them.
1–16 items
-
namestringThe new name; leave it out to keep the name.
-
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.
-
reply_tostring · email | nullReply-To; null: the project’ssettings.reply_to. -
subject_overridestring | nullThe subject source in place of the template’s; null: the template’s.
-
template_idstring · uuidAnother message template of the project; leave it out to keep it.
-
throttle_per_hourinteger · int64 | nullMost messages an hour, 1 to 4294967295; null: the project’s
default_throttle_per_hour, or no limit.1–4294967295
-
tracking_overrideTrackingOverrideArguments | nullWhat to track, both flags, in place of the project’s
settings.tracking; null: the project’s.2 fields
- TrackingOverrideArguments object · all fields required
-
clicksbooleanClick redirects.
-
opensbooleanThe open pixel.
-
transport_overridestring | nulldirectorrelay:<name>(a relay of the node); null: the project’s transport.
No other arguments are accepted.
Result
The result comes back as structuredContent, with the same JSON as a text block.
- 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.
Definitions
TrackingOverride
What a campaign tracks in place of the project’s.
- object · all fields required
-
clicksboolean -
opensboolean
TrackingOverrideArguments
What a campaign tracks.
- object · all fields required
-
clicksbooleanClick redirects.
-
opensbooleanThe open pixel.
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: PATCH /api/v1/projects/{project_id}/campaigns/{campaign_id}