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

# Generate Emails

> Generate Emails asynchronously - Headless



## OpenAPI

````yaml post /api/v2/async/headless/generate-emails
openapi: 3.0.0
info:
  version: 6.0.0
  title: Octave API
  description: API for Octave workspace management and AI-powered content generation
servers:
  - url: https://app.octavehq.com
security:
  - ApiKeyAuth: []
paths:
  /api/v2/async/headless/generate-emails:
    post:
      tags:
        - Async
      summary: Generate Emails
      description: Generate Emails asynchronously - Headless
      operationId: asyncGenerateEmails
      parameters:
        - schema:
            type: string
            description: >-
              Optional header used to identify the source of the request. Helps
              us apply appropriate rate limiting or disable it when necessary.
            example: some-source
          required: false
          description: >-
            Optional header used to identify the source of the request. Helps us
            apply appropriate rate limiting or disable it when necessary.
          name: x-request-source
          in: header
        - schema:
            type: string
            description: >-
              External Request ID. Add this header to identify the request from
              the client for better tracking and debugging.
            example: external-request-id
          required: false
          description: >-
            External Request ID. Add this header to identify the request from
            the client for better tracking and debugging.
          name: x-external-request-id
          in: header
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                sequence:
                  type: object
                  properties:
                    steps:
                      type: integer
                      minimum: 1
                      maximum: 7
                      description: Number of steps in the sequence
                      example: 4
                    length:
                      type: string
                      enum:
                        - SHORT
                        - MEDIUM
                        - LONG
                        - MIXED
                      description: Average length of emails in the sequence
                      example: MIXED
                    type:
                      type: string
                      enum:
                        - COLD_OUTBOUND
                        - WARM_OUTBOUND
                        - INBOUND
                        - CUSTOM
                        - CVI_WHY_CHANGE
                        - BARE_METAL
                      description: Purpose of the sequence
                      example: COLD_OUTBOUND
                    primaryGoal:
                      type: string
                      enum:
                        - INITIATE_CONVERSATION
                        - SCHEDULE_MEETING
                        - REQUEST_INTRODUCTION
                        - ASK_FOR_FEEDBACK
                        - FIND_TIME_TO_CONNECT
                        - POLITELY_DISENGAGE
                        - SMART_CTA
                      description: Primary goal for the sequence
                      example: INITIATE_CONVERSATION
                    generateUniqueSubjectLines:
                      type: boolean
                      description: >-
                        When true, generates unique subject lines for each
                        email. When false reuse the first subject line for all
                        subsequent emails.
                      example: true
                    additionalInstructions:
                      type: string
                      description: Additional instructions for the sequence
                      example: Additional instructions for the sequence
                    exampleForIntroEmail:
                      type: string
                      description: Example email for the first email in the sequence
                      example: Example email for the first email in the sequence
                    exampleForFinalEmail:
                      type: string
                      description: Example email for the final email in the sequence
                      example: Example email for the final email in the sequence
                    lang:
                      type: string
                      description: >-
                        Target language for the generated emails. Recommended:
                        Use ISO 639-1 language codes like 'es' (Spanish), 'fr'
                        (French), 'de' (German), 'it' (Italian), 'pt'
                        (Portuguese), 'ja' (Japanese), 'ko' (Korean). Full
                        language names (e.g., 'spanish', 'french') are also
                        supported for backward compatibility. Defaults to
                        English ('en') if not specified.
                      example: es
                    outputFormat:
                      type: string
                      enum:
                        - text
                        - html
                        - markdown
                      description: >-
                        Output format for the generated emails (text, html, or
                        markdown)
                      example: text
                  required:
                    - steps
                offering:
                  type: object
                  properties:
                    url:
                      type: string
                      minLength: 1
                      description: Primary website for the Product/Service
                      example: https://www.example.com
                    name:
                      type: string
                      minLength: 1
                      description: >-
                        External facing name of the Product or Service being
                        offered
                      example: Example product/service
                    coreValueProposition:
                      nullable: true
                      description: >-
                        Core value proposition of the offering. This helps
                        ground the email sequence in the offering and provide a
                        clear and concise message.
                      example: Example core value proposition
                    keyDifferentiator:
                      nullable: true
                      description: >-
                        What makes this offering unique and different from the
                        competition?
                      example: Example key differentiator
                    customerOutcomes:
                      nullable: true
                      description: >-
                        What are the specific benefits and results that
                        customers can expect from using this offering?
                      example: Example customer outcomes
                    additionalOfferingInfo:
                      nullable: true
                      description: Additional offer info
                      example: Example additional offer info
                  required:
                    - url
                    - name
                recipient:
                  type: object
                  properties:
                    firstName:
                      type: string
                      description: Recipient's first name
                      example: John
                    jobTitle:
                      type: string
                      description: Title
                      example: Example title
                    linkedInProfile:
                      type: string
                      format: uri
                      description: LinkedIn profile
                      example: https://www.linkedin.com/in/example
                    additionalRecipientInfo:
                      type: string
                      description: Additional recipient info
                      example: Example additional recipient info
                    companyName:
                      type: string
                      description: Company name
                      example: Example company name
                    companyDomain:
                      type: string
                      description: Company domain
                      example: example.com
                  required:
                    - firstName
                    - companyName
                    - companyDomain
                callbackUrl:
                  type: string
                  format: uri
                  description: Callback URL
                  example: https://example.com/api/callbacks/unique-id
              required:
                - sequence
                - offering
                - recipient
                - callbackUrl
      responses:
        '200':
          description: Async request accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - pending
                      - completed
                      - failed
                    description: Status
                    example: pending
                  message:
                    type: string
                    nullable: true
                    description: Message
                    example: Additional information
                  requestId:
                    type: string
                    example: requestId
                    description: Request ID
                required:
                  - status
                  - requestId
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - pending
                      - completed
                      - failed
                    description: Status
                    example: pending
                  message:
                    type: string
                    nullable: true
                    description: Message
                    example: Additional information
                  requestId:
                    type: string
                    example: requestId
                    description: Request ID
                required:
                  - status
                  - requestId
              example:
                status: failed
                message: Invalid callback URL
                requestId: 123e4567-e89b-12d3-a456-426614174000
      deprecated: false
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key

````

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