Projects
A project is the top-level container. Episodes, characters, locations, and world rules all belong to a project.
Endpoints overviewโ
| Method | Endpoint | Permission | Description |
|---|---|---|---|
GET | /api/projects | authenticated | List all projects |
GET | /api/projects/with-episodes | authenticated | List projects with episodes |
GET | /api/projects/:id | authenticated | Get project by ID |
POST | /api/projects | project:create | Create a project |
PUT / PATCH | /api/projects/:id | project:edit | Update a project |
DELETE | /api/projects/:id | project:delete | Delete a project |
Endpointsโ
List projectsโ
GET /api/projects โ Auth required
Supports optional filters via query params. When no params are supplied all projects are returned.
Query params (all optional)
| Param | Type | Description |
|---|---|---|
search | string | Full-text search on title |
status | string | draft | active | completed | paused |
categoryId | string | Age-range like 4-6, or all |
sortBy | string | title | createdAt | updatedAt |
sortOrder | string | asc | desc |
limit | number | Page size |
offset | number | Page offset |
Response โ 200
{
"projects": [
{
"id": "a1b2c3d4-0000-0000-0000-000000000001",
"code": "myproject",
"title": "My Project",
"description": "A great animated series",
"titleI18n": { "uk": "ะัะน ะฟัะพะตะบั", "en": "My Project", "es": "Mi proyecto" },
"descriptionI18n": { "uk": "ะะตะปะธะบะธะน ัะตััะฐะป", "en": "A great animated series", "es": "Una gran serie" },
"icon": "๐ฌ",
"targetEpisodeCount": 10,
"status": "active",
"categoryId": "4-6",
"category": { "id": "4-6", "name": "4โ6 years", "icon": null },
"progress": 40,
"safety": 95,
"createdAt": "2025-01-10T09:00:00.000Z",
"updatedAt": "2025-03-15T12:00:00.000Z",
"episodeCount": 4
}
],
"total": 1,
"filtered": 1
}
List projects with episodesโ
GET /api/projects/with-episodes โ Auth required
Returns each project with its nested episodes array โ useful for the sidebar/dashboard.
Response โ 200
{
"projects": [
{
"id": "a1b2c3d4-0000-0000-0000-000000000001",
"code": "myproject",
"title": "My Project",
"description": null,
"titleI18n": { "uk": "ะัะน ะฟัะพะตะบั", "en": "My Project", "es": "Mi proyecto" },
"descriptionI18n": { "uk": "", "en": "", "es": "" },
"icon": "๐ฌ",
"targetEpisodeCount": 10,
"status": "active",
"categoryId": "4-6",
"category": { "id": "4-6", "name": "4โ6 years", "icon": null },
"progress": 20,
"safety": null,
"createdAt": "2025-01-10T09:00:00.000Z",
"updatedAt": "2025-03-15T12:00:00.000Z",
"episodeCount": 2,
"episodes": [
{
"id": "ep-uuid-001",
"code": "ep01",
"projectId": "a1b2c3d4-0000-0000-0000-000000000001",
"episodeNumber": 1,
"title": "Episode 1",
"description": null,
"titleI18n": { "uk": "ะะฟัะทะพะด 1", "en": "Episode 1", "es": "Episodio 1" },
"descriptionI18n": { "uk": "", "en": "", "es": "" },
"icon": null,
"previewUrl": null,
"targetDuration": 300,
"status": "draft",
"safety": null,
"isLocked": false,
"tasks": [],
"createdAt": "2025-01-11T09:00:00.000Z",
"updatedAt": "2025-01-11T09:00:00.000Z",
"approved": false,
"templateId": null
}
]
}
],
"total": 1
}
Get project by IDโ
GET /api/projects/:id โ Auth required
Response โ 200 โ single project object (same shape as a list item, without episodes)
Create projectโ
POST /api/projects โ Auth required, Permission: project:create
Request body
{
"title": "My Project",
"code": "myproject",
"description": "A great animated series",
"icon": "๐ฌ",
"targetEpisodeCount": 10,
"categoryId": "4-6"
}
| Field | Required | Notes |
|---|---|---|
title | yes | Display title; auto-translated to all locales |
code | yes | URL-safe slug โ only a-z, 0-9, _ allowed |
description | no | Auto-translated if provided |
icon | no | Emoji or image URL |
targetEpisodeCount | no | Defaults to 10 |
categoryId | no | Age-range string like "4-6". Defaults to "4-6" |
Response โ 201 โ created project object
Update projectโ
PUT /api/projects/:id or PATCH /api/projects/:id โ Auth required, Permission: project:edit
Request body (all fields optional)
{
"title": "Updated Title",
"description": "New description",
"icon": "๐ฅ",
"targetEpisodeCount": 12,
"status": "active",
"categoryId": "7-9"
}
status values: draft | active | completed | paused
Response โ 200 โ updated project object
Delete projectโ
DELETE /api/projects/:id โ Auth required, Permission: project:delete
Response โ 204