# Update a taxonomy

`PATCH https://api.cademi.com.br/api/v3/products/{product_id}/taxonomies/{taxonomy_id}`

Operation ID: `taxonomies.update` · API v3

Updates the `name` and `plural_name` of a taxonomy.

Send the `ETag` returned by the retrieve operation in the `If-Match` header to avoid overwriting a newer version.

Taxonomies of replicated products are read-only. Attempts to update them return `403 Forbidden` with the `replica_readonly` error code.

Required permissions: `taxonomies.update`.

## Parameters

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

## Request body

Content type: `application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | no |  |
| `plural_name` | string | no |  |

## Responses

### 200

Returns the updated taxonomy.

Body: `data`: Taxonomy.

Fields of Taxonomy:

| Field | Type | Required | Description |
|---|---|---|---|
| `created_at` | string (date-time) | yes |  |
| `id` | string | yes | Public ID, with the tax_ prefix. |
| `name` | string | yes |  |
| `object` | string, one of `taxonomy` | yes |  |
| `plural_name` | string | yes |  |
| `product_id` | string | yes | Public ID, with the prd_ prefix. |
| `revision` | string | yes |  |
| `terms_count` | integer | yes |  |
| `updated_at` | string (date-time) | yes |  |

### 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 taxonomy was not found in this product or is not accessible with the current credentials.

Body: Error.

### 412

The resource 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
