JavaScript SDK: swarmhit.campaigns.updateStep(campaignId, stepId, params)
Partially updates one existing sequence step's copy and/or media while
preserving its id, wiring, delays and other A/B variants. Use the step
and variant ids returned by GET /campaigns/{id}. When variantId is
omitted, variant A is updated; pass another existing variantId to
update that variant without changing variant A. This endpoint is
preferred over replacing the full sequence for copy, attachment and
recorded-voice edits, except for a recorded voice note that records per
sender: those recordings are replaced through the campaign's sequence.
On a launched campaign, an update that leaves the step with nothing to
send is a 400 with code: empty-step (see
PATCH /campaigns/{id}).
Authorization
bearerAuth An API key created on the Access tokens page.
In: header
Path Parameters
Stable sequence step id returned by the campaign detail.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Content fields depend on the target step type: message uses
text/fallbackText; invite uses note/fallbackNote; InMail and
email also accept subject/fallbackSubject; AI voice note uses
script/fallbackScript (on LinkedIn and WhatsApp); comment post uses prompt; call uses
instructions. Message and
InMail accept attachments only (a voice on them is refused: voice
notes have their own steps); recorded voice note accepts voice. A
recorded voice note that records per sender (its config
carries voiceAssignments) is rejected here: its recordings live per
sender, not per variant, so replace them through the campaign's
sequence instead.
Content fields depend on the target step type: message uses
text/fallbackText; invite uses note/fallbackNote; InMail and
email also accept subject/fallbackSubject; AI voice note uses
script/fallbackScript (on LinkedIn and WhatsApp); comment post uses prompt; call uses
instructions. Message and
InMail accept attachments only (a voice on them is refused: voice
notes have their own steps); recorded voice note accepts voice. A
recorded voice note that records per sender (its config
carries voiceAssignments) is rejected here: its recordings live per
sender, not per variant, so replace them through the campaign's
sequence instead.
Response Body
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/campaigns/string/sequence/string" \ -H "Content-Type: application/json" \ -d '{ "text": "{{firstName}}, is that the kind of gap you run into too?" }'{ "data": { "id": "string", "name": "string", "status": "draft", "stats": { "total": 0, "done": 0, "failed": 0 }, "aiInterestEnabled": true, "unsubscribe": { "enabled": true, "text": "string" }, "tracking": { "opens": "mailbox", "clicks": "mailbox" }, "linkedinAccountIds": [ "string" ], "emailAccountIds": [ "string" ], "whatsappAccountIds": [ "string" ], "senderIds": [ "string" ], "excludeListIds": [ "string" ], "listId": "string", "excludeOtherCampaigns": true, "excludeOtherSenders": true, "excludeSameSenderOtherCampaigns": true, "companyLimit": { "max": 1, "period": "day", "scope": "campaign" }, "pauseCompanyOnReply": true, "outOfOffice": { "enabled": true, "fallbackDays": 7 }, "matchEmailProvider": true, "schedule": { "startDate": "2019-08-24T14:15:22Z", "endDate": "2019-08-24T14:15:22Z", "timezone": "string", "activeHours": { "from": "string", "to": "string" }, "activeDays": [ 0 ] }, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "sequence": { "steps": [ { "id": "string", "type": "if_connected", "parent": "string", "branch": "yes", "config": {}, "nextDelayHours": 0, "branchDelays": { "yes": 0, "no": 0 } } ] } }}