> ## 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: 6.9.0
  description: This API is used for sending whatsapp via API
servers:
  - url: http://localhost:3000
security:
  - basicAuth: []
tags:
  - name: app
    description: Initial Connection to Whatsapp server
  - name: user
    description: Getting information
  - name: send
    description: Send Message (Text/Image/File/Video).
  - name: message
    description: Message manipulation (revoke/react/update).
  - name: chat
    description: Chat conversations and messaging
  - name: group
    description: Group setting
  - name: newsletter
    description: newsletter setting
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:
        - 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)
          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:
  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
        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.)
        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
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

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