Skip to main content

Projects

A project is the top-level container. Episodes, characters, locations, and world rules all belong to a project.

Endpoints overviewโ€‹

MethodEndpointPermissionDescription
GET/api/projectsauthenticatedList all projects
GET/api/projects/with-episodesauthenticatedList projects with episodes
GET/api/projects/:idauthenticatedGet project by ID
POST/api/projectsproject:createCreate a project
PUT / PATCH/api/projects/:idproject:editUpdate a project
DELETE/api/projects/:idproject:deleteDelete 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)

ParamTypeDescription
searchstringFull-text search on title
statusstringdraft | active | completed | paused
categoryIdstringAge-range like 4-6, or all
sortBystringtitle | createdAt | updatedAt
sortOrderstringasc | desc
limitnumberPage size
offsetnumberPage 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"
}
FieldRequiredNotes
titleyesDisplay title; auto-translated to all locales
codeyesURL-safe slug โ€” only a-z, 0-9, _ allowed
descriptionnoAuto-translated if provided
iconnoEmoji or image URL
targetEpisodeCountnoDefaults to 10
categoryIdnoAge-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