June 7, 2022

Manage client sessions using Nimble API

Nimble Streamer allows controlling end-user client sessions using various approaches.

The most capable approach is Pay-per-view framework which allows controlling the streaming process on per-stream and per-user level. You can use your own handler application with custom business logic to gather stats and block un-wanted viewers and listeners. Nimble sends data to PPV handler and acts according to the response.

Another approach is to use playback session authorization framework where Nimble communicates with custom handler app on each streaming session start. Nimble sends data about a connection being established and in response the handler returns the decision whether Nimble must allow or deny the new session.

Both solutions assume that Nimble will send requests to a handler and will get responses with some decisions regarding current sessions.

New API

Now we introduce additional approach that works the opposite way, it uses Nimble Streamer HTTP API where you make calls to Nimble Streamer instance.

You make direct API call, get the list of active sessions and then make follow-up calls to deleted un-wanted sessions.

Initial setup

First, follow Pre-setup steps on API description page. This is required in order to enable and use the API. It needs a couple of parameters in nimble.conf file.

In addition you can secure your calls by using security token as described in respective section.

Get list of sessions

Use /manage/sessions method to get the list of current sessions as described in this docs section. In your response you'll get a JSON containing data of each session, including app and stream name, IP and some other parameters. Each session has its ID which you can use for terminating it.

Having list of all sessions, you can save it to your own database as well as make further decisions about each connection.

Delete specific session

If some clients need to be disconnected, you can call /manage/sessions/delete method with a list of session IDs that must be disconnected. Full description is available in this section

The HLS and MPEG-DASH clients will get 403 HTTP response while for other protocols (MPEG-TS/Icecast/RTMP/RTSP/SRT) they will just be disconnected.


This set of APIs provides a simple way to control Nimble Streamer playback. If you need more sophisticated way, check other approaches on top of this article.