Replace the sequence
Replaces the WHOLE sequence tree of the campaign. Always GET the campaign first, modify the steps object and send the complete tree back. The campaign must not be RUNNING (pause it first). Read the guide before you build a sequence: Write the sequence, with complete examples.
Step and version ids. Leave _id out on new steps and new versions: the server generates them. The only _id you write is "START" on the root. If you write ids yourself, they must be MongoDB ObjectIds (24 lowercase hexadecimal characters, like 66f2b4c19e7a3d5b8c0e1f24), never labels like "MAIL1" or "email-1", never UUIDs. Any other id is refused with HTTP 400 and the code INVALID_STEP_ID or INVALID_VERSION_ID, and two steps with the same id with DUPLICATE_STEP_ID. See Step and version ids.
Keep existing ids on a campaign that already ran, otherwise history, statistics and the position of contacts in the sequence are lost and contacts may receive steps again. Content is not validated here: empty email versions, missing subjects or audio are only reported by POST .../start.
Authorization
apiKey Your 48 character API key, sent as is (a Bearer prefix is tolerated). Create it at https://v3.emelia.io/settings/api.
In: header
Path Parameters
Identifier of a multichannel campaign (24 hexadecimal characters), as returned by POST /advanced/campaigns or GET /advanced/campaigns.
^[0-9a-fA-F]{24}$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/advanced/campaigns/6650f1a2b839d80011c5a0f1/steps" \ -H "Authorization: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "steps": { "_id": "START", "stepType": "START", "identities": [], "delay": { "amount": 0, "unit": "DAYS" }, "next": { "stepType": "CONNECTION", "identities": [], "delay": { "amount": 0, "unit": "DAYS" }, "versions": [ { "message": "Hi {{firstName}}, glad to connect." } ], "next": { "stepType": "CONDITION", "identities": [], "delay": { "amount": 3, "unit": "DAYS" }, "conditions": { "field": "ACCEPTED", "operator": "EQUAL", "value": "true" }, "yes": { "stepType": "MESSAGE", "identities": [], "delay": { "amount": 1, "unit": "HOURS" }, "versions": [ { "message": "Thanks for connecting {{firstName}}!" } ] }, "no": { "stepType": "EMAIL", "identities": [], "delay": { "amount": 2, "unit": "HOURS" }, "versions": [ { "subject": "Quick question, {{firstName}}", "message": "<p>Hi {{firstName}},</p><p>I sent you an invitation on LinkedIn...</p>" } ], "next": { "stepType": "END_OF_CAMPAIGN", "identities": [], "delay": { "amount": 0, "unit": "DAYS" } } } } } } }'{ "success": true}