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

# Listar mensagens de uma conversa

> Paginação por cursor — use `before_id` para buscar mensagens mais antigas.



## OpenAPI

````yaml /api-reference/openapi.yaml get /chat/conversations/{id}/messages
openapi: 3.0.3
info:
  title: Nupapia API — Integração
  version: '1.0'
  description: >
    Referência da API pública da Nupapia para integração de sistemas terceiros:
    conversas de chat e CRM (clientes). Gere um token de integração em
    **Configurações → Integrações** dentro da Nupapia e use-o como Bearer token
    em todas as chamadas abaixo.
servers:
  - url: https://api.nupapia.com.br/api
    description: Produção
security:
  - integrationToken: []
paths:
  /chat/conversations/{id}/messages:
    get:
      tags:
        - Conversas
      summary: Listar mensagens de uma conversa
      description: >-
        Paginação por cursor — use `before_id` para buscar mensagens mais
        antigas.
      parameters:
        - $ref: '#/components/parameters/ConversationId'
        - name: before_id
          in: query
          schema:
            type: integer
        - name: limit
          in: query
          schema:
            type: integer
            default: 50
            maximum: 200
      responses:
        '200':
          description: Lista de mensagens, ordem cronológica crescente
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Message'
                  pagination:
                    type: object
                    properties:
                      has_more:
                        type: boolean
                      oldest_id:
                        type: integer
                        nullable: true
                      limit:
                        type: integer
components:
  parameters:
    ConversationId:
      name: id
      in: path
      required: true
      schema:
        type: integer
  schemas:
    Message:
      type: object
      properties:
        id:
          type: integer
        body:
          type: string
        contentType:
          type: string
          example: text
        content:
          type: string
        senderType:
          type: string
          enum:
            - user
            - client
            - system
        senderId:
          type: integer
          nullable: true
        file_url:
          type: string
          nullable: true
        file_name:
          type: string
          nullable: true
        read:
          type: boolean
        read_at:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        reply_to_id:
          type: integer
          nullable: true
        edited_at:
          type: string
          format: date-time
          nullable: true
        client_message_id:
          type: string
          nullable: true
        reactions:
          type: array
          items:
            type: object
  securitySchemes:
    integrationToken:
      type: http
      scheme: bearer
      bearerFormat: Token de integração (gerado em Configurações → Integrações)

````