---
title: "Create a new comment"
method: POST
path: "/v1/comments"
tags: ["Comments"]
---

# Create a new comment

`POST /v1/comments`

Create a new comment in Comp AI. Create and manage collaboration comments on compliance entities such as tasks, policies, risks, vendors, and findings.

## Request body

- CreateCommentDto
  - `content` string, required — Content of the comment
  - `entityId` string, required — ID of the entity to comment on
  - `entityType` 'task' | 'vendor' | 'risk' | 'policy' | 'finding', required — Type of entity being commented on
  - `contextUrl` string — Optional URL of the page where the comment was created, used for deep-linking in notifications
  - `attachments` UploadAttachmentDto[] — Optional attachments to include with the comment
    - `fileName` string, required — Name of the file
    - `fileType` string, required — MIME type of the file
    - `fileData` string — Base64-encoded file contents. For the web UI / direct callers. AI/MCP clients should instead upload via /v1/uploads/presign (purpose=attachment) and pass `s3Key` — base64 through an LLM is impractically slow and times out. Provide exactly one of fileData or s3Key.
    - `s3Key` string — Key of a file already uploaded via /v1/uploads/presign (purpose=attachment). The server fetches the bytes from storage — no base64 needed. Provide exactly one of fileData or s3Key.
    - `description` string — Description of the attachment
    - `userId` string — User ID of the user uploading the attachment (required for API key auth, ignored for JWT auth)
  - `userId` string — User ID of the comment author (required for API key auth, ignored for JWT auth)

## Response `201`

Comment created successfully

- CommentResponseDto
  - `id` string, required — Unique identifier for the comment
  - `content` string, required — Comment content
  - `author` AuthorResponseDto, required
    - `id` string, required — User ID
    - `name` string, required — User name
    - `email` string, required — User email
    - `image` object, nullable, required — User profile image URL
    - `deactivated` boolean, nullable, required — Whether the user is deactivated
  - `attachments` AttachmentMetadataDto[], required — Attachment metadata (URLs generated on-demand)
    - `id` string, required — Unique identifier for the attachment
    - `name` string, required — Original filename
    - `type` string, required — File type/MIME type
    - `createdAt` string, date-time, required — Upload timestamp
  - `createdAt` string, date-time, required — Comment creation timestamp

---

[API](https://skmtc.net/trycompai/apis/comp-ai-api.md) · [All operations](https://skmtc.net/trycompai/apis/comp-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trycompai/comp-ai-api/revisions/726b9523fb22/schema)
