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

# Fetch business email

> Fetches one message from a thread linked to this business. Returns its stored HTML or plain-text body and temporary presigned S3 URLs for attachments. Treat HTML as untrusted before rendering it. Fetch the email again to refresh expired attachment URLs.



## OpenAPI

````yaml get /v1/businesses/{businessId}/support-emails/{messageId}
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/support-emails/{messageId}:
    get:
      tags: []
      summary: Fetch business email
      description: >-
        Fetches one message from a thread linked to this business. Returns its
        stored HTML or plain-text body and temporary presigned S3 URLs for
        attachments. Treat HTML as untrusted before rendering it. Fetch the
        email again to refresh expired attachment URLs.
      operationId: business.support-emails.get
      parameters:
        - name: businessId
          in: path
          description: The UUID of the business whose email to fetch.
          required: true
          schema:
            type: string
            format: uuid
        - name: messageId
          in: path
          description: >-
            The message UUID, for example `data.message_id` from an
            `email.message_received` webhook.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Email retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ApiSupportEmailMessageDetail'
                required:
                  - data
        '404':
          description: >-
            Business or message not found, or message belongs to another
            business.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    ApiSupportEmailMessageDetail:
      description: >-
        One business email with its stored body and presigned attachment
        download URLs. HTML takes precedence when both HTML and plain text
        arrive; only one body field is populated. Both are null when no body was
        stored.
      allOf:
        - $ref: '#/components/schemas/ApiSupportEmailMessage'
        - type: object
          properties:
            body_html:
              type: string
              nullable: true
              description: >-
                The stored HTML body, or null when only plain text or no body
                was stored. Treat as untrusted HTML.
            body_text:
              type: string
              nullable: true
              description: >-
                The stored plain-text body, or null when HTML or no body was
                stored.
            attachments:
              type: array
              items:
                $ref: '#/components/schemas/ApiSupportEmailAttachmentDetail'
              description: Stored attachments with presigned download URLs.
          required:
            - body_html
            - body_text
    ApiError:
      type: object
      description: An error object returned in API error responses.
      properties:
        type:
          $ref: '#/components/schemas/ApiErrorType'
          description: >-
            A fixed category for the error, helpful for categorizing and
            processing errors.
        description:
          type: string
          description: A human-readable error description.
        error_enum:
          $ref: '#/components/schemas/ApiEnumErrorType'
          description: >-
            A stable, machine-readable identifier for programmatically handling
            specific error conditions. Only present for 4xx client errors—not
            included for 5xx server errors. Use this instead of parsing the
            description field, as enum values remain stable across API versions.
          nullable: true
        meta:
          type: object
          description: Optional additional information about the error.
          nullable: true
      required:
        - type
        - description
    ApiSupportEmailMessage:
      type: object
      description: A message in a thread linked to the business.
      properties:
        id:
          type: string
          format: uuid
          description: The message UUID. Use this ID to fetch the full message.
        thread_id:
          type: string
          format: uuid
          description: The linked thread UUID.
        mailbox_id:
          type: string
          format: uuid
          description: The support mailbox UUID.
        gmail_message_id:
          type: string
          description: The source Gmail message ID.
        gmail_thread_id:
          type: string
          description: The source Gmail thread ID.
        business_id:
          type: string
          format: uuid
          description: The business linked to the thread.
        direction:
          type: string
          enum:
            - RECEIVED
            - SENT
          description: Whether the message was received or sent.
        from_address:
          type: string
          format: email
          description: The sender's email address.
        subject:
          type: string
          description: The message subject.
        snippet:
          type: string
          description: A short preview, not the full body.
        received_at:
          type: string
          format: date-time
          description: The message timestamp used for ordering and date filters.
        participants:
          type: array
          items:
            $ref: '#/components/schemas/ApiSupportEmailParticipant'
          description: Email addresses and their roles.
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/ApiSupportEmailAttachment'
          description: Stored attachment metadata; list results omit download URLs.
      required:
        - id
        - thread_id
        - mailbox_id
        - gmail_message_id
        - gmail_thread_id
        - business_id
        - direction
        - from_address
        - subject
        - snippet
        - received_at
    ApiSupportEmailAttachmentDetail:
      allOf:
        - $ref: '#/components/schemas/ApiSupportEmailAttachment'
        - type: object
          required:
            - url
      description: An email attachment with a presigned download URL.
    ApiErrorType:
      type: string
      enum:
        - ResourceArchived
        - AuthFailure
        - Plaid
        - Stripe
        - InvalidState
        - ResourceNotFound
        - InvalidParameters
        - JsonSerialization
        - Unknown
        - BadRequest
        - PaginationCursor
        - Conflict
        - LedgerOperationFailed
      example: InvalidParameters
    ApiEnumErrorType:
      type: string
      description: >-
        Stable enum values for programmatic error handling. Only present in 4xx
        error responses.
      enum:
        - AccessCodeInvalid
        - BalanceSheetDoesNotBalance
        - BalanceSheetMissingAccount
        - BankStatementAccountDetectionError
        - BankStatementParsingError
        - BankStatementParserError
        - BankStatementValidationError
        - BillStateError
        - BulkCategorizeFailure
        - BulkMatchFailure
        - BusinessTaskAlreadyCompleted
        - BusinessTaskDeleted
        - CalendlyOAuthError
        - CallBookingError
        - CantUpdateTransactionInCustomerPayout
        - CantUpdateTransactionInVendorPayout
        - CheckPayrollConfigNotFound
        - CheckPayrollServiceNotFound
        - ClerkUserAlreadyExists
        - ConflictingQueryParams
        - CustomAccountAlreadyExists
        - CustomTransactionCsvParsingError
        - CustomTransactionUploadFailure
        - CustomerPayoutInputFormatError
        - DoesNotMatchExistingEntity
        - EmptyBatchRequest
        - ExpenseParserError
        - ExternalAccountBalanceReconciliationError
        - ExternalIdConflict
        - InvalidCategory
        - InvalidEffectiveDate
        - InvalidLedgerOperation
        - InvalidMonthlyAverageRange
        - InvalidMultiPartRequest
        - InvalidPaginationCursor
        - InvalidPayload
        - InvoiceDeleted
        - InvoiceNotFound
        - InvoiceReferenceMismatch
        - InvoiceStateError
        - ManualRateLimit
        - MultipleTagKeyFiltersUnsupported
        - NoCognitoUserFound
        - NoOpeningBalanceFound
        - NotYetReconciled
        - OnePasswordApiError
        - OnePasswordItemNotFound
        - OnePasswordVaultNotFound
        - OpenAICategorizationError
        - PaymentLinkInvalid
        - PayrollStateError
        - PeriodIsClosed
        - PeriodNotClosed
        - PhoneNumberAlreadyRegistered
        - PlaidApiError
        - PlaidConnectionBroken
        - PlaidCreateLinkTokenError
        - PlaidCredentialsNotConfigured
        - PlaidExchangePublicTokenError
        - PlaidGetInstitutionByIdError
        - PlaidGetItemError
        - PlaidInvalidEnvironment
        - PlaidItemAlreadyExists
        - PlaidItemNotFound
        - PlaidProcessorApiError
        - PlaidUnlinkItemError
        - QueryParamFormat
        - QueryParamMissing
        - QuickbooksBrokenConnection
        - QuickbooksConnectionAlreadyExists
        - QuickbooksConnectionAlreadySyncing
        - QuickbooksConnectionMissing
        - QuickbooksConnectionNotActivated
        - QuickbooksInvalidRequest
        - QuickbooksInvalidState
        - QuickbooksNoMatchingAccount
        - QuickbooksNonPostingAccountType
        - QuickbooksNotConfigured
        - QuickbooksOAuthCallbackInvalid
        - QuickbooksOAuthError
        - QuickbooksTokenExpired
        - ReadOnlyBusiness
        - ResourceArchived
        - ScheduleCNotConfigured
        - SmsNotEnabled
        - SpecifiedBadRequest
        - SpecifiedIdNotFound
        - SplitTransactionError
        - StepEvaluationBadRequest
        - StripeConnectAccountIdNotFound
        - StripeCredentialsNotConfigured
        - StripeGetBalanceForConnectAccountFailure
        - StripeRedirectOrRefreshUrlNotConfigured
        - TagFilterNotFound
        - UnexpectedQueryParam
        - UnitAccountsInUse
        - WrongAnswerType
      example: InvalidPayload
    ApiSupportEmailParticipant:
      type: object
      properties:
        email_address:
          type: string
          format: email
          description: The participant's email address.
        role:
          type: string
          enum:
            - FROM
            - TO
            - CC
            - BCC
            - REPLY_TO
          description: The participant's role in this message.
      required:
        - email_address
        - role
    ApiSupportEmailAttachment:
      type: object
      description: >-
        An attachment stored with the email. Download URLs are provided only on
        the single-message endpoint.
      properties:
        id:
          type: string
          format: uuid
          description: The attachment UUID.
        filename:
          type: string
          description: The original filename.
        mime_type:
          type: string
          description: The attachment MIME type.
        size_bytes:
          type: integer
          format: int32
          description: The attachment size in bytes.
        url:
          type: string
          format: uri
          description: >-
            Temporary presigned S3 download URL, valid for 24 hours. Omitted
            from list results.
      required:
        - id
        - filename
        - mime_type
        - size_bytes
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````