Skip to main content
GET
/
users
PlexPHP
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",
        "thumb": "https://plex.tv/users/3346028014e93acd/avatar?c=1731605021",
        "protected": 1,
        "home": 1,
        "allowTuners": 1,
        "allowSync": 1,
        "allowCameraUpload": 1,
        "allowChannels": 1,
        "allowSubtitleAdmin": 1,
        "restricted": 1,
        "Server": [
          {
            "id": 907759180,
            "serverId": 9999999,
            "machineIdentifier": "fbb8aa6be6e0c997c6268bc2b4431c8807f70a3",
            "name": "ConnectedUserFlix",
            "lastSeenAt": 1556281940,
            "numLibraries": 16,
            "allLibraries": 1,
            "owned": 1,
            "pending": 1
          }
        ],
        "recommendationsPlaylistId": "",
        "filterAll": "",
        "filterMovies": "",
        "filterMusic": "",
        "filterPhotos": "",
        "filterTelevision": ""
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://plexapi.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-Plex-Token
string
header
required

The token which identifies the user accessing the PMS. This can be either:

  • A traditional access token obtained from plex.tv
  • A JWT token obtained through the JWT authentication flow

JWT tokens provide better security with:

  • Short-lived tokens (7 days expiration)
  • Public-key cryptography (ED25519)
  • Better clock synchronization
  • Individual device revocation capability

Headers

accepts
enum<string>
default:application/xml

Indicates the client accepts the indicated media types

Available options:
application/json,
application/xml
X-Plex-Client-Identifier
string
required

An opaque identifier unique to the client

Example:

"abc123"

X-Plex-Product
string

The name of the client product

Example:

"Plex for Roku"

X-Plex-Version
string

The version of the client application

Example:

"2.4.1"

X-Plex-Platform
string

The platform of the client

Example:

"Roku"

X-Plex-Platform-Version
string

The version of the platform

Example:

"4.3 build 1057"

X-Plex-Device
string

A relatively friendly name for the client device

Example:

"Roku 3"

X-Plex-Model
string

A potentially less friendly identifier for the device model

Example:

"4200X"

X-Plex-Device-Vendor
string

The device vendor

Example:

"Roku"

X-Plex-Device-Name
string

A friendly name for the client

Example:

"Living Room TV"

X-Plex-Marketplace
string

The marketplace on which the client application is distributed

Example:

"googlePlay"

Response

Successful response with media container data in JSON

MediaContainer
object

Container holding user and server details.