Get all comments for a post.
// Authenticated user
const res = await client.comment.list.$get({
postId: "post-123",
surface: "workspace" // or "public"
})
// Anonymous user
const res = await client.comment.list.$get({
postId: "post-123",
fingerprint: "browser-fingerprint",
surface: "public"
})
const { comments } = await res.json()
Type: Public Procedure
Browser fingerprint for anonymous vote status
“public” or “workspace” - affects internal comment visibility
Whether author is workspace owner
Internal Comments:
Only visible to workspace members
Shown when surface: "workspace" and user has access
Useful for private team discussions
Add a new comment to a post.
const res = await client.comment.create.$post({
postId: "post-123",
content: "Great idea! This would be very useful.",
parentId: "comment-456", // Optional: for replies
isInternal: false,
fingerprint: "browser-fingerprint" // For anonymous
})
const { comment } = await res.json()
Type: Public Procedure
Parent comment ID for nested replies
Mark as internal workspace note (requires membership)
Browser fingerprint for anonymous users
Authentication:
Private boards: Requires workspace membership
Public boards: Authenticated or anonymous (if allowed)
Internal comments: Requires workspace membership
Automatic Actions:
Auto-upvoted by author
Updates parent’s reply count
Updates post’s comment count
Parses @mentions and creates notifications
Logs activity
Mentions:
const res = await client.comment.create.$post({
postId: "post-123",
content: "@John Smith can you take a look at this?"
})
// Automatically creates notification for John Smith
Edit an existing comment.
const res = await client.comment.update.$post({
commentId: "comment-123",
content: "Updated comment text"
})
const { comment } = await res.json()
Type: Private Procedure
Permissions:
Only the comment author can edit their own comments
Sets isEdited: true and updates editedAt timestamp
Permanently delete a comment.
const res = await client.comment.delete.$post({
commentId: "comment-123"
})
const { success } = await res.json()
Type: Private Procedure
Permissions:
Comment author can delete their own comment
Workspace owner can delete any comment
Effects:
Hard deletes the comment
Updates parent reply count
Recalculates post comment count
Upvote or downvote a comment.
// Authenticated user
const res = await client.comment.vote.$post({
commentId: "comment-123",
voteType: "upvote" // or "downvote"
})
// Anonymous user
const res = await client.comment.vote.$post({
commentId: "comment-123",
voteType: "upvote",
fingerprint: "browser-fingerprint"
})
const { upvotes, downvotes, userVote } = await res.json()
Type: Public Procedure
Required for anonymous users
User’s current vote (“upvote”, “downvote”, or null)
Behavior:
Same vote type: Removes vote (toggle off)
Different vote type: Changes vote
No existing vote: Adds vote
Report a comment for moderation.
const res = await client.comment.report.$post({
commentId: "comment-123",
reason: "offensive",
description: "Contains inappropriate language"
})
Type: Private Procedure
Reason (spam, offensive, harassment, other)
Actions:
Creates report with “pending” status
Sends email to workspace owner
Logs activity with report count
Pin or unpin a comment (workspace owner only).
const res = await client.comment.pin.$post({
commentId: "comment-123",
isPinned: true
})
Type: Private Procedure
Permissions:
Only workspace owner can pin comments
Effect:
Pinned comments appear at the top of the comment list
Mention Notifications
List Mentions
Get mention notifications for current user.
const res = await client.comment.mentionsList.$get({
limit: 50
})
const { notifications } = await res.json()
Type: Private Procedure
Maximum number to return (1-100, default: 50)
Show notification properties
Count Unread Mentions
const res = await client.comment.mentionsCount.$get()
const { unread } = await res.json()
Type: Private Procedure
Mark Mention as Read
const res = await client.comment.mentionsMarkRead.$post({
id: "mention-123"
})
Type: Private Procedure
Mark All Mentions as Read
const res = await client.comment.mentionsMarkAllRead.$post()
Type: Private Procedure
// 1. Load existing comments
const listRes = await client.comment.list.$get({
postId: "post-123",
surface: "workspace"
})
const { comments } = await listRes.json()
// 2. Create a new comment with mention
const createRes = await client.comment.create.$post({
postId: "post-123",
content: "@Alice Johnson what do you think about this approach?",
isInternal: false
})
const { comment } = await createRes.json()
// Automatically creates mention notification for Alice
// 3. Vote on a comment
const voteRes = await client.comment.vote.$post({
commentId: comment.id,
voteType: "upvote"
})
const { upvotes, userVote } = await voteRes.json()
// 4. Create a reply
const replyRes = await client.comment.create.$post({
postId: "post-123",
content: "I agree with this suggestion!",
parentId: comment.id // Reply to the comment
})
// 5. Check mentions (Alice's perspective)
const mentionsRes = await client.comment.mentionsList.$get()
const { notifications } = await mentionsRes.json()
// 6. Mark mention as read
if (notifications.length > 0) {
await client.comment.mentionsMarkRead.$post({
id: notifications[0].id
})
}