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

# List Messages

> The {session} parameter must be the session's instanceName.



## OpenAPI

````yaml viewer-en.json get /api/{session}/chats/{chatId}/messages
openapi: 3.1.0
info:
  title: Wappfy - WhatsApp HTTP API
  version: '2.0'
  contact: {}
servers:
  - url: https://{host}
    description: Customizable Server
    variables:
      host:
        default: api.wappfy.com.br
        description: Server URL (e.g., api.wappfy.com.br or your-server.com)
security:
  - api_key: []
tags:
  - name: 🖥️ Sessions
    description: Control WhatsApp sessions (accounts)
  - name: 🔑 Auth
    description: Authentication
  - name: 🆔 Profile
    description: Your profile information
  - name: 🖼️ Screenshot
    description: Get WhatsApp screenshot and display QR code
  - name: 📤 Chatting
    description: Conversation methods
  - name: 📢 Channels
    description: Channels (newsletters) methods
  - name: 🟢 Status
    description: Status (aka stories) methods
  - name: 💬 Chats
    description: Conversations methods
  - name: 👤 Contacts
    description: |-
      Contacts methods.<br>
                      Use phone number (without +) or phone number and `@c.us` at the end as `contactId`.<br>
                      E.g: `12312312310` OR `12312312310@c.us`<br>
  - name: 👥 Groups
    description: Groups methods.<br>
  - name: ✅ Presence
    description: Presence information
  - name: 📅 Events
    description: Event Message
  - name: 🏷️ Labels
    description: Labels - available only for WhatsApp Business accounts
  - name: 🔍 Observability
    description: Other methods
  - name: 🗄️ Storage
    description: Storage methods
externalDocs:
  description: Wappfy - WhatsApp API
  url: https://docs.wappfy.com.br/
paths:
  /api/{session}/chats/{chatId}/messages:
    get:
      tags:
        - 💬 Chats
      summary: Get messages in conversation
      description: The {session} parameter must be the session's instanceName.
      operationId: ChatsController_getChatMessages
      parameters:
        - name: session
          required: true
          in: path
          description: Session name (instanceName)
          example: my-session
          schema:
            type: string
        - name: downloadMedia
          required: false
          in: query
          example: false
          description: Download media for messages
          schema:
            type: boolean
            default: true
        - name: limit
          required: true
          in: query
          schema:
            default: 10
            type: number
        - name: offset
          required: false
          in: query
          schema:
            type: number
        - name: filter.timestamp.lte
          required: false
          in: query
          description: Filter messages before this timestamp (inclusive)
          schema:
            type: number
        - name: filter.timestamp.gte
          required: false
          in: query
          description: Filter messages after this timestamp (inclusive)
          schema:
            type: number
        - name: filter.fromMe
          required: false
          in: query
          description: From me filter (by default shows all messages)
          schema:
            type: boolean
        - name: filter.ack
          required: false
          in: query
          description: Filter messages by acknowledgement status
          schema:
            enum:
              - ERROR
              - PENDING
              - SERVER
              - DEVICE
              - READ
              - PLAYED
            type: string
        - name: chatId
          required: true
          in: path
          description: Conversation ID
          example: 123456789@c.us
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WAMessage'
      security:
        - api_key: []
components:
  schemas:
    WAMessage:
      type: object
      properties:
        id:
          type: string
          description: Message ID
          example: false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA
        timestamp:
          type: number
          description: Unix timestamp of when the message was created
          example: 1666943582
        from:
          type: string
          description: Chat ID to which this message was sent
          example: 5511999999999@c.us
        fromMe:
          type: boolean
          description: Indicates if the message was sent by the current user
        source:
          enum:
            - api
            - app
          type: string
          description: >-
            The device that sent the message - either API or APP. Available in
            events (webhooks/websockets) only and only "fromMe: true" messages.
          example: api
        to:
          type: string
          description: >-
            * ID for who this message is for.

            * If the message is sent by the current user, it will be the Chat to
            which the message is being sent.

            * If the message is sent by another user, it will be the ID for the
            current user.
          example: 5511999999999@c.us
        participant:
          type: string
          description: For groups - participant who sent the message
        body:
          type: string
          description: Message content
        hasMedia:
          type: boolean
          description: Indicates if the message has media available for download
        media:
          description: Message media object, if any and downloaded
          allOf:
            - $ref: '#/components/schemas/WAMedia'
        ack:
          enum:
            - -1
            - 0
            - 1
            - 2
            - 3
            - 4
          type: number
          description: Message acknowledgement (ACK) status
        ackName:
          type: string
          description: Message acknowledgement status name
        author:
          type: string
          description: >-
            If the message was sent to a group, this field will contain the user
            who sent the message
        location:
          description: Location information contained in the message
          allOf:
            - $ref: '#/components/schemas/WALocation'
        vCards:
          description: List of vCards contained in the message
          type: array
          items:
            type: string
        _data:
          type: object
          description: >-
            Message in raw WhatsApp format. May change at any time, use with
            caution!
        replyTo:
          $ref: '#/components/schemas/ReplyToMessage'
      required:
        - id
        - timestamp
        - from
        - fromMe
        - source
        - to
        - participant
        - body
        - hasMedia
        - mediaUrl
        - ack
        - ackName
    WAMedia:
      type: object
      properties:
        url:
          type: string
          description: Media URL in the message, if any
          example: >-
            http://localhost:3000/api/files/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga
        mimetype:
          type: string
          description: Media MIME type in the message
          example: audio/jpeg
        filename:
          type: string
          description: Original media file name
          example: example.pdf
        s3:
          description: Media S3 attributes if you are using S3 storage
          allOf:
            - $ref: '#/components/schemas/S3MediaData'
        error:
          type: object
          description: Error message when downloading media
          example: null
    WALocation:
      type: object
      properties:
        description:
          type: string
        latitude:
          type: string
        longitude:
          type: string
      required:
        - latitude
        - longitude
    ReplyToMessage:
      type: object
      properties:
        id:
          type: string
          description: Message ID
          example: AAAAAAAAAAAAAAAAAAAA
        participant:
          type: string
          example: 5511999999999@c.us
        body:
          type: string
          example: Hello!
        _data:
          type: object
          description: Raw data from reply's message
      required:
        - id
    S3MediaData:
      type: object
      properties:
        Bucket:
          type: string
          description: Nome do bucket S3
          example: my-bucket
        Key:
          type: string
          description: S3 bucket object key
          example: default/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga
      required:
        - Bucket
        - Key
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apikey
      description: Your Wappfy API key (get it at dash.wappfy.com.br)

````