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

# Update Email Sequence

> Updates details for the given campaign email sequence. Updates can only be performed if the campaign is in `created` state. Use existing values for `update_data` by fetching them from `Retrieve Email Sequence` API, and then only update the required fieds.



## OpenAPI

````yaml /openapi.yml patch /api/v1/email-sequence/
openapi: 3.1.1
info:
  title: DeliverymanAI API
  version: 1.0.0
  description: >-
    API documentation for DeliverymanAI, a Cold Email Management and Automation
    platform. This API provides endpoints for managing campaigns, contacts,
    email sequences, and related services.
servers:
  - url: https://api.deliveryman.ai
    description: Deliveryman API Server
security: []
paths:
  /api/v1/email-sequence/:
    patch:
      tags:
        - Campaign Email Sequence
      summary: Update Email Sequence
      description: >-
        Updates details for the given campaign email sequence. Updates can only
        be performed if the campaign is in `created` state. Use existing values
        for `update_data` by fetching them from `Retrieve Email Sequence` API,
        and then only update the required fieds.
      operationId: email_sequence_partial_update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCampaignEmailSequenceUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCampaignEmailSequenceUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCampaignEmailSequenceUpdate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAllCampaignMessagesAPI'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleMessageResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleMessageResponse'
          description: Not Found
        '500':
          description: Internal Server Error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PatchedCampaignEmailSequenceUpdate:
      properties:
        sequence_id:
          title: Sequence Id
          type: integer
        update_data:
          $ref: '#/components/schemas/CampaignEmailSequenceData'
      required:
        - sequence_id
        - update_data
      title: CampaignEmailSequenceUpdate
      type: object
    GetAllCampaignMessagesAPI:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        order:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
        subject:
          type: string
        body:
          type: string
        next_message_days:
          type: integer
          maximum: 32767
          minimum: 0
        score:
          type:
            - integer
            - 'null'
          maximum: 2147483647
          minimum: 0
        verdict:
          type:
            - string
            - 'null'
        suggestions: {}
        label:
          $ref: '#/components/schemas/LabelEnum'
        blocked_reason:
          type:
            - string
            - 'null'
        is_flagged_for_approval:
          type: boolean
        block_approval:
          type: boolean
        email_content_type:
          $ref: '#/components/schemas/EmailContentTypeD42Enum'
      required:
        - body
        - id
        - subject
    SimpleMessageResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    CampaignEmailSequenceData:
      properties:
        order:
          description: Order cannot be less than 0
          minimum: 0
          title: Order
          type: integer
        subject:
          description: Subject cannot be an empty string
          minLength: 1
          pattern: \S
          title: Subject
          type: string
        body:
          description: Body cannot be an empty string
          minLength: 1
          pattern: \S
          title: Body
          type: string
        next_message_days:
          description: Next message days cannot be less than 1
          minimum: 1
          title: Next Message Days
          type: integer
        email_content_type:
          allOf:
            - $ref: >-
                #/components/schemas/CampaignEmailSequenceDataEmailContentTypeEnum
          title: Email Content Type
      required:
        - order
        - subject
        - body
        - next_message_days
        - email_content_type
      title: CampaignEmailSequenceData
      type: object
    LabelEnum:
      enum:
        - passed
        - blocked
        - rejected
        - approved
      type: string
      description: |-
        * `passed` - Passed
        * `blocked` - Blocked
        * `rejected` - Rejected
        * `approved` - Approved
    EmailContentTypeD42Enum:
      enum:
        - text/plain
        - text/html
        - text/rich
      type: string
      description: |-
        * `text/plain` - Plain Text
        * `text/html` - HTML
        * `text/rich` - Rich Text
    CampaignEmailSequenceDataEmailContentTypeEnum:
      enum:
        - text/html
        - text/plain
        - text/rich
      type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 'Enter your API key in the format: X-Api-Key <your_key>'

````