Sequences

Update sequence

Updates a sequence name, stop condition, branch logic, linear step insertion, or existing sequence email steps.

put/sequences/{sequenceId}

Path parameters

sequenceIdstring required

Sequence ID

Request body

namestring

Updated sequence name.

enrollmentPausedboolean

Set true to stop new enrollments for an active sequence while current recipients continue. Set false to resume new enrollments.

confirmStructuralChangeboolean

Required when inserting linear steps or branches into an active sequence. Set true only after confirming the live-flow impact for current and future recipients.

enrollmentMode'unlimited' | 'one_time' | 'matching_field'

Controls sequence re-entry. unlimited allows re-entry after completion but prevents concurrent active runs. one_time allows one enrollment ever. matching_field is only valid for event-triggered sequences and allows concurrent active runs only when the trigger payload resolves to a different event field value.

enrollmentFieldPathstring nullable

Dot-path event property used by matching_field enrollment on event-based sequences. Set to null to use built-in defaults.

Example request

{
  "name": "Updated Welcome Sequence",
  "enrollmentPaused": true,
  "confirmStructuralChange": true,
  "enrollmentFieldPath": "order.id",
  "sendingWindow": {
    "enabled": true,
    "timezone": "Europe/Kiev",
    "startTime": "08:00",
    "endTime": "20:00",
    "days": [
      "monday",
      "tuesday",
      "wednesday",
      "thursday",
      "friday"
    ]
  },
  "stopCondition": {
    "value": "saas.purchase"
  },
  "branch": {
    "afterNodeId": "node_trigger",
    "label": "Branching",
    "branches": [
      {
        "id": "branch-0",
        "label": "Has activated tag",
        "conditionType": "has_tag",
        "tagId": "activated",
        "tagName": "activated",
        "listId": "list_abc123",
        "segmentId": "seg_abc123",
        "segmentName": "Project invite recipients",
        "eventName": "project.invite.accepted",
        "linkUrl": "project-invites",
        "activityScope": "this_sequence",
        "fieldName": "plan",
        "fieldValue": "pro",
        "steps": [
          {
            "type": "email",
            "subject": "Can you refer us?",
            "blocks": [
              {
                "id": "block_123",
                "type": "html",
                "content": "<h1>Hello</h1>",
                "styles": {
                  "backgroundColor": "#f8fafc",
                  "backgroundOpacity": 80,
                  "textColor": "#111827",
                  "borderRadius": 12,
                  "borderColor": "#cbd5e1",
                  "borderWidth": 1
                }
              }
            ],
            "html": "<p>Can you refer us?</p>",
            "delay": {
              "mode": "until_date",
              "days": 1,
              "hours": 2,
              "minutes": 30,
              "untilDateField": "renews_at",
              "field": "event.subscription.renews_at",
              "untilOffsetDirection": "before",
              "direction": "before",
              "untilMissingAction": "exit",
              "missingAction": "exit"
            },
            "waitUntil": {
              "field": "renews_at",
              "untilDateField": "event.subscription.renews_at",
              "offset": {
                "days": 1,
                "hours": 2,
                "minutes": 30
              },
              "days": 1,
              "hours": 2,
              "minutes": 30,
              "direction": "before",
              "untilOffsetDirection": "before",
              "missingAction": "exit",
              "untilMissingAction": "exit"
            },
            "delayMs": 86400000
          }
        ]
      }
    ],
    "elseSteps": [
      {
        "type": "email",
        "subject": "Can you refer us?",
        "blocks": [
          {
            "id": "block_123",
            "type": "html",
            "content": "<h1>Hello</h1>",
            "styles": {
              "backgroundColor": "#f8fafc",
              "backgroundOpacity": 80,
              "textColor": "#111827",
              "borderRadius": 12,
              "borderColor": "#cbd5e1",
              "borderWidth": 1
            }
          }
        ],
        "html": "<p>Can you refer us?</p>",
        "delay": {
          "mode": "until_date",
          "days": 1,
          "hours": 2,
          "minutes": 30,
          "untilDateField": "renews_at",
          "field": "event.subscription.renews_at",
          "untilOffsetDirection": "before",
          "direction": "before",
          "untilMissingAction": "exit",
          "missingAction": "exit"
        },
        "waitUntil": {
          "field": "renews_at",
          "untilDateField": "event.subscription.renews_at",
          "offset": {
            "days": 1,
            "hours": 2,
            "minutes": 30
          },
          "days": 1,
          "hours": 2,
          "minutes": 30,
          "direction": "before",
          "untilOffsetDirection": "before",
          "missingAction": "exit",
          "untilMissingAction": "exit"
        },
        "delayMs": 86400000
      }
    ]
  },
  "insertSteps": {
    "afterNodeId": "node_migration_email",
    "steps": [
      {
        "type": "email",
        "subject": "Can you refer us?",
        "blocks": [
          {
            "id": "block_123",
            "type": "html",
            "content": "<h1>Hello</h1>",
            "styles": {
              "backgroundColor": "#f8fafc",
              "backgroundOpacity": 80,
              "textColor": "#111827",
              "borderRadius": 12,
              "borderColor": "#cbd5e1",
              "borderWidth": 1
            }
          }
        ],
        "html": "<p>Can you refer us?</p>",
        "delay": {
          "mode": "until_date",
          "days": 1,
          "hours": 2,
          "minutes": 30,
          "untilDateField": "renews_at",
          "field": "event.subscription.renews_at",
          "untilOffsetDirection": "before",
          "direction": "before",
          "untilMissingAction": "exit",
          "missingAction": "exit"
        },
        "waitUntil": {
          "field": "renews_at",
          "untilDateField": "event.subscription.renews_at",
          "offset": {
            "days": 1,
            "hours": 2,
            "minutes": 30
          },
          "days": 1,
          "hours": 2,
          "minutes": 30,
          "direction": "before",
          "untilOffsetDirection": "before",
          "missingAction": "exit",
          "untilMissingAction": "exit"
        },
        "delayMs": 86400000
      }
    ]
  },
  "emails": [
    {
      "emailId": "email_abc123",
      "nodeId": "node_abc123",
      "name": "Welcome Sequence - Email 1",
      "subject": "Welcome to Acme",
      "previewText": "Start here",
      "blocks": [
        {
          "id": "block_123",
          "type": "html",
          "content": "<h1>Hello</h1>",
          "styles": {
            "backgroundColor": "#f8fafc",
            "backgroundOpacity": 80,
            "textColor": "#111827",
            "borderRadius": 12,
            "borderColor": "#cbd5e1",
            "borderWidth": 1
          }
        }
      ],
      "html": "<p>Updated body</p>",
      "htmlContent": "<p>Updated body</p>"
    }
  ],
  "steps": [
    {
      "emailId": "email_abc123",
      "nodeId": "node_abc123",
      "name": "Welcome Sequence - Email 1",
      "subject": "Welcome to Acme",
      "previewText": "Start here",
      "blocks": [
        {
          "id": "block_123",
          "type": "html",
          "content": "<h1>Hello</h1>",
          "styles": {
            "backgroundColor": "#f8fafc",
            "backgroundOpacity": 80,
            "textColor": "#111827",
            "borderRadius": 12,
            "borderColor": "#cbd5e1",
            "borderWidth": 1
          }
        }
      ],
      "html": "<p>Updated body</p>",
      "htmlContent": "<p>Updated body</p>"
    }
  ]
}

Response

Sequence updated successfully

successboolean

Example response

{
  "success": true,
  "sequence": {
    "id": "seq_abc123",
    "name": "Updated Welcome Sequence",
    "enrollmentPaused": true,
    "updatedEmailCount": 1,
    "stopCondition": {
      "value": "saas.purchase"
    },
    "sendingWindow": {
      "enabled": true,
      "timezone": "Europe/Kiev",
      "startTime": "08:00",
      "endTime": "20:00",
      "days": [
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday"
      ]
    },
    "addedBranchNodeId": "node_branch",
    "addedBranchPathNodeIds": {
      "branch-0": [
        "node_if_delay",
        "node_if_email"
      ],
      "else": [
        "node_else_email"
      ]
    },
    "insertedNodeIds": [
      "node_inserted_email"
    ],
    "insertedEmailIds": [
      "email_inserted"
    ],
    "insertedEmailCount": 1
  }
}

Changes