Update Campaign
PUT/campaign/:id
Updates the details of an existing campaign
Use this endpoint to modify campaign properties such as subject line, content, recipients, schedule, or other settings, allowing you to keep campaigns up to date before sending.
- Campaigns in
LAUNCHED/COMPLETED/FAILEDstatus is not allowed to update. - sendOrder - omitting the field leaves the order already saved on the campaign alone.
Switching to
ENGAGEMENT_SCOREis rejected with400once the campaign has started building its recipient list: the engagement score is written while that list is built and is never backfilled. Switching toALPHABETICALorRANDOM, and restating an order the campaign already has, stay allowed at any point. - htmlTemplateId - ID of a saved template to use as the campaign content, instead of
template.html. Same meaning as on Create Campaign: the template's html, css and editor type are copied into the campaign, and its subject and preview text are used only whencampaign.subject/campaign.previewTextare not sent. Sending bothhtmlTemplateIdandtemplate.htmlfails with412.
Request
Path Parameters
ID of the campaign to update
- application/json
Body
required
ALPHABETICAL(Standard) - the order every campaign sends in when no order is picked.RANDOM(Shuffled) - a stable pseudo-random order, seeded with the campaign id, so every batch of one send agrees.ENGAGEMENT_SCORE(Most engaged first) - highest engagement score first, lowest and unscored contacts last. Omit the field to keep the standard order. It has no effect on campaigns that are not traffic shaped.
campaign object
template object
ID of a saved template (see the Templates API) to use as the campaign content, instead of template.html.
The template's html, css and editor type are copied into the campaign; editing or deleting the template later does not change the campaign.
The template's subject and preview text are used only when campaign.subject / campaign.previewText are not sent.
Mutually exclusive with template.html.
Possible values: [ALPHABETICAL, RANDOM, ENGAGEMENT_SCORE]
Order the recipients of a traffic-shaped campaign are sent in.
schedule object
Responses
- 204
- 400
- 401
- 405
- 412
Successful operation
Bad Request
- application/json
- Schema
- Example (from schema)
Schema
{
"message": "Some error message"
}
API key is missing or invalid
Method Not Allowed
Precondition Failed. The htmlTemplateId was not found in your account, or the request sent both template.html and htmlTemplateId.
- application/json
- Schema
- Example (from schema)
- Template not found
- Both content sources
Schema
- Array [
- ]
errorCodes object[]
{
"message": "Some error message",
"messageDetails": "string",
"errorCodes": [
{
"errorCode": "string",
"errorMessage": "string"
}
]
}
{
"message": "Template 8a6e0f6c-2b7d-4a8e-9a5e-6f1d2c3b4a59 not found"
}
{
"message": "Provide either template.html or htmlTemplateId, not both"
}