POST
/
pins
csharp
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI();

GetPinRequest req = new GetPinRequest() {
    ClientID = "3381b62b-9ab7-4e37-827b-203e9809eb58",
    ClientName = "Plex for Roku",
    DeviceNickname = "Roku 3",
    ClientVersion = "2.4.1",
    Platform = "Roku",
};

var res = await sdk.Plex.GetPinAsync(req);

// handle response
{
  "id": 308667304,
  "code": "7RQZ",
  "product": "0",
  "trusted": false,
  "qr": "https://plex.tv/api/v2/pins/qr/7RQZ",
  "clientIdentifier": "string",
  "location": {
    "code": "VI",
    "continent_code": "NA",
    "country": "United States Virgin Islands",
    "city": "Amsterdam",
    "european_union_member": true,
    "time_zone": "America/St_Thomas",
    "postal_code": 802,
    "in_privacy_restricted_country": true,
    "in_privacy_restricted_region": true,
    "subdivisions": "Saint Thomas",
    "coordinates": "18.3381, -64.8941"
  },
  "expiresIn": 876,
  "createdAt": "2024-07-16T17:03:05Z",
  "expiresAt": "2024-07-16T17:18:05Z",
  "authToken": null,
  "newRegistration": null
}

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-Version
string

The version of the client application.

X-Plex-Platform
string

The platform of the client application.

Query Parameters

strong
boolean
default:false

Determines the kind of code returned by the API call Strong codes are used for Pin authentication flows Non-Strong codes are used for Plex.tv/link

Response

Requests a new pin id used in the authentication flow

id
integer
required
Example:

308667304

code
string
required
Example:

"7RQZ"

product
string
required
Example:

"Tautulli"

trusted
boolean
default:false
required
qr
string
required
Example:

"https://plex.tv/api/v2/pins/qr/7RQZ"

clientIdentifier
string
required

The X-Client-Identifier used in the request

Example:

"Tautulli"

location
object
required

Geo location data

Examples:
{
"code": "VI",
"continent_code": "NA",
"country": "United States Virgin Islands",
"city": "Amsterdam",
"european_union_member": true,
"time_zone": "America/St_Thomas",
"postal_code": 802,
"in_privacy_restricted_country": true,
"in_privacy_restricted_region": true,
"subdivisions": "Saint Thomas",
"coordinates": "18.3381, -64.8941"
}
expiresIn
integer
default:900
required

The number of seconds this pin expires, by default 900 seconds

Example:

876

createdAt
string<date-time>
required
Example:

"2024-07-16T17:03:05Z"

expiresAt
string<date-time>
required
Example:

"2024-07-16T17:18:05Z"

authToken
string | null
Example:

"gcgzw5rz2xovp84b4vha3a40"

newRegistration
null