POST/comments/create

Create a comment on a page

Creates a comment on a page, optionally anchoring it to selected text or adding it as a reply to another comment. Supply pageId and content; use type to specify an inline or page-level comment. A 200 response returns the created comment.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

6 body fields

The page comment's content and optional threading or anchoring details. pageId and content are required.

contentstringrequired
Comment body as a JSON string (ProseMirror document format).
pageIdstringrequired
ID of the page to comment on.
parentCommentIdstringoptional
ID of a parent comment to reply to. If provided, creates a threaded reply. If omitted, creates a top-level comment.
selectionstringoptional
The highlighted text that the comment refers to. Used for inline/contextual comments that anchor to a specific passage in the page.
typestringoptional
`inline` anchors the comment to selected text; `page` is a page-level comment.
Allowed:inlinepage
yjsSelectionobjectoptional
Collaborative-editing anchor for inline comments, so the highlight survives concurrent edits.

3 status codes
200Returns the created comment object.
dataobjectoptional
statusintegeroptional
successbooleanoptional
403Returned when the request is forbidden.
errorstringoptional
Reason phrase, for example `Bad Request`.
messagestringoptional
statusCodeintegeroptional
404Returned when the page is not found.
errorstringoptional
Reason phrase, for example `Bad Request`.
messagestringoptional
statusCodeintegeroptional

Error handling

pageId and content are required. If provided, type must be inline or page. A 403 is returned when the request is forbidden, and a 404 is returned when the page is not found.