HTTP API The GUI, the waypaper-daemon CLI and your scripts all use the same JSON API, served on a Unix socket at $XDG_RUNTIME_DIR/waypaper-engine.sock (see Paths & files ). There is no authentication; the socket's file permissions are the access control.
bash SOCK = "$XDG_RUNTIME_DIR/waypaper-engine.sock"
curl -sS --unix-socket "$SOCK" http://localhost/wallpaper/current
curl -sS --unix-socket "$SOCK" -X POST http://localhost/wallpaper/random \
-H 'Content-Type: application/json' -d '{"monitor":"*"}' Bodies are JSON except thumbnails, raw files, theme CSS and the event stream. Lists take page (from 1) and per_page (default 50, max 200). Full schema: openapi.yaml .
Errors Failures return a non-2xx status and:
json { "error" : "message" , "code" : 400 , "details" : "..." , "error_code" : "no_backend" , "meta" : {} } error and code (same as the HTTP status) are always present. details, error_code (incompatible_backend or no_backend, from wallpaper routes) and meta appear sometimes. Statuses: 400 bad input, 404 unknown id/section/backend, 500 internal, 503 no backend installed. Every response has an X-Request-ID header that also appears in the daemon log.
Routes {id} is an integer.
Health and daemon Method Path Notes GET /healthzstatus: "ok".GET /infoversion, pid, hostname, uptime, go_version, os, arch.GET /capabilitiesffmpeg_available.POST /shutdownReplies {"status":"shutting_down"}, then stops. GET /eventsSSE stream; ?types=a,b filters. See Events .
Images Method Path Notes GET /imagesPaged gallery. Query: page, per_page, sort_by (name, imported_at, file_size, hue), sort_order (asc, desc; default desc), media_type, search, tags (comma list), colors (comma list of hex), colors_near (#hex~maxDeltaE, comma list), hue_group (0 to 11, or 99 for neutral), palette_similar_to (image id), palette_max_delta_e, folder_id. POST /imagesImport files. Body: paths (list), optional folder_id. Async; returns status, total, batch_id; progress arrives as events. POST /images/import-webImport an HTML wallpaper folder. Body: path, optional folder_id. DELETE /imagesBody: ids (list). Returns deleted count. GET /images/tagsDistinct tag list. GET /images/historyApply history. Query: monitor, limit, since_id. DELETE /images/historyClear history. POST /images/cancel-importCancel a running import by batch_id. POST /images/select-allBody: selected (bool). GET /images/{id}One image. PATCH /images/{id}Update metadata. Patching name renames the file on disk. GET /images/{id}/thumbnailWebP. Query: resolution (default, 720p, 1080p, 1440p, 4k). GET /images/{id}/rawThe original file. POST /images/{id}/ensure-browser-previewBuild an H.264 preview for a video if missing; ?force=1 rebuilds. Needs ffmpeg. POST /images/{id}/video-loop-exportBody: in_seconds, out_seconds, preset, action, optional folder_id, blend_halves. POST /images/{id}/extract-video-paletteBody: time_seconds. Stores and returns colors.
Wallpaper Method Path Notes GET /wallpaper/currentCurrent wallpaper per monitor. POST /wallpaper/setBody: image_id, monitor or monitors, mode (individual, clone, extend). POST /wallpaper/randomOptional body: monitor (default *), mode (default individual).
Playlists Method Path Notes GET /playlistsList. POST /playlistsCreate. Returns 201. GET /playlists/{id}One playlist. PATCH /playlists/{id}Update. DELETE /playlists/{id}Delete. POST /playlists/{id}/startBody: monitors (list), extend (bool). POST /playlists/{id}/stopPOST /playlists/{id}/pausePOST /playlists/{id}/resumePOST /playlists/{id}/nextPOST /playlists/{id}/previousGET /playlists/activeRunning playlists. GET /playlists/active/{monitor}Running playlist on one monitor. POST /playlists/active/stopStop all. Returns stopped count. POST /playlists/active/pausePause all. Returns paused. POST /playlists/active/resumeResume all. Returns resumed. POST /playlists/active/nextAdvance all. Returns advanced. POST /playlists/active/previousStep all back. Returns reversed.
Folders Method Path Notes GET /foldersQuery: parent_id (id, root or null), search. POST /foldersBody: name, parent_id. Returns 201. POST /folders/move-imagesBody: image_ids, folder_id. GET /folders/{id}One folder. PATCH /folders/{id}Rename or move. DELETE /folders/{id}Query: mode = keep_contents (default) or delete_all. GET /folders/{id}/pathBreadcrumb path.
Monitors Method Path Notes GET /monitorsConnected outputs. GET /monitors/{name}One output, e.g. DP-1.
Config and backends Keys: config.toml .
Method Path Notes GET /configWhole config; backend settings under backend.<name>. PATCH /configBody: {"<section>": {...}}. POST /config/resetReset to factory defaults. GET /config/{section}app, daemon, monitors, wallhaven. backend returns 404.PATCH /config/{section}Same sections. Returns the updated section. GET /config/backends/{backend}One backend's settings. PATCH /config/backends/{backend}Validated by the backend; 400 if invalid. POST /config/backends/{backend}/resetReset one backend to defaults. GET /backendsEvery backend, whether installed, and its capabilities. POST /backends/{name}/activateSwitch the active backend.
User themes Method Path Notes GET /api/themesUser palettes (Themes ). GET /api/themes/{name}.cssThe CSS file.