/services/courses/v1/courses/save
Auth
Without `id` a new course is made (draft unless `status` says otherwise); with `id` only the fields sent are changed. Rules: - Drafts and published courses count against the plan's `courses` limit (archived ones do not). - The slug is unique in the project; without one it is made from the title. - A course can only be published with at least one published lesson, and a paid course needs a linked webshop product (`webshop_product_id`, a product of this project).
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
id |
integer|null | No | ||
title |
string
max: 191 |
Yes | ||
slug |
string|null
max: 191 |
No | ||
subtitle |
string|null
max: 255 |
No | ||
description |
string|null
max: 200000 |
No | ||
image |
string|null
max: 2000 |
No | ||
status |
string|null
draft, published, archived, |
No | ||
access |
string|null
free, paid, |
No | ||
webshop_product_id |
integer|null | No | ||
level |
string|null
max: 40 |
No | ||
language |
string|null
max: 10 |
No | ||
estimated_minutes |
integer|null
min: 0 max: 100000 |
No | ||
certificate_enabled |
boolean|null | No | ||
settings |
array|null | No | ||
position |
integer|null
min: 0 |
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.course |
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.course |
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/save" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"id": "string",
"title": "string",
"slug": "string",
"subtitle": "string",
"description": "string",
"image": "string",
"status": "string",
"access": "string",
"webshop_product_id": "string",
"level": "string",
"language": "string",
"estimated_minutes": "string",
"certificate_enabled": "string",
"settings": "string",
"position": "string"
}'
fetch('https://api.wemasy.nl/api/services/courses/v1/courses/save', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"id": "string",
"title": "string",
"slug": "string",
"subtitle": "string",
"description": "string",
"image": "string",
"status": "string",
"access": "string",
"webshop_product_id": "string",
"level": "string",
"language": "string",
"estimated_minutes": "string",
"certificate_enabled": "string",
"settings": "string",
"position": "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/save', {
"id": "string",
"title": "string",
"slug": "string",
"subtitle": "string",
"description": "string",
"image": "string",
"status": "string",
"access": "string",
"webshop_product_id": "string",
"level": "string",
"language": "string",
"estimated_minutes": "string",
"certificate_enabled": "string",
"settings": "string",
"position": "string"
});
$data = $response->json();
import requests
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
data = {
"id": "string",
"title": "string",
"slug": "string",
"subtitle": "string",
"description": "string",
"image": "string",
"status": "string",
"access": "string",
"webshop_product_id": "string",
"level": "string",
"language": "string",
"estimated_minutes": "string",
"certificate_enabled": "string",
"settings": "string",
"position": "string"
}
r = requests.post("https://api.wemasy.nl/api/services/courses/v1/courses/save", headers=headers, json=data)
print(r.json())
{
"error": true,
"message": "string",
"data": {
"course": []
}
}