Create a new comment
POST/v2/comments
Creates a new comment or reply to an existing comment.
You can create a comment for a post or changelog. Comments support:
- HTML content (images are automatically uploaded to our storage)
- Threading (replies via
parentCommentId) - Privacy controls (private comments visible only to admins)
- Author attribution (post on behalf of users)
Required Fields
content- Comment content in HTML formatpostIdORchangelogId- One is required to specify the target
Optional Fields
parentCommentId- Create a reply to an existing commentisPrivate- Make comment visible only to admins (default: false)sendNotification- Notify voters about the comment (default: true)author- Post comment under a specific user (uses authenticated user if not provided)createdAt- Backdate creation (useful for imports)
Author Object
The author field supports multiple identification methods:
id- Featurebase user ID (direct reference)userId- External user ID from your system (via SSO)email- Email address (finds existing or creates new user)name- Display name (used with email for new users)profilePicture- Profile picture URL
If no author is provided, the comment is posted under the authenticated user.
Content Format
Content should be formatted as HTML. For images:
- External URLs in
img srcattributes are automatically pulled into our storage - Base64 encoded data URIs (
data:image/...) are also supported and processed
Response
Returns the created comment object with all fields populated, including:
id- Unique comment identifierauthor- Author information- Voting stats and timestamps
Errors
400- Invalid input (missing required fields, invalid IDs)403- Commenting disabled or not authorized404- Post/changelog not found or parent comment not found
Create a new comment
curl https://do.featurebase.app/v2/comments \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $FEATUREBASE_API_KEY" \
-d '{
"content": "<p>This is a great idea!</p>",
"changelogId": "507f1f77bcf86cd799439012",
"createdAt": "2025-01-15T10:30:00.000Z",
"parentCommentId": "507f1f77bcf86cd799439013",
"postId": "507f1f77bcf86cd799439011",
"sendNotification": true,
"upvotes": 5
}'{
"id": "507f1f77bcf86cd799439011",
"author": {
"id": "507f1f77bcf86cd799439011",
"name": "John Doe",
"profilePicture": "https://cdn.example.com/avatars/john.png",
"type": "customer"
},
"changelogId": "507f1f77bcf86cd799439013",
"content": "<p>This is a great idea!</p>",
"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
}Returns Examples
{
"id": "507f1f77bcf86cd799439011",
"author": {
"id": "507f1f77bcf86cd799439011",
"name": "John Doe",
"profilePicture": "https://cdn.example.com/avatars/john.png",
"type": "customer"
},
"changelogId": "507f1f77bcf86cd799439013",
"content": "<p>This is a great idea!</p>",
"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
}