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

# Update a sequence

> Rename a sequence or replace its steps. Send only what changes.

An API key needs **Campaigns: Read & write** (`outreach:write`), or the legacy `write` permission.



## OpenAPI

````yaml PATCH /api/outreach/sequences
openapi: 3.1.0
info:
  title: ManyPI API
  description: >-
    The REST API behind ManyPI — AI lead generation, email validation,
    cold-email outreach, agent runs and web scraping. Every endpoint is
    authenticated with a ManyPI API key (`mpi_...`) or an OAuth 2.1 access
    token, and honours the permissions granted to that credential.


    API keys carry permissions per area of the API (Leads & companies,
    Campaigns, Inboxes & replies, Agents & skills, Scrapers & data, Account &
    usage), each set to Read or Read & write, plus separate permissions for
    actions that spend credits or reach the outside world: Run agents, Run
    scrapers, Verify email addresses, Send outreach and Invoke endpoints. Each
    operation below names what it needs. Keys with the older `read` and `write`
    permissions keep working everywhere.
  version: 2.0.0
  contact:
    name: ManyPI Support
    email: support@manypi.com
    url: https://manypi.com
servers:
  - url: https://app.manypi.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Leads
    description: Find, store, enrich and manage leads.
  - name: Email validation
    description: Verify that lead addresses can receive mail.
  - name: Outreach
    description: Inboxes, sequences, campaigns, sending and replies.
  - name: Agent
    description: Agent runs, replies and skills.
  - name: Scraping
    description: Scrapers, runs and extracted data.
  - name: Endpoints
    description: Publish scrapers as typed REST endpoints.
  - name: Account
    description: Key validation and account information.
  - name: Imports
    description: >-
      Bring campaigns, leads and the do-not-contact list over from another
      outreach tool.
paths:
  /api/outreach/sequences:
    patch:
      tags:
        - Outreach
      summary: Update a sequence
      description: >-
        Rename a sequence or replace its steps. Send only what changes.


        An API key needs **Campaigns: Read & write** (`outreach:write`), or the
        legacy `write` permission.
      operationId: updateSequence
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - id
              properties:
                id:
                  type: string
                  format: uuid
                name:
                  type: string
                  maxLength: 120
                description:
                  type: string
                  maxLength: 500
                  nullable: true
                steps:
                  type: array
                  items:
                    $ref: '#/components/schemas/SequenceStep'
                  description: Replaces every step.
            example:
              id: ...
              name: Agencies, v2
      responses:
        '200':
          description: The updated sequence.
          content:
            application/json:
              schema:
                type: object
                properties:
                  sequence:
                    $ref: '#/components/schemas/Sequence'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: A/B versions need the Pro or Business plan.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SequenceStep:
      type: object
      required:
        - subject
        - body_html
      properties:
        subject:
          type: string
          maxLength: 300
          description: >-
            Merge variables allowed. Empty on a `reply` step, which sends as
            "Re:" the first email's subject.
        body_html:
          type: string
          description: 'Simple HTML: `<p>`, `<br>`, `<strong>`, `<a>`.'
        wait_days:
          type: number
          minimum: 0
          maximum: 90
          description: >-
            Days after the previous step, up to 90. Fractions work: `0.5` is 12
            hours. Step 0 is 0.
        thread_mode:
          type: string
          enum:
            - new
            - reply
          description: Step 0 is always `new`.
        variants:
          type: array
          maxItems: 4
          items:
            type: object
            properties:
              subject:
                type: string
              body_html:
                type: string
          description: Up to 4 extra A/B versions of this step. Pro and Business only.
        paused_variants:
          type: array
          items:
            type: integer
          description: Indexes of versions that stop sending. `0` is the step's own text.
        tailor_body:
          type: string
          enum:
            - 'off'
            - opening
            - full
            - manual
          description: How much of the body is personalized per lead.
        tailor_subject:
          type: boolean
        smtp_config_id:
          type: string
          format: uuid
          description: Send this step from a specific inbox.
    Sequence:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
          nullable: true
        steps:
          type: array
          items:
            $ref: '#/components/schemas/SequenceStep'
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          description: >-
            Human-readable message. A few validation failures (creating or
            updating an endpoint, bulk lead updates and deletes) send a list of
            the individual problems here instead of one string.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                properties:
                  path:
                    type: array
                    items:
                      type:
                        - string
                        - integer
                  message:
                    type: string
        code:
          type: string
          description: >-
            A machine-readable code on gated failures: `lead_limit`,
            `outreach_locked`, `validation_credits_exhausted`.
        details:
          description: >-
            Extra detail on some failures, such as the list of parameters that
            failed an endpoint's `param_schema`.
  responses:
    BadRequest:
      description: The request body or parameters failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: >-
        Missing, invalid or expired credential, or an API key without the
        permission this route needs. Both look the same, so check the key's
        permissions under API Access when a key that worked elsewhere is
        refused. A few routes check the key themselves and answer `403` instead.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A ManyPI API key (`mpi_...`) from the profile menu → API Access in the
        dashboard, or an OAuth 2.1 access token obtained through the MCP consent
        flow.

````

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