Anchor an Inline Comment to Page Text
A 3-step recipe with Confluence. We can help you get access.
Recipe · 3 steps
Anchor an Inline Comment to Page Text
with Confluence
Works with AI assistants
Create an inline comment anchored to a specific text selection on a Confluence page.
- Read the page in storage format so the caller can confirm the text selection exists verbatim in the body before anchoring to it.
- Create the inline comment bound to the text selection. The inlineCommentProperties carry the anchor; without them Confluence stores an unanchored comment.
- Read the page's inline comments back to confirm the new comment is present and anchored rather than silently dropped.
What you'll need to have ready
- pageId: The id of the page to comment on.
- textSelection: The exact text inside the page body that the comment anchors to.
- textSelectionMatchCount: How many times the selection occurs in the body. Confluence uses this to disambiguate the anchor; a wrong count detaches the comment.
- commentBody: The comment body in Confluence storage format (XHTML).
For your developer
Arazzo workflow confluence:anchor-inline-comment, 3 operations: getPageById → createInlineComment → getInlineComments. Specs on APIs.io.