# Update a comment

`PATCH https://api.cademi.com.br/api/v3/products/{product_id}/comments/{comment_id}`

Operation ID: `comments.update` · API v3

Moderates or pins a top-level comment. Only `status` and `pinned` can be changed; the comment text cannot be edited.

Changing `status` requires the `comments.moderate` permission, and changing `pinned` requires the `comments.pin` permission.

The retrieve operation returns an `ETag` representing the current revision. Send this value in the optional `If-Match` header to avoid overwriting a newer version; if the comment has changed since that revision, the update is rejected.

Required permissions: `comments.update`, `comments.moderate`, `comments.pin`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `product_id` | path | string | yes |  |
| `comment_id` | path | string | yes |  |
| `If-Match` | header | string | no |  |

## Request body

Content type: `application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `pinned` | boolean | no |  |
| `status` | string, one of `approved`, `hidden` | no |  |

## Responses

### 200

Returns the updated comment.

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 404

The comment was not found in this product or is not accessible with the current credentials.

Body: Error.

### 412

The comment has changed since the supplied revision was retrieved.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

Full schema: https://cademi.dev/openapi/v3.json
