> ## 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.

# Create Email Sequence

> Creates a new email sequence for a campaign using given details. This can only be done if the campaign is in `created` state.



## OpenAPI

````yaml /openapi.yml post /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/:
    post:
      tags:
        - Campaign Email Sequence
      summary: Create Email Sequence
      description: >-
        Creates a new email sequence for a campaign using given details. This
        can only be done if the campaign is in `created` state.
      operationId: email_sequence_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignEmailSequenceCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CampaignEmailSequenceCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CampaignEmailSequenceCreate'
        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:
    CampaignEmailSequenceCreate:
      properties:
        campaign_uid:
          title: Campaign Uid
          type: string
        sequence_data:
          $ref: '#/components/schemas/CampaignEmailSequenceData'
      required:
        - campaign_uid
        - sequence_data
      title: CampaignEmailSequenceCreate
      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>'

````