---
title: "Add a comment"
method: POST
path: "/tasks/{taskId}/comments"
tags: ["Comments"]
---

# Add a comment

`POST /tasks/{taskId}/comments`

## Request

- Base URL: `https://tasg.app/api/v1`
- URL: `https://tasg.app/api/v1/tasks/{taskId}/comments`
- Auth: HTTP bearer

Any project member (including viewers) may comment. Mentioned users who are not project members are silently dropped; valid mentions are notified immediately, other watchers via digest. The commenter auto-watches the task.

## Path parameters

- `taskId` string, uuid, required

## Request body

- object
  - `content` string, required
  - `mentions` string[]: User ids to @mention.

## Response `201`

Created.

- object
  - `comment` Comment, required
    - `id` string, uuid, required
    - `task_id` string, uuid, required
    - `author_id` string, uuid, required
    - `author` object, nullable
      - `id` string, uuid, required
      - `full_name` string, required
      - `avatar_url` string, uri, nullable
    - `content` string, required
    - `mentions` string[], required: User ids mentioned. Non-members are silently dropped on create.
    - `edited` boolean, required
    - `attachments` Attachment[]: Only present on GET /tasks/{id}.
      - `id` string, uuid, required
      - `task_id` string, uuid, required
      - `comment_id` string, uuid, nullable
      - `filename` string, required
      - `file_size` integer, required: Bytes.
      - `mime_type` string, required
      - `url` string, required: Relative download path (`/uploads/…`); requires the same Authorization header.
      - `uploaded_by` string, uuid, required
      - `created_at` string, date-time, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `400`: Validation failed: the body or query did not match the schema, or a business rule was violated. `error` says which.
- `401`: Missing, invalid, expired or revoked credentials.
- `403`: Authenticated, but not allowed: not a member, insufficient project role or the API token lacks the required scope.
- `404`: Not found, or not visible to the caller (tenancy is enforced: foreign resources look identical to missing ones).
- `429`: Rate limited. Back off and retry after the window in the `RateLimit-*` headers.

---

[API](https://skmtc.dev/tasg/apis/tasg-api.md) · [All operations](https://skmtc.dev/tasg/apis/tasg-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tasg/apis/tasg-api/revisions/cd2a1dbaf5cf?raw)
