GET /api/config
Get all current configuration settings.Authentication
RequiredResponse
Always
true for successful requestsThe platform Sunshine is running on (e.g., “linux”, “windows”, “macos”)
The current Sunshine version
Example Request
Example Response
Notes
- Returns all configuration keys and their current values
- Values match the format used in the configuration file
- Platform-specific settings may only appear on certain systems
POST /api/config
Update configuration settings.Authentication
RequiredRequest Headers
Request Body
Provide configuration key-value pairs to update. Only include settings you want to change.Any valid configuration key and its new value
Response
Whether the configuration was saved successfully
Example Request
Example Response
Notes
- Only include settings that differ from defaults or that you want to change
- Configuration is written to the config file immediately
- Some settings may require a Sunshine restart to take effect
- Null or empty string values are skipped and not written to config
- String values are written without quotes; other types are written as JSON
GET /api/configLocale
Get the locale setting for the Web UI.Authentication
Not Required - This is the only API endpoint that works without authenticationResponse
Always
true for successful requestsThe current locale code (e.g., “en”, “fr”, “de”)
Example Request
Example Response
Notes
- This endpoint is unauthenticated to allow the login page to display in the correct language
- Returns only the locale setting, not the full configuration
POST /api/password
Update or create Web UI credentials.Authentication
Required if credentials already exist. Not required for initial setup.Request Headers
Request Body
Current username (required if credentials already exist)
Current password (required if credentials already exist)
New username (optional, defaults to current username if not provided)
New password
Confirmation of new password (must match
newPassword)Response
Whether the password was updated successfully
Example Request (Initial Setup)
Example Request (Update Existing)
Example Response
Error Responses
If passwords don’t match:Notes
- Credentials are stored in the
credentials.jsonfile - Passwords are hashed with a random salt before storage
- When changing an existing password, you must authenticate with current credentials
- New credentials take effect immediately
POST /api/pin
Submit a PIN code for client pairing.Authentication
RequiredRequest Headers
Request Body
4-digit PIN code (0000-9999) displayed in Moonlight client
Friendly name for the client being paired
Response
Whether the pairing was successful
Example Request
Example Response
Error Responses
If PIN is out of range:Notes
- The PIN is generated by the Moonlight client during pairing
- PIN must be submitted while the pairing request is active
- The client name can be any descriptive string
- After successful pairing, the client appears in
/api/clients/list

