![]() |
Sunshine master
Self-hosted game stream host for Moonlight.
|
Sunshine has a RESTful API which can be used to interact with the service.
Unless otherwise specified, authentication is required for all API calls. You can authenticate using basic authentication with the admin username and password.
State-changing API endpoints (POST, DELETE) are protected against Cross-Site Request Forgery (CSRF) attacks.
For Web Browsers:
csrf_allowed_origins) are automatically allowedFor Non-Browser Applications:
curl, scripts, custom apps) are exempt from CSRF protectionOrigin or Referer header (as is typical for non-browser clients) are automatically allowed without a CSRF tokenExample (browser-equivalent cross-origin request):
Get a CSRF token for the authenticated user.
| response | The HTTP response object. |
| request | The HTTP request object. |
Get the list of available applications.
| response | The HTTP response object. |
| request | The HTTP request object. |
Save an application. To save a new application, the index must be -1. To update an existing application, you must provide the current index of the application.
| response | The HTTP response object. |
| request | The HTTP request object. The body for the post request should be JSON serialized in the following format: {
"name": "Application Name",
"output": "Log Output Path",
"cmd": "Command to run the application",
"index": -1,
"exclude-global-prep-cmd": false,
"elevated": false,
"auto-detach": true,
"wait-all": true,
"exit-timeout": 5,
"prep-cmd": [
{
"do": "Command to prepare",
"undo": "Command to undo preparation",
"elevated": false
}
],
"detached": [
"Detached command"
],
"image-path": "Full path to the application image. Must be a png file."
}
|
Close the currently running application.
| response | The HTTP response object. |
| request | The HTTP request object. |
Delete an application.
| response | The HTTP response object. |
| request | The HTTP request object. |
Browse the server filesystem.
| response | The HTTP response object. |
| request | The HTTP request object. |
Get the list of paired clients.
| response | The HTTP response object. |
| request | The HTTP request object. |
Unpair a client.
| response | The HTTP response object. |
| request | The HTTP request object. The body for the POST request should be JSON serialized in the following format: {
"uuid": "<uuid>"
}
|
Unpair all clients.
| response | The HTTP response object. |
| request | The HTTP request object. |
Enable or disable a client.
| response | The HTTP response object. |
| request | The HTTP request object. The body for the POST request should be JSON serialized in the following format: {
"uuid": "<uuid>",
"enabled": true
}
|
Get the configuration settings.
| response | The HTTP response object. |
| request | The HTTP request object. |
Get the locale setting. This endpoint does not require authentication.
| response | The HTTP response object. |
| request | The HTTP request object. |
Save the configuration settings.
| response | The HTTP response object. |
| request | The HTTP request object. The body for the POST request should be JSON serialized in the following format: {
"key": "value"
}
|
Get an application's image.
| response | The HTTP response object. |
| request | The HTTP request object. |
Upload a cover image.
| response | The HTTP response object. |
| request | The HTTP request object. The body for the post request should be JSON serialized in the following format: {
"key": "igdb_<game_id>",
"url": "https://images.igdb.com/igdb/image/upload/t_cover_big_2x/<slug>.png"
}
|
Get the logs from the log file.
| response | The HTTP response object. |
| request | The HTTP request object. |
Update existing credentials.
| response | The HTTP response object. |
| request | The HTTP request object. The body for the post request should be JSON serialized in the following format: {
"currentUsername": "Current Username",
"currentPassword": "Current Password",
"newUsername": "New Username",
"newPassword": "New Password",
"confirmNewPassword": "Confirm New Password"
}
|
Send a pin code to the host. The pin is generated from the Moonlight client during the pairing process.
| response | The HTTP response object. |
| request | The HTTP request object. The body for the post request should be JSON serialized in the following format: {
"pin": "<pin>",
"name": "Friendly Client Name"
}
|
Reset the display device persistence.
| response | The HTTP response object. |
| request | The HTTP request object. |
Restart Sunshine.
| response | The HTTP response object. |
| request | The HTTP request object. |
Get ViGEmBus driver version and installation status.
| response | The HTTP response object. |
| request | The HTTP request object. |
Install ViGEmBus driver with elevated permissions.
| response | The HTTP response object. |
| request | The HTTP request object. |