/services/courses/v1/courses/lessons/save
Auth
Without `id` a lesson is added at the end of module `module_id` (draft unless `status` says otherwise); with `id` only the fields sent change, and `module_id` moves it to another module of the same course. The slug is unique in the course; without one it is made from the title. `content` is HTML (cleaned on save). `is_preview`: anyone may read it while the course is published. A published course keeps at least one published lesson. A quiz lesson (`type` quiz) takes `settings.pass_percent` (0 to 100, default 70) and `settings.max_attempts` (empty: unlimited), and is published once it has a question.
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
id |
integer|null | No | ||
module_id |
integer | Yes | ||
title |
string
max: 191 |
Yes | ||
slug |
string|null
max: 191 |
No | ||
type |
string|null
text, video, download, quiz, embed, |
No | ||
content |
string|null
max: 2000000 |
No | ||
video_url |
string|null (uri)
max: 2000 |
No | ||
attachments |
array|null | No | ||
duration_minutes |
integer|null
min: 0 max: 100000 |
No | ||
is_preview |
boolean|null | No | ||
status |
string|null
draft, published, |
No | ||
position |
integer|null
min: 0 |
No | ||
settings |
object | No |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string | |
data |
object | |
data.lesson |
mixed[] |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string | |
data |
object | |
data.lesson |
mixed[] |
| Field | Type | Description |
|---|---|---|
message |
string | Errors overview. |
errors |
object | A detailed description of each field that failed validation. |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
Retry-After |
integer | Seconds until the rate limit resets | 60 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
curl -X POST "https://api.wemasy.nl/api/services/courses/v1/courses/lessons/save" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"id": "string",
"module_id": 0,
"title": "string",
"slug": "string",
"type": "string",
"content": "string",
"video_url": "string",
"attachments": "string",
"duration_minutes": "string",
"is_preview": "string",
"status": "string",
"position": "string",
"settings": "string"
}'
fetch('https://api.wemasy.nl/api/services/courses/v1/courses/lessons/save', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"id": "string",
"module_id": 0,
"title": "string",
"slug": "string",
"type": "string",
"content": "string",
"video_url": "string",
"attachments": "string",
"duration_minutes": "string",
"is_preview": "string",
"status": "string",
"position": "string",
"settings": "string"
})})
.then(r => r.json())
.then(data => console.log(data));
$response = Http::withToken('YOUR_API_TOKEN')
->accept('application/json')
->post('https://api.wemasy.nl/api/services/courses/v1/courses/lessons/save', {
"id": "string",
"module_id": 0,
"title": "string",
"slug": "string",
"type": "string",
"content": "string",
"video_url": "string",
"attachments": "string",
"duration_minutes": "string",
"is_preview": "string",
"status": "string",
"position": "string",
"settings": "string"
});
$data = $response->json();
import requests
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
data = {
"id": "string",
"module_id": 0,
"title": "string",
"slug": "string",
"type": "string",
"content": "string",
"video_url": "string",
"attachments": "string",
"duration_minutes": "string",
"is_preview": "string",
"status": "string",
"position": "string",
"settings": "string"
}
r = requests.post("https://api.wemasy.nl/api/services/courses/v1/courses/lessons/save", headers=headers, json=data)
print(r.json())
{
"error": true,
"message": "string",
"data": {
"lesson": []
}
}