Plex.tv - Get a User
This API request will return information about a single user that is associated with a Plex token.
URL
GET https://plex.tv/api/v2/home/user?X-Plex-Token={plex_token}Parameters
| Name | Description |
|---|---|
| plex_token | The Plex user token. |
Return Status
| HTTP Code | Description |
|---|---|
| 200 | Success - The request was successful. |
| 400 | Bad request. A mandatory parameter was missing. |
| 401 | Unauthorized - The Plex token provided was not valid. |
Response
XML string value that shows information for a single user. An example of the XML returned from the request is shown below:
<?xml version="1.0" encoding="UTF-8"?> <user id="246408570" uuid="7b4af7a9f26254bd" username="Plexopedia" title="Plexopedia" email="[email protected]" friendlyName="" locale="" confirmed="1" joinedAt="1419625151" emailOnlyAuth="1" hasPassword="1" protected="0" thumb="https://plex.tv/users/7b4af7a9f26254bd/avatar?c=1720981098" authToken="XXXXXXXXXXXXX" mailingListStatus="active" mailingListActive="1" scrobbleTypes="" country="CA" subscriptionDescription="Lifetime Plex Pass" restricted="0" anonymous="0" home="1" guest="0" homeSize="3" homeAdmin="1" maxHomeSize="15" rememberExpiresAt="1722263735" adsConsent="" adsConsentSetAt="" adsConsentReminderAt="" experimentalFeatures="0" twoFactorEnabled="1" backupCodesCreated="1"> <subscription active="1" subscribedAt="2015-01-04 06:27:34 UTC" status="Active" paymentService="braintree" plan="lifetime"> <features> <feature id="guided-upgrade"/> <feature id="increase-password-complexity"/> <feature id="upgrade-3ds2"/> <feature id="ad-countdown-timer"/> <feature id="adaptive_bitrate"/> <feature id="amazon-loop-debug"/> ... </subscription> ... </user>
The XML returned provides a information about the user. The root is the user element.
| 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. |
| locale | The locale of the user. |
| confirmed | Flag indicating the user has confirmed their account. 0 - the account has not been confirmed. 1 - the account has been confirmed. |
| joinedAt | The date and time in epoch time, the user created the account. |
| emailOnlyAuth | Authentication only done through email. |
| hasPassword | Flag indicating the user has a password. 0 - the user doesn't have a password set. 1 - the user has a password set. |
| protected | Flag indicating the user account is protected. 0 - the user is not protected. 1 - the user is protected. |
| thumb | The thumbnail for the user. |
| authToken | The Plex authentication token for the user. |
| mailingListStatus | The status of the current mail list subscription. |
| mailingListActive | Flag indicating if the user is currently actively subscribed to the Plex mailing list. 0 - not currently active. 1- currently active. |
| scrobbleTypes | Unknown. |
| country | Country for the user. |
| subscriptionDescription | A description of the user's Plex subscription. |
| restricted | Flag indicating the user account has restrictions. 0 - the user has no restrictions. 1 - the user has restrictions. |
| anonymous | Flag indicating the user is anonymous. 0 - the user is not anonymous. 1 - the user is anonymous. |
| home | Flag indicating that Plex Home is enabled. 0 - Plex Home is not enabled. 1 - Plex Home is enabled. |
| guest | Flag indicating the user account is a guest. 0 - the user is not a guest. 1 - the user is a guest. |
| homeSize | The number of users in Plex Home. |
| homeAdmin | Flag indicating the user is the Plex Home admin. 0 - the user is not the admin. 1 - the user is a Plex Home admin. |
| maxHomeSize | The maximum number of users allowed in Plex Home. |
| rememberExpiresAt | The date and time in epoch time, the user's remembers login expires. |
| adsConsent | Flag indicating the ads consent. |
| adsConsentSetAt | The date and time in epoch time, when the ads consent was set. |
| adsConsentReminderAt | The date and time in epoch time, when the ads consent reminder will be shown. |
| experimentalFeatures | Flag indicating the that experimental features are enabled. 0 - experimental features are not enabled. 1 - experimental features are enabled. |
| twoFactorEnabled | Flag indicating the that two factor authentication is enabled. 0 - two factor authentication is not enabled. 1 - two factor authentication is enabled. |
| backupCodesCreated | Flag indicating backup codes have been generated. 0 - backup codes have not been generated. 1 - backup codes have been generated. |
Within the user element there is a subscription element that contains information about the Plex subscription associated to the user.
| Attribute | Description |
|---|---|
| active | Flag indicating the subscription is active. |
| subscribedAt | The date and time in epoch time, when the subscription started. |
| status | Current status of the subscription. |
| paymentService | Service used for payment. |
| plan | The subscription plan type. |
Examples
curl -X GET https://plex.tv/api/v2/home/user?X-Plex-Token={plex_token}
import requests
plex_url = https://plex.tv/api/v2/home/user?X-Plex-Token={plex_token}
response = requests.get(plex_url)
print(response.text)
$response = Invoke-RestMethod "https://plex.tv/api/v2/home/user?X-Plex-Token={plex_token}" -Method GET
Write-Output $response