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

# Retorna lista paginada de comentários de uma entidade

> [!NOTE]
>
> **🚀 API v2 (Recomendada)** - Este endpoint está disponível apenas na v2


## OpenAPI

````yaml openapi/openapi-v2.json GET /comments/{pageNumber}/{pageLimit}
openapi: 3.0.0
info:
  title: Documentação de API
  version: '2.0'
servers:
  - url: https://backend-pied-prod.piedadmin.com.br/api/v2
security:
  - bearerAuth: []
tags:
  - name: Request
    description: Tudo sobre orçamentos ou pedidos
  - name: Equipment
    description: Tudo sobre equipamentos
  - name: Company
    description: Tudo sobre empresas de energia
  - name: Custom Field
    description: Tudo sobre campos customizados
  - name: Payments
    description: Tudo sobre pagamentos
  - name: Task Plan
    description: Tudo sobre tarefas (task plans)
  - name: Comments
    description: Tudo sobre comentários vinculados a entidades do workspace
paths:
  /comments/{pageNumber}/{pageLimit}:
    get:
      tags:
        - Comments
      summary: Retorna lista paginada de comentários de uma entidade
      parameters:
        - $ref: '#/components/parameters/pageNumber'
        - $ref: '#/components/parameters/pageLimit'
        - name: parentId
          in: query
          required: true
          description: ID da entidade pai do comentário.
          schema:
            type: string
        - name: parentType
          in: query
          required: true
          description: Tipo da entidade pai.
          schema:
            type: string
            enum:
              - request
              - company
              - call
              - rehearse
        - name: pastParentId
          in: query
          description: >-
            ID alternativo do parent (ex.: orçamento anterior vinculado ao
            pedido).
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commentListResponse'
        '401':
          description: Esta funcionalidade está indisponível no momento
        '404':
          description: Entidade pai não encontrada ou não pertence ao distribuidor
        '429':
          $ref: '#/components/schemas/429'
        '500':
          $ref: '#/components/schemas/500'
      security:
        - bearerAuth: []
components:
  parameters:
    pageNumber:
      name: pageNumber
      in: path
      description: Determina o número da página a ser retornada.
      required: true
      schema:
        type: integer
    pageLimit:
      name: pageLimit
      in: path
      description: Limita a quantidade de registros retornados por página.
      required: true
      schema:
        type: integer
  schemas:
    '429':
      description: >-
        hardLimit: O limite de requisições por hora foi ultrapassado. Tente
        novamente mais tarde / timeLimit: O limite de 1 minuto de processamento
        de requisição por hora foi atingido. Tente novamente mais tarde
    '500':
      description: Erro na API
    commentListResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: array
          items:
            $ref: '#/components/schemas/comment_v2'
        metadata:
          $ref: '#/components/schemas/paginationMetadata'
    comment_v2:
      type: object
      properties:
        id:
          type: string
          example: 507f1f77bcf86cd799439016
        parentId:
          type: string
          example: 507f1f77bcf86cd799439014
        parentType:
          type: string
          enum:
            - request
            - company
            - call
            - rehearse
          example: request
        createdAt:
          type: string
          format: date-time
          example: '2026-08-31T10:00:00.000Z'
        message:
          type: string
          example: Cliente pediu retorno até sexta-feira.
        fixed:
          type: boolean
          example: false
        edited:
          type: boolean
          example: false
        user:
          $ref: '#/components/schemas/commentUser'
        replies:
          type: array
          items:
            $ref: '#/components/schemas/commentReply_v2'
    paginationMetadata:
      type: object
      properties:
        totalItems:
          type: integer
          example: 100
        itemsPerPage:
          type: integer
          example: 25
        totalPages:
          type: integer
          example: 4
        currentPage:
          type: integer
          example: 1
        links:
          type: object
          properties:
            first:
              type: string
              example: /api/v2/task-plans/1/25
            last:
              type: string
              nullable: true
              example: /api/v2/task-plans/4/25
            next:
              type: string
              nullable: true
              example: /api/v2/task-plans/2/25
            previous:
              type: string
              nullable: true
              example: null
    commentUser:
      type: object
      properties:
        id:
          type: string
          example: 507f1f77bcf86cd799439011
        fullName:
          type: string
          example: João Silva
    commentReply_v2:
      type: object
      properties:
        id:
          type: string
          example: 507f1f77bcf86cd799439015
        commentId:
          type: string
          example: 507f1f77bcf86cd799439016
        createdAt:
          type: string
          format: date-time
          example: '2026-08-31T12:00:00.000Z'
        message:
          type: string
          example: Cliente confirmou recebimento.
        edited:
          type: boolean
          example: false
        user:
          $ref: '#/components/schemas/commentUser'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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