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

# Create an email thread

> Initialize an outbound email thread for the given agent version. The version must be deployed and have a verified email domain configured.



## OpenAPI

````yaml post /api/v1/email/threads
openapi: 3.0.0
info:
  version: 1.0.0
  title: Feather AI API
servers:
  - url: https://prod.featherhq.com
    description: Production environment
security: []
paths:
  /api/v1/email/threads:
    post:
      tags:
        - Email
      summary: Create an email thread
      description: >-
        Initialize an outbound email thread for the given agent version. The
        version must be deployed and have a verified email domain configured.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                agentVersionId:
                  type: string
                  format: uuid
                toEmail:
                  type: string
                  format: email
                subject:
                  type: string
                  minLength: 1
                  maxLength: 998
                firstMessage:
                  type: string
                  minLength: 1
                leadId:
                  type: string
                  format: uuid
                variables:
                  type: object
                  additionalProperties:
                    nullable: true
                metadata:
                  type: object
                  additionalProperties:
                    nullable: true
              required:
                - agentVersionId
                - toEmail
      responses:
        '201':
          description: Email thread created
          content:
            application/json:
              schema:
                type: object
                properties:
                  thread:
                    type: object
                    properties:
                      id:
                        type: string
                      agentId:
                        type: string
                      agentVersionId:
                        type: string
                      organizationId:
                        type: string
                      emailDomainId:
                        type: string
                      fromEmail:
                        type: string
                        nullable: true
                      fromName:
                        type: string
                        nullable: true
                      toEmail:
                        type: string
                      subject:
                        type: string
                        nullable: true
                      leadId:
                        type: string
                        nullable: true
                      isActive:
                        type: boolean
                      createdAt:
                        type: string
                    required:
                      - id
                      - agentId
                      - agentVersionId
                      - organizationId
                      - emailDomainId
                      - fromEmail
                      - fromName
                      - toEmail
                      - subject
                      - leadId
                      - isActive
                      - createdAt
                required:
                  - thread
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 400
                  message:
                    type: string
                    default: Bad request
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    default: BAD_REQUEST
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 500
                  message:
                    type: string
                    default: Internal server error
                  code:
                    type: string
                    enum:
                      - INTERNAL_SERVER_ERROR
                    default: INTERNAL_SERVER_ERROR
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
      security:
        - ApiKey: []
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key

````