Skip to main content

Delete Lesson

Delete a lesson. A later read of that id returns 404. On a draft course the lesson is gone for good. On a published course the deletion is a pending edit: visitors still see the lesson until you publish. To keep a lesson but hide it from visitors, set is_hidden with Update Lesson.

Request​

DELETE /players/{playerId}/files/{id}

Path Parameters​

ParameterTypeRequiredDescription
playerIdstringYesCourse UUID. See Identifiers.
idstringYesLesson UUID

Request Body​

ParameterTypeRequiredDescription
draft_versionintegerYesCurrent counter from Get Course. Minimum 1. Missing, not an integer, or below 1 is 422. A value that is not current is 409.

Example Request​

curl -X DELETE "https://app.easy.tools/api/v1/players/8f3c1a62-d047-4e89-9b25-1c6a4d8e0f71/files/3a91c4e0-6b27-4f58-9d14-7e2b8c0a5f63" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"draft_version": 1
}'

Response​

Success Response (204)​

No response body and no preview_url. The counter still moves forward.

Error Responses​

Not Found Error (404)​

See Identifiers.

{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found"
}
}

Conflict Error (409)​

draft_version is not the current counter. Read the course and retry with that value.

{
"error": {
"code": "CONFLICT",
"message": "The draft was edited elsewhere. GET the draft and retry with the current draft_version."
}
}

Authentication, permission, and rate-limit errors are described in Authorization.