Get a Single Account
Each Plex server can have multiple accounts created for different users. Information about a single account can be returned using this API command.
URL
GET http://{ip_address}:32400/accounts/{id}?X-Plex-Token={plex_token}
Parameters
Name | Description |
---|---|
ip_address | The IP address of the Plex Media server. |
plex_token | The Plex token. |
id | The key associated with an account. This key can be found by calling the Accounts API command and looking for the account. |
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 account that has 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="1" identifier="com.plexapp.system.accounts"> <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 account on the server.
Attribute | Description |
---|---|
size | The number of accounts returned. |
identifier | The identifier for this type of item in Plex. |
Within the MediaContainer
is one Account
child element. The Account
element represents the 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/{id}?X-Plex-Token={plex_token}
import requests plex_url = http://{ip_address}:32400/accounts/{id}?X-Plex-Token={plex_token} response = requests.get(plex_url) print(response.text)
$response = Invoke-RestMethod 'http://{ip_address}:32400/accounts/{id}?X-Plex-Token={plex_token}' -Method 'GET' Write-Output $response