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

# Get messages from a specific chat

> Retrieve messages from a specific chat conversation with filtering options



## OpenAPI

````yaml /openapi.yml get /chat/{chat_jid}/messages
openapi: 3.0.0
info:
  title: WhatsApp API MultiDevice
  version: 9.7.0
  description: |
    This API is used for sending whatsapp via API.

    The web dashboard is a separate project (gowa-ui); the server downloads its
    latest release asset and serves it at `/` (or returns a JSON banner when
    APP_UI_ENABLED=false).

    Device scoping:
    - Send `X-Device-Id` on all device-scoped REST calls.
    - WebSocket: connect to `/ws?device_id=<id>`.
    - WebSocket auth (when basic auth is enabled): browsers cannot set an
      Authorization header on WebSocket connections, so also pass
      `&authorization=<base64(user:pass)>` in the query string. Use TLS in
      production since the credential is visible in the URL.
servers:
  - url: http://localhost:3000
security:
  - basicAuth: []
tags:
  - name: app
    description: Initial Connection to Whatsapp server
  - name: device
    description: Device management for multi-device support
  - name: user
    description: Getting information
  - name: send
    description: Send Message (Text/Image/File/Video).
  - name: message
    description: Message manipulation (revoke/react/update).
  - name: call
    description: Call management (reject incoming calls)
  - name: chat
    description: Chat conversations and messaging
  - name: group
    description: Group setting
  - name: newsletter
    description: newsletter setting
  - name: chatwoot
    description: Chatwoot integration for customer support
paths:
  /chat/{chat_jid}/messages:
    get:
      tags:
        - chat
      summary: Get messages from a specific chat
      description: >-
        Retrieve messages from a specific chat conversation with filtering
        options
      operationId: getChatMessages
      parameters:
        - $ref: '#/components/parameters/DeviceIdHeader'
        - in: path
          name: chat_jid
          schema:
            type: string
          required: true
          description: >-
            Chat JID (e.g., phone@s.whatsapp.net for individual or groupid@g.us
            for group). Percent-encoded values (e.g., groupid%40g.us) are
            accepted.
          example: 6289685028129@s.whatsapp.net
        - name: limit
          in: query
          schema:
            type: integer
            default: 50
            maximum: 100
          description: Maximum number of messages to return
        - name: offset
          in: query
          schema:
            type: integer
            default: 0
          description: Number of messages to skip (for pagination)
        - name: start_time
          in: query
          schema:
            type: string
            format: date-time
          description: Filter messages from this timestamp (ISO 8601 format)
        - name: end_time
          in: query
          schema:
            type: string
            format: date-time
          description: Filter messages until this timestamp (ISO 8601 format)
        - name: media_only
          in: query
          schema:
            type: boolean
            default: false
          description: Only return messages with media content
        - name: is_from_me
          in: query
          schema:
            type: boolean
          description: >-
            Filter messages by sender (true for messages sent by you, false for
            received messages). When both media_only=true and isFromMe=false are
            provided, media_only takes precedence and will return all media
            messages regardless of sender.
        - name: search
          in: query
          schema:
            type: string
          description: Search messages by content text
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMessagesResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorUnauthorized'
        '404':
          description: Chat Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInternalServer'
components:
  parameters:
    DeviceIdHeader:
      name: X-Device-Id
      in: header
      required: false
      description: >
        Device identifier for multi-device support. Required when multiple
        devices are registered.

        If only one device is registered, it will be used as the default.

        Can also be provided as `device_id` query parameter.
      schema:
        type: string
        example: my-device-id
  schemas:
    ChatMessagesResponse:
      type: object
      properties:
        code:
          type: string
          example: SUCCESS
        message:
          type: string
          example: Success get chat messages
        results:
          type: object
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/ChatMessage'
            pagination:
              type: object
              properties:
                limit:
                  type: integer
                  example: 50
                offset:
                  type: integer
                  example: 0
                total:
                  type: integer
                  example: 1250
            chat_info:
              $ref: '#/components/schemas/Chat'
    ErrorBadRequest:
      type: object
      properties:
        code:
          type: string
          example: 400
          description: HTTP Status Code
        message:
          type: string
          example: field cannot be blank
          description: Detail error message
        results:
          type: object
          example: null
          description: additional data
    ErrorUnauthorized:
      type: object
      properties:
        code:
          type: string
          example: 401
          description: HTTP Status Code
        message:
          type: string
          example: Unauthorized access
          description: Detail error message
        results:
          type: object
          example: null
          description: additional data
    ErrorNotFound:
      type: object
      properties:
        code:
          type: string
          example: 404
          description: HTTP Status Code
        message:
          type: string
          example: Chat not found
          description: Detail error message
        results:
          type: object
          example: null
          description: additional data
    ErrorInternalServer:
      type: object
      properties:
        code:
          type: string
          example: INTERNAL_SERVER_ERROR
          description: SYSTEM_CODE_ERROR
        message:
          type: string
          example: you are not loggin
          description: Detail error message
        results:
          type: object
          example: null
          description: additional data
    ChatMessage:
      type: object
      properties:
        id:
          type: string
          example: 3EB0B430B6F8F1D0E053AC120E0A9E5C
          description: Message ID
        chat_jid:
          type: string
          example: 6289685028129@s.whatsapp.net
          description: Chat JID this message belongs to
        sender_jid:
          type: string
          example: 6289685028129@s.whatsapp.net
          description: Sender JID
        sender_display_name:
          type: string
          example: Saved Contact
          description: >-
            Human-readable sender label resolved dynamically when this response
            is produced, not stored with the message. For other senders, it
            prefers the saved contact full name, then the stored contact push
            name, business name, JID user part, and raw JID. For the active
            account, it prefers the device display name (falling back to the
            stored account push name), account JID user part, account JID,
            sender JID user part, and raw sender JID. A contact rename can
            therefore change the label returned for historical messages.
            `sender_jid` remains the stable sender identifier.
        content:
          type: string
          example: Hello, how are you?
          description: Message text content
        timestamp:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
          description: Message timestamp
        is_from_me:
          type: boolean
          example: false
          description: Whether this message was sent by the current user
        media_type:
          type: string
          example: image
          nullable: true
          description: >-
            Type of media (image, video, audio, document, etc.). Value `call`
            indicates a stored incoming call log.
        reactions:
          type: array
          description: Emoji reactions attached to this message
          items:
            $ref: '#/components/schemas/ChatReaction'
        call_metadata:
          type: string
          example: '{"call_id":"ABC","auto_rejected":false}'
          description: >-
            JSON string with call details when media_type is `call`. Omitted
            when not applicable (matches Go json omitempty).
        referral_metadata:
          type: string
          example: '{"ctwa_clid":"clid_123","source_app":"whatsapp"}'
          description: >-
            JSON string with Meta Ads referral/attribution details when the
            message originated from a Click-to-WhatsApp ad. Omitted when not
            applicable (matches Go json omitempty).
        context_metadata:
          type: string
          example: '{"replied_to_id":"AC625C65EA7143E71D784176C4A90A93"}'
          description: >-
            JSON string containing the replied-to message ID when reply context
            is known. Captured from live, sent, and history-sync messages.
            Omitted when no reply context is available, including older stored
            rows until they are reingested with context.
        filename:
          type: string
          example: photo.jpg
          nullable: true
          description: Original filename for media messages
        url:
          type: string
          example: https://media.example.com/file.jpg
          nullable: true
          description: Media file URL
        file_length:
          type: integer
          example: 1024768
          nullable: true
          description: File size in bytes for media messages
        created_at:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
          description: Record creation timestamp
        updated_at:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
          description: Record last update timestamp
    Chat:
      type: object
      properties:
        jid:
          type: string
          example: 6289685028129@s.whatsapp.net
          description: Chat JID identifier
        name:
          type: string
          example: John Doe
          description: Chat display name
        last_message_time:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
          description: Timestamp of the last message
        ephemeral_expiration:
          type: integer
          example: 0
          description: Ephemeral message expiration time in seconds (0 = disabled)
        created_at:
          type: string
          format: date-time
          example: '2024-01-10T08:00:00Z'
          description: Chat creation timestamp
        updated_at:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
          description: Chat last update timestamp
        archived:
          type: boolean
          example: false
          description: Whether the chat is archived
    ChatReaction:
      type: object
      properties:
        emoji:
          type: string
          example: 👍
          description: Emoji used in the reaction
        sender_jid:
          type: string
          example: 628123456789@s.whatsapp.net
          description: JID of the user who reacted
        sender_display_name:
          type: string
          example: Saved Contact
          description: >-
            Human-readable sender label resolved dynamically when this response
            is produced, not stored with the reaction. For other senders, it
            prefers the saved contact full name, then the stored contact push
            name, business name, JID user part, and raw JID. For the active
            account, it prefers the device display name (falling back to the
            stored account push name), account JID user part, account JID,
            sender JID user part, and raw sender JID. A contact rename can
            therefore change the label returned for historical reactions.
            `sender_jid` remains the stable sender identifier.
        is_from_me:
          type: boolean
          example: false
          description: Whether the reaction was made by the current user
        timestamp:
          type: string
          format: date-time
          example: '2024-01-15T10:31:00Z'
          description: When the reaction was received
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.