Create a new comment
const url = 'https://api.varman.io/v1/comments';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"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"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
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.
Example
This task needs to be completed by end of weekID of the entity to comment on
Example
tsk_abc123def456Type of entity being commented on
Example
taskOptional URL of the page where the comment was created, used for deep-linking in notifications
Example
https://app.example.com/org_abc123/vendors/vnd_abc123?taskItemId=tki_abc123#task-itemsOptional attachments to include with the comment
object
Name of the file
Example
document.pdfMIME type of the file
Example
application/pdfBase64-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.
Example
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==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.
Example
org_abc123/uploads/attachment/1700000000000-rbac-matrix.xlsxDescription of the attachment
Example
Meeting notes from Q4 planning sessionUser ID of the user uploading the attachment (required for API key auth, ignored for JWT auth)
Example
usr_abc123def456User ID of the comment author (required for API key auth, ignored for JWT auth)
Example
usr_abc123def456Responses
Section titled “Responses”Comment created successfully
object
Unique identifier for the comment
Comment content
Comment author information
object
User ID
User name
User email
User profile image URL
object
Whether the user is deactivated
Attachment metadata (URLs generated on-demand)
object
Unique identifier for the attachment
Original filename
File type/MIME type
Upload timestamp
Comment creation timestamp
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"}