Skip to content

Comments

Comments can be anchored to specific text ranges in a document, support threading via replies, and can be resolved when addressed.

{
"id": "comment-uuid",
"document_id": "doc-uuid",
"author_id": "user-uuid",
"parent_id": null,
"body": "This section needs more detail.",
"anchor_text": "Introduction",
"anchor_start": 0,
"anchor_end": 12,
"anchor_context": "# Introduction\n\nThis document covers...",
"resolved": false,
"resolved_at": null,
"resolved_by": null,
"created_at": "2026-03-13T12:00:00.000Z",
"updated_at": "2026-03-13T12:00:00.000Z",
"author": {
"id": "user-uuid",
"display_name": "Jane Doe",
"avatar_url": null
}
}
FieldTypeDescription
idUUIDComment identifier
document_idUUIDParent document
author_idUUID or nullComment author (null for anonymous share link users)
parent_idUUID or nullParent comment ID for threaded replies
bodystringComment text
anchor_textstring or nullThe highlighted text this comment is anchored to
anchor_startint or nullCharacter offset start in the markdown
anchor_endint or nullCharacter offset end in the markdown
anchor_contextstring or nullSurrounding paragraph for context
resolvedbooleanWhether the comment has been resolved
resolved_atISO 8601 or nullWhen it was resolved
resolved_byUUID or nullWho resolved it
authorobjectEmbedded author profile

GET /api/documents/:id/comments

Returns all comments on a document, sorted by created_at ascending.

Terminal window
curl https://notebind.com/api/documents/DOC_ID/comments \
-H "Authorization: Bearer nb_sk_YOUR_KEY"
{
"data": [
{
"id": "comment-uuid",
"body": "Great introduction!",
"anchor_text": "Hello World",
"anchor_start": 2,
"anchor_end": 13,
"resolved": false,
"parent_id": null,
"author": { "display_name": "Jane", "avatar_url": null },
"created_at": "2026-03-13T12:00:00.000Z"
}
],
"error": null
}

Any share token (view, comment, or edit) can list comments:

Terminal window
curl "https://notebind.com/api/documents/DOC_ID/comments?share_token=TOKEN"

POST /api/documents/:id/comments
FieldTypeRequiredDescription
bodystringYesComment text
parent_idUUIDNoParent comment ID for replies
anchor_textstringNoHighlighted text
anchor_startintNoCharacter offset start
anchor_endintNoCharacter offset end
anchor_contextstringNoSurrounding paragraph
Terminal window
curl -X POST https://notebind.com/api/documents/DOC_ID/comments \
-H "Authorization: Bearer nb_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"body": "This paragraph needs more detail about the API.",
"anchor_text": "the API",
"anchor_start": 45,
"anchor_end": 52
}'

Returns the created comment with embedded author.

Comment and edit share tokens can create comments:

Terminal window
curl -X POST "https://notebind.com/api/documents/DOC_ID/comments?share_token=COMMENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"body": "This looks good!"}'

To reply to an existing comment, include parent_id:

Terminal window
curl -X POST https://notebind.com/api/documents/DOC_ID/comments \
-H "Authorization: Bearer nb_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"body": "Good point, I will fix this.", "parent_id": "PARENT_COMMENT_ID"}'

GET /api/documents/:id/comments/:cid

Returns a single comment. Requires document owner or comment author access.

Terminal window
curl https://notebind.com/api/documents/DOC_ID/comments/COMMENT_ID \
-H "Authorization: Bearer nb_sk_YOUR_KEY"

PATCH /api/documents/:id/comments/:cid
FieldTypeDescription
bodystringUpdated comment text (author only)
resolvedbooleanResolve or unresolve (owner, author, or share users)
Terminal window
curl -X PATCH https://notebind.com/api/documents/DOC_ID/comments/COMMENT_ID \
-H "Authorization: Bearer nb_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"resolved": true}'
{
"data": {
"id": "comment-uuid",
"body": "...",
"resolved": true,
"resolved_at": "2026-03-13T12:10:00.000Z",
"resolved_by": "user-uuid"
},
"error": null
}

Only the comment author can edit the body:

Terminal window
curl -X PATCH https://notebind.com/api/documents/DOC_ID/comments/COMMENT_ID \
-H "Authorization: Bearer nb_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"body": "Updated comment text"}'
ActionDocument ownerComment authorShare user (comment/edit)
Edit bodyNoYesNo
ResolveYesYesYes
UnresolveYesYesYes

DELETE /api/documents/:id/comments/:cid

Deletes a comment and all its replies.

Terminal window
curl -X DELETE https://notebind.com/api/documents/DOC_ID/comments/COMMENT_ID \
-H "Authorization: Bearer nb_sk_YOUR_KEY"
{
"data": { "deleted": true },
"error": null
}
  • Document owner can delete any comment
  • Comment author can delete their own comments
  • Share users can only delete anonymous (null author) comments

StatusCodeDescription
400VALIDATION_ERRORMissing body field or no valid updates
401UNAUTHORIZEDMissing or invalid credentials
403UNAUTHORIZEDInsufficient permissions
404NOT_FOUNDComment or document not found