forked from LukeHagar/plex-api-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplex-tv-spec-dereferenced.yaml
742 lines (742 loc) · 24.7 KB
/
plex-tv-spec-dereferenced.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
openapi: 3.1.0
info:
title: Plex-API
summary: A Plex.TV API Map
description: An Open API Spec for interacting with Plex.tv
version: 0.0.3
contact:
name: Luke Hagar
url: 'https://www.LukeHagar.com'
email: [email protected]
license:
name: MIT
identifier: MIT
servers:
- url: 'https://plex.tv/api/v2'
security:
- Token: []
ClientIdentifier: []
Device: []
DeviceName: []
Platform: []
PlatformVersion: []
Product: []
Version: []
components:
securitySchemes:
Token:
description: Plex Authentication Token
type: apiKey
in: header
name: X-Plex-Token
ClientIdentifier:
description: Plex Authentication Token
type: apiKey
in:
- header
- query
- cookie
name: X-Plex-Client-Identifier
DeviceName:
description: Primary name for the device eg. `Plex Web (Chrome)`
type: apiKey
in: header
name: X-Plex-Device-Name
Device:
description: |
The type of device your application is running on
Device name and or model number, eg `iPhone3,2`, `Motorola XOOM™`, `LG5200TV`
type: apiKey
in: header
name: X-Plex-Device
PlatformVersion:
description: |
Operating system version
eg `4.3.1`, `10.6.7`, `3.2`
type: apiKey
in: header
name: X-Plex-Platform-Version
Platform:
description: |
Platform name
eg: `Web`, `iOS`, `MacOSX`, `Android`, `LG`
type: apiKey
in: header
name: X-Plex-Platform
Product:
description: |
Plex application name
eg: `Laika`, `Plex Media Server`, `Media Link`
type: apiKey
in: header
name: X-Plex-Product
Version:
description: Plex application version number
type: apiKey
in: header
name: X-Plex-Version
paths:
/companions:
get:
tags:
- Plex.tv
summary: Get Companions Data
description: Get Companions Data
operationId: getCompanionsData
responses:
'200':
description: Companions Data
content:
application/json:
schema:
type: array
items:
type: object
properties:
identifier:
type: string
example: tv.plex.sonos
baseURL:
type: string
example: 'https://sonos.plex.tv'
title:
type: string
example: Sonos
linkURL:
type: string
example: 'https://sonos.plex.tv/link'
provides:
type: string
example: clientplayer
token:
type: string
example: VFnxitsRFdWx_WrzsKL
'400':
description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
'401':
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1001
message:
type: string
example: User could not be authenticated
status:
type: number
example: 401
/geoip:
get:
tags:
- Plex.tv
summary: Get Geo Data
description: Get Geo Data
operationId: getGeoData
responses:
'200':
description: Geo Data
content:
application/json:
schema:
type: object
properties:
id:
type: number
example: 1841489
name:
type: string
example: Blindkitty38's home
guestUserID:
type: number
example: 58815432
guestUserUUID:
type: string
example: f3df4e01bfca0787
guestEnabled:
type: boolean
subscription:
type: boolean
'400':
description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
'401':
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1001
message:
type: string
example: User could not be authenticated
status:
type: number
example: 401
/home:
get:
tags:
- Plex.tv
summary: Get Home Data
description: Get Home Data
operationId: getHomeData
responses:
'200':
description: Home Data
content:
application/json:
schema:
type: object
properties:
id:
type: number
example: 1841489
name:
type: string
example: Blindkitty38's home
guestUserID:
type: number
example: 58815432
guestUserUUID:
type: string
example: f3df4e01bfca0787
guestEnabled:
type: boolean
subscription:
type: boolean
'400':
description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
'401':
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1001
message:
type: string
example: User could not be authenticated
status:
type: number
example: 401
/pins:
post:
tags:
- Plex.tv
summary: Get a Pin
operationId: getPin
description: Retrieve a Pin from Plex.tv for authentication flows
security:
- ClientIdentifier: []
parameters:
- name: strong
description: |
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`
in: query
schema:
type: boolean
default: false
required: false
responses:
'200':
description: The Pin
content:
application/json:
schema:
type: object
properties:
id:
description: PinID for use with authentication
type: number
example: 1272322473
code:
type: string
example: 3patfx1a78ukcbr7x0n9bl26t
product:
type: string
example: Plex Web
trusted:
type: boolean
qr:
description: |
a link to a QR code hosted on plex.tv
The QR code redirects to the relevant `plex.tv/link` authentication page
Which then prompts the user for the 4 Digit Link Pin
type: string
example: 'https://plex.tv/api/v2/pins/qr/3patfx1a78ukcbr7x0n9bl26t'
clientIdentifier:
type: string
example: Postman
location:
type: object
properties:
code:
type: string
example: US
european_union_member:
type: boolean
continent_code:
type: string
example: NA
country:
type: string
example: United States
city:
type: string
example: Austin
time_zone:
type: string
example: America/Chicago
postal_code:
type: number
example: 78732
in_privacy_restricted_country:
type: boolean
subdivisions:
type: string
example: Texas
coordinates:
type: string
example: 30.3768 -97.8935
expiresIn:
type: number
example: 1800
createdAt:
type: string
format: date-time
example: 2023-04-12T17:00:03.000Z
expiresAt:
type: string
format: date-time
example: 2023-04-12T17:30:03.000Z
authToken:
type: string
format: nullable
newRegistration:
type: string
format: nullable
'400':
description: X-Plex-Client-Identifier is missing
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1000
message:
type: string
example: X-Plex-Client-Identifier is missing
status:
type: number
example: 400
'/pins/{pinID}':
get:
tags:
- Plex.tv
summary: Get Access Token
operationId: getToken
description: Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
security:
- ClientIdentifier: []
parameters:
- name: pinID
description: The PinID to retrieve an access token for
in: path
schema:
type: string
required: true
responses:
'200':
description: Access Token
'400':
description: X-Plex-Client-Identifier is missing
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1000
message:
type: string
example: X-Plex-Client-Identifier is missing
status:
type: number
example: 400
/resources:
get:
tags:
- Plex.tv
summary: Get Devices
description: Get Devices
operationId: getDevices
parameters:
- name: includeHttps
description: Include Https entries in the results
in: query
schema:
type: integer
enum:
- 0
- 1
- name: includeRelay
description: Include Relay addresses in the results
in: query
schema:
type: integer
enum:
- 0
- 1
- name: includeIPv6
description: Include IPv6 entries in the results
in: query
schema:
type: integer
enum:
- 0
- 1
responses:
'200':
description: List of Plex Devices
content:
application/json:
schema:
type: array
items:
type: object
properties:
name:
type: string
example: Hera
product:
type: string
example: Plex Media Server
productVersion:
type: string
example: 1.31.3.6868-28fc46b27
platform:
type: string
example: Linux
platformVersion:
type: string
example: '5.19.17-Unraid (#2 SMP PREEMPT_DYNAMIC Wed Nov 2 11:54:15 PDT 2022)'
device:
type: string
example: PC
clientIdentifier:
type: string
example: 96f2fe7a78c9dc1f16a16bedbe90f98149be16b4
createdAt:
type: string
format: date-time
example: 2022-06-02T00:54:26.000Z
lastSeenAt:
type: string
format: date-time
example: 2023-04-11T05:53:59.000Z
provides:
type: string
example: server
ownerId:
type: string
format: nullable
sourceTitle:
type: string
format: nullable
publicAddress:
type: string
example: 68.248.140.20
accessToken:
type: string
example: CR3nxzsaSHdWx_WwZsJL
owned:
type: boolean
home:
type: boolean
synced:
type: boolean
relay:
type: boolean
presence:
type: boolean
httpsRequired:
type: boolean
publicAddressMatches:
type: boolean
dnsRebindingProtection:
type: boolean
natLoopbackSupported:
type: boolean
connections:
type: array
items:
type: object
properties:
protocol:
type: string
example: http
address:
type: string
example: 172.18.0.1
port:
type: number
example: 32400
uri:
type: string
example: 'http://172.18.0.1:32400'
local:
type: boolean
relay:
type: boolean
IPv6:
type: boolean
'400':
description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
'401':
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1001
message:
type: string
example: User could not be authenticated
status:
type: number
example: 401
/user:
get:
tags:
- Plex.tv
summary: Get Logged in User
description: Get Logged in User
operationId: getUserDetails
responses:
'200':
description: Logged in user details
'400':
description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
'401':
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1001
message:
type: string
example: User could not be authenticated
status:
type: number
example: 401
/user/settings:
get:
tags:
- Plex.tv
summary: Get User Settings
description: Get User Settings
operationId: getUserSettings
responses:
'200':
description: User Settings
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: string
example: experience
type:
type: string
example: json
value:
type: string
hidden:
type: boolean
updatedAt:
type: number
example: 1681769995
'400':
description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
'401':
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1001
message:
type: string
example: User could not be authenticated
status:
type: number
example: 401
/user/settings/opt_outs:
get:
tags:
- Plex.tv
summary: Get User Opt Out Settings
description: Get User Opt Out Settings
operationId: getUserOptOutSettings
responses:
'200':
description: User Opt Out Settings
content:
application/json:
schema:
type: object
properties:
tv.plex.provider.podcasts:
type: string
example: opt_in
tv.plex.provider.news:
type: string
example: opt_in
tv.plex.provider.webshows:
type: string
example: opt_out
tv.plex.provider.music:
type: string
example: opt_out
tv.plex.provider.vod:
type: string
example: opt_in
scrobbling:
type: string
example: opt_in
'400':
description: 'Bad Request - A parameter was not specified, or was specified incorrectly.'
'401':
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1001
message:
type: string
example: User could not be authenticated
status:
type: number
example: 401
tags:
- name: Activities
description: |
Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity.
Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details:
- They can contain a `progress` (from 0 to 100) marking the percent completion of the activity.
- They must contain an `type` which is used by clients to distinguish the specific activity.
- They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)
- The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
- name: Authentication
description: |
API Calls regarding authentication for Plex Media Server
- name: Butler
description: |
Butler is the task manager of the Plex Media Server Ecosystem.
- name: Server
description: |
Operations against the Plex Media Server System.
- name: Updater
description: |
This describes the API for searching and applying updates to the Plex Media Server.
Updates to the status can be observed via the Event API.
- name: Log
description: |
Submit logs to the Log Handler for Plex Media Server
- name: Security
description: |
API Calls against Security for Plex Media Server
- name: Library
description: |
API Calls interacting with Plex Media Server Libraries
- name: Hubs
description: |
Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
- name: Playlists
description: |
Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017").
They can be organized in (optionally nesting) folders.
Retrieving a playlist, or its items, will trigger a refresh of its metadata.
This may cause the duration and number of items to change.
- name: Search
description: |
API Calls that perform search operations with Plex Media Server
- name: User
description: |
API Calls that perform operations with Plex Media Server Users