Agent: Courses¶
List courses¶
GET /api/v1/agent/courses/
Requires courses: view.
Authentication: API key — Authorization: Bearer <key>
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Create a course¶
POST /api/v1/agent/courses/
Requires courses: edit. Subject to the plan's course limit, exactly as in the creator studio: over it, the answer is 403 with code: course_limit.
Authentication: API key — Authorization: Bearer <key>
Request body (JSON):
{
"title": "string",
"slug": "string",
"description": null,
"thumbnail_url": "https://example.com/",
"status": "draft",
"visibility": "public",
"level": "beginner",
"grade_level": "k-2",
"language": "string",
"category": 0,
"estimated_duration_minutes": 0,
"sales_page_blocks": null,
"landing_title": "string",
"meta_title": "string",
"meta_description": "string",
"og_image_url": "https://example.com/",
"timezone": "string",
"length_mode": "none",
"duration_days": 0,
"start_date": "2026-01-01",
"end_date": "2026-01-01",
"schedule_basis": "absolute"
}
curl -sS -X POST "https://www-dev.yoshuko.com/api/v1/agent/courses/" \
-H "Authorization: Bearer $YOSHUKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "string", "slug": "string", "description": null, "thumbnail_url": "https://example.com/", "status": "draft", "visibility": "public", "level": "beginner", "grade_level": "k-2", "language": "string", "category": 0, "estimated_duration_minutes": 0, "sales_page_blocks": null, "landing_title": "string", "meta_title": "string", "meta_description": "string", "og_image_url": "https://example.com/", "timezone": "string", "length_mode": "none", "duration_days": 0, "start_date": "2026-01-01", "end_date": "2026-01-01", "schedule_basis": "absolute"}'
import os
import requests
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/"
payload = {
"title": "string",
"slug": "string",
"description": None,
"thumbnail_url": "https://example.com/",
"status": "draft",
"visibility": "public",
"level": "beginner",
"grade_level": "k-2",
"language": "string",
"category": 0,
"estimated_duration_minutes": 0,
"sales_page_blocks": None,
"landing_title": "string",
"meta_title": "string",
"meta_description": "string",
"og_image_url": "https://example.com/",
"timezone": "string",
"length_mode": "none",
"duration_days": 0,
"start_date": "2026-01-01",
"end_date": "2026-01-01",
"schedule_basis": "absolute"
}
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, json=payload, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"title": "string",
"slug": "string",
"description": null,
"thumbnail_url": "https://example.com/",
"status": "draft",
"visibility": "public",
"level": "beginner",
"grade_level": "k-2",
"language": "string",
"category": 0,
"estimated_duration_minutes": 0,
"sales_page_blocks": null,
"landing_title": "string",
"meta_title": "string",
"meta_description": "string",
"og_image_url": "https://example.com/",
"timezone": "string",
"length_mode": "none",
"duration_days": 0,
"start_date": "2026-01-01",
"end_date": "2026-01-01",
"schedule_basis": "absolute"
})
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
201 |
No response body |
400 |
Validation failed; the body names each field. |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Get a course¶
GET /api/v1/agent/courses/{id}/
Requires courses: view.
Authentication: API key — Authorization: Bearer <key>
| Parameter | In | Required | Description |
|---|---|---|---|
id |
path | yes |
import os
import requests
id = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{id}/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const id = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${id}/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Replace a course¶
PUT /api/v1/agent/courses/{id}/
Requires courses: edit.
Authentication: API key — Authorization: Bearer <key>
| Parameter | In | Required | Description |
|---|---|---|---|
id |
path | yes |
Request body (JSON):
{
"title": "string",
"slug": "string",
"description": null,
"thumbnail_url": "https://example.com/",
"status": "draft",
"visibility": "public",
"level": "beginner",
"grade_level": "k-2",
"language": "string",
"category": 0,
"estimated_duration_minutes": 0,
"sales_page_blocks": null,
"landing_title": "string",
"meta_title": "string",
"meta_description": "string",
"og_image_url": "https://example.com/",
"timezone": "string",
"length_mode": "none",
"duration_days": 0,
"start_date": "2026-01-01",
"end_date": "2026-01-01",
"schedule_basis": "absolute"
}
ID="..."
curl -sS -X PUT "https://www-dev.yoshuko.com/api/v1/agent/courses/$ID/" \
-H "Authorization: Bearer $YOSHUKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "string", "slug": "string", "description": null, "thumbnail_url": "https://example.com/", "status": "draft", "visibility": "public", "level": "beginner", "grade_level": "k-2", "language": "string", "category": 0, "estimated_duration_minutes": 0, "sales_page_blocks": null, "landing_title": "string", "meta_title": "string", "meta_description": "string", "og_image_url": "https://example.com/", "timezone": "string", "length_mode": "none", "duration_days": 0, "start_date": "2026-01-01", "end_date": "2026-01-01", "schedule_basis": "absolute"}'
import os
import requests
id = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{id}/"
payload = {
"title": "string",
"slug": "string",
"description": None,
"thumbnail_url": "https://example.com/",
"status": "draft",
"visibility": "public",
"level": "beginner",
"grade_level": "k-2",
"language": "string",
"category": 0,
"estimated_duration_minutes": 0,
"sales_page_blocks": None,
"landing_title": "string",
"meta_title": "string",
"meta_description": "string",
"og_image_url": "https://example.com/",
"timezone": "string",
"length_mode": "none",
"duration_days": 0,
"start_date": "2026-01-01",
"end_date": "2026-01-01",
"schedule_basis": "absolute"
}
response = requests.put(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, json=payload, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const id = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${id}/`, {
method: "PUT",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"title": "string",
"slug": "string",
"description": null,
"thumbnail_url": "https://example.com/",
"status": "draft",
"visibility": "public",
"level": "beginner",
"grade_level": "k-2",
"language": "string",
"category": 0,
"estimated_duration_minutes": 0,
"sales_page_blocks": null,
"landing_title": "string",
"meta_title": "string",
"meta_description": "string",
"og_image_url": "https://example.com/",
"timezone": "string",
"length_mode": "none",
"duration_days": 0,
"start_date": "2026-01-01",
"end_date": "2026-01-01",
"schedule_basis": "absolute"
})
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Update a course¶
PATCH /api/v1/agent/courses/{id}/
Requires courses: edit.
Authentication: API key — Authorization: Bearer <key>
| Parameter | In | Required | Description |
|---|---|---|---|
id |
path | yes |
Request body (JSON):
{
"title": "string",
"slug": "string",
"description": null,
"thumbnail_url": "https://example.com/",
"status": "draft",
"visibility": "public",
"level": "beginner",
"grade_level": "k-2",
"language": "string",
"category": 0,
"estimated_duration_minutes": 0,
"sales_page_blocks": null,
"landing_title": "string",
"meta_title": "string",
"meta_description": "string",
"og_image_url": "https://example.com/",
"timezone": "string",
"length_mode": "none",
"duration_days": 0,
"start_date": "2026-01-01",
"end_date": "2026-01-01",
"schedule_basis": "absolute"
}
ID="..."
curl -sS -X PATCH "https://www-dev.yoshuko.com/api/v1/agent/courses/$ID/" \
-H "Authorization: Bearer $YOSHUKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "string", "slug": "string", "description": null, "thumbnail_url": "https://example.com/", "status": "draft", "visibility": "public", "level": "beginner", "grade_level": "k-2", "language": "string", "category": 0, "estimated_duration_minutes": 0, "sales_page_blocks": null, "landing_title": "string", "meta_title": "string", "meta_description": "string", "og_image_url": "https://example.com/", "timezone": "string", "length_mode": "none", "duration_days": 0, "start_date": "2026-01-01", "end_date": "2026-01-01", "schedule_basis": "absolute"}'
import os
import requests
id = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{id}/"
payload = {
"title": "string",
"slug": "string",
"description": None,
"thumbnail_url": "https://example.com/",
"status": "draft",
"visibility": "public",
"level": "beginner",
"grade_level": "k-2",
"language": "string",
"category": 0,
"estimated_duration_minutes": 0,
"sales_page_blocks": None,
"landing_title": "string",
"meta_title": "string",
"meta_description": "string",
"og_image_url": "https://example.com/",
"timezone": "string",
"length_mode": "none",
"duration_days": 0,
"start_date": "2026-01-01",
"end_date": "2026-01-01",
"schedule_basis": "absolute"
}
response = requests.patch(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, json=payload, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const id = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${id}/`, {
method: "PATCH",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"title": "string",
"slug": "string",
"description": null,
"thumbnail_url": "https://example.com/",
"status": "draft",
"visibility": "public",
"level": "beginner",
"grade_level": "k-2",
"language": "string",
"category": 0,
"estimated_duration_minutes": 0,
"sales_page_blocks": null,
"landing_title": "string",
"meta_title": "string",
"meta_description": "string",
"og_image_url": "https://example.com/",
"timezone": "string",
"length_mode": "none",
"duration_days": 0,
"start_date": "2026-01-01",
"end_date": "2026-01-01",
"schedule_basis": "absolute"
})
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Delete a course¶
DELETE /api/v1/agent/courses/{id}/
Requires courses: edit.
Authentication: API key — Authorization: Bearer <key>
| Parameter | In | Required | Description |
|---|---|---|---|
id |
path | yes |
import os
import requests
id = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{id}/"
response = requests.delete(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const id = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${id}/`, {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
204 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |