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

# Create An Email



## OpenAPI

````yaml /openapi.json post /v1/emails
openapi: 3.0.3
info:
  contact:
    name: Stuut Support
    url: https://stuut.ai
    email: devs@stuut.co
  termsOfService: https://stuut.ai/terms-and-conditions
  title: Stuut API
  version: 0.1.0
servers:
  - url: http://api.stuut.ai
security: []
tags:
  - name: Analytics
  - name: Bank Accounts
  - name: Bank Statements
  - name: Bank Transactions
  - name: Call Agents
  - name: Call Agent Scenarios
  - name: Calls
  - name: Contact Suggestions
  - name: demo
  - name: Email Senders
  - name: Email Templates
  - name: Email Template Folders
  - name: Email Threads
  - name: Emails
  - name: Files
  - name: Invoices
  - name: Notes
  - name: Organizations
  - name: Outreach Workflows
  - name: Partners
  - name: Partner Contacts
  - name: Payments
  - name: Phone Numbers
  - name: Plaid
  - name: Profile
  - name: Pusher
  - name: Remittances
  - name: Tags
  - name: Tasks
  - name: User Invites
  - name: Users
paths:
  /v1/emails:
    post:
      tags:
        - Emails
      summary: Create An Email
      operationId: emails.create
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEmail'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Email'
          description: Successful response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StuutErrorHTTP'
          description: Authentication error
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: Validation error
      security:
        - BearerAuth: []
components:
  schemas:
    CreateEmail:
      type: object
      properties:
        bcc:
          type: array
          items:
            type: string
            format: email
        body:
          type: string
        cc:
          type: array
          items:
            type: string
            format: email
        email_sender:
          type: string
          description: The `EmailSender` identifier, (e.g. `sndr_abc123`).
        email_template:
          type: string
          description: The `EmailTemplate` identifier, (e.g. `eml_tmpl_abc123`).
        invoices:
          type: array
          items:
            type: string
            description: The `Invoice` identifier, (e.g. `inv_abc123`).
        partner:
          type: string
          description: The `Partner` identifier, (e.g. `ptn_abc123`).
        options:
          $ref: '#/components/schemas/CreateEmailOptions'
        parent_email:
          type: string
          description: The `Email` identifier, (e.g. `eml_abc123`).
        reply_to:
          type: array
          items:
            type: string
            format: email
        subject:
          type: string
        to:
          type: array
          items:
            type: string
            format: email
    Email:
      type: object
      properties:
        id:
          type: string
          maxLength: 32
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
        author:
          $ref: '#/components/schemas/User'
        author_id:
          type: string
          maxLength: 32
          nullable: true
        bcc:
          type: array
          items:
            type: string
        body:
          type: string
          description: The HTML body of the email.
          nullable: true
        bounced_addresses:
          type: array
          description: List of email addresses that bounced for this email
          items:
            type: string
        bulk_email_request_id:
          type: string
          maxLength: 32
          nullable: true
        cc:
          type: array
          items:
            type: string
        created_at:
          type: string
          format: date-time
        custom_headers:
          description: Custom email headers
          nullable: true
        direction:
          maxLength: 8
          description: The request direction of the email. Either inbound or outbound
          enum:
            - inbound
            - outbound
        email_reason:
          type: string
          description: The reason the email was sent.
          nullable: true
        email_sender:
          $ref: '#/components/schemas/EmailSender'
        email_sender_id:
          type: string
          maxLength: 32
          nullable: true
        error_message:
          type: string
          description: The error message if the email failed to send.
          nullable: true
        from_email:
          type: string
        generated_body:
          type: string
          description: >-
            Saves LLM-generated body of the email. Diffed against email body
            when email is sent to get user changes.
          nullable: true
        is_automated:
          type: boolean
          description: >-
            Whether the email was automatically sent by a workflow or an AI
            agent.
        is_generated:
          type: boolean
          description: >-
            Whether the email was automatically generated by a workflow or an AI
            agent.
        is_originated_in_stuut:
          type: boolean
          description: Whether the email originated (was sent through) Stuut.
        is_unread:
          type: boolean
        modified_at:
          type: string
          format: date-time
          nullable: true
        object:
          type: string
        parent_email_id:
          type: string
          maxLength: 32
          nullable: true
        participants:
          type: array
          items:
            type: string
            format: email
        remote_id:
          type: string
          description: The Nylas ID of the email
          nullable: true
        remote_links:
          type: array
          items:
            $ref: '#/components/schemas/EmailRemoteLink'
        reply_to:
          type: array
          items:
            type: string
        send_separately:
          type: boolean
        sent_at:
          type: string
          format: date-time
          description: When the email was sent.
          nullable: true
        sent_by_id:
          type: string
          maxLength: 32
          nullable: true
        snippet:
          type: string
          nullable: true
        status:
          maxLength: 7
          enum:
            - draft
            - pending
            - sending
            - sent
            - error
        subject:
          type: string
          nullable: true
        thread_id:
          type: string
          maxLength: 32
        to:
          type: array
          items:
            type: string
      required:
        - object
        - thread_id
    StuutErrorHTTP:
      type: object
      properties:
        data:
          type: object
          additionalProperties: {}
        error:
          type: string
        message:
          type: string
      required:
        - data
        - error
        - message
    ValidationError:
      properties:
        detail:
          type: object
          properties:
            <location>:
              type: object
              properties:
                <field_name>:
                  type: array
                  items:
                    type: string
        message:
          type: string
      type: object
    CreateEmailOptions:
      type: object
      properties:
        include_checkout_url:
          type: boolean
          default: false
        reply_all:
          type: boolean
          default: false
        use_llm:
          type: boolean
          default: false
    Attachment:
      type: object
      properties:
        id:
          type: string
          maxLength: 32
        content_id:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        disposition:
          type: string
        file_type:
          maxLength: 8
          enum:
            - audio
            - document
            - gif
            - image
            - video
        is_verified:
          type: boolean
        mime_type:
          type: string
        modified_at:
          type: string
          format: date-time
          nullable: true
        name:
          type: string
        object:
          type: string
        organization_id:
          type: string
          maxLength: 32
        presigned_url:
          type: string
          nullable: true
        presigned_url_expires_at:
          type: string
          format: date-time
          nullable: true
        purpose:
          type: string
          description: The use case for this attachment
          nullable: true
        remote_id:
          type: string
          description: The address' third party API ID.
          nullable: true
        size:
          type: integer
          nullable: true
        src:
          readOnly: true
        user_id:
          type: string
          maxLength: 32
          nullable: true
      required:
        - file_type
        - mime_type
        - name
        - object
        - organization_id
    User:
      type: object
      properties:
        id:
          type: string
          maxLength: 32
        created_at:
          type: string
          format: date-time
        dashboard_settings:
          $ref: '#/components/schemas/DashboardSettings'
        default_email_sender_id:
          type: string
          maxLength: 32
          nullable: true
        email:
          type: string
          maxLength: 255
        family_name:
          type: string
        given_name:
          type: string
        invited_by_user_id:
          type: string
          maxLength: 32
          nullable: true
        is_access_approved:
          type: boolean
        is_org_admin:
          type: boolean
        modified_at:
          type: string
          format: date-time
          nullable: true
        name:
          type: string
          readOnly: true
        object:
          type: string
        onboarding_required:
          type: boolean
        organization_id:
          type: string
          maxLength: 32
        profile_picture:
          type: string
        selected:
          type: boolean
      required:
        - email
        - family_name
        - given_name
        - object
        - organization_id
    EmailSender:
      type: object
      properties:
        id:
          type: string
          maxLength: 32
        created_at:
          type: string
          format: date-time
        email:
          type: string
          maxLength: 255
          description: The account's email.
        expired_at:
          type: string
          format: date-time
          description: The time the email sender grant expired.
          nullable: true
        is_nylas_connection:
          type: boolean
        is_nylas_grant_expired:
          type: boolean
          description: Whether the Nylas grant for this email sender has expired
        is_shared:
          type: boolean
          description: >-
            Whether this email sender should be shared with the entire
            organization
        modified_at:
          type: string
          format: date-time
          nullable: true
        name:
          type: string
          description: Email owner's name.
          nullable: true
        object:
          type: string
        provider:
          type: string
          nullable: true
        reply_to:
          type: string
          maxLength: 255
          description: This account's default reply-to
        reply_to_name:
          type: string
          description: This account's default reply-to
          nullable: true
        signature_html:
          type: string
          description: Email signature html.
          nullable: true
        user_id:
          type: string
          maxLength: 32
      required:
        - email
        - object
        - reply_to
        - user_id
    EmailRemoteLink:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
        email_id:
          type: string
          maxLength: 32
        email_sender_id:
          type: string
          maxLength: 32
        modified_at:
          type: string
          format: date-time
          nullable: true
        object:
          type: string
        remote_id:
          type: string
          description: The ID of the email in a remote system, e.g. Nylas
        remote_thread_id:
          type: string
          description: The ID of the email thread in a remote system, e.g. Nylas
      required:
        - email_id
        - email_sender_id
        - object
        - remote_id
        - remote_thread_id
    DashboardSettings:
      type: object
      properties:
        thread_emails_sort_order:
          type: string
          default: asc
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````