GET
/
users
declare(strict_types=1);

require 'vendor/autoload.php';

use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;

$sdk = Plex_API\PlexAPI::builder()->build();

$request = new Operations\GetUsersRequest(
    clientID: '3381b62b-9ab7-4e37-827b-203e9809eb58',
    clientName: 'Plex for Roku',
    deviceNickname: 'Roku 3',
    deviceName: 'Chrome',
    deviceScreenResolution: '1487x1165,2560x1440',
    clientVersion: '2.4.1',
    platform: 'Roku',
    clientFeatures: 'external-media,indirect-media,hub-style-list',
    model: '4200X',
    xPlexSessionId: '97e136ef-4ddd-4ff3-89a7-a5820c96c2ca',
    xPlexLanguage: 'en',
    platformVersion: '4.3 build 1057',
    xPlexToken: 'CV5xoxjTpFKUzBTShsaf',
);

$response = $sdk->users->getUsers(
    request: $request
);

if ($response->body !== null) {
    // handle response
}
{
  "MediaContainer": {
    "friendlyName": "myPlex",
    "identifier": "com.plexapp.plugins.myplex",
    "machineIdentifier": "3dff4c4da3b1229a649aa574a9e2b419a684a20e",
    "totalSize": 30,
    "size": 30,
    "User": [
      {
        "id": 22526914,
        "title": "Plex User",
        "username": "zgfuc7krcqfimrmb9lsl5j",
        "email": "zgfuc7krcqfimrmb9lsl5j@protonmail.com",
        "recommendationsPlaylistId": "",
        "thumb": "https://plex.tv/users/3346028014e93acd/avatar?c=1731605021",
        "protected": 1,
        "home": 1,
        "allowTuners": 1,
        "allowSync": 1,
        "allowCameraUpload": 1,
        "allowChannels": 1,
        "allowSubtitleAdmin": 1,
        "filterAll": "",
        "filterMovies": "",
        "filterMusic": "",
        "filterPhotos": "",
        "filterTelevision": "",
        "restricted": 1,
        "Server": [
          {
            "id": 907759180,
            "serverId": 9999999,
            "machineIdentifier": "fbb8aa6be6e0c997c6268bc2b4431c8807f70a3",
            "name": "ConnectedUserFlix",
            "lastSeenAt": 1556281940,
            "numLibraries": 16,
            "allLibraries": 1,
            "owned": 1,
            "pending": 1
          }
        ]
      }
    ]
  }
}

Headers

X-Plex-Client-Identifier
string
required

An opaque identifier unique to the client (UUID, serial number, or other unique device ID)

X-Plex-Product
string

The name of the client application. (Plex Web, Plex Media Server, etc.)

X-Plex-Device
string

A relatively friendly name for the client device

X-Plex-Device-Name
string

The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.)

X-Plex-Device-Screen-Resolution
string

The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440)

X-Plex-Version
string

The version of the client application.

X-Plex-Platform
string

The platform of the client application.

X-Plex-Features
string

The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list)

X-Plex-Model
string

A potentially less friendly identifier for the device model

X-Plex-Session-Id
string

The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca)

X-Plex-Language
string

The language of the client application.

X-Plex-Platform-Version
string

The version of the platform

X-Plex-Token
string
required

An authentication token, obtained from plex.tv

Example:

"CV5xoxjTpFKUzBTShsaf"

Response

200
application/xml
Successful response with media container data in XML
MediaContainer
object

Container holding user and server details.