# Replace lesson taxonomy terms

`PUT https://api.cademi.com.br/api/v3/products/{product_id}/lessons/{lesson_id}/taxonomy-terms`

Operation ID: `lessons.taxonomy_terms.update` · API v3

Replaces the complete set of taxonomy terms assigned to the lesson with the terms in `term_ids`. Send an empty array to remove all terms. Every term must belong to a taxonomy of the same product.

Only lessons in products with the `blog` format support taxonomies. For products in other formats, the API returns `format_unsupported` and nothing is saved. Replicated lessons are read-only, and requests to change them return `replica_readonly`.

Send the lesson's current `ETag` in the `If-Match` header to avoid overwriting a newer version.

Required permissions: `lessons.update`.

## Parameters

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

## Request body

Content type: `application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `term_ids` | array of string | yes |  |

## Responses

### 200

Returns the taxonomy terms now assigned to the lesson.

Body: `data`: LessonTaxonomyTerms.

Fields of LessonTaxonomyTerms:

| Field | Type | Required | Description |
|---|---|---|---|
| `lesson_id` | string | yes | Public ID, with the les_ prefix. |
| `object` | string, one of `lesson_taxonomy_terms` | yes |  |
| `terms` | array of object | 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 lesson was not found in the product or is not accessible with the current credentials.

Body: Error.

### 409

The product format does not support taxonomies.

Body: Error.

### 412

The lesson has changed since the revision supplied in If-Match.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

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