Skip to main content
These endpoints allow you to manage Moonlight clients that have been paired with Sunshine.

GET /api/clients/list

Get the list of all paired clients.

Authentication

Required

Response

array
Array of paired client objects
string
Friendly name of the client (e.g., “Living Room PC”)
string
Unique identifier for the client
boolean
Always true for successful requests

Example Request

Example Response

Notes

  • Clients are paired through the Moonlight pairing process
  • Each client is identified by its UUID
  • Client names are set during the pairing process

POST /api/clients/unpair

Unpair a specific client by UUID.

Authentication

Required

Request Headers

Request Body

string
required
The UUID of the client to unpair

Response

boolean
Whether the unpair operation was successful

Example Request

Example Response

Notes

  • The unpaired client will need to go through the pairing process again to reconnect
  • If the UUID doesn’t exist, the operation will still return success
  • The client’s certificate is removed from the server

POST /api/clients/unpair-all

Unpair all clients and terminate any active streaming sessions.

Authentication

Required

Request Headers

Response

boolean
Always true for successful requests

Example Request

Example Response

Notes

  • This removes all paired client certificates from the server
  • Any active streaming session is terminated immediately
  • All clients will need to re-pair to connect again
  • The request body can be empty JSON {} but the Content-Type header is required
  • Use this endpoint carefully as it affects all paired clients

Client Pairing Flow

While pairing is typically done through the Moonlight client UI, you can also use the API:
  1. Start Pairing: The Moonlight client initiates pairing by sending a PIN
  2. Submit PIN: Use POST /api/pin to submit the PIN and client name (see Configuration endpoints)
  3. Complete: If the PIN matches, the client is paired and added to the list

Example: Complete Client Management

Here’s an example script to list and unpair clients:

Python Example