About the Comments API

The Comments API allows you to manage a customized commenting program that lets site visitors share feedback or engage in discussions around different types of resources, including blog posts, forum threads, or other site content.

With the Wix Comments API, you can:

  • Allow commenting on any page of your site.
  • Mark specific comments to highlight and feature to your readers.
  • Engage with visitors who are not site members through guest commenting.

Integrations

The Comments API is fully integrated with several Wix solutions. Each integration uses a slightly different configuration to work with Comments.

The following table details the currently supported integrations:

Wix AppappIdcontextIdresourceId
Wix Blog14bcded7-0066-7c35-14d7-466cb3f09103internalIdinternalId
Wix Comments91c9d6a7-6667-41fb-b0b4-7d3b3ff0b02ecategoryIdcomponentId
Wix Forum14724f35-6794-cd1a-0244-25fd138f9242forumPostIdforumPostId
Wix Groups148c2287-c669-d849-d153-463c7486a694groupIdfeedItemId

Use cases

Terminology

  • Marked comments: When a comment's marked field is set to TRUE, it indicates that the comment has been flagged or marked for special attention. No additional automated behavior or action is taken with the comment. However, you can manually filter for comments marked as such with Query Comments and highlight them to your visitors as needed.
  • Parent comments: Parent comments refer to comments that have subsequent comments directly responding to them. They serve as the original or initial comments in a conversation thread. The parent comment's unique identifier is stored in the parentComment.id field of the corresponding reply comment.
  • Replies: Replies are comments that are made in direct response to earlier comments within a discussion. They are specifically intended as responses to a particular parent comment and contribute to the ongoing conversation. Replies help maintain the hierarchical structure of comment threads and enhance the engagement and interactivity among users.
Was this helpful?
Yes
No

Sample Flows

This article shares possible use cases your app could support, as well as sample flows. You're certainly not limited to these use cases, but it can be a helpful jumping off point as you plan your app's implementation.

Note: This flow requires Wix Blocks which is currently in Beta. Your app can help site owners find the most popular comments left on their site and feature those comments to other site visitors.

To find and highlight the most popular comments:

  1. Use Query Comments to filter and sort comments for the highest replyCount, rating, and reactionSummary.total.
  2. Use Mark Comment for each of the top comments to set marked as TRUE.
  3. Display marked comments in a widget. Widgets can be built using Wix Blocks. Learn more about Wix Blocks and adding widgets.

Provide comment analytics

Your app can gather insights and generate reports about a site's comments.

To get the information follow these steps:

  1. Use Query Comments to retrieve a list of comments based on specified filters.
  2. Analyze the statistical data, such as comment count and engagement rates based on replyCount, reactionSummary.total, and voteSummary.netVoteCount.
  3. Use the comment metrics to generate comprehensive reports on comment activity, user engagement, and popular discussions.
  4. Customize the reporting with segmentation based on available filtering and sorting options.
  5. Visualize parts of the data in an easily understandable format, such as charts and graphs.
  6. Schedule and distribute the reports at regular intervals.
Was this helpful?
Yes
No

Comments: Supported Filters and Sorting

The following table shows field support for filters and sorting for the comment object:

FieldSupported FiltersSortable
id$eq, $ne, $in
contextId$eq, $ne, $in
resourceId$eq, $ne, $in
author.userId$eq, $ne, $in
author.memberId$eq, $ne, $in
author.visitorId$eq, $ne, $in
parentComment.id$eq, $ne, $in
parentIdsInThread$hasAll, $hasSome, $isEmpty
replyCount$eq, $ne, $gt, $lt, $gte, $lteSortable
status$eq, $ne, $in
voteSummary.netVoteCount$eq, $ne, $gt, $lt, $gte, $lteSortable
rating$eq, $ne, $gt, $lt, $gte, $lteSortable
reactionSummary.total$eq, $ne, $gt, $lt, $gte, $lteSortable
marked$eq, $neSortable
Was this helpful?
Yes
No

Comment Object

Properties
idstringRead-onlyformat GUID
Comment ID.

revisionobjectRead-only
Revision number, which increments by 1 each time the comment is updated. To prevent conflicting changes, the current revision must be passed when updating the comment.

createdDatestringRead-onlyformat date-time
Date and time the comment was created.

updatedDatestringRead-onlyformat date-time
Date and time the comment was last updated.

appIdstring
ID of the app that the comment is added to.

contextIdstringmaxLength 128
ID of the specific context the comment is in response to. Within some Wix apps, the contextId will be the same as the resourceId. For example in Wix Forum, the forumPostId is used as both the contextId and the resourceId.

contextTypestringmaxLength 128
Reserved for internal use.

resourceIdstringmaxLength 128
ID of the specific resource that the comment is in response to. Within some Wix apps, the resourceId will be the same as the contextId. For example in Wix Forum, the forumPostId is used as both the resourceId and the contextId.

contentobject
Published comment content.

authorobject
Comment's author.

parentCommentobject
Parent comment information. Only present if this comment is in direct reply to another comment. See Terminology for more information about parent comments.

replyCountintegerRead-only
Amount of comments that reply to this comment.

voteSummaryobject
Summary of votes.

statusstringRead-only
5 enum supported values:
UNKNOWNPUBLISHEDDELETEDPENDINGHIDDEN
Comment status. Supported values:
  • "PUBLISHED": This comment is published and publicly visible.
  • "DELETED": This comment is deleted.
  • "PENDING": This comment is pending moderation. Moderation is not currently supported.
  • "HIDDEN": This comment has been hidden by a site moderator.

ratingintegerRead-onlyformat int32
Comment rating.

reactionSummaryobject
Summary of reactions.

markedboolean
Whether the comment is marked.
Was this helpful?
Yes
No

PostCreate Comment

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a new comment.

The appId, contextId, and resourceId are all required and associate the created comment with the specific resource it responds to. See Integrations for a list of integrated scopes for these fields.

If the created comment is a direct response to another comment, the commentId of the parent comment should be passed as parentComment.id in this comment's request. See Terminology for additional information on parent comments and replies.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Comments
Learn more about permission scopes.
Endpoint
POST
https://www.wixapis.com/comments/v1/comments

Event TriggersThis method triggers the following events:
Was this helpful?
Yes
No

GetGet Comment

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a comment.

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Comments
Learn more about permission scopes.
Endpoint
GET
https://www.wixapis.com/comments/v1/comments/{commentId}

Was this helpful?
Yes
No

DeleteDelete Comment

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Deletes a comment.

This endpoint deletes the content of the comment and sets its status to DELETED.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Comments
Learn more about permission scopes.
Endpoint
DELETE
https://www.wixapis.com/comments/v1/comments/{commentId}

Event TriggersThis method triggers the following events:
Was this helpful?
Yes
No

PatchUpdate Comment

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Updates a comment.

Each time the comment is updated, revision increments by 1. The current revision must be passed when updating the comment. This ensures you're working with the latest comment and prevents unintended overwrites.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Comments
Learn more about permission scopes.
Endpoint
PATCH
https://www.wixapis.com/comments/v1/comments/{comment.id}

Event TriggersThis method triggers the following events:
Was this helpful?
Yes
No

PostQuery Comments

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a list of comments, given the provided paging, filtering, and sorting.

Query Comments runs with these defaults, which you can override:

  • id sorted in ASC order

For field support for filters and sorting, see Comments: Supported Filters and Sorting.

To learn about working with Query endpoints, see API Query Language, Sorting and Paging, and Field Projection.

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Comments
Learn more about permission scopes.
Endpoint
POST
https://www.wixapis.com/comments/v1/comments/query-cursor

Was this helpful?
Yes
No

PutMark Comment

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Sets marked to TRUE to mark a comment.

You can then filter for marked comments with Query Comments to apply customizations. See Highlight marked comments for an example.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Comments
Learn more about permission scopes.
Endpoint
PUT
https://www.wixapis.com/comments/v1/comments/{commentId}/mark

Event TriggersThis method triggers the following events:
Was this helpful?
Yes
No

PutUnmark Comment

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Sets marked to FALSE to unmark a comment.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Comments
Learn more about permission scopes.
Endpoint
PUT
https://www.wixapis.com/comments/v1/comments/{commentId}/unmark

Event TriggersThis method triggers the following events:
Was this helpful?
Yes
No

PostCount Comments

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Counts comments, given the provided filtering.

For field support for filters and sorting, see Comments: Supported Filters and Sorting.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Comments
Learn more about permission scopes.
Endpoint
POST
https://www.wixapis.com/comments/v1/comments/count

Was this helpful?
Yes
No

Comment Created

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when a comment is created.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring
Unique event ID. Allows clients to ignore duplicate webhooks.

entityFqdnstring
Fully qualified domain name of the entity associated with the event. Expected wix.comments.v2.comment.

slugstring
Event name. Expected created.

entityIdstring
ID of the entity associated with the event.

eventTimestringformat date-time
Event timestamp.

triggeredByAnonymizeRequestboolean
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).

originatedFromstring
If present, indicates the action that triggered the event.

createdEventobject
Event information.

Was this helpful?
Yes
No

Comment Updated

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when a comment is updated.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring
Unique event ID. Allows clients to ignore duplicate webhooks.

entityFqdnstring
Fully qualified domain name of the entity associated with the event. Expected wix.comments.v2.comment.

slugstring
Event name. Expected updated.

entityIdstring
ID of the entity associated with the event.

eventTimestringformat date-time
Event timestamp.

triggeredByAnonymizeRequestboolean
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).

originatedFromstring
If present, indicates the action that triggered the event.

updatedEventobject
Event information.

Was this helpful?
Yes
No

Comment Deleted

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when a comment is deleted.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring
Unique event ID. Allows clients to ignore duplicate webhooks.

entityFqdnstring
Fully qualified domain name of the entity associated with the event. Expected wix.comments.v2.comment.

slugstring
Event name. Expected comment_deleted.

entityIdstring
ID of the entity associated with the event.

eventTimestringformat date-time
Event timestamp.

triggeredByAnonymizeRequestboolean
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).

originatedFromstring
If present, indicates the action that triggered the event.

actionEventobject
Event information.

Was this helpful?
Yes
No

Comment Marked

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when a comment is marked.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring
Unique event ID. Allows clients to ignore duplicate webhooks.

entityFqdnstring
Fully qualified domain name of the entity associated with the event. Expected wix.comments.v2.comment.

slugstring
Event name. Expected comment_marked.

entityIdstring
ID of the entity associated with the event.

eventTimestringformat date-time
Event timestamp.

triggeredByAnonymizeRequestboolean
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).

originatedFromstring
If present, indicates the action that triggered the event.

actionEventobject
Event information.

Was this helpful?
Yes
No

Comment Unmarked

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when a comment is unmarked.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring
Unique event ID. Allows clients to ignore duplicate webhooks.

entityFqdnstring
Fully qualified domain name of the entity associated with the event. Expected wix.comments.v2.comment.

slugstring
Event name. Expected comment_unmarked.

entityIdstring
ID of the entity associated with the event.

eventTimestringformat date-time
Event timestamp.

triggeredByAnonymizeRequestboolean
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).

originatedFromstring
If present, indicates the action that triggered the event.

actionEventobject
Event information.

Was this helpful?
Yes
No