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

# Compose Email

> Compose and send a new email.



## OpenAPI

````yaml post /email/compose
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /email/compose:
    post:
      tags:
        - provider
        - email
      summary: Compose Email
      description: Compose and send a new email.
      operationId: compose_email_email_compose_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ComposeEmailRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ComposeEmailRequest:
      properties:
        to:
          items:
            type: string
          type: array
          minItems: 1
          title: To
          description: Recipient email addresses
        cc:
          items:
            type: string
          type: array
          title: Cc
          description: CC recipients
          default: []
        bcc:
          items:
            type: string
          type: array
          title: Bcc
          description: BCC recipients
          default: []
        subject:
          type: string
          maxLength: 500
          minLength: 1
          title: Subject
        bodyHtml:
          anyOf:
            - type: string
            - type: 'null'
          title: Bodyhtml
        bodyText:
          anyOf:
            - type: string
            - type: 'null'
          title: Bodytext
        patientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientid
          description: Link email to a patient
      type: object
      required:
        - to
        - subject
      title: ComposeEmailRequest
      description: Request to compose and send a new email.
    SendEmailResponse:
      properties:
        success:
          type: boolean
          title: Success
        messageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Messageid
        threadId:
          anyOf:
            - type: string
            - type: 'null'
          title: Threadid
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
      type: object
      required:
        - success
      title: SendEmailResponse
      description: Response after sending an email.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````