GET
/
user
declare(strict_types=1);

require 'vendor/autoload.php';

use LukeHagar\Plex_API;

$sdk = Plex_API\PlexAPI::builder()
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();



$response = $sdk->authentication->getTokenDetails(

);

if ($response->userPlexAccount !== null) {
    // handle response
}
{
  "adsConsent": true,
  "adsConsentReminderAt": 1556281940,
  "adsConsentSetAt": 1556281940,
  "anonymous": false,
  "authToken": "CxoUzBTSV5hsxjTpFKaf",
  "backupCodesCreated": false,
  "confirmed": false,
  "country": "US",
  "email": "username@email.com",
  "emailOnlyAuth": false,
  "experimentalFeatures": false,
  "friendlyName": "friendlyUsername",
  "entitlements": [
    "[]"
  ],
  "guest": false,
  "hasPassword": true,
  "home": false,
  "homeAdmin": false,
  "homeSize": 1,
  "id": 13692262,
  "joinedAt": 1556281940,
  "locale": "<string>",
  "mailingListActive": false,
  "mailingListStatus": "active",
  "maxHomeSize": 15,
  "pin": "<string>",
  "profile": {
    "autoSelectAudio": true,
    "defaultAudioLanguage": "ja",
    "defaultSubtitleLanguage": "en",
    "autoSelectSubtitle": 1,
    "defaultSubtitleAccessibility": 1,
    "defaultSubtitleForced": 1,
    "watchedIndicator": 1,
    "mediaReviewsVisibility": 1
  },
  "protected": false,
  "rememberExpiresAt": 1556281940,
  "restricted": false,
  "roles": [
    "<string>"
  ],
  "scrobbleTypes": "<string>",
  "services": [
    {
      "identifier": "metadata-dev",
      "endpoint": "https://epg.provider.plex.tv",
      "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv",
      "secret": "<string>",
      "status": "online"
    }
  ],
  "subscription": {
    "features": [
      "<string>"
    ],
    "active": true,
    "subscribedAt": "2021-04-12T18:21:12Z",
    "status": "Inactive",
    "paymentService": "<string>",
    "plan": "<string>"
  },
  "subscriptionDescription": "<string>",
  "subscriptions": [
    {
      "features": [
        "<string>"
      ],
      "active": true,
      "subscribedAt": "2021-04-12T18:21:12Z",
      "status": "Inactive",
      "paymentService": "<string>",
      "plan": "<string>"
    }
  ],
  "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101",
  "title": "UsernameTitle",
  "twoFactorEnabled": false,
  "username": "Username",
  "uuid": "dae343c1f45beb4f",
  "attributionPartner": null
}

Authorizations

X-Plex-Token
string
header
required

Plex Authentication Token

Response

200
application/json
Logged in user details

Unknown

Unix epoch datetime in seconds

Example:

1556281940

Unix epoch datetime in seconds

Example:

1556281940

anonymous
boolean | null
default:false
required

Unknown

authToken
string
required

The account token

Example:

"CxoUzBTSV5hsxjTpFKaf"

backupCodesCreated
boolean
default:false
required

If the two-factor authentication backup codes have been created

confirmed
boolean
default:false
required

If the account has been confirmed

country
string
required

The account country

Required string length: 2
Example:

"US"

email
string
required

The account email address

Example:

"username@email.com"

emailOnlyAuth
boolean
default:false
required

If login with email only is enabled

experimentalFeatures
boolean
default:false
required

If experimental features are enabled

friendlyName
string
required

Your account full name

Example:

"friendlyUsername"

entitlements
string[]
required

List of devices your allowed to use with this account

guest
boolean
default:false
required

If the account is a Plex Home guest user

hasPassword
boolean
default:true
required

If the account has a password

home
boolean
default:false
required

If the account is a Plex Home user

homeAdmin
boolean
default:false
required

If the account is the Plex Home admin

homeSize
integer
required

The number of accounts in the Plex Home

Example:

1

id
integer
required

The Plex account ID

Example:

13692262

joinedAt
integer
required

Unix epoch datetime in seconds

Example:

1556281940

locale
string | null
required

The account locale

mailingListActive
boolean
default:false
required

If you are subscribed to the Plex newsletter

mailingListStatus
enum<string>
required

Your current mailing list status (active or unsubscribed)

Available options:
active,
unsubscribed
Example:

"active"

maxHomeSize
integer
required

The maximum number of accounts allowed in the Plex Home

Example:

15

profile
object
required
protected
boolean
default:false
required

If the account has a Plex Home PIN enabled

rememberExpiresAt
integer
required

Unix epoch datetime in seconds

Example:

1556281940

restricted
boolean
default:false
required

If the account is a Plex Home managed user

scrobbleTypes
string
required

Unknown

services
object[]
required
subscription
object
required

If the account’s Plex Pass subscription is active

subscriptionDescription
string | null
required

Description of the Plex Pass subscription

subscriptions
object[]
required
thumb
string
required

URL of the account thumbnail

Example:

"https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101"

title
string
required

The title of the account (username or friendly name)

Example:

"UsernameTitle"

twoFactorEnabled
boolean
default:false
required

If two-factor authentication is enabled

username
string
required

The account username

Example:

"Username"

uuid
string
required

The account UUID

Example:

"dae343c1f45beb4f"

attributionPartner
string | null
required
Example:

null

pin
string
deprecated

[Might be removed] The hashed Plex Home PIN

roles
string[]

[Might be removed] List of account roles. Plexpass membership listed here