Get All Activities

A Plex server can have multiple activities running at different times. Activities such as scanning media, database maintenance or streaming can happen either on-demand or on a schedule.

You can view these activities in from the Plex Web app, or use this API command to request them from the server.

URL

GET http://[IP address]:32400/activites/?X-Plex-Token=[PlexToken]

Parameters

NameDescription
IP addressThe IP address of the Plex Media server.
PlexTokenThe authentication Plex token.

Return Status

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

Response

XML string value that lists all the current activites running on the server. An example of the XML returned from the request is shown below:

<?xml version="1.0" encoding="UTF-8"?>
  <MediaContainer size="1">
      <Activity uuid="c3f190e4-eabb-4b3d-8811-b7c1f183560e" type="library.update.section" cancellable="0" userID="1" title="Scanning Photos" subtitle="4th Birthday" progress="30">
          <Context librarySectionID="1" />
      </Activity>
  </MediaContainer>

The XML returned provides a list of the all the running activities on the Plex server. The root is the MediaContainer element. This element contains a single attribute that indicates the number of activites that are running.

MediaContainer Attributes
AttributeDescription
sizeThe number of activities.

The MediaContainer element will still be returned if no activites are running. The size attribute will be 0, and there will be no Activity child elements.

Within the MediaContainer there are one or more Activity child elements. Each Activity element represents one running activity on the Plex server.

Activity Attributes
AttributeDescription
uuidUnique identifier for the activity.
typeThe type of activity that is running.
cancellableFlag indicating the activity can be cancelled.
0 - the activity can't be cancelled, 1 - the activity can be cancelled.
userIDThe ID of the user running the activity.
titleThe description of the activity.
subtitleAdditional description or the activity.
progressThe percentage of the activity that has completed.

An activity can include one or more Context child elements. These elements include additional information that is related to the activity, such as the library ID for a scan.

Context Attributes
AttributeDescription
librarySectionIDThe identifier for the library section.

Examples

curl -X GET http://[IP address]:32400/activites/?X-Plex-Token=[PlexToken]
import requests
plex_url = http://[IP address]:32400/activites/?X-Plex-Token=[PlexToken]
response = requests.get(plex_url)
print(response.text)
$response = Invoke-RestMethod 'http://[IP address]:32400/activites/?X-Plex-Token=[PlexToken]' -Method 'GET'
Write-Output $response
Subscribe
Display