Comments allow you to add notes and discussions to individual records in your NocoDB tables. The Comments API provides endpoints to create, read, update, and delete comments.
Retrieve comments for a specific row or table.
GET /api/v1/db/meta/comments
curl -X GET "https://app.nocodb.com/api/v1/db/meta/comments?fk_model_id={modelId}&row_id={rowId}" \
-H "xc-auth: YOUR_API_TOKEN"
Model/Table ID to fetch comments from
Row ID to fetch comments for
Array of comment objectsRow ID this comment belongs to
Comment text content (max 3000 characters)
User ID of the comment creator
Email of the comment creator
User ID who resolved the comment (if applicable)
Email of the user who resolved the comment
Parent Comment ID for threaded comments
Foreign Key to Model/Table
Comment creation timestamp
Comment last update timestamp
Whether the comment has been deleted
Response Example
{
"list": [
{
"id": "cmt_abc123",
"row_id": "rec0Adp9PMG9o7uJy",
"comment": "This is a comment on the record",
"created_by": "usr_xyz789",
"created_by_email": "user@example.com",
"fk_model_id": "md_ehn5izr99m7d45",
"created_at": "2023-03-03T10:15:30Z",
"updated_at": "2023-03-03T10:15:30Z",
"is_deleted": false
}
],
"pageInfo": {
"totalRows": 1,
"page": 1,
"pageSize": 25,
"isFirstPage": true,
"isLastPage": true
}
}
Add a new comment to a row.
POST /api/v1/db/meta/comments
curl -X POST "https://app.nocodb.com/api/v1/db/meta/comments" \
-H "xc-auth: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fk_model_id": "md_ehn5izr99m7d45",
"row_id": "rec0Adp9PMG9o7uJy",
"comment": "This is a new comment"
}'
Model/Table ID where the row exists
Row ID to add the comment to
Comment text content (max 3000 characters)
Response Example
{
"id": "cmt_new123",
"row_id": "rec0Adp9PMG9o7uJy",
"comment": "This is a new comment",
"created_by": "usr_xyz789",
"created_by_email": "user@example.com",
"fk_model_id": "md_ehn5izr99m7d45",
"created_at": "2023-03-03T14:20:00Z",
"updated_at": "2023-03-03T14:20:00Z",
"is_deleted": false
}
Update an existing comment.
PATCH /api/v1/db/meta/comment/{commentId}
curl -X PATCH "https://app.nocodb.com/api/v1/db/meta/comment/{commentId}" \
-H "xc-auth: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"comment": "Updated comment text",
"fk_model_id": "md_ehn5izr99m7d45"
}'
Unique Comment ID to update
Updated comment text (max 3000 characters)
Model/Table ID (for validation)
Response Example
{
"id": "cmt_abc123",
"row_id": "rec0Adp9PMG9o7uJy",
"comment": "Updated comment text",
"created_by": "usr_xyz789",
"created_by_email": "user@example.com",
"fk_model_id": "md_ehn5izr99m7d45",
"created_at": "2023-03-03T10:15:30Z",
"updated_at": "2023-03-03T14:25:00Z",
"is_deleted": false
}
Delete a comment from a row.
DELETE /api/v1/db/meta/comment/{commentId}
curl -X DELETE "https://app.nocodb.com/api/v1/db/meta/comment/{commentId}" \
-H "xc-auth: YOUR_API_TOKEN"
Unique Comment ID to delete
Whether the deletion was successful
Get the comment count for one or more rows.
GET /api/v1/db/meta/comments/count
curl -X GET "https://app.nocodb.com/api/v1/db/meta/comments/count?fk_model_id={modelId}&ids[]={rowId1}&ids[]={rowId2}" \
-H "xc-auth: YOUR_API_TOKEN"
Array of Row IDs to count comments for
Response Example
{
"rec0Adp9PMG9o7uJy": 5,
"rec1Bdq0QNH0p8vKz": 3,
"rec2Cdr1ROI1q9wLa": 0
}
Threading
Comments support threading through the parent_comment_id field. To create a reply to an existing comment:
curl -X POST "https://app.nocodb.com/api/v1/db/meta/comments" \
-H "xc-auth: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fk_model_id": "md_ehn5izr99m7d45",
"row_id": "rec0Adp9PMG9o7uJy",
"comment": "Reply to the comment",
"parent_comment_id": "cmt_abc123"
}'
Comments can be resolved by setting the resolved_by field. This is useful for tracking which comments have been addressed.
Mentions
You can mention users in comments using @ syntax. Mentioned users may receive notifications depending on their preferences.
Soft Delete
Deleted comments are soft-deleted by default, setting is_deleted to true rather than removing them from the database. This preserves comment history and threading.
Best Practices
- Keep comments concise and relevant
- Maximum length is 3000 characters
- Use multiple comments for lengthy discussions
Permissions
- Users can only edit or delete their own comments
- Table/view permissions apply to comment visibility
- Admins can manage all comments
- Use the count endpoint to efficiently check comment counts for multiple rows
- Implement pagination when fetching comments for rows with many comments
- Consider caching comment counts for frequently accessed records
Use Cases
Collaborative Review
// Add review comment
await fetch('https://app.nocodb.com/api/v1/db/meta/comments', {
method: 'POST',
headers: {
'xc-auth': 'YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
fk_model_id: 'md_tasks',
row_id: 'rec_task123',
comment: 'Reviewed and approved. Ready for deployment.'
})
});
Issue Tracking
// Add issue resolution comment
await fetch('https://app.nocodb.com/api/v1/db/meta/comments', {
method: 'POST',
headers: {
'xc-auth': 'YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
fk_model_id: 'md_issues',
row_id: 'rec_issue456',
comment: 'Bug fixed in commit abc123. Closing issue.'
})
});
Customer Feedback
// Log customer feedback
await fetch('https://app.nocodb.com/api/v1/db/meta/comments', {
method: 'POST',
headers: {
'xc-auth': 'YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
fk_model_id: 'md_customers',
row_id: 'rec_customer789',
comment: 'Customer requested feature X. Priority: High'
})
});