New frontmatter'd docs with real shapes (sqlc models pinned directly):
- bookmarks: get/create/update/delete (sync-aware rows: dedup_key,
last_modified_*, tombstones; delete is 204)
- review: upsert (empty string DELETES the review) / get (200 with
{review:null} when absent) / delete
- get single note + highlight (full sqlc row shapes)
- annotation history: restore (POST, kind via query or body) and purge
(DELETE, kind via required query; permanent)
Gate hardening forced by this batch:
- required-field walk now guards non-struct Request types (RawMessage pins)
- update_media_bookmark needed a full example block (no cross-reference
shortcuts — the gate checks every doc standalone)
1.0 KiB
1.0 KiB
method, path, auth, area
| method | path | auth | area |
|---|---|---|---|
| POST | /api/media-items/:id/annotations/:annotationId/restore | jwt | media-items |
Restore Deleted Annotation
Restores a tombstoned annotation (highlight, note, or bookmark). The kind is
read from the annotation_type query parameter or, if absent, from a JSON
body {"annotation_type": "..."}.
Example request
POST /api/media-items/550e8400-.../annotations/440e8400-.../restore?annotation_type=highlight
Example response
{
"restored": true
}
Errors
| Status | Body | When |
|---|---|---|
| 400 | {"error": "annotation_type must be highlight, note, or bookmark"} |
missing/invalid kind |
| 404 | {"error": "deleted annotation not found"} |
nothing tombstoned under that id |
| 500 | {"error": "failed to restore annotation"} |
unexpected server error |
| 503 | {"error": "annotation service unavailable"} |
service not constructed |