> ## Documentation Index
> Fetch the complete documentation index at: https://velt.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Comments

Use this API to update comments within a specific CommentAnnotation.

# Endpoint

`POST https://api.velt.dev/v1/commentannotations/comments/update`

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**organizationId** `string` *required*

Organization ID

**documentId** `string` *required*

Document ID

**annotationId** `string` *required*

Comment Annotation ID

**commentIds** `number[]` *required*

Comment IDs

**updatedData** `Object` *required*

Comment data

**properties**

**commentText** `string`

Comment content in plain text string

**commentHtml** `string`

Comment content in HTML string

**isCommentResolverUsed** `boolean`

Use this for self-hosting comments data. Set this as true if you are comments resolver data provider in the SDK.

**isCommentTextAvailable** `boolean`

Use this for self-hosting comments data. Set this as true if this comment will have text content. Sometimes, comments might only have attachments and in that case, set this as false.

**from** `User` *required*

User object from whom the comment is added

**taggedUserContacts** `Object[]`

Array of tagged user contacts

**properties**

**text** `string` *required*

Display text of the tagged user (e.g. "@Username")

**userId** `string` *required*

User ID of the tagged user

**contact** `Object` *required*

**properties**

**email** `string` *required*

Email of the tagged user

**name** `string` *required*

Name of the tagged user

**userId** `string` *required*

User ID of the tagged user

## **Example Requests**

#### Update comment in a CommentAnnotation by organizationId, documentId, annotationId and commentId

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "annotationId": "yourAnnotationId",
    "commentIds": [
      153783,
      607395
    ],
    "updatedData": {
      "commentText": "Sample Updated Comment",
      "commentHtml": "<div>Hello Updated</div>"
    }
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Comment updated successfully.",
    "data": {
      "607395": {
        "success": true,
        "id": 607395,
        "message": "Updated successfully"
      }
    }
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

```js theme={null}
{
  "result": {
    "status": "success",
    "message": "Comment updated successfully.",
    "data": {
      "607395": {
        "success": true,
        "id": 607395,
        "message": "Updated successfully"
      }
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.