# Remove an attachment

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

Operation ID: `lessons.attachments.delete` · API v3

Removes the attachment from the lesson body. The underlying file is not deleted.

Attachments without a `file_id` cannot be removed with this operation; remove them by replacing the lesson content instead. Replicated lessons are read-only, and requests to change them return `replica_readonly`.

Required permissions: `lessons.update`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `product_id` | path | string | yes |  |
| `lesson_id` | path | string | yes |  |
| `file_id` | path | string | yes |  |

## Responses

### 204

The attachment was removed from the lesson.

### 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 or is not accessible with the current credentials, or the lesson body has no attachment with the given file ID.

Body: Error.

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