> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salessequencer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Save the email sequence

> Replaces the whole multi-step sequence (every step, each with A/B variants). Preferred input is sequence_json; if it is missing or not a JSON list, the flat repeatable subject/body/wait fields are used instead (one variant per step). A positive wait on step 2+ becomes a wait step of that many days; the first step's wait is ignored. Refuses with flash 'Write at least one email before saving.' when every body is blank (nothing saved).

**Minimum role:** `edit` (`x-min-role`). **Destructive:** `false` (`x-destructive`).



## OpenAPI

````yaml /openapi.json post /campaigns/{campaign_id}/sequence
openapi: 3.0.3
info:
  title: Sales Sequencer API
  version: '1'
  description: >-
    Every Sales Sequencer action over HTTP. Each call runs as the API key's
    creator, with that user's role, in the key's workspace. Auth: X-API-Key
    header.
servers:
  - url: https://api.salessequencer.com/api/v1
security:
  - key: []
paths:
  /campaigns/{campaign_id}/sequence:
    post:
      tags:
        - Sequence
      summary: Save the email sequence
      description: >-
        Replaces the whole multi-step sequence (every step, each with A/B
        variants). Preferred input is sequence_json; if it is missing or not a
        JSON list, the flat repeatable subject/body/wait fields are used instead
        (one variant per step). A positive wait on step 2+ becomes a wait step
        of that many days; the first step's wait is ignored. Refuses with flash
        'Write at least one email before saving.' when every body is blank
        (nothing saved).


        **Minimum role:** `edit` (`x-min-role`). **Destructive:** `false`
        (`x-destructive`).
      operationId: campaigns_save_sequence
      parameters:
        - in: path
          name: campaign_id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              properties:
                body:
                  description: >-
                    Fallback, repeatable, one per step. Used only when
                    sequence_json is absent.
                  type: array
                  items:
                    type: string
                sequence_json:
                  description: >-
                    JSON list: [{"wait": <days before this step>, "variants":
                    [{"subject": "...", "body": "..."}]}].
                  type: string
                subject:
                  description: >-
                    Fallback, repeatable, one per step. Used only when
                    sequence_json is absent.
                  type: array
                  items:
                    type: string
                wait:
                  description: >-
                    Fallback, repeatable, days to wait before each step after
                    the first.
                  type: array
                  items:
                    type: integer
              type: object
      responses:
        '200':
          description: Redirect to the sequence tab; flash 'Sequence saved'.
components:
  securitySchemes:
    key:
      in: header
      name: X-API-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.