> ## 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 SMS message history

> Returns the SMS message log for the specified business. This endpoint returns the most recent messages first.



## OpenAPI

````yaml get /v1/businesses/{businessId}/sms/messages
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/sms/messages:
    get:
      tags: []
      summary: Fetch SMS message history
      description: >-
        Returns the SMS message log for the specified business. This endpoint
        returns the most recent messages first.
      operationId: business.sms.messages.get
      parameters:
        - name: businessId
          in: path
          description: The UUID of the business to fetch the SMS message log for.
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Content-Type must be set to application/json.
          schema:
            type: string
      responses:
        '200':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiMessages'
        '400':
          description: >-
            SMS is not enabled for this business. Enable SMS to enable message
            history.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: >-
            Business is not found. This indicates the business id is invalid or
            the business has been archived.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    ApiMessages:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be 'Messages'.
          example: Messages
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ApiMessageLog'
          description: List of message logs.
      example: ''
      description: ''
    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
    ApiMessageLog:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be 'Message_Log'.
          example: Message_Log
        id:
          type: string
          format: uuid
          description: The ID of the message log.
        business_id:
          type: string
          format: uuid
          description: The ID of the business that sent the message.
        at:
          type: string
          format: date-time
          description: The time when the message was received.
        direction:
          $ref: '#/components/schemas/MessageDirection'
          description: Whether the message was sent or received.
        delivery_status:
          $ref: '#/components/schemas/MessageDeliveryStatus'
          description: The message's delivery status.
        sent_by:
          $ref: '#/components/schemas/MessageSender'
          description: How the message was sent.
        business_phone:
          type: string
          description: The phone number for the business.
          example: '+16504651359'
        body:
          type: string
          description: The message body.
          example: Hello from Layer!
        retry_of_id:
          type: string
          format: uuid
          description: The ID of the original message log this is a retry of.
        sent_at:
          type: string
          format: date-time
          description: The time when the message was sent.
        presigned_attachment_urls:
          type: array
          items:
            type: string
            description: Pre-signed URL to download an attachment.
            example: >
              https://example-bucket.s3.amazonaws.com/example-object?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=FAKEAWSACCESSKEY%2F20240710%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Date=20240710T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=FAKESIGNATURE1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
          description: List of pre-signed URLs to download the message's attachments.
        presigned_file_types:
          type: array
          items:
            type: string
            description: The filetype of an attachment.
            example: csv
          description: List of file types for the message's attachments.
      description: A single message log.
    ApiErrorType:
      type: string
      enum:
        - ResourceArchived
        - AuthFailure
        - Plaid
        - Stripe
        - InvalidState
        - ResourceNotFound
        - InvalidParameters
        - JsonSerialization
        - Unknown
        - BadRequest
        - PaginationCursor
        - Conflict
        - LedgerOperationFailed
    ApiEnumErrorType:
      type: string
      description: >-
        Stable enum values for programmatic error handling. Only present in 4xx
        error responses.
      enum:
        - AccessCodeInvalid
        - BalanceSheetDoesNotBalance
        - BalanceSheetMissingAccount
        - BankStatementParserError
        - 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
        - ResourceArchived
        - ScheduleCNotConfigured
        - SmsNotEnabled
        - SpecifiedBadRequest
        - SpecifiedIdNotFound
        - SplitTransactionError
        - StepEvaluationBadRequest
        - StripeConnectAccountIdNotFound
        - StripeCredentialsNotConfigured
        - StripeGetBalanceForConnectAccountFailure
        - StripeRedirectOrRefreshUrlNotConfigured
        - TagFilterNotFound
        - UnexpectedQueryParam
        - UnitAccountsInUse
        - WrongAnswerType
    MessageDirection:
      type: string
      enum:
        - SENT
        - RECEIVED
    MessageDeliveryStatus:
      type: string
      enum:
        - ACCEPTED
        - SCHEDULED
        - QUEUED
        - SENDING
        - SENT
        - RECEIVING
        - RECEIVED
        - DELIVERED
        - UNDELIVERED
        - FAILED
        - READ
        - CANCELED
        - LAYER_TIMEOUT
        - UNKNOWN
    MessageSender:
      type: string
      enum:
        - API
        - MANUAL
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````