Skip to main content
POST
Get Comment Annotations
Use this API to retrieve comment annotations from a document within an organization. Additional filters can be applied using location IDs, annotation IDs, or user IDs.
Prior to using this API, you must:
  • Enable advanced queries option in the console
  • Deploy v4 series of the Velt SDK.

Endpoint

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

Headers

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

Body

Params

data
object
required

Example Requests

1. Get annotations by organizationId and documentId

2. Get annotations by organizationId and documentIds grouped by documentId

3. Get annotations by organizationId, documentId, and locationIds

4. Get annotations by organizationId, documentId, locationIds, and userIds

5. Get annotations by organizationId, documentId, and userIds

6. Get annotations by organizationId, documentId, and annotationIds

7. Get annotations by organizationId, documentId, locationIds, and annotationIds

8. Get annotations by organizationId, statusIds, updatedAfter, and updatedBefore

9. Get annotations by organizationId, folderId

10. Get agent annotations by organizationId, documentId, and agentId

Agent annotations in the response carry type: "suggestion" and sourceType: "agent" at the annotation root, the annotation-root agent block, and the agent block on the agent-authored comment (comments[].agent). Both agent blocks are returned lean — only the internal agentFields filter tokens are omitted (see Response Field Notes below).

Response

Response Field Notes:
  • reactionAnnotationIds: Array of reaction annotation IDs (strings) attached to a comment.
  • reactionAnnotations: Array of full reaction annotation objects attached to a comment. Each reaction includes the icon, fromUsers (the users who reacted), location, locationId, commentAnnotationId, context, type, annotationId, and lastUpdated.
  • viewedBy: This field is not currently returned by this endpoint.
  • createdAt and lastUpdated: Timestamps are returned in milliseconds since epoch for annotations and reactions, and in ISO 8601 format for comments.
  • type: Annotation kind, either comment (a regular collaboration comment) or suggestion (an agent-produced finding).
  • sourceType: How the annotation/comment was created. rest-api for annotations created via this REST API, or agent for agent-authored annotations and comments.
  • agent: Returned at the annotation root (for agent-authored annotations) and on each agent-authored comment (comments[].agent). Contains agentId, agentType (built-in / custom / external), agentSource (velt / external), executionId, agentName, url, and the reason finding object (title, description, severity, findingType, etc.). The internal agentFields filter tokens are not returned on either block.
  • suggestion: Lifecycle object present only when type is suggestion, e.g. { "status": "pending" }. status is one of pending, accepted, or rejected.
  • visibilityConfig: Visibility of the annotation, e.g. { "type": "public" }. type is one of public, organizationPrivate, or restricted.
  • context.access / context.accessFields: Access control metadata for the annotation (e.g. { "default": "velt" }). When visibility is set on creation, the resolved access tokens appear in context.accessFields.
  • hasDraftComments: Boolean indicating whether the annotation has any draft comments.

Success Response with single documentId

Success Response with multiple documentIds with groupByDocumentId

Failure Response