Skip to content

Create a new comment

POST
/v1/comments
curl --request POST \
--url https://api.varman.io/v1/comments \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "content": "This task needs to be completed by end of week", "entityId": "tsk_abc123def456", "entityType": "task", "contextUrl": "https://app.example.com/org_abc123/vendors/vnd_abc123?taskItemId=tki_abc123#task-items", "attachments": [ { "fileName": "document.pdf", "fileType": "application/pdf", "fileData": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==", "s3Key": "org_abc123/uploads/attachment/1700000000000-rbac-matrix.xlsx", "description": "Meeting notes from Q4 planning session", "userId": "usr_abc123def456" } ], "userId": "usr_abc123def456" }'

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

Media typeapplication/json
object
content
required

Content of the comment (plain text or serialized Tiptap JSON). Limited to 2000 characters of visible text; maxLength bounds the serialized payload size, not the visible text.

string
<= 50000 characters

Example

This task needs to be completed by end of week
entityId
required

ID of the entity to comment on

string

Example

tsk_abc123def456
entityType
required

Type of entity being commented on

string
Allowed values: task vendor risk policy finding

Example

task
contextUrl

Optional URL of the page where the comment was created, used for deep-linking in notifications

string
<= 2048 characters

Example

https://app.example.com/org_abc123/vendors/vnd_abc123?taskItemId=tki_abc123#task-items
attachments

Optional attachments to include with the comment

Array<object>
object
fileName
required

Name of the file

string
<= 255 characters

Example

document.pdf
fileType
required

MIME type of the file

string

Example

application/pdf
fileData

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.

string

Example

iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==
s3Key

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.

string

Example

org_abc123/uploads/attachment/1700000000000-rbac-matrix.xlsx
description

Description of the attachment

string
<= 500 characters

Example

Meeting notes from Q4 planning session
userId

User ID of the user uploading the attachment (required for API key auth, ignored for JWT auth)

string

Example

usr_abc123def456
userId

User ID of the comment author (required for API key auth, ignored for JWT auth)

string

Example

usr_abc123def456

Comment created successfully

Media typeapplication/json
object
id
required

Unique identifier for the comment

string
content
required

Comment content

string
author
required

Comment author information

object
id
required

User ID

string
name
required

User name

string
email
required

User email

string
image
required

User profile image URL

object
deactivated
required

Whether the user is deactivated

boolean
nullable
attachments
required

Attachment metadata (URLs generated on-demand)

Array<object>
object
id
required

Unique identifier for the attachment

string
name
required

Original filename

string
type
required

File type/MIME type

string
createdAt
required

Upload timestamp

string format: date-time
createdAt
required

Comment creation timestamp

string format: date-time

Example

{
"id": "cmt_abc123def456",
"content": "This task needs to be completed by end of week",
"author": {
"id": "usr_abc123def456",
"name": "John Doe",
"email": "john.doe@company.com",
"image": "https://example.com/avatar.jpg",
"deactivated": false
},
"attachments": [
{
"id": "att_abc123def456",
"name": "document.pdf",
"type": "application/pdf",
"createdAt": "2024-01-15T10:30:00Z"
}
],
"createdAt": "2024-01-15T10:30:00Z"
}