Jamulus JSON-RPC Server Documentation

March 3, 2026 · View on GitHub

A JSON-RPC server can be added to both Jamulus client and Jamulus server to allow programmatic access. To add the JSON-RPC server, run Jamulus with the --jsonrpcport <port> --jsonrpcsecretfile /file/with/a/secret.txt options. This will start a JSON-RPC server on the specified port on the localhost.

The file referenced by --jsonrpcsecretfile must contain a single line with a freely chosen string with at least 16 characters. It can be generated like this:

$ openssl rand -base64 10 > /file/with/a/secret.txt

The JSON-RPC server defaults to listening on the local loopback network interface (127.0.0.1). This can be optionally changed by using the --jsonrpcbindip <ip address> command line option.

Wire protocol

The JSON-RPC server is based on the JSON-RPC 2.0 protocol, using streaming newline-delimited JSON over TCP as the transport. There are three main types of messages being exchanged:

  • A request from the consumer to Jamulus.
  • A response from Jamulus to the consumer.
  • A notification from Jamulus to the consumer.

Connect to a JSON-RPC server

On Linux, you can connect to a JSON-RPC server using the nc CLI tool.

On Windows, you can download and use the ncat CLI tool.

This snippet uses jayson to connect using Node.js:

const jayson = require("jayson/promise");
const client = new jayson.client.tcp({ host: "127.0.0.1", port: 22100 });

client.request('jamulusserver/getServerInfo', {})
.then(console.log)
.catch(console.error)

Example

After opening a TCP connection to the JSON-RPC server, the connection must be authenticated:

{"id":1,"jsonrpc":"2.0","method":"jamulus/apiAuth","params":{"secret": "...the secret from the file in --jsonrpcsecretfile..."}}

Request must be sent as a single line of JSON-encoded data, followed by a newline character. Jamulus will send back a response in the same manner:

{"id":1,"jsonrpc":"2.0","result":"ok"}

After successful authentication, the following request can be sent:

{"id":2,"jsonrpc":"2.0","method":"jamulus/getMode","params":{}}

The request must be sent as a single line of JSON-encoded data, followed by a newline character. Jamulus will send back a response in the same manner:

{"id":2,"jsonrpc":"2.0","result":{"mode":"client"}}

Jamulus will also send notifications to the consumer:

{"jsonrpc":"2.0","method":"jamulusclient/chatTextReceived","params":{"text":"<font color=\"mediumblue\">(01:23:45 AM) <b>user</b></font> test"}}

Method reference

jamulus/apiAuth

Authenticates the connection which is a requirement for calling further methods.

Parameters:

NameTypeDescription
params.secretstringThe preshared secret key.

Results:

NameTypeDescription
resultstring"ok" on success

jamulus/getMode

Returns the current mode, i.e. whether Jamulus is running as a server or client.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
result.modestringThe current mode (server or client).

jamulus/getVersion

Returns Jamulus version.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
result.versionstringThe Jamulus version.

jamulusclient/getChannelInfo

Returns the client's profile information.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
result.idnumberThe channel ID.
result.namestringThe musician’s name.
result.skillLevelstringThe musician’s skill level (beginner, intermediate, expert, or null).
result.countryIdnumberThe musician’s country ID (see QLocale::Country).
result.countrystringThe musician’s country.
result.citystringThe musician’s city.
result.instrumentIdnumberThe musician’s instrument ID (see CInstPictures::GetTable).
result.instrumentstringThe musician’s instrument.
result.skillLevelstringYour skill level (beginner, intermediate, expert, or null).

jamulusclient/getClientInfo

Returns the client information.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
result.connectedbooleanWhether the client is connected to the server.

jamulusclient/getClientList

Returns the client list.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
result.clientsarrayThe client list. See jamulusclient/clientListReceived for the format.

jamulusclient/getMidiDevices

Returns a list of available MIDI input devices.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
resultarrayArray of MIDI device name strings.

jamulusclient/getMidiSettings

Returns all MIDI controller settings.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
resultobjectMIDI settings object.

jamulusclient/pollServerList

Request list of servers in a directory.

Parameters:

NameTypeDescription
params.directorystringSocket address of directory to query. Example: anygenre1.jamulus.io:22124

Results:

NameTypeDescription
resultstring"ok" or "error" if bad arguments.

jamulusclient/sendChatText

Sends a chat text message.

Parameters:

NameTypeDescription
params.chatTextstringThe chat text message.

Results:

NameTypeDescription
resultstringAlways "ok".

jamulusclient/setFaderLevel

Sets the fader level. Example: {"id":1,"jsonrpc":"2.0","method":"jamulusclient/setFaderLevel","params":{"channelIndex": 0,"level": 50}}.

Parameters:

NameTypeDescription
params.channelIndexnumberThe channel index of the fader to be set.
params.levelnumberThe fader level in range 0..100.

Results:

NameTypeDescription
resultstringAlways "ok".

jamulusclient/setMidiSettings

Sets one or more MIDI controller settings.

Parameters:

NameTypeDescription
paramsobjectAny subset of MIDI settings fields to set.

Results:

NameTypeDescription
resultstringAlways "ok".

jamulusclient/setName

Sets your name.

Parameters:

NameTypeDescription
params.namestringThe new name.

Results:

NameTypeDescription
resultstringAlways "ok".

jamulusclient/setSkillLevel

Sets your skill level.

Parameters:

NameTypeDescription
params.skillLevelstringThe new skill level (beginner, intermediate, expert, or null).

Results:

NameTypeDescription
resultstringAlways "ok".

jamulusserver/getClients

Returns the list of connected clients along with details about them.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
result.connectionsnumberThe number of active connections.
result.clientsarrayThe list of connected clients.
result.clients[*].idnumberThe client’s channel id.
result.clients[*].addressstringThe client’s address (ip:port).
result.clients[*].namestringThe client’s name.
result.clients[*].jitterBufferSizenumberThe client’s jitter buffer size.
result.clients[*].channelsnumberThe number of audio channels of the client.
result.clients[*].instrumentCodenumberThe id of the instrument for this channel.
result.clients[*].citystringThe city name provided by the user for this channel.
result.clients[*].countryNamenumberThe text name of the country specified by the user for this channel (see QLocale::Country).
result.clients[*].skillLevelCodenumberThe skill level id provided by the user for this channel.

jamulusserver/getRecorderStatus

Returns the recorder state.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
result.initialisedbooleanTrue if the recorder is initialised.
result.errorMessagestringThe recorder error message, if any.
result.enabledbooleanTrue if the recorder is enabled.
result.recordingDirectorystringThe recorder recording directory.

jamulusserver/getServerProfile

Returns the server registration profile and status.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
result.namestringThe server name.
result.citystringThe server city.
result.countryIdnumberThe server country ID (see QLocale::Country).
result.welcomeMessagestringThe server welcome message.
result.directoryTypestringThe directory type as a string (see EDirectoryType and SerializeDirectoryType).
result.directoryAddressstringThe string used to look up the directory address (only assume valid if directoryType is "custom" and registrationStatus is "registered").
result.directorystringThe directory with which this server requested registration, or blank if none.
result.registrationStatusstringThe server registration status as string (see ESvrRegStatus and SerializeRegistrationStatus).

jamulusserver/restartRecording

Restarts the recording into a new directory.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
resultstringAlways "acknowledged". To check if the recording was restarted or if there is any error, call jamulusserver/getRecorderStatus again.

jamulusserver/setDirectory

Set the directory type and, for custom, the directory address.

Parameters:

NameTypeDescription
params.directoryTypestringThe directory type as a string (see EDirectoryType and DeserializeDirectoryType).
[params.directoryAddress]string(optional) The directory address, required if directoryType is "custom".

Results:

NameTypeDescription
resultstringAlways "ok".

jamulusserver/setRecordingDirectory

Sets the server recording directory.

Parameters:

NameTypeDescription
params.recordingDirectorystringThe new recording directory.

Results:

NameTypeDescription
resultstringAlways "acknowledged". To check if the directory was changed, call jamulusserver/getRecorderStatus again.

jamulusserver/setServerName

Sets the server name.

Parameters:

NameTypeDescription
params.serverNamestringThe new server name.

Results:

NameTypeDescription
resultstringAlways "ok".

jamulusserver/setWelcomeMessage

Sets the server welcome message.

Parameters:

NameTypeDescription
params.welcomeMessagestringThe new welcome message.

Results:

NameTypeDescription
resultstringAlways "ok".

jamulusserver/startRecording

Starts the server recording.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
resultstringAlways "acknowledged". To check if the recording was enabled, call jamulusserver/getRecorderStatus again.

jamulusserver/stopRecording

Stops the server recording.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

Results:

NameTypeDescription
resultstringAlways "acknowledged". To check if the recording was disabled, call jamulusserver/getRecorderStatus again.

Notification reference

jamulusclient/channelLevelListReceived

Emitted when the channel level list is received.

Parameters:

NameTypeDescription
params.channelLevelListarrayThe channel level list. Each item corresponds to the respective client retrieved from the jamulusclient/clientListReceived notification.
params.channelLevelList[*]numberThe channel level, an integer between 0 and 9.

jamulusclient/chatTextReceived

Emitted when a chat text is received.

Parameters:

NameTypeDescription
params.chatTextstringThe chat text.

jamulusclient/clientListReceived

Emitted when the client list is received.

Parameters:

NameTypeDescription
params.clientsarrayThe client list.
params.clients[*].idnumberThe channel ID.
params.clients[*].namestringThe musician’s name.
params.clients[*].skillLevelstringThe musician’s skill level (beginner, intermediate, expert, or null).
params.clients[*].countryIdnumberThe musician’s country ID (see QLocale::Country).
params.clients[*].countrystringThe musician’s country.
params.clients[*].citystringThe musician’s city.
params.clients[*].instrumentIdnumberThe musician’s instrument ID (see CInstPictures::GetTable).
params.clients[*].instrumentstringThe musician’s instrument.

jamulusclient/connected

Emitted when the client is connected to the server.

Parameters:

NameTypeDescription
params.idnumberThe channel ID assigned to the client.

jamulusclient/disconnected

Emitted when the client is disconnected from the server.

Parameters:

NameTypeDescription
paramsobjectNo parameters (empty object).

jamulusclient/recorderState

Emitted when the client is connected to a server whose recorder state changes.

Parameters:

NameTypeDescription
params.statenumberThe recorder state.

jamulusclient/serverInfoReceived

Emitted when a server info is received.

Parameters:

NameTypeDescription
params.addressstringThe server socket address.
params.pingtimenumberThe round-trip ping time, in milliseconds.
params.numClientsnumberThe number of clients connected to the server.

jamulusclient/serverListReceived

Emitted when the server list is received.

Parameters:

NameTypeDescription
params.serversarrayThe server list.
params.servers[*].addressstringSocket address (ip_address:port).
params.servers[*].namestringServer name.
params.servers[*].countryIdnumberServer country ID (see QLocale::Country).
params.servers[*].countrystringServer country.
params.servers[*].citystringServer city.