Skip to main content
POST
Create a new comment

Authorizations

X-API-Key
string
header
required

API key for authentication

Body

application/json
content
string
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.

Maximum string length: 50000
Example:

"This task needs to be completed by end of week"

entityId
string
required

ID of the entity to comment on

Example:

"tsk_abc123def456"

entityType
enum<string>
required

Type of entity being commented on

Available options:
task,
vendor,
risk,
policy,
finding
Example:

"task"

contextUrl
string

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

Maximum string length: 2048
Example:

"https://app.trycomp.ai/org_abc123/vendors/vnd_abc123?taskItemId=tki_abc123#task-items"

attachments
object[]

Optional attachments to include with the comment

userId
string
deprecated

Deprecated. Accepted for backwards compatibility and ignored: the author is resolved from the authenticated credential (the signed-in user, or for an API key the member who created it, else the organization owner).

Example:

"usr_abc123def456"

Response

201 - application/json

Comment created successfully

id
string
required

Unique identifier for the comment

Example:

"cmt_abc123def456"

content
string
required

Comment content

Example:

"This task needs to be completed by end of week"

author
object
required

Comment author information

attachments
object[]
required

Attachment metadata (URLs generated on-demand)

createdAt
string<date-time>
required

Comment creation timestamp

Example:

"2024-01-15T10:30:00Z"

editedAt
string<date-time> | null
required

When the author last changed the content; null if the comment was never edited

Example:

null