2.3 KiB
2.3 KiB
Todo Data Protocol
Scope
Defines the backend/frontend data contract for /api/v1/todos.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/todos |
Create todo |
| GET | /api/v1/todos |
List todos (supports status/priority filter) |
| GET | /api/v1/todos/{todo_id} |
Get todo detail |
| PATCH | /api/v1/todos/reorder |
Batch reorder todos |
| PATCH | /api/v1/todos/{todo_id} |
Update todo |
| POST | /api/v1/todos/{todo_id}/complete |
Mark todo completed |
| DELETE | /api/v1/todos/{todo_id} |
Delete todo |
Field Definitions
id: string (UUID)owner_id: string (UUID)title: string,1..255description: string ornull, max1000priority: int, quadrant value in[1, 4]order: int, zero-based ordering inside the sameprioritybucket,>= 0status: enum string:pending | done | canceledcompleted_at: datetime string ornullcreated_at: datetime stringupdated_at: datetime stringschedule_items: array
Request Contracts
Create Todo (POST /api/v1/todos)
- required:
title - optional:
description,priority,order,schedule_item_ids orderomitted: backend assigns append position in the target quadrant.
Update Todo (PATCH /api/v1/todos/{todo_id})
- optional:
title,description,priority,order,status,schedule_item_ids orderis interpreted inside the todo's finalpriorityquadrant.
List Todos (GET /api/v1/todos)
- query
status:pending | done | canceled(optional) - query
priority: integer in[1, 4](optional)
Reorder Todos (PATCH /api/v1/todos/reorder)
- body:
{ items: Array<{ id, priority, order }> } - each item requires:
id: UUIDpriority: integer in[1, 4]order: integer>= 0
Complete Todo (POST /api/v1/todos/{todo_id}/complete)
- body:
{} - effect: sets todo status to
doneand updatescompleted_at
Ordering Rules
- Todo list API returns items sorted by
priority ASC, thenorder ASC. - Drag reorder in same quadrant updates
orderto a continuous sequence starting from0. - Drag move across quadrants updates both
priorityandorder, and source/target quadrants should both stay contiguous from0.
Compatibility Notes
due_atis removed from todo protocol.- Clients must not send or depend on
due_atfor todo ordering.