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

# Lista comentários de uma tarefa

> Lista comentários de uma tarefa com controle de acesso.
Use `type=internal` para comentários internos e `type=client` para comentários de cliente.
Usuários externos/clientes recebem somente comentários de cliente, mesmo se informarem outro tipo.




## OpenAPI

````yaml /api-reference/tarefas.yaml get /v2/comments/{taskId}
openapi: 3.0.0
info:
  title: Tarefy API
  description: >-
    Tarefy REST API — platform for team management, tasks, culture, and
    performance.


    Versioned endpoints are available under `/v2/...`. Authenticate with a
    Bearer JWT in the `Authorization` header.


    To get started, see the [authentication guide](/authentication) and the
    [quickstart](/quickstart).
  version: 2.0.0
  contact:
    name: Tarefy Support
    email: suporte@tarefy.com
    url: https://tarefy.com
  license:
    name: Proprietary
servers:
  - url: https://app.tarefy.com/nodeapi
    description: Production
security:
  - bearerAuth: []
tags: []
paths:
  /v2/comments/{taskId}:
    get:
      tags:
        - Comments
      summary: Lista comentários de uma tarefa
      description: >
        Lista comentários de uma tarefa com controle de acesso.

        Use `type=internal` para comentários internos e `type=client` para
        comentários de cliente.

        Usuários externos/clientes recebem somente comentários de cliente, mesmo
        se informarem outro tipo.
      parameters:
        - in: path
          name: taskId
          required: true
          description: ID interno da tarefa no banco.
          schema:
            type: integer
            example: 12345
        - in: query
          name: type
          required: false
          schema:
            type: string
            enum:
              - all
              - internal
              - client
            default: all
          description: >-
            Tipo de comentário a retornar. `internal` retorna comentários
            internos; `client` retorna comentários visíveis ao cliente.
      responses:
        '200':
          description: Comentários retornados com sucesso
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCommentsListResponse'
              examples:
                all:
                  summary: Retorno com comentários internos e de cliente
                  value:
                    status: true
                    data:
                      comments:
                        - id: 9801
                          content: <p>Comentário interno da equipe.</p>
                          type: null
                          isClient: false
                          isClientVisible: false
                          createdAt: '2026-06-02T13:30:00.000Z'
                          updatedAt: '2026-06-02T13:30:00.000Z'
                          editedAt: null
                          mentions: 12, 34
                          author:
                            id: 7
                            name: Douglas Araujo
                            email: douglas@tarefy.com
                            profilePhoto: null
                          attachments:
                            - id: 501
                              name: briefing.pdf
                              file: https://signed-url.example.com/briefing.pdf
                              createdAt: '2026-06-02T13:31:00.000Z'
                          hasRead: true
                        - id: 9802
                          content: <p>Comentário enviado pelo cliente.</p>
                          type: null
                          isClient: true
                          isClientVisible: true
                          createdAt: '2026-06-02T14:00:00.000Z'
                          updatedAt: '2026-06-02T14:00:00.000Z'
                          editedAt: null
                          mentions: null
                          author:
                            id: 44
                            name: Cliente Exemplo
                            email: cliente@example.com
                            profilePhoto: null
                          attachments: []
                          hasRead: false
                      internalComments:
                        - id: 9801
                          content: <p>Comentário interno da equipe.</p>
                          type: null
                          isClient: false
                          isClientVisible: false
                          createdAt: '2026-06-02T13:30:00.000Z'
                          updatedAt: '2026-06-02T13:30:00.000Z'
                          editedAt: null
                          mentions: 12, 34
                          author:
                            id: 7
                            name: Douglas Araujo
                            email: douglas@tarefy.com
                            profilePhoto: null
                          attachments: []
                          hasRead: true
                      clientComments:
                        - id: 9802
                          content: <p>Comentário enviado pelo cliente.</p>
                          type: null
                          isClient: true
                          isClientVisible: true
                          createdAt: '2026-06-02T14:00:00.000Z'
                          updatedAt: '2026-06-02T14:00:00.000Z'
                          editedAt: null
                          mentions: null
                          author:
                            id: 44
                            name: Cliente Exemplo
                            email: cliente@example.com
                            profilePhoto: null
                          attachments: []
                          hasRead: false
                      total: 2
                internal:
                  summary: Retorno filtrado por comentários internos
                  value:
                    status: true
                    data:
                      comments:
                        - id: 9801
                          content: <p>Comentário interno da equipe.</p>
                          type: null
                          isClient: false
                          isClientVisible: false
                          createdAt: '2026-06-02T13:30:00.000Z'
                          updatedAt: '2026-06-02T13:30:00.000Z'
                          editedAt: null
                          mentions: 12, 34
                          author:
                            id: 7
                            name: Douglas Araujo
                            email: douglas@tarefy.com
                            profilePhoto: null
                          attachments: []
                          hasRead: true
                      total: 1
                client:
                  summary: Retorno filtrado por comentários de cliente
                  value:
                    status: true
                    data:
                      comments:
                        - id: 9802
                          content: <p>Comentário enviado pelo cliente.</p>
                          type: null
                          isClient: true
                          isClientVisible: true
                          createdAt: '2026-06-02T14:00:00.000Z'
                          updatedAt: '2026-06-02T14:00:00.000Z'
                          editedAt: null
                          mentions: null
                          author:
                            id: 44
                            name: Cliente Exemplo
                            email: cliente@example.com
                            profilePhoto: null
                          attachments: []
                          hasRead: false
                      total: 1
components:
  schemas:
    TaskCommentsListResponse:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: boolean
          example: true
        data:
          type: object
          required:
            - comments
            - total
          properties:
            comments:
              type: array
              description: >-
                Lista de comentários retornada para o filtro solicitado. Com
                `type=all`, contém internos e clientes juntos.
              items:
                $ref: '#/components/schemas/TaskComment'
            internalComments:
              type: array
              description: Presente quando `type=all`; contém comentários internos.
              items:
                $ref: '#/components/schemas/TaskComment'
            clientComments:
              type: array
              description: Presente quando `type=all`; contém comentários de cliente.
              items:
                $ref: '#/components/schemas/TaskComment'
            total:
              type: integer
              description: Total de comentários retornados em `comments`.
              example: 2
        message:
          type: string
    TaskComment:
      type: object
      required:
        - id
        - content
        - isClient
        - isClientVisible
        - createdAt
      properties:
        id:
          type: integer
          example: 9801
        content:
          type: string
          description: Conteúdo HTML do comentário.
          example: <p>Comentário interno da equipe.</p>
        type:
          type: string
          nullable: true
          description: >-
            Tipo técnico do comentário, por exemplo `system`; comentários
            normais costumam retornar null.
          example: null
        isClient:
          type: boolean
          description: Indica se é comentário de cliente.
          example: false
        isClientVisible:
          type: boolean
          description: Indica se o comentário é visível ao cliente.
          example: false
        createdAt:
          type: string
          format: date-time
          example: '2026-06-02T13:30:00.000Z'
        updatedAt:
          type: string
          format: date-time
          nullable: true
          example: '2026-06-02T13:30:00.000Z'
        editedAt:
          type: string
          format: date-time
          nullable: true
          example: null
        mentions:
          type: string
          nullable: true
          description: IDs de usuários mencionados separados por vírgula.
          example: 12, 34
        author:
          $ref: '#/components/schemas/CommentAuthor'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/CommentAttachment'
        hasRead:
          type: boolean
          description: Indica se o usuário autenticado já leu esse comentário.
          example: true
    CommentAuthor:
      type: object
      nullable: true
      properties:
        id:
          type: integer
        name:
          type: string
        email:
          type: string
          nullable: true
        profilePhoto:
          type: string
          nullable: true
    CommentAttachment:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        file:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        JWT token obtained from `/v2/auth/login`. Send it in the header:
        `Authorization: Bearer <your_token>`

````