docs/api.md
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 CSRF token
curl -u user:pass https://localhost:47990/api/csrf-token
# Use token in request
curl -u user:pass -H "X-CSRF-Token: your_token_here" \
-X POST https://localhost:47990/api/restart
@htmlonly
<script src="api.js"></script>@endhtmlonly
@copydoc confighttp::getCSRFToken()
@copydoc confighttp::getApps()
@copydoc confighttp::saveApp()
@copydoc confighttp::closeApp()
@copydoc confighttp::deleteApp()
@copydoc confighttp::browseDirectory()
@copydoc confighttp::getClients()
@copydoc confighttp::unpair()
@copydoc confighttp::unpairAll()
@copydoc confighttp::getConfig()
@copydoc confighttp::getLocale()
@copydoc confighttp::saveConfig()
@copydoc confighttp::getCover()
@copydoc confighttp::uploadCover()
@copydoc confighttp::getLogs()
@copydoc confighttp::savePassword()
@copydoc confighttp::savePin()
@copydoc confighttp::resetDisplayDevicePersistence()
@copydoc confighttp::restart()
@copydoc confighttp::getViGEmBusStatus()
@copydoc confighttp::installViGEmBus()
<div class="section_buttons">| Previous | Next |
|---|---|
| Performance Tuning | Troubleshooting |