-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
github-actions[bot] edited this page May 5, 2026
·
25 revisions
all API routes live under /api/* and are handled by PHP.
- returns
{ isAdmin: boolean } - refreshes frontend admin awareness for maintenance-mode bypass logic
GET
- requires logged-in user
- returns current settings from
data/accounts/accounts.json - currently exposes
theme,glowIntensity,colors, andmobileFriendlyView
POST
- requires logged-in user
- updates user settings in
accounts.json - can set
themetodefault,custom, or a valid/themes/*.jsontheme id - can set
mobileFriendlyViewand sync themobile_friendly_viewcookie - syncs the
theme_prefcookie so anonymous and first-load rendering can pick the active theme - validates color fields as
#RRGGBB - admin users can also toggle maintenance mode through the settings flow
GET
- public route
- returns selectable themes discovered from
/themes/*.json - each valid theme must include
name,html, andcss - theme
htmlandcsspaths are resolved from/themes/lib
POST only.
- requires logged-in user for server persistence
- supports single toggle via
postId - supports full replacement via
bookmarks - writes normalized bookmark ids back to
accounts.json - bookmark ids currently include raw feed ids,
journal:{id}, andnewsletter:{id} - anonymous bookmarking is handled client-side in localStorage instead
POST JSON payload with { markdown, password, hardBreaks }.
- stores temporary markdown paste records in
data/mdpaste - empty passwords create public pastes
- non-empty passwords encrypt the markdown before storage
-
hardBreaksstores whether single line breaks render as line breaks in formatted paragraphs - returns
{ ok, id, url, expires_at, encrypted } - rejects blank pastes and content over 512 KiB
- returns parsed feed post JSON for a supplied
?id= - does not expose replies; thread replies are loaded directly by
/feed/posts/{id}fromdata/feed/replies/*.json
- admin-only image deletion from
data/images - validates filename/path and allowed image extensions
- writes newsletter HTML to
data/newsletter/{id}.html - this is the real publish endpoint, not an
/email/*route
- admin-only sitemap generator
- scans routes and content files
- writes
/sitemap.xml
- reads
data/etc/toast.json - returns bot and stream status payload for UI consumers
POST JSON payload with stream info.
- updates stream URL and name in
data/etc/toast.json - writes a stream update signal for downstream consumers
POST JSON payload with bot status.
- updates bot online/offline state in
data/etc/toast.json
- same-origin proxy for stream audio playback
- host-restricted based on configured stream host
- used by toast playback UI
POST JSON payload with { path }.
- normalizes route path
- rejects
/api/*paths - hashes client IP before storage
- updates
data/etc/page_views.json - returns updated page count
- returns CPU, memory, and disk usage data
- includes Linux and Windows code paths
- most endpoints return JSON and perform direct file IO
- write-heavy endpoints should be treated carefully because there is no database transaction safety blanket here
-
/api/page-viewalready uses file locking, which is the sane move - some account and toast integrations also talk to a localhost-only bot HTTP service on
127.0.0.1:8765, but those are not public/api/*routes