---
title: "Replace email campaign steps"
method: PATCH
path: "/emails/campaigns/{campaignId}/steps"
tags: ["Email campaigns (legacy)"]
deprecated: true
---

# Replace email campaign steps

`PATCH /emails/campaigns/{campaignId}/steps`

## Request

- Base URL: `https://api.emelia.io`
- URL: `https://api.emelia.io/emails/campaigns/{campaignId}/steps`
- Auth: API key in header `Authorization`

> **Deprecated.**

Replaces the full ordered list of steps (the sequence). The campaign must not be RUNNING or ARCHIVED. Steps after the first must have delay.amount > 0, and a step may have at most one disabled version. Changing the step count resets the cached stats. New integrations should use the multichannel /advanced campaign endpoints instead.

## Path parameters

- `campaignId` string, required

## Request body

- object
  - `steps` object[], required
    - `delay` object, required
      - `amount` integer: Must be > 0 for steps after the first.
      - `unit` 'MINUTES' | 'HOURS' | 'DAYS', required
    - `versions` object[], required: A/B versions. At most one may be disabled.
      - `subject` string
      - `disabled` boolean
      - `message` string: HTML body. Variables use {{firstName}}, {{custom_field}}, {{UNSUBSCRIBE_LINK}}, {{SENDER}}, {{UNIQUE_ID}}.
      - `rawHtml` boolean
      - `attachments` object[]
        - `name` string, required
        - `url` string, uri, required
      - `options` object: Per-version overrides (per-day schedule, tracking, provider). Usually omitted; derived from the campaign schedule.

## Response `200`

Updated campaign.

- object
  - `success` true, required
  - `campaign` LegacyEmailCampaign, required: A full email campaign document (as returned by create/get/update).
    - `_id` string
    - `userId` string
    - `name` string
    - `status` 'DRAFT' | 'RUNNING' | 'PAUSED' | 'FINISHED' | 'ARCHIVED'
    - `provider` string, nullable
    - `useManyProviders` boolean
    - `providersUsed` string[]
    - `schedule` LegacyEmailScheduleOut
      - `bcc` string
      - `dailyContact` integer
      - `dailyLimit` integer
      - `minInterval` integer
      - `maxInterval` integer
      - `blacklistUnsub` boolean
      - `trackLinks` boolean
      - `trackOpens` boolean
      - `timeZone` string
      - `days` integer[]
      - `start` string
      - `end` string
      - `eventToStopMails` string[]
    - `steps` object[]
      - `_id` string
      - `delay` object
        - `amount` integer
        - `unit` string
      - `versions` object[]
        - `_id` string
        - `subject` string
        - `message` string
        - `disabled` boolean
        - `rawHtml` boolean
        - `attachments` object[]
        - `options` object
    - `recipients` object
      - `lists` object[]
      - `contacts` string[]
      - `processing` boolean
    - `zapierData` object[]
      - `webhookUrl` string
      - `events` string[]
    - `createdAt` string, date-time
    - `startAt` string, date-time
    - `estimatedEnd` string, date-time
    - `plannedStart` string, date-time

## Other responses

- `400`: Business or validation error. 400 by default; Joi validation errors carry code INVALID_REQUEST.

---

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