Skip to main content
These endpoints allow you to retrieve and modify Sunshine configuration settings.

GET /api/config

Get all current configuration settings.

Authentication

Required

Response

boolean
Always true for successful requests
string
The platform Sunshine is running on (e.g., “linux”, “windows”, “macos”)
string
The current Sunshine version
Additional fields contain all configuration settings from the config file. Configuration options vary by platform and 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

Required

Request Headers

Request Body

Provide configuration key-value pairs to update. Only include settings you want to change.
string | number | boolean
Any valid configuration key and its new value

Response

boolean
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 authentication

Response

boolean
Always true for successful requests
string
The 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

string
required
Current username (required if credentials already exist)
string
required
Current password (required if credentials already exist)
string
New username (optional, defaults to current username if not provided)
string
required
New password
string
required
Confirmation of new password (must match newPassword)

Response

boolean
Whether the password was updated successfully

Example Request (Initial Setup)

Example Request (Update Existing)

Example Response

Error Responses

If passwords don’t match:
If current credentials are invalid:
If username is empty:

Notes

  • Credentials are stored in the credentials.json file
  • 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

Required

Request Headers

Request Body

string
required
4-digit PIN code (0000-9999) displayed in Moonlight client
string
required
Friendly name for the client being paired

Response

boolean
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

Example: Complete Configuration Management