Listen for Notifications

You can have your Plex server push notifications to a client through a Websocket connection.

This API endpoint will allow you to establish a live connection to your server and have your server stream notifications.

This endpoint can be used to stream the log notifications from your Plex server to another application.

URL

wss://{ip_address}:32400/:/websockets/notifications?filters={filters}&X-Plex-Token={plex_token}

Parameters

NameDescription
ip_addressThe IP address of the Plex Media server.
plex_tokenThe Plex token.
filtersThe type of notification filter to apply. The available filter options are outlined in the Filters section.

Return Status

HTTP CodeDescription
200Success - The request was successful.
401Unauthorized - The Plex token provided was not valid.

Response

When a connection is established, a JSON response with the following information is returned from a Plex server when a notification occurs:

{"NotificationContainer":{"type":"log","size":1,"LogSentNotification":[{"level":3,"thread":"6536","time":"Nov 29, 2024 11:00:09.977","message":"Beginning read from WebSocket"}]}}

For each notification sent from the server, the following fields are included:

Notification Fields
NameDescription
typeThe type of notification.
sizeThe number of notifications included.
LogSentNotificationAn array of data regarding the log notification.

An array of LogSentNotification information can be sent from the Plex server. Information in the array includes the following:

LogSentNotification Fields
NameDescription
levelThe notification logging level.
threadThe thread.
timeThe date and timestamp of the notification.
messageThe message of the notification.

Remarks

Filters

To return specific events, you can apply filters to the API command. If a filter parameter is not passed into the command, then all events will be pushed to the client.

The following table lists valid filters that can be passed into the command.

Event Notification Filter Values
NameDescription
logNotification from the Plex log.

Subscribe
Display