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

# Add Comment to Task

> Add a comment to a task and notify relevant team members

## Overview

Add a comment to a task. Comments can be used to discuss task details, provide updates, or ask questions. When a comment is added, relevant team members (watchers, assignee, reporter, and project managers) are automatically notified via email and push notifications.

## Request Body

<ParamField body="comment" type="string" required>
  The comment text. Supports HTML formatting.

  **Example:** `"This task is progressing well. I've completed the first phase."`
</ParamField>

<ParamField body="task_id" type="integer" required>
  The ID of the task to add the comment to. Can also be provided as `refrence_id`.

  **Example:** `456`
</ParamField>

<ParamField body="watchersIds" type="array">
  Array of user IDs to add as watchers to the task when commenting. These users will receive notifications about future updates.

  **Example:** `[5, 7, 9]`
</ParamField>

## Example Request

```bash theme={null}
```


## OpenAPI

````yaml POST /api/v3/task/comment/add
openapi: 3.1.0
info:
  title: Thareja API Documentation
  description: A comprehensive API for team and task management
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.thareja.ai
security:
  - bearerAuth: []
tags:
  - name: Teams
    description: Team management endpoints
  - name: Tasks
    description: Task management endpoints
  - name: Projects
    description: Project management endpoints
  - name: Comments
    description: Comment management endpoints
paths:
  /api/v3/task/comment/add:
    post:
      tags:
        - Comments
      summary: Add comment to task
      description: Add a comment to a task and notify relevant team members
      operationId: addTaskComment
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewComment'
        required: true
      responses:
        '200':
          description: Comment added successfully
          content:
            application/json: {}
        '400':
          description: Bad request - Missing required fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden - Empty comment
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: comment can't be null!
        '404':
          description: Task not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    NewComment:
      required:
        - comment
      type: object
      properties:
        comment:
          description: The comment text (supports HTML)
          type: string
          example: This task is progressing well. I've completed the first phase.
        task_id:
          description: The ID of the task to add the comment to
          type: integer
          format: int64
          example: 456
        refrence_id:
          description: Alternative field for task_id
          type: integer
          format: int64
          example: 456
        type:
          description: The type of comment
          type: string
          example: update
        watchersIds:
          description: Array of user IDs to add as watchers
          type: array
          items:
            type: integer
            format: int64
          example:
            - 5
            - 7
            - 9
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
          example: 400
        message:
          type: string
          example: Invalid request parameters
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````