Plex.tv - Get Users
A Plex account can have multiple Plex Home users associated with it. This API request will return a list of all users for the Plex account.
URL
GET https://plex.tv/api/v2/home/users?X-Plex-Client-Identifier={client_identifier}&X-Plex-Token={plex_token}
Parameters
Name | Description |
---|---|
plex_token | The Plex token. |
client_identifier | The identifier for the client. You can get a client ID by making a request to the Get Devices API and look for an ID in the clientIdentifier attribute. |
Return Status
HTTP Code | Description |
---|---|
200 | Success - The request was successful. |
401 | Unauthorized - The Plex token provided was not valid. |
Response
XML string value that lists the users that have been added to the Plex Home for an account. An example of the XML returned from the request is shown below:
<?xml version="1.0" encoding="UTF-8"?> <home id="XXXXXX" name="Plexopedia's home" guestUserID="XXXXXXX" guestUserUUID="3e11f81d041ae84f" guestEnabled="0" subscription="1"> <users> <user id="246408570" uuid="7b4af7a9f26254bd" title="Plexopedia" username="Plexopedia" email="[email protected]" friendlyName="" thumb="https://plex.tv/users/7b4af7a9f26254bd/avatar?c=1720981098" hasPassword="1" restricted="0" updatedAt="1704558269" restrictionProfile="" admin="1" guest="0" protected="0"/> </home>
The XML returned provides a list of all users associated with a Plex account. The root is the home
element. This element contains several attributes for the Plex Home.
Attribute | Description |
---|---|
id | The identifier of the account. |
name | The name of the account. |
guestUserID | The ID of the guest user. |
guestUserUUID | The unique identifier for the guest user. |
guestEnabled | Flag indicating guest users are enabled. 0 - guest users are not enabled. 1 - guest users are enabled. |
subscription | The home account has a subscription (Plex Pass). |
There is a users
child element within the home
element but it doesn’t have any attributes.
Within the users
element there are one or more user
child elements. Each user
element represents one user for the Plex Home.
Attribute | Description |
---|---|
id | The ID of the user. |
uuid | The unique identifier for the user. |
title | The title of the user. |
username | The user name associated to the user. |
The email associated to the user. | |
friendlyName | An easier to read name for the user. |
thumb | The thumbnail for the user. |
hasPassword | Flag indicating the user has a password. 0 - the user doesn't have a password set. 1 - the user has a password set. |
restricted | Flag indicating the user account has restrictions. 0 - the user has no restrictions. 1 - the user has restrictions. |
updatedAt | The date and time in epoch time, the user was updated. |
restrictionProfile | The restriction profile set to the user. |
admin | Flag indicating the user account is the server admin. 0 - the user is not the admin. 1 - the user is the admin. |
guest | Flag indicating the user account is a guest. 0 - the user is not a guest. 1 - the user is a guest. |
protected | Flag indicating the user account is protected. 0 - the user is not protected. 1 - the user is protected. |
Examples
curl -X GET https://plex.tv/api/v2/home/users?X-Plex-Client-Identifier={client_identifier}&X-Plex-Token={plex_token}
import requests plex_url = https://plex.tv/api/v2/home/users?X-Plex-Client-Identifier={client_identifier}&X-Plex-Token={plex_token} response = requests.get(plex_url) print(response.text)
$response = Invoke-RestMethod 'https://plex.tv/api/v2/home/users?X-Plex-Client-Identifier={client_identifier}&X-Plex-Token={plex_token}' -Method 'GET' Write-Output $response