API Documentation

myMPD uses a JSON-RPC 2 for the communication between frontend and backend.


The json rpc is the combination of two numeric ids.

  1. Client ID: Generated on initial loading of the client, 6 digits
  2. Request ID: Incremented on each request, 3 digits, wraps around

The websocket connection registers the Client ID on the webserver. This registration is used to send async responses from the webserver to a specific client.


API endpoint: /api/<partition>

Notifications from the backend to the frontend are sent over a websocket connection.

Websocket endpoint: /ws/<partition>

Example API calls


Pin protection

If myMPD is protected with a pin some methods require authentication with a special header.


{"jsonrpc":"2.0","id":0,"method":"MYMPD_API_SESSION_LOGIN","params":{"pin": "<pin>"}}

Use the session string in the response for authenticated requests. The session is valid for 30 minutes.

Authenticated request

To send a request with authentication data add a X-myMPD-Session header to it.

X-myMPD-Session: <token>

Validate the token

Content-Type: application/json
X-myMPD-Session: <token>



Content-Type: application/json
X-myMPD-Session: <token>