Tasks
The clinic's shared to-do board.
| Method | Path | Permission |
|---|---|---|
GET | /api/tasks | task:read |
POST | /api/tasks | task:write |
PATCH | /api/tasks/{id} | task:write |
DELETE | /api/tasks/{id} | task:delete |
The task object
| Field | Type | Notes |
|---|---|---|
id | string | Assigned by the server |
title | string | Required. Max 200 characters |
assignee | string | Display name of the assignee; defaults to "Unassigned" |
assigneeRole | string | null | Department/role the task is assigned to |
assigneeUserId | string | null | A specific person the task is assigned to (user id). When set, the task surfaces for that person and takes precedence over assigneeRole |
due | string | Free text, defaults to "No due date" |
priority | enum | high | medium (default) | low |
status | enum | todo (default) | in_progress | done — the board column |
patient | string | null | Linked patient, if any |
notes | string | null | Free text |
done | boolean | Completion state — kept in sync with status (done === status === "done") |
createdByName | string | Who created the task |
status drives the kanban board column. It stays consistent with done: setting
status to done marks the task done (and vice-versa); patching done maps it to
done/todo. Send either field in a PATCH to move a task between columns.
A task can be assigned three ways from the New task dialog: to Myself (a personal
task, both fields null), to a Department (assigneeRole), or to a specific Person
(assigneeUserId, picked from the clinic's providers — send the chosen person's name as
assignee). Non-admins see tasks they created, tasks for their department, and tasks
assigned to them personally.
Examples
# Create
curl -b cookies.txt -X POST http://localhost:4000/api/tasks \
-H "Content-Type: application/json" \
-d '{
"title": "Call Hodan Warsame with lab results",
"assignee": "Dr. Amina Yusuf",
"due": "2026-06-12",
"priority": "high",
"patient": "Hodan Warsame"
}'
# PATCH accepts any subset of fields — e.g. just toggle done:
curl -b cookies.txt -X PATCH http://localhost:4000/api/tasks/TASK_ID \
-H "Content-Type: application/json" \
-d '{ "done": true }'PATCH is a partial update — send only the fields you're changing. Create returns
201; delete returns 204.