From 26bb2787d39197e9dba9232263cfa3eb6512adb5 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Tue, 12 Aug 2025 14:09:17 -0300 Subject: [PATCH] docs: add REST API endpoints documentation to DESIGN.md Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) --- DESIGN.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/DESIGN.md b/DESIGN.md index ad4280e..2e4d026 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -61,3 +61,16 @@ - `plugins.rs` - Shared plugin utilities - Contains `ProgramWriter` for external process communication +## REST API Endpoints + +### Item Operations +- `GET /api/item/latest` - Return the latest item as JSON, with metadata and content. Optional params: `tags[]` (find latest with matching tags) +- `GET /api/item/latest/meta` - Return the latest item metadata as JSON. Optional params: `tags[]` +- `GET /api/item/latest/content` - Return the raw content of the latest item using the mime type from meta, or unknown binary. Optional params: `tags[]` +- `GET /api/item/<#>` - Return the item as JSON, with metadata and content +- `GET /api/item/<#>/meta` - Return the item metadata as JSON +- `GET /api/item/<#>/content` - Return the raw content of the item using the mime type from meta, or unknown binary +- `GET /api/item/` - Get a list of items as JSON. Optional params: `order=newest`, `start=0`, `count=100`, `tags[]` +- `POST /api/item/` - Add a new item. Optional params: `tags[]` (defaults to `['none']` if empty), `meta[]` +- `DELETE /api/item/<#>` - Delete an item +