Calendar slots API
Slots are the synced entity slot, personal like a frame: one block on the Day and Week grid that holds a checklist of small tasks, such as "Admin" on Wednesday from 16:00 for 45 minutes.
Implementation notes
Slots (OpenSpec calendar-slots; guide: slots.md) are the synced entity slot, personal like a frame: one block on the Day and Week grid that holds a checklist of small tasks, such as "Admin" on Wednesday from 16:00 for 45 minutes. Fields: title (content, encrypted for an encrypted account; empty reads as "Slot"), date (YYYY-MM-DD), start (floating wall time HH:MM), minutes (15 to 480 in steps of 15; the op log accepts 1 to 1440), task_ids (ordered task ids, at most 20, written as one whole list), color (hex), created_at, deleted_at. No field is added to tasks: a task is in a slot when the slot lists it and the task is open and due on the slot's date without a time (or has no due date). Devices write slots through /api/v1/sync; the REST routes below add the checks.
- GET
/api/v1/slots - POST
/api/v1/slots - GET
/api/v1/slots/{id} - PATCH
/api/v1/slots/{id} - DELETE
/api/v1/slots/{id}
GET /api/v1/slots
List slots · Token or session
?from=&to= (optional dates, inclusive) → {slots: [{id, title, date, start, minutes, task_ids, color, created_at, encrypted}]} by date and start
| Field | Type | Description |
|---|---|---|
slots required | array of object |
POST /api/v1/slots
Create a slot · Token or session
{date, title?, start?, minutes?, task_ids?, color?, move_tasks?} → 201 slot (defaults 09:00, 30 minutes, #64748b)
| Field | Type | Description |
|---|---|---|
color required | string | |
date required | string | |
minutes required | string | |
move_tasks required | boolean | |
start required | string | |
task_ids required | string | |
title required | string |
| Field | Type | Description |
|---|---|---|
encrypted | boolean | |
id required | string |
GET /api/v1/slots/{id}
Get a slot · Token or session
PATCH takes the same fields → 200 slot; DELETE → 204 (a tombstone; the tasks keep their date without a time); an unknown or deleted id answers 404 not_found
| Field | Type | Description |
|---|---|---|
id required | string | path |
| Field | Type | Description |
|---|---|---|
encrypted | boolean | |
id required | string |
PATCH /api/v1/slots/{id}
Update a slot · Token or session
PATCH takes the same fields → 200 slot; DELETE → 204 (a tombstone; the tasks keep their date without a time); an unknown or deleted id answers 404 not_found
| Field | Type | Description |
|---|---|---|
id required | string | path |
| Field | Type | Description |
|---|---|---|
color required | string | |
date required | string | |
minutes required | string | |
move_tasks required | boolean | |
start required | string | |
task_ids required | string | |
title required | string |
| Field | Type | Description |
|---|---|---|
encrypted | boolean | |
id required | string |
DELETE /api/v1/slots/{id}
Delete a slot · Token or session
PATCH takes the same fields → 200 slot; DELETE → 204 (a tombstone; the tasks keep their date without a time); an unknown or deleted id answers 404 not_found
| Field | Type | Description |
|---|---|---|
id required | string | path |