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

# Find messages

> Find messages for the active team



## OpenAPI

````yaml /swagger.yml get /public/messages
openapi: 3.0.0
info:
  title: Public API Docs
  description: Clerk Public API
  version: '1.0'
  contact: {}
servers:
  - url: https://web-api.clerk.chat
    description: Production server
  - url: http://localhost:3000
    description: Production server
security: []
tags: []
paths:
  /public/messages:
    get:
      tags:
        - Messages
      summary: Find messages
      description: Find messages for the active team
      operationId: PublicMessagesController_findMessages
      parameters:
        - name: inboxIds
          in: query
          required: false
          description: >-
            The IDs of the inboxes to filter messages by. If not provided, all
            inboxes will be included.
          schema:
            type: array
            items:
              type: string
        - name: start
          in: query
          required: false
          description: Only messages after this date until the end date or now
          schema:
            type: string
            format: date-time
        - name: end
          in: query
          required: false
          description: Only messages up to this date
          schema:
            type: string
            format: date-time
        - name: limit
          in: query
          required: false
          description: Number of items to return (max 50)
          example: 10
          schema:
            type: number
        - name: page
          in: query
          required: false
          description: Page number
          example: 1
          schema:
            type: number
      responses:
        '200':
          description: A paginated list of messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMessagesResponse'
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized request
        '403':
          description: You do not have permission to access this resource
        '404':
          description: Resource not found
        '422':
          description: Invalid request parameters
        '429':
          description: Too many requests for this resource
        '500':
          description: Internal server error
      security:
        - api_key: []
components:
  schemas:
    PaginatedMessagesResponse:
      type: object
      required:
        - data
        - total
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MessageObject'
        links:
          type: object
          properties:
            next:
              type: string
              description: The URL for the next page
            prev:
              type: string
              description: The URL for the previous page
            self:
              type: string
              description: The URL for the current page
        total:
          type: number
          description: The total number of messages
          example: 1
    MessageObject:
      type: object
      description: Represents a message resource
      required:
        - id
        - body
        - conversationId
        - inbound
        - members
        - sender
        - senderType
        - status
        - created
        - updated
        - seen
        - segments
        - timestamp
      properties:
        id:
          type: number
          description: The ID of the resource
          example: 1
          readOnly: true
        body:
          type: string
          description: The message text
          example: Hello, world!
        conversationId:
          type: string
          description: The associated Conversation ID
          example: '1'
          readOnly: true
        userId:
          type: string
          description: The ID of the user who created the resource
          example: '1'
          readOnly: true
          nullable: true
        campaignMessageId:
          type: number
          nullable: true
          description: The ID of the campaign message
          example: 1
        campaignId:
          type: number
          nullable: true
          description: The associated Campaign ID
          example: 1
          readOnly: true
        channelId:
          type: string
          description: The associated Channel ID
          example: 00000000-0000-0000-0000-000000000000
          readOnly: true
          nullable: true
        inboxId:
          type: string
          description: The associated Inbox ID
          example: 00000000-0000-0000-0000-000000000000
          readOnly: true
          nullable: true
        inbound:
          type: boolean
          description: Whether the message was received (true) or sent (false)
          example: true
        members:
          type: array
          description: The phone numbers or identifiers of message participants
          items:
            type: string
          example:
            - '+1415456789'
        sender:
          type: string
          description: The phone number or identifier of the message sender
          example: '+1415456789'
        senderType:
          type: string
          description: The type of sender
          enum:
            - ai_pipeline
            - assistant
            - user
            - campaign
            - campaign_message
            - workflow
          example: user
        status:
          type: string
          description: The status of the message
          enum:
            - sending
            - scheduled
            - sent
            - delivered
            - failed
            - read
          example: delivered
        error:
          type: string
          description: The error message if the message failed to send
          nullable: true
        sentByName:
          type: string
          description: The name of the sender displayed in the UI
          example: Clerk
          nullable: true
        errorCode:
          type: number
          description: The error code if the message failed to send
          example: 123
          nullable: true
        created:
          type: string
          format: date-time
          example: '2021-01-01T00:00:00.000Z'
          readOnly: true
          description: The date and time the resource was created
        updated:
          type: string
          format: date-time
          example: '2021-01-01T00:00:00.000Z'
          readOnly: true
          description: The date and time the resource was last updated
        seen:
          type: boolean
          description: Whether the message has been seen
          example: true
        externalId:
          type: string
          description: The external ID of the resource
          example: external-id
          nullable: true
        segments:
          type: number
          description: Number of SMS message segments used by the message
          example: 1
        timestamp:
          type: string
          format: date-time
          example: '2021-01-01T00:00:00.000Z'
          description: The timestamp associated with the message
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apiKey

````