> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# UpdateCommentStatus

# Package: feedback

# Namespace: Comments

# Method link: https://dev.wix.com/docs/api-reference/account-level/studio-workspace/feedback/comment-v1/update-comment-status.md

## Permission Scopes:
Manage Site Feedback: SCOPE.PARTNERS.FEEDBACK_MANAGE

## Introduction

Updates the triage status of 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.

The status is the only part of a comment the site owner can change. The text belongs to whoever
wrote it.

---

## REST API

### Schema

```
 Method: updateCommentStatus
 Description: Updates the triage status of 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.  The status is the only part of a comment the site owner can change. The text belongs to whoever wrote it.
 URL: https://www.wixapis.com/partners/feedback/v1/comments/{commentId}/update-status
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  status, revision
 Method parameters: 
   param name: revision | type: revision | description: Current revision of the comment. | required: true | validation: format int64
   param name: status | type: Status | description: Triage status of a comment. | required: true 
      - enum:
           NEW - The comment hasn't been read yet.
           OPEN - The comment has been read but isn't resolved.
           RESOLVED - The comment has been dealt with.
 Return type: UpdateCommentStatusResponse
  - name: comment | type: Comment | description: Updated comment.  
     - name: id | type: string | description: Comment GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: 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.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the comment was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the comment was updated.  | read-only: true | validation: format date-time
     - name: feedbackId | type: string | description: GUID of the [feedback session](https://dev.wix.com/docs/api-reference/account-level/studio-workspace/feedback/feedback-session-v1/introduction.md) the comment belongs to.  A feedback session scopes a round of review on a site and carries an expiration date. Once a session lapses it accepts no new comments, but the comments already in it stay readable and can still be triaged and replied to.  | read-only: true | validation: format GUID
     - name: commenterId | type: string | description: GUID of the commenter who left the comment.  | read-only: true | validation: format GUID
     - name: message | type: string | description: Text of the comment.  | validation: minLength 2, maxLength 2000
     - name: status | type: Status | description: Triage status of the comment.  Every comment starts as `NEW`. [Update Comment Status](https://dev.wix.com/docs/api-reference/account-level/studio-workspace/feedback/comment-v1/update-comment-status.md) is the only way for the site owner to change it, and a commenter can't set the status of their own comment. A comment does return to `NEW` on its own when the commenter replies to it, whatever it was triaged as; a reply from anyone else leaves the status alone. The commenter can also reopen a `RESOLVED` comment, which returns it to `NEW`.  | read-only: true 
         - enum:
         -     NEW: The comment hasn't been read yet.
         -     OPEN: The comment has been read but isn't resolved.
         -     RESOLVED: The comment has been dealt with.
     - name: commentLocation | type: CommentLocation | description: Where on the page the comment is anchored.  
        - name: pageId | type: string | description: GUID of the editor page the comment was left on.  | validation: maxLength 100
        - name: x | type: number | description: Horizontal position of the comment on the page.  
        - name: y | type: number | description: Vertical position of the comment on the page.  
        - name: breakpoint | type: Breakpoint | description: Responsive-design breakpoint the comment was left at.  
           - name: id | type: string | description: Breakpoint GUID.  | validation: maxLength 100
           - name: minWidth | type: integer | description: Lowest viewport width the breakpoint applies to, in pixels.  
           - name: maxWidth | type: integer | description: Highest viewport width the breakpoint applies to, in pixels.  
        - name: innerPath | type: string | description: Inner path of the Wix dynamic page the comment was left on.  | validation: maxLength 2048
        - name: position | type: Position | description: Position of the comment relative to the element it's attached to.  
           - name: selector | type: string | description: DOM selector of the target element.  | validation: maxLength 1024
           - name: offsetXPct | type: number | description: Horizontal offset within the element, as a percentage of its width.  
           - name: offsetYPct | type: number | description: Vertical offset within the element, as a percentage of its height.  
           - name: innerPath | type: string | description: Inner path of the Wix dynamic page the element is on.  | validation: maxLength 2048
     - name: replies | type: array<CommentReply> | description: Replies to the comment, ordered oldest first.  A reply is addressed by its index in this list, so indexes shift when an earlier reply is deleted. Pass the comment's current `revision` when updating or deleting a reply to be sure the index you're addressing is still the one you read.  | read-only: true | validation: maxItems 1000
        - name: message | type: string | description: Text of the reply.  | validation: minLength 1, maxLength 2000
        - name: createdDate | type: string | description: Date and time the reply was created.  | read-only: true | validation: format date-time
        - name: replier | type: Replier | description: Who wrote the reply.  | read-only: true 
           - ONE-OF: 
              - name: wixUserOptions | type: WixUserOptions | description: The Wix user who wrote the reply, when `type` is `WIX_USER`.  
                 - name: accountId | type: string | description: GUID of the account the Wix user was logged in to when they replied. This isn't necessarily the account that owns the site.  A `WIX_USER` replier with no `accountId` is the agency that owns the site.  | validation: format GUID
           - name: type | type: Type | description: What kind of identity wrote the reply.  
                 - enum:
                 -     COMMENTER: The comment's commenter. Their name comes from the commenter with the comment's `commenterId`.
                 -     WIX_USER: A Wix user: a user of the agency that owns the site, or of a collaborator account. Details are in `wixUserOptions`.  A `WIX_USER` replier with no `accountId` is the agency that owns the site.


```

### Examples

### Update Comment Status
Marks a comment as resolved

```curl
curl -X POST \
'https://www.wixapis.com/partners/feedback/v1/comments/8046df3c-7575-4098-a5ab-c91ad8f33c47/update-status' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "status": "RESOLVED",
  "revision": "1"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.feedback.comments.updateCommentStatus(commentId, status, options)
 Description: Updates the triage status of 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.  The status is the only part of a comment the site owner can change. The text belongs to whoever wrote it.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  commentId, status, options.revision, options
 Method parameters: 
   param name: commentId | type: string | description: GUID of the comment to triage. | required: true | validation: format GUID
   param name: options | type: UpdateCommentStatusOptions  none | required: true 
        - name: revision | type: string | description: Current revision of the comment. | required: true | validation: format int64
   param name: status | type: Status | description: Triage status of a comment. | required: true 
      - enum:
           NEW - The comment hasn't been read yet.
           OPEN - The comment has been read but isn't resolved.
           RESOLVED - The comment has been dealt with.
 Return type: PROMISE<UpdateCommentStatusResponse>
  - name: comment | type: Comment | description: Updated comment.  
     - name: _id | type: string | description: Comment GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: 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.  | read-only: true | validation: format int64
     - name: _createdDate | type: Date | description: Date and time the comment was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the comment was updated.  | read-only: true 
     - name: feedbackId | type: string | description: GUID of the [feedback session](https://dev.wix.com/docs/api-reference/account-level/studio-workspace/feedback/feedback-session-v1/introduction.md) the comment belongs to.  A feedback session scopes a round of review on a site and carries an expiration date. Once a session lapses it accepts no new comments, but the comments already in it stay readable and can still be triaged and replied to.  | read-only: true | validation: format GUID
     - name: commenterId | type: string | description: GUID of the commenter who left the comment.  | read-only: true | validation: format GUID
     - name: message | type: string | description: Text of the comment.  | validation: minLength 2, maxLength 2000
     - name: status | type: Status | description: Triage status of the comment.  Every comment starts as `NEW`. [Update Comment Status](https://dev.wix.com/docs/api-reference/account-level/studio-workspace/feedback/comment-v1/update-comment-status.md) is the only way for the site owner to change it, and a commenter can't set the status of their own comment. A comment does return to `NEW` on its own when the commenter replies to it, whatever it was triaged as; a reply from anyone else leaves the status alone. The commenter can also reopen a `RESOLVED` comment, which returns it to `NEW`.  | read-only: true 
         - enum:
         -     NEW: The comment hasn't been read yet.
         -     OPEN: The comment has been read but isn't resolved.
         -     RESOLVED: The comment has been dealt with.
     - name: commentLocation | type: CommentLocation | description: Where on the page the comment is anchored.  
        - name: pageId | type: string | description: GUID of the editor page the comment was left on.  | validation: maxLength 100
        - name: x | type: number | description: Horizontal position of the comment on the page.  
        - name: y | type: number | description: Vertical position of the comment on the page.  
        - name: breakpoint | type: Breakpoint | description: Responsive-design breakpoint the comment was left at.  
           - name: _id | type: string | description: Breakpoint GUID.  | validation: maxLength 100
           - name: minWidth | type: integer | description: Lowest viewport width the breakpoint applies to, in pixels.  
           - name: maxWidth | type: integer | description: Highest viewport width the breakpoint applies to, in pixels.  
        - name: innerPath | type: string | description: Inner path of the Wix dynamic page the comment was left on.  | validation: maxLength 2048
        - name: position | type: Position | description: Position of the comment relative to the element it's attached to.  
           - name: selector | type: string | description: DOM selector of the target element.  | validation: maxLength 1024
           - name: offsetXPct | type: number | description: Horizontal offset within the element, as a percentage of its width.  
           - name: offsetYPct | type: number | description: Vertical offset within the element, as a percentage of its height.  
           - name: innerPath | type: string | description: Inner path of the Wix dynamic page the element is on.  | validation: maxLength 2048
     - name: replies | type: array<CommentReply> | description: Replies to the comment, ordered oldest first.  A reply is addressed by its index in this list, so indexes shift when an earlier reply is deleted. Pass the comment's current `revision` when updating or deleting a reply to be sure the index you're addressing is still the one you read.  | read-only: true | validation: maxItems 1000
        - name: message | type: string | description: Text of the reply.  | validation: minLength 1, maxLength 2000
        - name: _createdDate | type: Date | description: Date and time the reply was created.  | read-only: true 
        - name: replier | type: Replier | description: Who wrote the reply.  | read-only: true 
           - ONE-OF: 
              - name: wixUserOptions | type: WixUserOptions | description: The Wix user who wrote the reply, when `type` is `WIX_USER`.  
                 - name: accountId | type: string | description: GUID of the account the Wix user was logged in to when they replied. This isn't necessarily the account that owns the site.  A `WIX_USER` replier with no `accountId` is the agency that owns the site.  | validation: format GUID
           - name: type | type: Type | description: What kind of identity wrote the reply.  
                 - enum:
                 -     COMMENTER: The comment's commenter. Their name comes from the commenter with the comment's `commenterId`.
                 -     WIX_USER: A Wix user: a user of the agency that owns the site, or of a collaborator account. Details are in `wixUserOptions`.  A `WIX_USER` replier with no `accountId` is the agency that owns the site.


```

### Examples

### Update a comment's status
Marks a comment as resolved

```javascript
import { comments } from "@wix/feedback";

async function updateCommentStatus() {
  const response = await comments.updateCommentStatus(
    "8046df3c-7575-4098-a5ab-c91ad8f33c47",
    "RESOLVED",
    { revision: "1" },
  );
}

/* Promise resolves to:
 * {
 *   "comment": {
 *     "_id": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
 *     "revision": "2",
 *     "_createdDate": "2024-01-15T10:30:00.000Z",
 *     "_updatedDate": "2024-01-16T09:12:33.000Z",
 *     "feedbackId": "3f1a6c2e-9b47-4b1e-8c55-2d7a9f0e5b31",
 *     "commenterId": "e2f06b91-8d4a-4c37-b519-3a7c60d8e4f2",
 *     "message": "The hero image looks stretched on mobile.",
 *     "status": "RESOLVED",
 *     "commentLocation": { "pageId": "c1dmp", "x": 412.5, "y": 980.25 },
 *     "replies": []
 *   }
 * }
 */

```

### updateCommentStatus (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { comments } from '@wix/feedback';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { comments },
  // Include the auth strategy and host as relevant
});


async function updateCommentStatus(commentId,status,options) {
  const response = await myWixClient.comments.updateCommentStatus(commentId,status,options);
};
```

---