Skip to main content

Update Lesson

Change a lesson. Only the keys you send are written. type stays as it was created — a different type returns 422. schedule merges, and schedule: null clears it. The write does not publish. On a published course it saves pending edits; on a draft course it changes the course itself. See Lesson Object and Lessons.

Request​

PATCH /players/{playerId}/files/{id}

Path Parameters​

ParameterTypeRequiredDescription
playerIdstringYesCourse UUID. See Identifiers.
idstringYesLesson UUID

Request Body​

draft_version is required. Every other field is optional.

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.
typestringNoMust match the stored type
namestringNoName, 1–255 characters
descriptionstring|nullNonull clears it
textstringNoBody text
src_urlstringNoAddress of the lesson
video_sourcestringNoyoutube, vimeo, wistia, bunny, or other
infostringNoShort note, maximum 255 characters
is_freebooleanNoWhether the lesson is free
is_hiddenbooleanNotrue hides the lesson and leaves the row in place
scheduleobject|nullNoSchedule Object. null clears the schedule.

Example Request​

curl -X PATCH "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,
"is_hidden": true,
"schedule": {
"release_at": "2026-03-01T15:00:00.000Z",
"is_visible_before_release": false
}
}'

Response​

Success Response (200)​

{
"data": {
"id": "3a91c4e0-6b27-4f58-9d14-7e2b8c0a5f63",
"name": "Welcome",
"type": "video",
"description": "Start here.",
"text": "",
"src_url": "https://video.example.com/play/welcome",
"video_source": "bunny",
"info": "",
"is_free": true,
"is_hidden": true,
"order": 0,
"schedule": {
"release_at": "2026-03-01T15:00:00.000Z",
"is_visible_before_release": false,
"expires_at": null,
"is_visible_after_expiry": true,
"release_after_days": null,
"expires_after_days": null
},
"preview_url": "https://app.easy.tools/players/8f3c1a62-d047-4e89-9b25-1c6a4d8e0f71/preview?expires=1768478400&signature=7d2e9c41a6b85f03e1c7d94a2b6f80e35c1a9d7b4e2f60c8a3d5b1e9f7c2a046",
"draft_version": 2,
"draft_updated_at": "2026-01-15T11:05:00.000Z"
}
}

Response Fields​

See Lesson Object. preview_url on data is minted for this response. draft_version and draft_updated_at are on data as well.

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."
}
}

Validation Error (422 Unprocessable Entity)​

{
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid",
"details": {
"type": ["type cannot be changed"]
}
}
}

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