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

# Replace a draft campaign's sequence

> Replaces every step with the list you send, so it is safe to retry. Returns 409 once the campaign has been launched.



## OpenAPI

````yaml /openapi.json put /v1/campaigns/{campaign_id}/sequence
openapi: 3.1.0
info:
  title: Cluster API
  version: '1'
servers:
  - url: https://api.getcluster.ai
security: []
paths:
  /v1/campaigns/{campaign_id}/sequence:
    put:
      tags:
        - Campaigns
      summary: Replace a draft campaign's sequence
      description: >-
        Replaces every step with the list you send, so it is safe to retry.
        Returns 409 once the campaign has been launched.
      operationId: replace_campaign_sequence
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Campaign Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SequenceInput'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sequence'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Payment Required
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '429':
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
        '503':
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
      security:
        - ApiKey: []
components:
  schemas:
    SequenceInput:
      properties:
        steps:
          items:
            $ref: '#/components/schemas/SequenceStepInput'
          type: array
          maxItems: 10
          minItems: 1
          title: Steps
      additionalProperties: false
      type: object
      required:
        - steps
      title: SequenceInput
      description: >-
        Steps run in the order given. A message after a connection request waits
        for the connection.
    Sequence:
      properties:
        steps:
          items:
            $ref: '#/components/schemas/SequenceStep'
          type: array
          title: Steps
      type: object
      required:
        - steps
      title: Sequence
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - error
      title: ErrorResponse
    SequenceStepInput:
      properties:
        type:
          type: string
          enum:
            - connection_request
            - message
            - email
            - profile_visit
            - like_post
          title: Type
        name:
          anyOf:
            - type: string
              maxLength: 120
              minLength: 1
            - type: 'null'
          title: Name
        subject:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Subject
        body:
          anyOf:
            - type: string
              maxLength: 8000
            - type: 'null'
          title: Body
        wait_days:
          type: integer
          maximum: 365
          minimum: 0
          title: Wait Days
          default: 0
      additionalProperties: false
      type: object
      required:
        - type
      title: SequenceStepInput
    SequenceStep:
      properties:
        type:
          type: string
          title: Type
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        subject:
          anyOf:
            - type: string
            - type: 'null'
          title: Subject
        body:
          anyOf:
            - type: string
            - type: 'null'
          title: Body
        wait_days:
          type: integer
          title: Wait Days
      type: object
      required:
        - type
        - wait_days
      title: SequenceStep
    ErrorBody:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
        request_id:
          type: string
          title: Request Id
        details:
          anyOf:
            - items:
                $ref: '#/components/schemas/ErrorDetail'
              type: array
            - type: 'null'
          title: Details
      type: object
      required:
        - code
        - message
        - request_id
      title: ErrorBody
    ErrorDetail:
      properties:
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
        message:
          type: string
          title: Message
      type: object
      required:
        - message
      title: ErrorDetail
  securitySchemes:
    ApiKey:
      type: http
      description: A workspace API key, created under Settings, API keys.
      scheme: bearer

````

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