Get Accounts
A Plex server can multiple accounts setup. Additional accounts can be used to help control the content that specified users can stream from the Plex server. For example, a Kids account can only access content appropriate for their age group.
Different accounts can be setup from the Plex administration site, as well as the content filter. The API command described here can return the information for each account setup on the Plex server.
URL
GET http://{ip_address}:32400/accounts/?X-Plex-Token={plex_token}
Parameters
Name | Description |
---|---|
ip_address | The IP address of the Plex Media server. |
plex_token | The Plex token. |
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 accounts that have been created on the Plex server. An example of the XML returned from the request is shown below:
<?xml version="1.0" encoding="UTF-8"?> <MediaContainer size="3" identifier="com.plexapp.system.accounts"> <Account id="0" key="/accounts/0" name="" defaultAudioLanguage="en" autoSelectAudio="1" defaultSubtitleLanguage="en" subtitleMode="1" thumb="" /> <Account id="1" key="/accounts/1" name="PlexUser" defaultAudioLanguage="en" autoSelectAudio="0" defaultSubtitleLanguage="en" subtitleMode="0" thumb="" /> <Account id="3972737" key="/accounts/3972737" name="Kids" defaultAudioLanguage="en" autoSelectAudio="0" defaultSubtitleLanguage="en" subtitleMode="0" thumb="" /> </MediaContainer>
Remarks
The XML returned provides a list of the libraries that are available on the Plex server. The root is the MediaContainer
element. This element contains a few attributes that provide overall information about the accounts on the server.
Attribute | Description |
---|---|
size | The number of accounts available on the Plex server. |
identifier | The identifier for this type of item in Plex. |
Within the MediaContainer
there are one or more Account
child elements. Each Account
element represents one account on the Plex server.
Attribute | Description |
---|---|
id | An integer value representing the unique identifier for the account. |
key | The relative URL of the account used to get information about the account. |
name | The name of the account. |
defaultAudioLanguage | The default audio language used for the account. |
autoSelectAudio | 1 - automatically select the audio for the account. 0 - do not automatically select the audio for the account. |
defaultSubtitleLanguage | The default language for subtitles. |
subtitleMode | An integer value representing the subtitle mode. The values are unknown. |
thumb | Thumbnail associated with the account. |
Examples
curl -X GET http://{ip_address}:32400/accounts/?X-Plex-Token={plex_token}
import requests plex_url = http://{ip_address}:32400/accounts/?X-Plex-Token={plex_token} response = requests.get(plex_url) print(response.text)
$response = Invoke-RestMethod 'http://{ip_address}:32400/accounts/?X-Plex-Token={plex_token}' -Method 'GET' Write-Output $response