# Plugin API Reference --- ## REST Endpoints All plugin endpoints are under `/api/plugins`. Endpoints that modify state require authentication. ### List Plugins ``` GET /api/plugins ``` Returns an array of all discovered plugins and their current state. **Response** ```json [ { "id": "themes", "name": "Themes", "version": "1.2.0", "type": "provider", "state": "active", "bundled": true, "nav": { "label": "Themes", "icon": "swatch", "order": 80 } } ] ``` `state` is one of: `discovered`, `validating`, `loading`, `setting_up`, `active`, `tearing_down`, `disabled`, `errored`. --- ### Get Plugin ``` GET /api/plugins/:id ``` Returns detailed information for a single plugin including full manifest and current state. --- ### Serve Plugin Asset ``` GET /api/plugins/:id/file/*path ``` Serves a static file from the plugin's directory. No authentication required — used by the frontend to load plugin scripts and Vue components. --- ### Enable Plugin ``` POST /api/plugins/:id/enable ``` Marks the plugin as enabled in `disabled-plugins.json`. Takes effect on the next server restart. **Response** `200 OK` --- ### Disable Plugin ``` POST /api/plugins/:id/disable ``` Marks the plugin as disabled. Takes effect on the next server restart. **Response** `200 OK` --- ### List Providers ``` GET /api/plugins/providers ``` Returns all registered provider implementations grouped by type. **Response** ```json { "storage": [ { "name": "local", "pluginId": "built-in-storage", "active": true }, { "name": "s3", "pluginId": "storage-s3", "active": false } ], "metadata": [ { "name": "musicbrainz", "pluginId": "metadata-mb", "active": true } ] } ``` --- ### Switch Active Provider ``` PUT /api/plugins/providers/:type/active ``` Changes the active provider for a given type. Requires the `settings` permission. **Body** ```json { "name": "s3" } ``` **Response** `200 OK` --- ### Plugin Settings Page ``` GET /api/plugins/:id/settings ``` Returns the raw HTML defined in the plugin manifest's `settings` field. Rendered inside an `