# Delete a lesson

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

Operation ID: `lessons.delete` · API v3

Moves the lesson to the trash. Trashed lessons can be restored by setting `deleted` to `false` with the update operation.

A lesson that is the source of connected lessons cannot be deleted and returns `state_conflict`; disconnect those lessons first. Replicated lessons are read-only and cannot be deleted; such requests return `replica_readonly`.

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

Required permissions: `lessons.delete`.

## Parameters

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

## Responses

### 204

The lesson was moved to the trash.

### 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 the source of connected lessons.

Body: Error.

### 412

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

Body: Error.

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