## Update a comment **patch** `/v2/comments/{id}` Updates an existing comment by its unique identifier. You can update: - **content** - Comment text (HTML format) - **isPrivate** - Privacy status (admin-only visibility) - **isPinned** - Pinned status (displayed at top) - **inReview** - Moderation status ### Content Format Content should be formatted as HTML. For images: - External URLs in `img src` attributes are automatically pulled into our storage - Base64 encoded data URIs (`data:image/...`) are also supported and processed ### Permissions - Comment authors can update their own comment content - Admin permissions required for: - `isPrivate` - Requires `manage_comments_private` permission - `isPinned` - Requires `set_comment_pinned` permission - `inReview` - Requires `moderate_comments` permission - Updating other users' comments - Requires `moderate_comments` permission ### Response Returns the updated comment object with all fields populated. ### Errors - `400` - Invalid comment ID format or input - `403` - Not authorized to update this comment - `404` - Comment not found ### Path Parameters - `id: string` Comment unique identifier ### Header Parameters - `"Featurebase-Version": optional "2026-01-01.nova" or "2025-12-12.clover"` - `"2026-01-01.nova"` - `"2025-12-12.clover"` ### Body Parameters - `content: optional string` Comment content in HTML format - `createdAt: optional string` Update the creation date (useful for imports) - `downvotes: optional number` Set the downvotes count directly. Score will be recalculated as upvotes - downvotes. - `inReview: optional boolean` Whether the comment is pending moderation review - `isPinned: optional boolean` Whether the comment is pinned at the top - `isPrivate: optional boolean` Whether the comment is private (only visible to admins) - `upvotes: optional number` Set the upvotes count directly. Score will be recalculated as upvotes - downvotes. ### Returns - `Comment object { id, author, changelogId, 14 more }` - `id: string` Unique identifier - `author: object { id, name, profilePicture, type }` - `id: string` Author unique identifier - `name: string` Author display name - `profilePicture: string` Author profile picture URL - `type: "admin" or "customer" or "guest" or 3 more` Type of user who authored the comment - `"admin"` - `"customer"` - `"guest"` - `"integration"` - `"bot"` - `"lead"` - `changelogId: string` Changelog ID this comment belongs to - `content: string` Comment content in HTML format - `createdAt: string` ISO 8601 timestamp when created - `downvotes: number` Number of downvotes - `inReview: boolean` Whether the comment is in review - `isDeleted: boolean` Whether the comment is deleted - `isPinned: boolean` Whether the comment is pinned - `isPrivate: boolean` Whether the comment is private - `isSpam: boolean` Whether the comment is spam - `object: "comment"` Object type identifier - `"comment"` - `parentCommentId: string` Parent comment ID for replies, null for root comments - `postId: string` Post ID this comment belongs to - `score: number` Net score (upvotes - downvotes) - `updatedAt: string` ISO 8601 timestamp when updated - `upvotes: number` Number of upvotes ### Example ```http curl https://do.featurebase.app/v2/comments/$ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $FEATUREBASE_API_KEY" \ -d '{ "content": "

This is my updated comment.

", "createdAt": "2025-01-15T10:30:00.000Z", "downvotes": 2, "isPinned": true, "upvotes": 10 }' ``` #### Response ```json { "id": "507f1f77bcf86cd799439011", "author": { "id": "507f1f77bcf86cd799439011", "name": "John Doe", "profilePicture": "https://cdn.example.com/avatars/john.png", "type": "customer" }, "changelogId": "507f1f77bcf86cd799439013", "content": "

This is a great idea!

", "createdAt": "2023-12-12T00:00:00.000Z", "downvotes": 0, "inReview": false, "isDeleted": false, "isPinned": false, "isPrivate": false, "isSpam": false, "object": "comment", "parentCommentId": "507f1f77bcf86cd799439014", "postId": "507f1f77bcf86cd799439012", "score": 5, "updatedAt": "2023-12-13T00:00:00.000Z", "upvotes": 5 } ```