5 minutes to help shape OpenTodo. Anonymous, no account. Take the survey

Server themes API

The owner sets the default light and dark theme of the server and offers up to 20 server themes to everyone (Settings → Server → Branding).

Implementation notes

The owner sets the default light and dark theme of the server and offers up to 20 server themes to everyone (Settings → Server → Branding). A member whose choice for a side is empty sees the server default; a member's own choice always wins, and nothing is written to anyone's data. GET /api/v1/auth/status carries "themes": {"version": 3} for a signed-in caller; the version grows with every change, so a device reads the themes again when it differs from the one it has.

PUT /api/v1/settings/themes/default

Update settings themes default · Token or session

Owner. {light, dark}, each "", builtin:<id> or instance:<id> of that side's kind (400 invalid_input for an unknown id or a theme of the other kind; OpenTodo's own theme is stored as ""). Answers like the read; recorded as settings.changed (themes.default.light, themes.default.dark, the ids only)

Only the server's owner.

Request body
FieldTypeDescription
dark requiredstring
light requiredstring
Response 200
FieldTypeDescription
default requiredobject
default.dark requiredstring
default.light requiredstring
themes requiredarray of object
themes[].doc requiredstring
themes[].id requiredstring
themes[].kind requiredstring
version requirednumber

PUT /api/v1/settings/themes/instance/{id}

Replace a settings themes instance · Token or session

Owner. A theme document as the body, at most 16 KB (413 too_large), valid (400 invalid_input); {id} is new to add one (409 limit_reached past 20) or the id of one to replace (404 not_found). The server sets the document's id. A theme that is a default keeps its kind (400 invalid_input). Answers the read plus the theme's id; recorded as settings.changed (themes.instance, added or changed and the id)

Only the server's owner.

Path parameters
FieldTypeDescription
id requiredstringpath
Response 200
FieldTypeDescription
default requiredobject
default.dark requiredstring
default.light requiredstring
id requiredstring
themes requiredarray of object
themes[].doc requiredstring
themes[].id requiredstring
themes[].kind requiredstring
version requirednumber

DELETE /api/v1/settings/themes/instance/{id}

Delete a settings themes instance · Token or session

Owner. Removes the theme and clears a default that names it in the same change (404 not_found for an unknown id). Members who chose it fall back to their side's default and keep their stored choice. Recorded as settings.changed (themes.instance, removed and the id)

Only the server's owner.

Path parameters
FieldTypeDescription
id requiredstringpath
Response 200
FieldTypeDescription
default requiredobject
default.dark requiredstring
default.light requiredstring
themes requiredarray of object
themes[].doc requiredstring
themes[].id requiredstring
themes[].kind requiredstring
version requirednumber

GET /api/v1/themes/instance

Get themes instance · Token or session

Signed in (read tokens too). Answers {version, default: {light, dark}, themes: [{id, kind, doc}]}: each default is "" (OpenTodo's), builtin:<id> or instance:<id>; each doc is a theme document (docs/themes.md) whose id is the server id. 401 unauthorized without a session or token

Response 200
FieldTypeDescription
default requiredobject
default.dark requiredstring
default.light requiredstring
themes requiredarray of object
themes[].doc requiredstring
themes[].id requiredstring
themes[].kind requiredstring
version requirednumber

This group in the HTTP API guide