---
title: "Replace a campaign's sequence"
method: PUT
path: "/campaigns/{id}/sequence"
tags: ["Campaigns"]
---

# Replace a campaign's sequence

`PUT /campaigns/{id}/sequence`

## Request

- Base URL: `https://api.emailchaser.com/r`
- URL: `https://api.emailchaser.com/r/campaigns/{id}/sequence`
- Auth: HTTP bearer

Replaces the campaign's whole sequence with the steps provided. The operation is idempotent, so sending the same payload twice leaves the same state and a retried request cannot duplicate steps. delayDays is counted from the previous step and the first step must be 0. Editing a running campaign is allowed and re-queues future sends; already-sent emails are untouched. Merge tags take ONE brace, e.g. {first_name}, {last_name}, {company_name}, {job_title}, plus any key set in a lead's customVariables; a fallback is {first_name}[there] or {first_name|there}. Placeholders written in another tool's syntax ({{first_name}}, [[first_name]], [First Name]) are rejected with a 400 that names the tag to write instead, because they are not substituted and would be sent exactly as typed ("Hi [First Name],").

## Path parameters

- `id` integer, required

## Request body

- ModelsReplaceSequenceRequest
  - `signature` string: Signature omitted keeps the campaign's current signature; pass an empty string to clear it. Editing one body should not silently drop a signature the caller never asked about.
  - `steps` ModelsSequenceStepInput[], required
    - `body` string, required
    - `contentType` 'html' | 'text'
    - `delayDays` integer
    - `order` integer
    - `subject` string, required
    - `useSameThread` boolean
    - `variants` ModelsSequenceVariantInput[]
      - `body` string
      - `label` string, required
      - `subject` string, required

## Response `200`

Campaign sequence replaced successfully

- ModelsReplaceSequenceResponse
  - `campaignId` integer
  - `message` string
  - `signature` string
  - `steps` ModelsSequenceStep[]
    - `body` string
    - `contentType` string
    - `delayDays` integer
    - `order` integer
    - `subject` string
    - `useSameThread` boolean
    - `variants` ModelsSequenceVariant[]
      - `body` string
      - `label` string
      - `subject` string
  - `total` integer

## Other responses

- `400`: Invalid campaign ID or sequence payload
- `401`: Unauthorized - invalid or missing API key
- `404`: Campaign not found
- `422`: Campaign flow does not support sequences
- `500`: Failed to replace campaign sequence

---

[API](https://skmtc.dev/emailchaser/apis/emailchaser-api.md) · [All operations](https://skmtc.dev/emailchaser/apis/emailchaser-api/llms.txt) · [OpenAPI document](https://skmtc.dev/emailchaser/apis/emailchaser-api/revisions/8b114990abb7?raw)
