Skip to main content
POST
Add Comment Annotations
Use this API to add comment annotations to a document within an organization.
  • You can add comments on an elemement, text or page.
  • You can provide HTML or text content.
  • Additional filters can be applied using location IDs.

Endpoint

POST https://api.velt.dev/v2/commentannotations/add

Headers

x-velt-api-key
string
required
Your API key.
x-velt-auth-token
string
required

Body

Params

data
object
required

Example Requests

Add comment annotation by organizationId, documentId and location

Add comment annotation with user tagging

In this example, {{user_sarah_chen}} in the commentText will be replaced with “Sarah Chen” on the frontend, displaying as “Hey Sarah Chen, can you review this color scheme? I think we should use a darker shade for better contrast.”

Add comment annotation with permission verification

When verifyUserPermissions is enabled, the API verifies the user has access to the document before creating the comment annotation. If verification fails, the request will be rejected.

Add comment annotation with activity tracking

Add comment annotation with access context

Add an agent suggestion (finding)

Set type: "suggestion" and attach an agent block to the root comment (commentData[0]). The server generates the annotation-level agent block and stamps sourceType: "agent".
To attach a finding from an agent run through your own framework, use agentSource: "external" and supply your own agentName (and optionally agentId / executionId):

Add a private (restricted) comment annotation

Use visibility to limit who can see the annotation.

Response

Success Response

Failure Response