Skip to main content

Comments

Threaded comment system with inline anchoring support. Comments are organized in threads attached to specific positions within documents.

Base Path: /api/v1/comments Authentication: Required (Bearer Token) Tag: Comments


List Comment Threads

Retrieve all comment threads for a document.

GET /comments/documents/{documentId}/threads?status={status}

Path Parameters

ParameterTypeDescription
documentIdUUIDDocument ID

Query Parameters

ParameterTypeRequiredDefaultValuesDescription
statusStringNoallall, open, resolvedFilter by thread status

Response

{
"success": true,
"data": [
{
"id": "...",
"documentId": "...",
"workspaceId": "...",
"anchor": {
"blockId": "block-123",
"startOffset": 10,
"endOffset": 25,
"selectedText": "highlighted text"
},
"status": "open",
"resolvedAt": null,
"resolvedBy": null,
"comments": [
{
"id": "...",
"threadId": "...",
"userId": "...",
"userName": "John Doe",
"userAvatar": "https://...",
"content": "This needs revision",
"isEdited": false,
"createdAt": "2025-01-15T10:00:00Z",
"updatedAt": "2025-01-15T10:00:00Z"
}
],
"createdAt": "2025-01-15T10:00:00Z",
"updatedAt": "2025-01-15T10:00:00Z"
}
]
}

Response Type: ApiResponse<List<CommentThreadResponse>>


Create Comment Thread

Create a new comment thread anchored to a specific position in the document.

POST /comments/documents/{documentId}/threads

Path Parameters

ParameterTypeDescription
documentIdUUIDDocument ID

Request Body

{
"anchor": {
"blockId": "block-123",
"startOffset": 10,
"endOffset": 25,
"selectedText": "highlighted text"
},
"comment": {
"content": "This section needs more detail."
}
}
FieldTypeRequiredDescription
anchorObjectYesPosition info (blockId, offsets, text)
commentObjectYesInitial comment
comment.contentStringYesComment text (supports @mentions)

Response

Status: 201 Created Response Type: ApiResponse<CommentThreadResponse>


Resolve Thread

Mark a comment thread as resolved.

PUT /comments/threads/{threadId}/resolve

Path Parameters

ParameterTypeDescription
threadIdUUIDThread ID

Response Type: ApiResponse<CommentThreadResponse>


Reopen Thread

Reopen a previously resolved thread.

PUT /comments/threads/{threadId}/reopen

Path Parameters

ParameterTypeDescription
threadIdUUIDThread ID

Response Type: ApiResponse<CommentThreadResponse>


Delete Thread

Delete a comment thread and all its comments.

DELETE /comments/threads/{threadId}

Path Parameters

ParameterTypeDescription
threadIdUUIDThread ID

Response Type: ApiResponse<Void>


Add Comment to Thread

Add a reply comment to an existing thread.

POST /comments/threads/{threadId}/comments

Path Parameters

ParameterTypeDescription
threadIdUUIDThread ID

Request Body

{
"content": "I agree, let me fix this."
}
FieldTypeRequiredValidationDescription
contentStringYesNot blankComment text

Response

Status: 201 Created Response Type: ApiResponse<CommentResponse>


Update Comment

Edit an existing comment.

PUT /comments/{commentId}

Path Parameters

ParameterTypeDescription
commentIdUUIDComment ID

Request Body

{
"content": "Updated comment text"
}
FieldTypeRequiredValidationDescription
contentStringYesNot blankNew comment text

Response Type: ApiResponse<CommentResponse>

info

Only the comment author can edit their own comments. The isEdited flag will be set to true.


Delete Comment

Delete a comment from a thread.

DELETE /comments/{commentId}

Path Parameters

ParameterTypeDescription
commentIdUUIDComment ID

Response Type: ApiResponse<Void>