Comments API: Sample Flows

This article presents sample flows for adding and managing conversations on Wix site content.

You can help site visitors discover active conversations by displaying popular comments in a custom widget.

To highlight popular comments:

  1. Call Query Comments and sort by replyCount, reactionSummary.total, or voteSummary.netVoteCount.
  2. Select the comments to feature.
  3. Call Mark Comment for each selected comment.
  4. Call Query Comments with a filter for marked comments when refreshing the widget.
  5. Display the returned comments in the widget.

Create and moderate a guest comment

You can accept comments from site visitors who aren't site members and route their submissions through the site's moderation flow.

To create and moderate a guest comment:

  1. Identify the app, context, and resource where the comment is submitted.
  2. Call Create Comment with the comment content, guest display name, and optional contactDetails.email.
  3. Check the returned comment's status. If moderation is required, render the submission as pending and don't display its draft content publicly.
  4. Retrieve the current comment and its revision before making a moderation decision.
  5. Call Moderate Draft Content with APPROVE or REJECT.
  6. Refresh the comment using the comment returned by the moderation method.

Display comments with author badges and reactions

You can display author categories and personalized reaction state beside a page of comments.

To display comments with author badges and reactions:

  1. Call List Comments By Resource with AUTHOR_BADGES in fields.
  2. Match each member author's ID to authorBadges.badgesByMemberId. If the author or badge entry is unavailable, render the comment without a badge.
  3. Collect the returned comment and reply IDs.
  4. Call Bulk Get Comment Reactions with the IDs and the same app and context.
  5. Display per-code totals and the current identity's hasReacted state.
  6. When the current identity chooses a reaction, call Add Comment Reaction or Remove Comment Reaction.
  7. Refresh the reaction summary after the change.

Display a comment's edit history

You can let site visitors review earlier published versions of a comment.

To display a comment's edit history:

  1. Retrieve the comment visible to the current identity and collect its ID.
  2. Call List Comment Content Revisions with the comment ID.
  3. Follow the returned cursor to retrieve additional revisions.
  4. Display the revisions in reverse chronological order.

Last updated: 12 October 2026

Did this help?