# Replace lesson content

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

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

Replaces the lesson body and, when `video` is included, the lesson video. The `inherited` field returned by the retrieve operation is accepted and ignored, so retrieved content can be sent back as is.

`raw` blocks are not accepted, embed blocks must use a recognized provider, and quiz lessons do not accept a video. The request body must not exceed 1 MiB.

The content of a connected lesson belongs to its source lesson and cannot be changed; such requests fail with `state_conflict`. 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`.

| Field | Type | Required | Description |
|---|---|---|---|
| `body` | object | no |  |
| `video` | object or null | no |  |

## Responses

### 200

Returns the updated lesson content.

Body: `data`: LessonContent.

Fields of LessonContent:

| Field | Type | Required | Description |
|---|---|---|---|
| `body` | object | yes |  |
| `embed` | object or null | yes |  |
| `format` | string, one of `standard`, `quiz`, `live_youtube`, `live_vimeo` | yes |  |
| `lesson_id` | string | yes | Public ID, with the les_ prefix. |
| `live` | object or null | yes |  |
| `object` | string, one of `lesson_content` | yes |  |
| `revision` | string | yes |  |
| `video` | object or null | 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 lesson is connected to a source lesson, and its content can only be changed in the source lesson.

Body: Error.

### 412

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

Body: Error.

### 413

The request body exceeds 1 MiB.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

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