> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.heyreach.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.heyreach.io/_mcp/server.

# UpdateSequence

POST https://api//api/public/campaign/UpdateSequence
Content-Type: application/json

## 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.`

Reference: https://docs.heyreach.io/hey-reach-api/campaigns/update-sequence

## Request

### Headers

- `X-API-KEY` (string, optional) — API key header using this scheme. Example: "X-API-KEY: \{API\_KEY}"

### Body (application/json)

This endpoint expects a string.

- `string`

## Examples

**Request**

```json
"{\n  \"campaignId\": 12345,\n  \"sequence\": {\n    \"nodeType\": \"CONNECTION_REQUEST\",\n    \"actionDelay\": 0,\n    \"actionDelayUnit\": \"DAY\",\n    \"payload\": {\n      \"messages\": [\n        \"Hi {FIRST_NAME}, I'd love to connect!\"\n      ],\n      \"fallbackMessage\": \"Hi there, I'd love to connect!\",\n      \"toBeWithdrawnAfterDays\": 30\n    },\n    \"conditionalNode\": {\n      \"nodeType\": \"MESSAGE\",\n      \"actionDelay\": 2,\n      \"actionDelayUnit\": \"DAY\",\n      \"payload\": {\n        \"messages\": [\n          \"Thanks for connecting, {FIRST_NAME}!\"\n        ],\n        \"fallbackMessage\": \"Thanks for connecting!\"\n      },\n      \"unconditionalNode\": {\n        \"nodeType\": \"SEND_LEAD_TO_BISON\",\n        \"actionDelay\": 3,\n        \"actionDelayUnit\": \"HOUR\",\n        \"payload\": {\n          \"bisonCampaignId\": {{bisonCampaignId}},\n          \"stopExternalLead\": false\n        },\n        \"unconditionalNode\": {\n          \"nodeType\": \"END\"\n        }\n      }\n    },\n    \"unconditionalNode\": {\n      \"nodeType\": \"END\",\n      \"actionDelay\": 3,\n      \"actionDelayUnit\": \"HOUR\"\n    }\n  }\n}"
```

**SDK Code**

```python
import requests

url = "https://api//api/public/campaign/UpdateSequence"

payload = "{
  \"campaignId\": 12345,
  \"sequence\": {
    \"nodeType\": \"CONNECTION_REQUEST\",
    \"actionDelay\": 0,
    \"actionDelayUnit\": \"DAY\",
    \"payload\": {
      \"messages\": [
        \"Hi {FIRST_NAME}, I'd love to connect!\"
      ],
      \"fallbackMessage\": \"Hi there, I'd love to connect!\",
      \"toBeWithdrawnAfterDays\": 30
    },
    \"conditionalNode\": {
      \"nodeType\": \"MESSAGE\",
      \"actionDelay\": 2,
      \"actionDelayUnit\": \"DAY\",
      \"payload\": {
        \"messages\": [
          \"Thanks for connecting, {FIRST_NAME}!\"
        ],
        \"fallbackMessage\": \"Thanks for connecting!\"
      },
      \"unconditionalNode\": {
        \"nodeType\": \"SEND_LEAD_TO_BISON\",
        \"actionDelay\": 3,
        \"actionDelayUnit\": \"HOUR\",
        \"payload\": {
          \"bisonCampaignId\": {{bisonCampaignId}},
          \"stopExternalLead\": false
        },
        \"unconditionalNode\": {
          \"nodeType\": \"END\"
        }
      }
    },
    \"unconditionalNode\": {
      \"nodeType\": \"END\",
      \"actionDelay\": 3,
      \"actionDelayUnit\": \"HOUR\"
    }
  }
}"
headers = {
    "X-API-KEY": "{{HR_API_KEY}}",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api//api/public/campaign/UpdateSequence';
const options = {
  method: 'POST',
  headers: {'X-API-KEY': '{{HR_API_KEY}}', 'Content-Type': 'application/json'},
  body: '"{\n  \"campaignId\": 12345,\n  \"sequence\": {\n    \"nodeType\": \"CONNECTION_REQUEST\",\n    \"actionDelay\": 0,\n    \"actionDelayUnit\": \"DAY\",\n    \"payload\": {\n      \"messages\": [\n        \"Hi {FIRST_NAME}, I\'d love to connect!\"\n      ],\n      \"fallbackMessage\": \"Hi there, I\'d love to connect!\",\n      \"toBeWithdrawnAfterDays\": 30\n    },\n    \"conditionalNode\": {\n      \"nodeType\": \"MESSAGE\",\n      \"actionDelay\": 2,\n      \"actionDelayUnit\": \"DAY\",\n      \"payload\": {\n        \"messages\": [\n          \"Thanks for connecting, {FIRST_NAME}!\"\n        ],\n        \"fallbackMessage\": \"Thanks for connecting!\"\n      },\n      \"unconditionalNode\": {\n        \"nodeType\": \"SEND_LEAD_TO_BISON\",\n        \"actionDelay\": 3,\n        \"actionDelayUnit\": \"HOUR\",\n        \"payload\": {\n          \"bisonCampaignId\": {{bisonCampaignId}},\n          \"stopExternalLead\": false\n        },\n        \"unconditionalNode\": {\n          \"nodeType\": \"END\"\n        }\n      }\n    },\n    \"unconditionalNode\": {\n      \"nodeType\": \"END\",\n      \"actionDelay\": 3,\n      \"actionDelayUnit\": \"HOUR\"\n    }\n  }\n}"'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api//api/public/campaign/UpdateSequence"

	payload := strings.NewReader("\"{\\n  \\\"campaignId\\\": 12345,\\n  \\\"sequence\\\": {\\n    \\\"nodeType\\\": \\\"CONNECTION_REQUEST\\\",\\n    \\\"actionDelay\\\": 0,\\n    \\\"actionDelayUnit\\\": \\\"DAY\\\",\\n    \\\"payload\\\": {\\n      \\\"messages\\\": [\\n        \\\"Hi {FIRST_NAME}, I'd love to connect!\\\"\\n      ],\\n      \\\"fallbackMessage\\\": \\\"Hi there, I'd love to connect!\\\",\\n      \\\"toBeWithdrawnAfterDays\\\": 30\\n    },\\n    \\\"conditionalNode\\\": {\\n      \\\"nodeType\\\": \\\"MESSAGE\\\",\\n      \\\"actionDelay\\\": 2,\\n      \\\"actionDelayUnit\\\": \\\"DAY\\\",\\n      \\\"payload\\\": {\\n        \\\"messages\\\": [\\n          \\\"Thanks for connecting, {FIRST_NAME}!\\\"\\n        ],\\n        \\\"fallbackMessage\\\": \\\"Thanks for connecting!\\\"\\n      },\\n      \\\"unconditionalNode\\\": {\\n        \\\"nodeType\\\": \\\"SEND_LEAD_TO_BISON\\\",\\n        \\\"actionDelay\\\": 3,\\n        \\\"actionDelayUnit\\\": \\\"HOUR\\\",\\n        \\\"payload\\\": {\\n          \\\"bisonCampaignId\\\": {{bisonCampaignId}},\\n          \\\"stopExternalLead\\\": false\\n        },\\n        \\\"unconditionalNode\\\": {\\n          \\\"nodeType\\\": \\\"END\\\"\\n        }\\n      }\\n    },\\n    \\\"unconditionalNode\\\": {\\n      \\\"nodeType\\\": \\\"END\\\",\\n      \\\"actionDelay\\\": 3,\\n      \\\"actionDelayUnit\\\": \\\"HOUR\\\"\\n    }\\n  }\\n}\"")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-KEY", "{{HR_API_KEY}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api//api/public/campaign/UpdateSequence")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '{{HR_API_KEY}}'
request["Content-Type"] = 'application/json'
request.body = "\"{\\n  \\\"campaignId\\\": 12345,\\n  \\\"sequence\\\": {\\n    \\\"nodeType\\\": \\\"CONNECTION_REQUEST\\\",\\n    \\\"actionDelay\\\": 0,\\n    \\\"actionDelayUnit\\\": \\\"DAY\\\",\\n    \\\"payload\\\": {\\n      \\\"messages\\\": [\\n        \\\"Hi {FIRST_NAME}, I'd love to connect!\\\"\\n      ],\\n      \\\"fallbackMessage\\\": \\\"Hi there, I'd love to connect!\\\",\\n      \\\"toBeWithdrawnAfterDays\\\": 30\\n    },\\n    \\\"conditionalNode\\\": {\\n      \\\"nodeType\\\": \\\"MESSAGE\\\",\\n      \\\"actionDelay\\\": 2,\\n      \\\"actionDelayUnit\\\": \\\"DAY\\\",\\n      \\\"payload\\\": {\\n        \\\"messages\\\": [\\n          \\\"Thanks for connecting, {FIRST_NAME}!\\\"\\n        ],\\n        \\\"fallbackMessage\\\": \\\"Thanks for connecting!\\\"\\n      },\\n      \\\"unconditionalNode\\\": {\\n        \\\"nodeType\\\": \\\"SEND_LEAD_TO_BISON\\\",\\n        \\\"actionDelay\\\": 3,\\n        \\\"actionDelayUnit\\\": \\\"HOUR\\\",\\n        \\\"payload\\\": {\\n          \\\"bisonCampaignId\\\": {{bisonCampaignId}},\\n          \\\"stopExternalLead\\\": false\\n        },\\n        \\\"unconditionalNode\\\": {\\n          \\\"nodeType\\\": \\\"END\\\"\\n        }\\n      }\\n    },\\n    \\\"unconditionalNode\\\": {\\n      \\\"nodeType\\\": \\\"END\\\",\\n      \\\"actionDelay\\\": 3,\\n      \\\"actionDelayUnit\\\": \\\"HOUR\\\"\\n    }\\n  }\\n}\""

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api//api/public/campaign/UpdateSequence")
  .header("X-API-KEY", "{{HR_API_KEY}}")
  .header("Content-Type", "application/json")
  .body("\"{\\n  \\\"campaignId\\\": 12345,\\n  \\\"sequence\\\": {\\n    \\\"nodeType\\\": \\\"CONNECTION_REQUEST\\\",\\n    \\\"actionDelay\\\": 0,\\n    \\\"actionDelayUnit\\\": \\\"DAY\\\",\\n    \\\"payload\\\": {\\n      \\\"messages\\\": [\\n        \\\"Hi {FIRST_NAME}, I'd love to connect!\\\"\\n      ],\\n      \\\"fallbackMessage\\\": \\\"Hi there, I'd love to connect!\\\",\\n      \\\"toBeWithdrawnAfterDays\\\": 30\\n    },\\n    \\\"conditionalNode\\\": {\\n      \\\"nodeType\\\": \\\"MESSAGE\\\",\\n      \\\"actionDelay\\\": 2,\\n      \\\"actionDelayUnit\\\": \\\"DAY\\\",\\n      \\\"payload\\\": {\\n        \\\"messages\\\": [\\n          \\\"Thanks for connecting, {FIRST_NAME}!\\\"\\n        ],\\n        \\\"fallbackMessage\\\": \\\"Thanks for connecting!\\\"\\n      },\\n      \\\"unconditionalNode\\\": {\\n        \\\"nodeType\\\": \\\"SEND_LEAD_TO_BISON\\\",\\n        \\\"actionDelay\\\": 3,\\n        \\\"actionDelayUnit\\\": \\\"HOUR\\\",\\n        \\\"payload\\\": {\\n          \\\"bisonCampaignId\\\": {{bisonCampaignId}},\\n          \\\"stopExternalLead\\\": false\\n        },\\n        \\\"unconditionalNode\\\": {\\n          \\\"nodeType\\\": \\\"END\\\"\\n        }\\n      }\\n    },\\n    \\\"unconditionalNode\\\": {\\n      \\\"nodeType\\\": \\\"END\\\",\\n      \\\"actionDelay\\\": 3,\\n      \\\"actionDelayUnit\\\": \\\"HOUR\\\"\\n    }\\n  }\\n}\"")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api//api/public/campaign/UpdateSequence', [
  'body' => '"{\\n  \\"campaignId\\": 12345,\\n  \\"sequence\\": {\\n    \\"nodeType\\": \\"CONNECTION_REQUEST\\",\\n    \\"actionDelay\\": 0,\\n    \\"actionDelayUnit\\": \\"DAY\\",\\n    \\"payload\\": {\\n      \\"messages\\": [\\n        \\"Hi {FIRST_NAME}, I\'d love to connect!\\"\\n      ],\\n      \\"fallbackMessage\\": \\"Hi there, I\'d love to connect!\\",\\n      \\"toBeWithdrawnAfterDays\\": 30\\n    },\\n    \\"conditionalNode\\": {\\n      \\"nodeType\\": \\"MESSAGE\\",\\n      \\"actionDelay\\": 2,\\n      \\"actionDelayUnit\\": \\"DAY\\",\\n      \\"payload\\": {\\n        \\"messages\\": [\\n          \\"Thanks for connecting, {FIRST_NAME}!\\"\\n        ],\\n        \\"fallbackMessage\\": \\"Thanks for connecting!\\"\\n      },\\n      \\"unconditionalNode\\": {\\n        \\"nodeType\\": \\"SEND_LEAD_TO_BISON\\",\\n        \\"actionDelay\\": 3,\\n        \\"actionDelayUnit\\": \\"HOUR\\",\\n        \\"payload\\": {\\n          \\"bisonCampaignId\\": {{bisonCampaignId}},\\n          \\"stopExternalLead\\": false\\n        },\\n        \\"unconditionalNode\\": {\\n          \\"nodeType\\": \\"END\\"\\n        }\\n      }\\n    },\\n    \\"unconditionalNode\\": {\\n      \\"nodeType\\": \\"END\\",\\n      \\"actionDelay\\": 3,\\n      \\"actionDelayUnit\\": \\"HOUR\\"\\n    }\\n  }\\n}"',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '{{HR_API_KEY}}',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api//api/public/campaign/UpdateSequence");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "{{HR_API_KEY}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "\"{\\n  \\\"campaignId\\\": 12345,\\n  \\\"sequence\\\": {\\n    \\\"nodeType\\\": \\\"CONNECTION_REQUEST\\\",\\n    \\\"actionDelay\\\": 0,\\n    \\\"actionDelayUnit\\\": \\\"DAY\\\",\\n    \\\"payload\\\": {\\n      \\\"messages\\\": [\\n        \\\"Hi {FIRST_NAME}, I'd love to connect!\\\"\\n      ],\\n      \\\"fallbackMessage\\\": \\\"Hi there, I'd love to connect!\\\",\\n      \\\"toBeWithdrawnAfterDays\\\": 30\\n    },\\n    \\\"conditionalNode\\\": {\\n      \\\"nodeType\\\": \\\"MESSAGE\\\",\\n      \\\"actionDelay\\\": 2,\\n      \\\"actionDelayUnit\\\": \\\"DAY\\\",\\n      \\\"payload\\\": {\\n        \\\"messages\\\": [\\n          \\\"Thanks for connecting, {FIRST_NAME}!\\\"\\n        ],\\n        \\\"fallbackMessage\\\": \\\"Thanks for connecting!\\\"\\n      },\\n      \\\"unconditionalNode\\\": {\\n        \\\"nodeType\\\": \\\"SEND_LEAD_TO_BISON\\\",\\n        \\\"actionDelay\\\": 3,\\n        \\\"actionDelayUnit\\\": \\\"HOUR\\\",\\n        \\\"payload\\\": {\\n          \\\"bisonCampaignId\\\": {{bisonCampaignId}},\\n          \\\"stopExternalLead\\\": false\\n        },\\n        \\\"unconditionalNode\\\": {\\n          \\\"nodeType\\\": \\\"END\\\"\\n        }\\n      }\\n    },\\n    \\\"unconditionalNode\\\": {\\n      \\\"nodeType\\\": \\\"END\\\",\\n      \\\"actionDelay\\\": 3,\\n      \\\"actionDelayUnit\\\": \\\"HOUR\\\"\\n    }\\n  }\\n}\"", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-KEY": "{{HR_API_KEY}}",
  "Content-Type": "application/json"
]
let parameters = "{
  \"campaignId\": 12345,
  \"sequence\": {
    \"nodeType\": \"CONNECTION_REQUEST\",
    \"actionDelay\": 0,
    \"actionDelayUnit\": \"DAY\",
    \"payload\": {
      \"messages\": [
        \"Hi {FIRST_NAME}, I'd love to connect!\"
      ],
      \"fallbackMessage\": \"Hi there, I'd love to connect!\",
      \"toBeWithdrawnAfterDays\": 30
    },
    \"conditionalNode\": {
      \"nodeType\": \"MESSAGE\",
      \"actionDelay\": 2,
      \"actionDelayUnit\": \"DAY\",
      \"payload\": {
        \"messages\": [
          \"Thanks for connecting, {FIRST_NAME}!\"
        ],
        \"fallbackMessage\": \"Thanks for connecting!\"
      },
      \"unconditionalNode\": {
        \"nodeType\": \"SEND_LEAD_TO_BISON\",
        \"actionDelay\": 3,
        \"actionDelayUnit\": \"HOUR\",
        \"payload\": {
          \"bisonCampaignId\": {{bisonCampaignId}},
          \"stopExternalLead\": false
        },
        \"unconditionalNode\": {
          \"nodeType\": \"END\"
        }
      }
    },
    \"unconditionalNode\": {
      \"nodeType\": \"END\",
      \"actionDelay\": 3,
      \"actionDelayUnit\": \"HOUR\"
    }
  }
}" as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api//api/public/campaign/UpdateSequence")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```