Wrench comes with a fully functional REST API that exposes certain management features for easier integration with external systems. To enable the REST API, you need to set wrench.ui.enabled to true and set to false in order to allow external access to the API without valid session cookie that you can obtain by logging in via the UI.

You can set the port on which Wrench listens to requests with the wrench.ui.port paramter. If not set, by default it is 4567.

The REST API has preconfigured CORS filter so that it will respond to CORS preflight requests (OPTIONS) and will allow access from any server. Please note that the endpoints don’t have authentication yet so you need to make sure that they are only accessible from your intranet and not public. This will be addressed in upcoming releases.

Terminating User Session

GET /wrench/manage/kick/{usernameOrSessionId}

immediately terminates all sessions associated to the specified username or session id. Please note that username comparison is case insensitive.

Response: { "username": "john" , "kickCount": 2 }

List Current Sessions

GET /wrench/manage/sessions

Returns a list of all current sessions with details, eg.

   "sessionid": 123,
   "username": "john",
   "ip": "",
   "streamname": "football_720p",
   "connecttime": 100000,
   "elapsedtime": 60,
   "token": "asdf123",
   "encoder": false,
   "bitratelimit": 100000,
   "byteratein": 0,
   "byterateout": 100,
   "totalinbytes": 100,
   "totaloutbytes": 100000
  { ... }