Plugins API Documentation
The PluginsController
handles actions related to managing
plugins in the system. This includes viewing the list of plugins,
enabling/disabling them, and rescanning/reloading the plugins directory.
Controller Route: /api/settings/plugins
All routes within the PluginsController
are prefixed by
/api/settings/plugins
.
Summary of Endpoints
Endpoint | Method | Description | Authorization |
---|---|---|---|
/api/settings/plugins/list |
GET | View a list of all available plugins. | Admin |
/api/settings/plugins/disable |
POST | Disable a specific plugin by name and author. | Admin |
/api/settings/plugins/enable |
POST | Enable a specific plugin by name and author. | Admin |
/api/settings/plugins/rescan |
POST | Rescan the plugins folder and reload plugins. | Admin |
/api/settings/plugins/reload |
POST | Reload all loaded plugins. | Admin |
Endpoint Details
View Plugins
Fetch a list of all available plugins with their details, including whether they are enabled or disabled.
Details:
-
Endpoint:
/api/settings/plugins/list
- Method:
GET
- Authorization: JWT (Roles: Admin)
Parameters: None
Responses:
- 200 OK: Returns a list of plugins with their details (name, author, version, description, and enabled/disabled status).
Example Request (using curl
):
curl -X GET "https://your-api-url.com/api/settings/plugins/list" \
-H "Authorization: Bearer <JWT-token>"
Disable Plugin
Disable a specific plugin by its name and author.
Details:
-
Endpoint:
/api/settings/plugins/disable
- Method:
POST
- Authorization: JWT (Roles: Admin)
Parameters:
- name (string, required): The name of the plugin.
- author (string, required): The author of the plugin.
Responses:
- 200 OK: The plugin is successfully disabled.
- 404 Not Found: The plugin is not found.
- 400 Bad Request: If there is an error during the operation.
Example Request (using curl
):
curl -X POST "https://your-api-url.com/api/settings/plugins/disable?name=ExamplePlugin&author=JohnDoe" \
-H "Authorization: Bearer <JWT-token>"
Enable Plugin
Enable a specific plugin by its name and author.
Details:
-
Endpoint:
/api/settings/plugins/enable
- Method:
POST
- Authorization: JWT (Roles: Admin)
Parameters:
- name (string, required): The name of the plugin.
- author (string, required): The author of the plugin.
Responses:
- 200 OK: The plugin is successfully enabled.
- 404 Not Found: The plugin is not found.
- 400 Bad Request: If there is an error during the operation.
Example Request (using curl
):
curl -X POST "https://your-api-url.com/api/settings/plugins/enable?name=ExamplePlugin&author=JohnDoe" \
-H "Authorization: Bearer <JWT-token>"
Rescan Plugins Folder
Rescan the plugins folder and reload all plugins from the directory.
Details:
-
Endpoint:
/api/settings/plugins/rescan
- Method:
POST
- Authorization: JWT (Roles: Admin)
Parameters: None
Responses:
- 200 OK: The plugins folder was successfully rescanned, and all plugins were reloaded.
- 400 Bad Request: If there is an error during the operation.
Example Request (using curl
):
curl -X POST "https://your-api-url.com/api/settings/plugins/rescan" \
-H "Authorization: Bearer <JWT-token>"
Reload Plugins
Reload all the currently loaded plugins.
Details:
-
Endpoint:
/api/settings/plugins/reload
- Method:
POST
- Authorization: JWT (Roles: Admin)
Parameters: None
Responses:
- 200 OK: The plugins were successfully reloaded.
- 400 Bad Request: If there is an error during the operation.
Example Request (using curl
):
curl -X POST "https://your-api-url.com/api/settings/plugins/reload" \
-H "Authorization: Bearer <JWT-token>"