Skip to main content

Create Comment

Create a new comment on a note. Supports nested/threaded comments through the parent_comment parameter.

Headers

Authorization
string
required
Bearer token for authentication

Body Parameters

notes_id
string
required
The ID of the note to comment on
comment
string
required
The text content of the comment
parent_comment
number
Optional ID of parent comment for creating nested replies

Response

message
string
Success message
data
object
The created comment object
data.id
number
Unique identifier for the comment
data.text
string
The comment text
data.noteId
number
ID of the note this comment belongs to
data.userId
number
ID of the user who created the comment
data.parentCommentId
number | null
ID of parent comment if this is a reply, null otherwise
data.createdAt
string
Timestamp when comment was created
data.updatedAt
string
Timestamp when comment was last updated
curl -X POST https://api.noteverse.com/api/notes/comments \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "notes_id": "123",
    "comment": "Great note! Very helpful."
  }'

Response Example

{
  "message": "Comment created",
  "data": {
    "id": 789,
    "text": "Great note! Very helpful.",
    "noteId": 123,
    "userId": 42,
    "parentCommentId": null,
    "createdAt": "2026-03-03T10:30:00.000Z",
    "updatedAt": "2026-03-03T10:30:00.000Z"
  }
}

Error Responses

error
string
Error message
statusCode
number
HTTP status code
400 Bad Request - Missing note ID
{
  "error": "Note id is required",
  "statusCode": 400
}
400 Bad Request - Authentication failure
{
  "error": "Error creating comment",
  "statusCode": 400
}

Get Comments

Retrieve all comments for a specific note, organized in a threaded/nested structure.

Headers

Authorization
string
required
Bearer token for authentication

Query Parameters

note_id
string
required
The ID of the note to fetch comments for

Response

message
string
Success message
data
array
Array of top-level comments with nested replies
data[].id
number
Unique identifier for the comment
data[].text
string
The comment text
data[].noteId
number
ID of the note this comment belongs to
data[].userId
number
ID of the user who created the comment
data[].parentCommentId
number | null
Always null for top-level comments
data[].user
object
User information
data[].user.id
number
User ID
data[].user.email
string
User email
data[].user.username
string
Username
data[].replies
array
Nested array of reply comments (same structure as parent)
data[].createdAt
string
Timestamp when comment was created
data[].updatedAt
string
Timestamp when comment was last updated
curl -X GET "https://api.noteverse.com/api/notes/comments?note_id=123" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response Example

{
  "message": "Comments found",
  "data": [
    {
      "id": 789,
      "text": "Great note! Very helpful.",
      "noteId": 123,
      "userId": 42,
      "parentCommentId": null,
      "user": {
        "id": 42,
        "email": "[email protected]",
        "username": "johndoe"
      },
      "replies": [
        {
          "id": 790,
          "text": "I agree!",
          "noteId": 123,
          "userId": 43,
          "parentCommentId": 789,
          "user": {
            "id": 43,
            "email": "[email protected]",
            "username": "janedoe"
          },
          "replies": [],
          "createdAt": "2026-03-03T10:35:00.000Z",
          "updatedAt": "2026-03-03T10:35:00.000Z"
        }
      ],
      "createdAt": "2026-03-03T10:30:00.000Z",
      "updatedAt": "2026-03-03T10:30:00.000Z"
    }
  ]
}
Comments are returned in a nested structure where replies contain all child comments. This allows for infinite nesting depth in threaded discussions.

Error Responses

400 Bad Request - Missing note ID
{
  "error": "Note id is required",
  "statusCode": 400
}
400 Bad Request - Authentication failure
{
  "error": "Error fetching comments",
  "statusCode": 400
}

Build docs developers (and LLMs) love