UpdateSequence

View as Markdown
## Creates or fully replaces the sequence (workflow) of a campaign. The START node is implicit; the root of the request must be your first action node. Every path through the tree must terminate with an **END** node. Allowed statuses: DRAFT, SCHEDULED, PAUSED. Returns 400 for any other status (e.g. IN_PROGRESS, FINISHED). For PAUSED campaigns a safe update is performed - existing lead states are preserved and leads are remapped to compatible positions in the new sequence. For SCHEDULED campaigns the campaign reverts to DRAFT. ### Body Parameters - **campaignId** _(long, required)_: The campaign to update. - **sequence** _(PublicSequenceNodeDto, required)_: Root node of the workflow tree. ### PublicSequenceNodeDto fields - **nodeType** _(string, required)_: One of `CONNECTION_REQUEST`, `MESSAGE`, `INMAIL`, `VIEW_PROFILE`, `FOLLOW`, `LIKE_POST`, `FIND_EMAIL`, `CHECK_IS_CONNECTION`, `CHECK_IS_OPEN_PROFILE`, `SEND_LEAD_TO_INSTANTLY`, `SEND_LEAD_TO_SMARTLEAD`, `SEND_LEAD_TO_BISON`, `END`. - **unconditionalNode** _(PublicSequenceNodeDto, required for non-END nodes)_: The next node to follow unconditionally, or when a branching condition is `false`. - **conditionalNode** _(PublicSequenceNodeDto, required for branching nodes)_: The next node to follow when the branching condition is `true`. Branching nodes are `CONNECTION_REQUEST`, `CHECK_IS_CONNECTION`, `CHECK_IS_OPEN_PROFILE`, `FIND_EMAIL`. All other non-END nodes must NOT set this field. - **actionDelay** _(int, optional)_: How long to wait before executing this node, paired with `actionDelayUnit`. Range 0-100. **Recommended default for non-root nodes:** `actionDelay: 3` with `actionDelayUnit: "HOUR"` - that is the minimum the server accepts when the parent is in the list below. The resulting delay (`actionDelay` x `actionDelayUnit`) must be at least 3 hours and not more than 500 days if the parent is in the list - this applies to every node type, including `END`. Parents that require the minimum on their **unconditional** child: `CONNECTION_REQUEST`, `MESSAGE`, `INMAIL`, `VIEW_PROFILE`, `FOLLOW`, `LIKE_POST`. Parents that require the minimum on their **conditional** child: `CONNECTION_REQUEST`. The root node has no parent and may use `0`. - **actionDelayUnit** _(string, optional)_: Unit for `actionDelay`. `HOUR` or `DAY`. - **payload** _(object, conditional)_: **Schema is node-specific** - the shape of `payload` depends on `nodeType`, it is NOT a shared object. Required for action nodes that take configuration: `CONNECTION_REQUEST`, `MESSAGE`, `INMAIL`, `LIKE_POST`, `SEND_LEAD_TO_INSTANTLY`, `SEND_LEAD_TO_SMARTLEAD`, `SEND_LEAD_TO_BISON`. Not used for action-only nodes: `VIEW_PROFILE`, `FOLLOW`, `FIND_EMAIL`, `CHECK_IS_CONNECTION`, `CHECK_IS_OPEN_PROFILE`, `END`. Omitting `payload` on a node that requires one is rejected with 400 - see **Integration node errors** below. The `SEND_LEAD_TO_*` schemas are documented below; refer to the API documentation for the exact schema of the remaining node types. - **externalReference** _(string, optional)_: Your own tracking ID for this step, returned via API and webhooks. Max 100 characters. ### Integration node payloads The `payload` shapes for the three `SEND_LEAD_TO_*` nodes. All three expose the same behaviour - when a lead replies in your HeyReach campaign, they are automatically paused / removed / stopped in the external tool - but the field name differs per integration. #### `SEND_LEAD_TO_INSTANTLY` - **instantlyResourceId** _(string, required)_: GUID of the Instantly list or campaign. - **resourceType** _(string, required)_: `LIST` or `CAMPAIGN`. Must be sent explicitly - it is not defaulted. - **removeExternalLead** _(bool, optional)_: Remove the lead from the Instantly campaign when they reply in HeyReach. Applies to `CAMPAIGN` only, where it defaults to `true`. Sending it together with `resourceType: "LIST"` - even as `false` - is rejected with 400. ``` json { "instantlyResourceId": "2f1a9c84-7f3e-4c2b-9d55-1b8e0a4d6c77", "resourceType": "CAMPAIGN", "removeExternalLead": true } ``` #### `SEND_LEAD_TO_SMARTLEAD` - **smartLeadCampaignId** _(long, required)_: The numeric ID of the Smartlead campaign. - **pauseExternalLead** _(bool, optional)_: Pause the lead in the Smartlead campaign when they reply in HeyReach. Always applies, defaults to `true`. ``` json { "smartLeadCampaignId": 987654, "pauseExternalLead": true } ``` #### `SEND_LEAD_TO_BISON` - **bisonCampaignId** _(long, optional)_: The numeric ID of the EmailBison campaign. If omitted, the lead is created in EmailBison without being added to a campaign. - **stopExternalLead** _(bool, optional)_: Stop the lead in the EmailBison campaign when they reply in HeyReach. Applies only when `bisonCampaignId` is set, where it defaults to `true`. Sending it without a `bisonCampaignId` - even as `false` - is rejected with 400. ``` json { "bisonCampaignId": 4321, "stopExternalLead": true } ``` ### Integration node errors All of the following return **400** with body `{ "errorMessage": "..." }`: - `payload` omitted on a node that requires one (`CONNECTION_REQUEST`, `MESSAGE`, `INMAIL`, `LIKE_POST`, `SEND_LEAD_TO_INSTANTLY`, `SEND_LEAD_TO_SMARTLEAD`, `SEND_LEAD_TO_BISON`): `Error in the SEND_LEAD_TO_INSTANTLY node of the campaign sequence. The required payload was not provided.` - `resourceType` and/or `instantlyResourceId` omitted: `The following properties are required: ResourceType, InstantlyResourceId.` - `smartLeadCampaignId` omitted: `The following properties are required: SmartLeadCampaignId.` - `resourceType` is not `LIST` or `CAMPAIGN`: `Error in Instantly node. The provided resource type is invalid.` - `removeExternalLead` sent with `resourceType: "LIST"`: `Error in Instantly node. Incorrect usage of the 'Remove external lead' option.` - `stopExternalLead` sent without `bisonCampaignId`: `Error in EmailBison node. Incorrect usage of the 'Stop external lead' option.` - `smartLeadCampaignId` is negative: `Error in Smartlead node. The provided campaign id is invalid.`

Headers

X-API-KEYstringOptional

API key header using this scheme. Example: “X-API-KEY: {API_KEY}

Request

This endpoint expects a string.