> 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

# UpdateCommentReply

# Package: feedback

# Namespace: Comments

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

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

## Introduction

Updates the text of one of your own replies to 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 reply is addressed by `replyIndex`, its position in the comment's `replies` list. Because
indexes shift when an earlier reply is deleted, a stale `revision` is rejected rather than
applied to whichever reply now sits at that index.

---

## REST API

### Schema

```
 Method: updateCommentReply
 Description: Updates the text of one of your own replies to 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 reply is addressed by `replyIndex`, its position in the comment's `replies` list. Because indexes shift when an earlier reply is deleted, a stale `revision` is rejected rather than applied to whichever reply now sits at that index.
 URL: https://www.wixapis.com/partners/feedback/v1/comments/{commentId}/replies/{replyIndex}
 Method: PATCH
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  message, revision
 Method parameters: 
   param name: message | type: message | description: New text for the reply. | required: true | validation: minLength 1, maxLength 2000
   param name: revision | type: revision | description: Current revision of the comment. | required: true | validation: format int64
 Return type: UpdateCommentReplyResponse
  - name: comment | type: Comment | description: Updated comment, including the updated reply.  
     - 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 Reply
Corrects the text of your own reply, addressed by its position in the replies list

```curl
curl -X PATCH \
'https://www.wixapis.com/partners/feedback/v1/comments/8046df3c-7575-4098-a5ab-c91ad8f33c47/replies/0' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "message": "Good catch. A mobile crop is live now, and the tablet breakpoint is next.",
  "revision": "2"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.feedback.comments.updateCommentReply(identifiers, message, options)
 Description: Updates the text of one of your own replies to 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 reply is addressed by `replyIndex`, its position in the comment's `replies` list. Because indexes shift when an earlier reply is deleted, a stale `revision` is rejected rather than applied to whichever reply now sits at that index.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  identifiers.commentId, message, options.revision, identifiers.replyIndex, identifiers, options
 Method parameters: 
   param name: identifiers | type: UpdateCommentReplyIdentifiers  none | required: true 
        - name: commentId | type: string | description: GUID of the comment the reply belongs to. | required: true | validation: format GUID
        - name: replyIndex | type: integer | description: Position of the reply in the comment's `replies` list. | required: true | validation: minimum 0
   param name: message | type: string | description: New text for the reply. | required: true | validation: minLength 1, maxLength 2000
   param name: options | type: UpdateCommentReplyOptions  none | required: true 
        - name: revision | type: string | description: Current revision of the comment. | required: true | validation: format int64
 Return type: PROMISE<UpdateCommentReplyResponse>
  - name: comment | type: Comment | description: Updated comment, including the updated reply.  
     - 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 your own reply
Corrects a reply, addressed by its position in the replies list

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

async function updateCommentReply() {
  const response = await comments.updateCommentReply(
    { commentId: "8046df3c-7575-4098-a5ab-c91ad8f33c47", replyIndex: 0 },
    "Good catch. A mobile crop is live now, and the tablet breakpoint is next.",
    { revision: "2" },
  );
}

/* Promise resolves to:
 * {
 *   "comment": {
 *     "_id": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
 *     "revision": "3",
 *     "_createdDate": "2024-01-15T10:30:00.000Z",
 *     "_updatedDate": "2024-01-16T09:41:07.000Z",
 *     "feedbackId": "3f1a6c2e-9b47-4b1e-8c55-2d7a9f0e5b31",
 *     "commenterId": "e2f06b91-8d4a-4c37-b519-3a7c60d8e4f2",
 *     "message": "The hero image looks stretched on mobile.",
 *     "status": "NEW",
 *     "commentLocation": { "pageId": "c1dmp", "x": 412.5, "y": 980.25 },
 *     "replies": [
 *       {
 *         "replierId": "4c9b2e70-61af-4d85-9e3b-d07a5f18c6b4",
 *         "message": "Good catch. A mobile crop is live now, and the tablet breakpoint is next.",
 *         "_createdDate": "2024-01-16T09:12:33.000Z"
 *       }
 *     ]
 *   }
 * }
 */

```

### updateCommentReply (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 updateCommentReply(identifiers,message,options) {
  const response = await myWixClient.comments.updateCommentReply(identifiers,message,options);
};
```

---