Skip to content
Hoody.com

Use these endpoints to manage threaded comments anchored to notebook document nodes. Each comment is attached to a document through an anchor (the whole document, a single block, or a text range), and every comment payload carries a version that increments on each update. Pass that version back as expectedVersion on edit, re-anchor, resolve, and delete so concurrent edits are detected. The list endpoints support limit/offset and an opaque cursor for pagination.

Returns lightweight thread anchor metadata for comment decorations. Use this endpoint to render sidebar markers, gutter dots, and orphaned-anchor indicators without loading every comment’s full body and author data.

GET /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comment-anchors

Section titled “GET /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comment-anchors”
NameInTypeRequiredDescription
notebookIdpathstringYesIdentifier of the notebook that owns the document
nodeIdpathstringYesIdentifier of the document node whose anchors are returned
limitqueryintegerNoMaximum number of anchors to return. Defaults to 500
offsetqueryintegerNoNumber of anchors to skip from the start of the result set. Defaults to 0
cursorquerystringNoOpaque pagination cursor returned by a previous call
Terminal window
curl -X GET "https://{projectId}-{containerId}-notes-1.{server}.containers.hoody.com/api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comment-anchors?limit=200" \
-H "Authorization: Bearer $HOODY_TOKEN"

Returns all comments for a document node, including replies. Each entry carries the comment, its author, its anchor, and its resolution state.

GET /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments

Section titled “GET /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments”
NameInTypeRequiredDescription
notebookIdpathstringYesIdentifier of the notebook that owns the document
nodeIdpathstringYesIdentifier of the document node whose comments are returned
limitqueryintegerNoMaximum number of comments to return. Defaults to 100
offsetqueryintegerNoNumber of comments to skip. Defaults to 0
cursorquerystringNoOpaque pagination cursor returned by a previous call
Terminal window
curl -X GET "https://{projectId}-{containerId}-notes-1.{server}.containers.hoody.com/api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments?limit=50" \
-H "Authorization: Bearer $HOODY_TOKEN"

Creates a new comment on a document node. Pass an anchor to attach the comment to a specific location (document, block, or text range), or pass parentId to reply to an existing comment.

POST /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments

Section titled “POST /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments”
NameInTypeRequiredDescription
notebookIdpathstringYesIdentifier of the notebook that owns the document
nodeIdpathstringYesIdentifier of the document node to attach the comment to
NameTypeRequiredDescription
contentstringYesComment body, 1 to 10000 characters
parentIdstringNoIdentifier of the parent comment when this is a reply
anchorBlockIdstringNoIdentifier of the block the comment is attached to
anchorobjectNoAnchor describing where in the document the comment is positioned

The anchor field is a discriminated union on type. Use one of the following forms:

  • { "type": "document" } to anchor the comment to the whole document
  • { "type": "block", "blockId": "<block id>" } to anchor the comment to a single block
  • { "type": "text-range", "startBlockId": "<block id>", "startOffset": <integer>, "endBlockId": "<block id>", "endOffset": <integer>, "quote": "<text>", "contextBefore": "<text>", "contextAfter": "<text>" } to anchor the comment to a text range. startBlockId, startOffset, endBlockId, and endOffset are required; quote, contextBefore, and contextAfter are optional.
Terminal window
curl -X POST "https://{projectId}-{containerId}-notes-1.{server}.containers.hoody.com/api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "Please add a citation for this claim.",
"anchor": {
"type": "text-range",
"startBlockId": "blk4e9a72b3c8d1e4f6a7b8c9d2",
"startOffset": 12,
"endBlockId": "blk4e9a72b3c8d1e4f6a7b8c9d2",
"endOffset": 48,
"quote": "this needs a citation"
}
}'

Edits the content of an existing comment. Pass expectedVersion to require the server’s current version to match; the call returns 409 when it does not.

PATCH /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments/{commentId}

Section titled “PATCH /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments/{commentId}”
NameInTypeRequiredDescription
notebookIdpathstringYesIdentifier of the notebook that owns the document
nodeIdpathstringYesIdentifier of the document node the comment is attached to
commentIdpathstringYesIdentifier of the comment to edit
NameTypeRequiredDescription
contentstringYesNew comment body, 1 to 10000 characters
expectedVersionintegerNoVersion returned by the previous read; the call returns 409 if the comment has changed since
Terminal window
curl -X PATCH "https://{projectId}-{containerId}-notes-1.{server}.containers.hoody.com/api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments/{commentId}" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "Please add a citation here.",
"expectedVersion": 1
}'

Updates the root comment anchor for a comment thread. Use this when the original anchor has been orphaned (the underlying text or block has moved or been deleted) and the comment should be reattached elsewhere.

POST /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments/{commentId}/reanchor

Section titled “POST /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments/{commentId}/reanchor”
NameInTypeRequiredDescription
notebookIdpathstringYesIdentifier of the notebook that owns the document
nodeIdpathstringYesIdentifier of the document node the comment is attached to
commentIdpathstringYesIdentifier of the comment thread root to re-anchor
NameTypeRequiredDescription
anchorobjectYesNew anchor for the comment thread. Uses the same three variants as create: { "type": "document" }, { "type": "block", "blockId": "<block id>" }, or a text-range with startBlockId, startOffset, endBlockId, endOffset (and optional quote, contextBefore, contextAfter)
expectedVersionintegerNoVersion returned by the previous read; the call returns 409 if the comment has changed since
Terminal window
curl -X POST "https://{projectId}-{containerId}-notes-1.{server}.containers.hoody.com/api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments/{commentId}/reanchor" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"anchor": {
"type": "block",
"blockId": "blk5a8b92d4e7c1f3a6b9d2e5c8"
},
"expectedVersion": 2
}'

Marks a comment as resolved. The response carries the updated resolvedAt and resolvedBy fields.

POST /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments/{commentId}/resolve

Section titled “POST /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments/{commentId}/resolve”
NameInTypeRequiredDescription
notebookIdpathstringYesIdentifier of the notebook that owns the document
nodeIdpathstringYesIdentifier of the document node the comment is attached to
commentIdpathstringYesIdentifier of the comment to resolve
NameTypeRequiredDescription
expectedVersionintegerNoVersion returned by the previous read; the call returns 409 if the comment has changed since
Terminal window
curl -X POST "https://{projectId}-{containerId}-notes-1.{server}.containers.hoody.com/api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments/{commentId}/resolve" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"expectedVersion": 3
}'

Deletes a comment and all of its replies. Pass expectedVersion as a query parameter to require an exact version match; if the comment has been updated since you read it, the call returns 409 and you should refetch before retrying.

DELETE /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments/{commentId}

Section titled “DELETE /api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments/{commentId}”
NameInTypeRequiredDescription
notebookIdpathstringYesIdentifier of the notebook that owns the document
nodeIdpathstringYesIdentifier of the document node the comment is attached to
commentIdpathstringYesIdentifier of the comment to delete
expectedVersionqueryintegerNoVersion returned by the previous read; the call returns 409 if the comment has changed since
Terminal window
curl -X DELETE "https://{projectId}-{containerId}-notes-1.{server}.containers.hoody.com/api/v1/notes/notebooks/{notebookId}/nodes/{nodeId}/comments/{commentId}?expectedVersion=4" \
-H "Authorization: Bearer $HOODY_TOKEN"