latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-13260150938.9 KB

fc5624c7d57a

Sequences

Realign waiting enrollments to the sending window

Pulls waiting enrollments forward to the start of the sequence sending window on the day they are already scheduled for. Changing a sending window leaves existing waits alone, so a widened window never reaches contacts already parked on an email-bound delay step and a narrowed one defers them to the next allowed day. Sequence windows never advance SMS, webhooks, branches, or other non-email actions. A wait only ever moves earlier, never onto a different local day, and never before now. Nobody is cancelled or re-enrolled. Defaults to a synchronous dry run; set dryRun false to queue a background apply job, then poll its status endpoint. Each job is capped at 1000 enrollments; when the completed result has hasMore true, pass nextCursor as cursor on the next request.

post/sequences/{sequenceId}/enrollments/realign-sending-window

Path parameters

sequenceIdstring required

Sequence ID

Request body

nodeIdsstring[]

Step IDs to limit realignment to. Defaults to every step.

subscriberIdsstring[]

Up to 500 subscriber IDs to limit realignment to. Defaults to every waiting contact.

cursorstring

Opaque continuation cursor. When a response has hasMore true, pass its nextCursor here to continue after the enrollments already scanned.

dryRunboolean

When true (the default), returns the new wait times without writing them. Set false to apply.

Example request

{
  "nodeIds": [
    "node_week_14"
  ],
  "subscriberIds": [
    "sub_abc123",
    "sub_def456"
  ]
}

Response

Dry-run preview

successboolean
sequenceIdstring
sequenceNamestring
dryRunboolean
sendingWindowobject nullable

The sequence sending window realignment anchored on, or null when only per-step weekday gates applied.

scannedCountnumber

Waiting enrollments inspected by this request.

realignedCountnumber

Waiting enrollments moved earlier, or that would move on a dry run. Capped at 1000 per request.

unchangedCountnumber
unchangedReasonsobject

Counts per reason an enrollment did not move: already_at_window_start, already_due, day_not_allowed, no_shared_opening, no_window, not_email_bound, send_retry, raced.

requeueFailedCountnumber

Enrollments whose new wait time was stored but whose wake-up could not be re-queued. The stuck-enrollment sweeper recovers these within a few minutes.

hasMoreboolean

True when a per-request cap stopped the scan early. Continue with nextCursor while this is true.

nextCursorstring

Opaque continuation cursor to pass as cursor on the next request when hasMore is true.

maxRealignmentsPerRequestnumber
messagestring

Example response

{
  "success": true,
  "sequenceId": "seq_abc123",
  "sequenceName": "52-Week Medicine Wheel",
  "scannedCount": 330,
  "realignedCount": 330,
  "changes": [
    {
      "enrollmentId": "tok_abc123",
      "subscriberId": "sub_abc123",
      "subscriberEmail": "customer@example.com",
      "currentNodeId": "node_week_14",
      "waitUntil": "2026-08-16T18:13:00.000Z",
      "newWaitUntil": "2026-08-16T15:00:00.000Z",
      "movedEarlierMinutes": 193
    }
  ],
  "maxRealignmentsPerRequest": 1000,
  "message": "Realigned 330 waiting enrollments to the sending-window opening on the day they were already scheduled for."
}