Create Lesson
Add a lesson to a course. type and name are required. The new lesson is placed after the highest order, or at 0 when the course has no lessons. Visitors see the lesson after you publish. See Lessons and Lesson Object.
Request
POST /players/{id}/files
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Course UUID. See Identifiers. |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
draft_version | integer | Yes | Current counter from Get Course. Minimum 1. Missing, not an integer, or below 1 is 422. A value that is not current is 409. |
type | string | Yes | video, audio, file, pdf, google, embed, text, image, or header |
name | string | Yes | Name, 1–255 characters |
description | string|null | No | Longer description. Omit for null. |
text | string | No | Body text. Omit for "". |
src_url | string | No | Address of the lesson. Omit for "". |
video_source | string | No | youtube, vimeo, wistia, bunny, or other. Omit for vimeo. |
info | string | No | Short note, maximum 255 characters. Omit for "". |
is_free | boolean | No | Omit for false. |
is_hidden | boolean | No | Omit for false. |
schedule | object|null | No | Schedule Object. Omit for null. |
Example Request
curl -X POST "https://app.easy.tools/api/v1/players/8f3c1a62-d047-4e89-9b25-1c6a4d8e0f71/files" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"draft_version": 1,
"type": "video",
"name": "Welcome",
"description": "Start here.",
"src_url": "https://video.example.com/play/welcome",
"video_source": "bunny",
"is_free": true
}'
Response
Success Response (201)
{
"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": false,
"order": 0,
"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
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 must be one of the following values: video, audio, file, pdf, google, embed, text, image, header"]
}
}
}
Authentication, permission, and rate-limit errors are described in Authorization.