Skip to main content

Reorder Lessons

Set order on the lessons you list. A lesson you leave out keeps its order. Visitors see the new order after you publish. The response is every lesson in the new order, with no pagination. preview_url, draft_version, and draft_updated_at sit beside data. See Reorder.

Request​

POST /players/{id}/files/reorder

Path Parameters​

ParameterTypeRequiredDescription
idstringYesCourse UUID. See Identifiers.

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.
itemsarrayYesAt least one lesson to move

Items Object​

ParameterTypeRequiredDescription
idstringYesLesson UUID on this course
orderintegerYesNew position, 0 or greater

Example Request​

curl -X POST "https://app.easy.tools/api/v1/players/8f3c1a62-d047-4e89-9b25-1c6a4d8e0f71/files/reorder" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"draft_version": 1,
"items": [
{ "id": "7c4e2b18-9a30-4d61-b845-1f6d0e8a3c29", "order": 0 },
{ "id": "3a91c4e0-6b27-4f58-9d14-7e2b8c0a5f63", "order": 1 }
]
}'

Response​

Success Response (200)​

{
"data": [
{
"id": "7c4e2b18-9a30-4d61-b845-1f6d0e8a3c29",
"name": "Week 1",
"type": "header",
"description": null,
"text": "",
"src_url": "",
"video_source": "vimeo",
"info": "",
"is_free": false,
"is_hidden": false,
"order": 0,
"schedule": null
},
{
"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": false,
"order": 1,
"schedule": 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​

Each entry has the fields described in Lesson Object. preview_url, draft_version, and draft_updated_at sit beside data.

Error Responses​

Not Found Error (404)​

An unknown course, or an id in items that is missing or not a UUID. Nothing is saved. 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)​

A duplicate id, a duplicate order, or an order that matches a lesson you left out. Nothing is saved.

{
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid",
"details": {
"items": ["items order collides with a file that was omitted"]
}
}
}

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