Skip to main content

Tasks

User tasks track personal work items, optionally linked to one or more episodes. Tasks can be scoped to a specific user or to a role. Admins can view all tasks; regular users see only their own.

Endpoints overview

MethodEndpointPermissionDescription
GET/api/user-tasksauthenticatedGet tasks for a user
GET/api/user-tasks/alladmin:dashboardGet all tasks (Admin)
POST/api/user-tasksauthenticatedCreate a task
PATCH/api/user-tasks/:idauthenticatedUpdate task (assign user)
PATCH/api/user-tasks/:id/statusauthenticatedUpdate task status
DELETE/api/user-tasks/:idauthenticatedDelete a task
POST/api/user-tasks/:id/episodesauthenticatedLink task to episode
DELETE/api/user-tasks/:id/episodes/:episodeIdauthenticatedUnlink task from episode

Endpoints

Get tasks for a user

GET /api/user-tasks — Auth required

Query params

ParamTypeRequiredDescription
userIdstring (UUID)yesReturn tasks for this user

Response200

[
{
"id": "task-uuid-001",
"userId": "user-uuid-001",
"roleId": "role-uuid-001",
"title": "Review episode 3 script",
"titleI18n": { "uk": "Перевірити сценарій 3 епізоду", "en": "Review episode 3 script", "es": "Revisar el guion del episodio 3" },
"description": "Check continuity with episode 2",
"descriptionI18n": { "uk": "Перевірити безперервність з епізодом 2", "en": "Check continuity with episode 2", "es": "Verificar continuidad con el episodio 2" },
"url": "",
"status": "to-do",
"createdAt": "2025-03-01T10:00:00.000Z",
"updatedAt": "2025-03-01T10:00:00.000Z",
"userEmail": "writer@example.com",
"roleName": "Script Writer"
}
]

Get all tasks (Admin)

GET /api/user-tasks/all — Auth required, Permission: admin:dashboard

Returns every task across all users. Supports date filtering.

Query params (all optional)

ParamTypeDescription
filterstringtoday | monthly | range
monthnumberMonth index (0-based). Used with filter=monthly
yearnumberFull year. Used with filter=monthly
dateFromstringISO date string. Used with filter=range
dateTostringISO date string. Used with filter=range

Response200 — array of task objects (same shape as above)


Create task

POST /api/user-tasks — Auth required

Request body

{
"title": "Review episode 3 script",
"roleId": "role-uuid-001",
"userId": "user-uuid-001",
"description": "Check continuity with episode 2",
"url": "",
"status": "to-do"
}
FieldRequiredNotes
roleIdyesUUID of the role this task belongs to
titleyesAuto-translated
userIdnoUUID of the assigned user
descriptionnoAuto-translated if provided
urlnoExternal link
statusnoDefaults to "to-do"

Response201 — created task object


Update task (assign user)

PATCH /api/user-tasks/:id — Auth required

Updates the userId assignment on the task.

Request body

{ "userId": "user-uuid-002" }

Response200 — updated task object


Update task status

PATCH /api/user-tasks/:id/status — Auth required

Request body

{
"status": "in-progress",
"episodeId": "ep-uuid-001"
}
FieldRequiredNotes
statusyesto-do | in-progress | blocked | done
episodeIdnoIf provided, the status change is recorded for this specific episode link

Response200 — updated task object


Delete task

DELETE /api/user-tasks/:id — Auth required

Response204


POST /api/user-tasks/:id/episodes — Auth required

Request body

{
"episodeId": "ep-uuid-001",
"order": 1
}
FieldRequiredNotes
episodeIdyesUUID of the episode to link
ordernoDisplay order; defaults to 0

Response204


DELETE /api/user-tasks/:id/episodes/:episodeId — Auth required

Response204