Terminate a Session

This API command can be used to terminate any active session on a Plex server. Once the session is terminated, the client will receive a message on the screen indicating that the playback session has been terminated. The message that is display on the client's screen will also contain the reason provided by this command.

URL

GET http://[IP address]:32400/status/sessions/terminate?sessionId=[Session ID]&reason=[Message String]&X-Plex-Token=[PlexToken]

Parameters

NameDescription
IP addressThe IP address of the Plex Media server.
PlexTokenThe authentication Plex token.
Session IDThe key associated with a session. This key can be found by calling the Active Sessions API command and looking for the session.
Message StringThis is the message that will be sent to the client associated with the terminated session. Any special characters will need to be encoded. For example, a space will need to be encoded to %20.

Return Status

HTTP CodeDescription
200Success - The request was successful.
400Bad Request - A parameter was not specified, or was specified incorrectly.
401Unauthorized - The Plex token provided was not valid.

Response

No response is returned when a session is terminated. Check for a return status code of 200 to determine if the API call was successful.

Remarks

The 'i' in the parameter sessionId is capitalized. Using a lowercase 'i' will cause the request to return a status code of 400, and the session won't terminate.

Examples

Example 1

Terminate a session and send the message 'No transcoding allowed' to the client from the Plex Media Server located at the IP address of 192.168.1.4:

GET http://192.168.1.4:32400/status/sessions?X-Plex-Token=L6vkd7JtLHjsH5987vYY&sessionId=reeee84kpicw5afiavwhcafb&reason=No%20transcoding%20allowed