Base URL
The API is served over HTTPS on the Web UI port. By default, the base URL is:47989 + 1 (base port + 1).
Versioning
The current API does not use versioning in the URL path. All endpoints are accessed directly under/api.
Authentication
All API endpoints require authentication using HTTP Basic Authentication, unless otherwise specified. You must provide the admin username and password that you configured during initial setup. See the Authentication page for detailed information on how to authenticate API requests.Response Format
All API responses are returned in JSON format with theContent-Type: application/json header.
Success Response
Successful responses typically include astatus field:
Error Response
Error responses include standard HTTP status codes and a JSON body with error details:HTTP Status Codes
The API uses standard HTTP status codes:| Status Code | Description |
|---|---|
| 200 | Success - Request completed successfully |
| 400 | Bad Request - Invalid input or parameters |
| 401 | Unauthorized - Authentication required or failed |
| 403 | Forbidden - Access denied from your IP address |
| 404 | Not Found - Resource does not exist |
| 307 | Temporary Redirect - Redirected to another page |
Error Handling
The API provides descriptive error messages to help troubleshoot issues:- 400 Bad Request: Invalid JSON format, missing required fields, or invalid parameter values
- 401 Unauthorized: Missing or invalid authentication credentials
- 403 Forbidden: Request origin not allowed (IP-based restrictions)
- 404 Not Found: Requested resource (e.g., application index) does not exist
Security Headers
All API responses include security headers:X-Frame-Options: DENY- Prevents clickjacking attacksContent-Security-Policy: frame-ancestors 'none'- Additional frame protection
Request Content Type
POST endpoints that accept JSON data require theContent-Type: application/json header. Requests without the proper content type will receive a 400 Bad Request error.
Getting Started
To get started with the API:- Set up your Sunshine username and password via the Web UI
- Choose your preferred HTTP client or library
- Use Basic Authentication with your credentials
- Start making requests to the API endpoints
- Applications - Manage streaming applications
- Clients - Manage paired clients
- Configuration - Get and update configuration
- System - System operations and logs

