aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc/api/openapi.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'support/doc/api/openapi.yaml')
-rw-r--r--support/doc/api/openapi.yaml2054
1 files changed, 1056 insertions, 998 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index e88c05333..c5bea99ac 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -1,4 +1,4 @@
1swagger: '2.0' 1openapi: 3.0.0
2info: 2info:
3 title: PeerTube 3 title: PeerTube
4 version: 1.1.0-alpha.2 4 version: 1.1.0-alpha.2
@@ -17,64 +17,46 @@ info:
17 accepts and returns JSON in the HTTP body. You can use your favorite 17 accepts and returns JSON in the HTTP body. You can use your favorite
18 HTTP/REST library for your programming language to use PeerTube. No official 18 HTTP/REST library for your programming language to use PeerTube. No official
19 SDK is currently provided. 19 SDK is currently provided.
20 20
21 # Authentication 21 # Authentication
22 When you sign up for an account, you are given the possibility to generate 22 When you sign up for an account, you are given the possibility to generate
23 sessions, and authenticate using this session token. One session token can 23 sessions, and authenticate using this session token. One session token can
24 currently be used at a time. 24 currently be used at a time.
25securityDefinitions:
26 OAuth2:
27 description: |
28 In the header: *Authorization: Bearer <token\>*
29
30 Authenticating via OAuth requires the following steps:
31
32 - Have an account with sufficient authorization levels
33 - [Generate](https://docs.joinpeertube.org/lang/en/devdocs/rest.html) a Bearer Token
34 - Make Authenticated Requests
35 type: oauth2
36 flow: password
37 # Not implemented yet
38 # authorizationUrl: https://example.com/oauth/authorize
39 tokenUrl: https://peertube.example.com/api/v1/users/token
40 scopes:
41 admin: Admin scope
42 moderator: Moderator scope
43 user: User scope
44basePath: '/api/v1'
45schemes:
46 - https
47host: peertube.example.com
48x-servers:
49 - url: 'https://peertube.cpy.re/api/v1'
50 description: Live Server
51produces:
52 - application/json; charset=utf-8
53consumes:
54 - application/json
55tags: 25tags:
56 - name: Accounts 26 - name: Accounts
57 description: | 27 description: >
58 Using some features of PeerTube require authentication, for which Accounts 28 Using some features of PeerTube require authentication, for which Accounts
59 provide different levels of permission as well as associated user information. 29
30 provide different levels of permission as well as associated user
31 information.
32
60 Accounts also encompass remote accounts discovered across the federation. 33 Accounts also encompass remote accounts discovered across the federation.
61 - name: Config 34 - name: Config
62 description: | 35 description: >
63 Each server exposes public information regarding supported videos and options. 36 Each server exposes public information regarding supported videos and
37 options.
64 - name: Feeds 38 - name: Feeds
65 description: | 39 description: |
66 Feeds of videos and feeds of comments allow to see updates and get them in 40 Feeds of videos and feeds of comments allow to see updates and get them in
67 an aggregator or script of your choice. 41 an aggregator or script of your choice.
68 - name: Job 42 - name: Job
69 description: | 43 description: >
70 Jobs are long-running tasks enqueued and processed by the instance itself. 44 Jobs are long-running tasks enqueued and processed by the instance
45 itself.
46
71 No additional worker registration is currently available. 47 No additional worker registration is currently available.
72 - name: ServerFollowing 48 - name: ServerFollowing
73 description: | 49 description: >
74 Managing servers which the instance interacts with is crucial to the concept 50 Managing servers which the instance interacts with is crucial to the
75 of federation in PeerTube and external video indexation. The PeerTube server 51 concept
52
53 of federation in PeerTube and external video indexation. The PeerTube
54 server
55
76 then deals with inter-server ActivityPub operations and propagates 56 then deals with inter-server ActivityPub operations and propagates
57
77 information across its social graph by posting activities to actors' inbox 58 information across its social graph by posting activities to actors' inbox
59
78 endpoints. 60 endpoints.
79 - name: VideoAbuse 61 - name: VideoAbuse
80 description: | 62 description: |
@@ -89,11 +71,14 @@ tags:
89 followed by the instance) can be found via keywords and other criteria of 71 followed by the instance) can be found via keywords and other criteria of
90 the advanced search. 72 the advanced search.
91 - name: VideoComment 73 - name: VideoComment
92 description: | 74 description: >
93 Operations dealing with comments to a video. Comments are organized in threads. 75 Operations dealing with comments to a video. Comments are organized in
76 threads.
94 - name: VideoChannel 77 - name: VideoChannel
95 description: | 78 description: >
96 Operations dealing with creation, modification and video listing of a user's 79 Operations dealing with creation, modification and video listing of a
80 user's
81
97 channels. 82 channels.
98paths: 83paths:
99 '/accounts/{name}': 84 '/accounts/{name}':
@@ -101,37 +86,33 @@ paths:
101 tags: 86 tags:
102 - Accounts 87 - Accounts
103 summary: Get the account by name 88 summary: Get the account by name
104 consumes:
105 - application/json
106 produces:
107 - application/json
108 parameters: 89 parameters:
109 - $ref: "accounts.yaml#/parameters/name" 90 - $ref: '#/components/parameters/name'
110 - $ref: "commons.yaml#/parameters/start" 91 - $ref: '#/components/parameters/start'
111 - $ref: "commons.yaml#/parameters/count" 92 - $ref: '#/components/parameters/count'
112 - $ref: "commons.yaml#/parameters/sort" 93 - $ref: '#/components/parameters/sort'
113 responses: 94 responses:
114 '200': 95 '200':
115 description: successful operation 96 description: successful operation
116 schema: 97 content:
117 $ref: '#/definitions/Account' 98 application/json:
99 schema:
100 $ref: '#/components/schemas/Account'
118 '/accounts/{name}/videos': 101 '/accounts/{name}/videos':
119 get: 102 get:
120 tags: 103 tags:
121 - Accounts 104 - Accounts
122 - Video 105 - Video
123 summary: Get videos for an account, provided the name of that account 106 summary: 'Get videos for an account, provided the name of that account'
124 consumes:
125 - application/json
126 produces:
127 - application/json
128 parameters: 107 parameters:
129 - $ref: "accounts.yaml#/parameters/name" 108 - $ref: '#/components/parameters/name'
130 responses: 109 responses:
131 '200': 110 '200':
132 description: successful operation 111 description: successful operation
133 schema: 112 content:
134 $ref: '#/definitions/Video' 113 application/json:
114 schema:
115 $ref: '#/components/schemas/Video'
135 x-code-samples: 116 x-code-samples:
136 - lang: JavaScript 117 - lang: JavaScript
137 source: | 118 source: |
@@ -146,58 +127,62 @@ paths:
146 tags: 127 tags:
147 - Accounts 128 - Accounts
148 summary: Get all accounts 129 summary: Get all accounts
149 consumes:
150 - application/json
151 produces:
152 - application/jsonhttps://peertube.cpy.re/api/v1
153 responses: 130 responses:
154 '200': 131 '200':
155 description: successful operation 132 description: successful operation
156 schema: 133 content:
157 type: array 134 'application/jsonhttps://peertube.cpy.re/api/v1':
158 items: 135 schema:
159 $ref: '#/definitions/Account' 136 type: array
137 items:
138 $ref: '#/components/schemas/Account'
160 /config: 139 /config:
161 get: 140 get:
162 tags: 141 tags:
163 - Config 142 - Config
164 summary: Get the configuration of the server 143 summary: Get the configuration of the server
165 consumes:
166 - application/json
167 produces:
168 - application/json
169 responses: 144 responses:
170 '200': 145 '200':
171 description: successful operation 146 description: successful operation
172 schema: 147 content:
173 $ref: '#/definitions/ServerConfig' 148 application/json:
174 /feeds/videos.{format}: 149 schema:
150 $ref: '#/components/schemas/ServerConfig'
151 '/feeds/videos.{format}':
175 get: 152 get:
176 summary: Get the feed of videos for the server, with optional filter by account name or id 153 summary: >-
154 Get the feed of videos for the server, with optional filter by account
155 name or id
177 tags: 156 tags:
178 - Feeds 157 - Feeds
179 produces:
180 - application/atom+xml
181 - application/rss+xml
182 - application/json
183 parameters: 158 parameters:
184 - name: format 159 - name: format
185 in: path 160 in: path
186 required: true 161 required: true
187 type: string 162 description: >-
188 enum: [ 'xml', 'atom', 'json'] 163 The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and
189 default: 'xml' 164 json to JSON FEED 1.0
190 description: 'The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and json to JSON FEED 1.0' 165 schema:
166 type: string
167 enum:
168 - xml
169 - atom
170 - json
171 default: xml
191 - name: accountId 172 - name: accountId
192 in: query 173 in: query
193 required: false 174 required: false
194 type: number 175 description: >-
195 description: 'The id of the local account to filter to (beware, users IDs and not actors IDs which will return empty feeds' 176 The id of the local account to filter to (beware, users IDs and not
177 actors IDs which will return empty feeds
178 schema:
179 type: number
196 - name: accountName 180 - name: accountName
197 in: query 181 in: query
198 required: false 182 required: false
199 type: string 183 description: The name of the local account to filter to
200 description: 'The name of the local account to filter to' 184 schema:
185 type: string
201 responses: 186 responses:
202 '200': 187 '200':
203 description: successful operation 188 description: successful operation
@@ -205,46 +190,44 @@ paths:
205 get: 190 get:
206 summary: Get list of jobs 191 summary: Get list of jobs
207 security: 192 security:
208 - OAuth2: [ admin ] 193 - OAuth2:
194 - admin
209 tags: 195 tags:
210 - Job 196 - Job
211 consumes:
212 - application/json
213 produces:
214 - application/json
215 parameters: 197 parameters:
216 - name: state 198 - name: state
217 in: path 199 in: path
218 required: true 200 required: true
219 type: string 201 description: The state of the job
220 description: 'The state of the job' 202 schema:
221 - $ref: "commons.yaml#/parameters/start" 203 type: string
222 - $ref: "commons.yaml#/parameters/count" 204 - $ref: '#/components/parameters/start'
223 - $ref: "commons.yaml#/parameters/sort" 205 - $ref: '#/components/parameters/count'
206 - $ref: '#/components/parameters/sort'
224 responses: 207 responses:
225 '200': 208 '200':
226 description: successful operation 209 description: successful operation
227 schema: 210 content:
228 type: array 211 application/json:
229 items: 212 schema:
230 $ref: '#/definitions/Job' 213 type: array
214 items:
215 $ref: '#/components/schemas/Job'
231 '/server/following/{host}': 216 '/server/following/{host}':
232 delete: 217 delete:
233 security: 218 security:
234 - OAuth2: [ admin ] 219 - OAuth2:
220 - admin
235 tags: 221 tags:
236 - ServerFollowing 222 - ServerFollowing
237 summary: Unfollow a server by hostname 223 summary: Unfollow a server by hostname
238 consumes:
239 - application/json
240 produces:
241 - application/json
242 parameters: 224 parameters:
243 - name: host 225 - name: host
244 in: path 226 in: path
245 required: true 227 required: true
246 type: string
247 description: 'The host to unfollow ' 228 description: 'The host to unfollow '
229 schema:
230 type: string
248 responses: 231 responses:
249 '201': 232 '201':
250 description: successful operation 233 description: successful operation
@@ -253,1276 +236,1351 @@ paths:
253 tags: 236 tags:
254 - ServerFollowing 237 - ServerFollowing
255 summary: Get followers of the server 238 summary: Get followers of the server
256 consumes:
257 - application/json
258 produces:
259 - application/json
260 parameters: 239 parameters:
261 - $ref: "commons.yaml#/parameters/start" 240 - $ref: '#/components/parameters/start'
262 - $ref: "commons.yaml#/parameters/count" 241 - $ref: '#/components/parameters/count'
263 - $ref: "commons.yaml#/parameters/sort" 242 - $ref: '#/components/parameters/sort'
264 responses: 243 responses:
265 '200': 244 '200':
266 description: successful operation 245 description: successful operation
267 schema: 246 content:
268 type: array 247 application/json:
269 items: 248 schema:
270 $ref: '#/definitions/Follow' 249 type: array
250 items:
251 $ref: '#/components/schemas/Follow'
271 /server/following: 252 /server/following:
272 get: 253 get:
273 tags: 254 tags:
274 - ServerFollowing 255 - ServerFollowing
275 summary: Get servers followed by the server 256 summary: Get servers followed by the server
276 consumes:
277 - application/json
278 produces:
279 - application/json
280 parameters: 257 parameters:
281 - $ref: "commons.yaml#/parameters/start" 258 - $ref: '#/components/parameters/start'
282 - $ref: "commons.yaml#/parameters/count" 259 - $ref: '#/components/parameters/count'
283 - $ref: "commons.yaml#/parameters/sort" 260 - $ref: '#/components/parameters/sort'
284 responses: 261 responses:
285 '200': 262 '200':
286 description: successful operation 263 description: successful operation
287 schema: 264 content:
288 type: array 265 application/json:
289 items: 266 schema:
290 $ref: '#/definitions/Follow' 267 type: array
268 items:
269 $ref: '#/components/schemas/Follow'
291 post: 270 post:
292 security: 271 security:
293 - OAuth2: [ admin ] 272 - OAuth2:
273 - admin
294 tags: 274 tags:
295 - ServerFollowing 275 - ServerFollowing
296 summary: Follow a server 276 summary: Follow a server
297 consumes:
298 - application/json
299 produces:
300 - application/json
301 parameters:
302 - in: body
303 name: body
304 schema:
305 $ref: '#/definitions/Follow'
306 responses: 277 responses:
307 '204': 278 '204':
308 $ref: "commons.yaml#/responses/emptySuccess" 279 $ref: '#/paths/~1users~1me/put/responses/204'
280 requestBody:
281 content:
282 application/json:
283 schema:
284 $ref: '#/components/schemas/Follow'
309 /users: 285 /users:
310 post: 286 post:
311 summary: Creates user 287 summary: Creates user
312 security: 288 security:
313 - OAuth2: [ admin ] 289 - OAuth2:
290 - admin
314 tags: 291 tags:
315 - User 292 - User
316 consumes:
317 - application/json
318 produces:
319 - application/json
320 parameters:
321 - in: body
322 name: body
323 required: true
324 description: 'User to create'
325 schema:
326 $ref: '#/definitions/AddUser'
327 responses: 293 responses:
328 '200': 294 '200':
329 description: successful operation 295 description: successful operation
330 schema: 296 content:
331 $ref: '#/definitions/AddUserResponse' 297 application/json:
298 schema:
299 $ref: '#/components/schemas/AddUserResponse'
300 requestBody:
301 content:
302 application/json:
303 schema:
304 $ref: '#/components/schemas/AddUser'
305 description: User to create
306 required: true
332 get: 307 get:
333 summary: Get a list of users 308 summary: Get a list of users
334 security: 309 security:
335 - OAuth2: [ ] 310 - OAuth2: []
336 tags: 311 tags:
337 - User 312 - User
338 consumes:
339 - application/json
340 produces:
341 - application/json
342 parameters: 313 parameters:
343 - $ref: "commons.yaml#/parameters/start" 314 - $ref: '#/components/parameters/start'
344 - $ref: "commons.yaml#/parameters/count" 315 - $ref: '#/components/parameters/count'
345 - $ref: "commons.yaml#/parameters/sort" 316 - $ref: '#/components/parameters/sort'
346 responses: 317 responses:
347 '200': 318 '200':
348 description: successful operation 319 description: successful operation
349 schema: 320 content:
350 type: array 321 application/json:
351 items: 322 schema:
352 $ref: '#/definitions/User' 323 type: array
324 items:
325 $ref: '#/components/schemas/User'
353 '/users/{id}': 326 '/users/{id}':
354 delete: 327 delete:
355 summary: Delete a user by its id 328 summary: Delete a user by its id
356 security: 329 security:
357 - OAuth2: [ admin ] 330 - OAuth2:
331 - admin
358 tags: 332 tags:
359 - User 333 - User
360 consumes:
361 - application/json
362 produces:
363 - application/json
364 parameters: 334 parameters:
365 - $ref: "users.yaml#/parameters/id" 335 - $ref: '#/components/parameters/id'
366 responses: 336 responses:
367 '204': 337 '204':
368 $ref: "commons.yaml#/responses/emptySuccess" 338 $ref: '#/paths/~1users~1me/put/responses/204'
369 get: 339 get:
370 summary: Get user by its id 340 summary: Get user by its id
371 security: 341 security:
372 - OAuth2: [ ] 342 - OAuth2: []
373 tags: 343 tags:
374 - User 344 - User
375 consumes:
376 - application/json
377 produces:
378 - application/json
379 parameters: 345 parameters:
380 - $ref: "users.yaml#/parameters/id" 346 - $ref: '#/components/parameters/id'
381 responses: 347 responses:
382 '200': 348 '200':
383 description: successful operation 349 description: successful operation
384 schema: 350 content:
385 $ref: '#/definitions/User' 351 application/json:
352 schema:
353 $ref: '#/components/schemas/User'
386 put: 354 put:
387 summary: Update user profile by its id 355 summary: Update user profile by its id
388 security: 356 security:
389 - OAuth2: [ ] 357 - OAuth2: []
390 tags: 358 tags:
391 - User 359 - User
392 consumes:
393 - application/json
394 produces:
395 - application/json
396 parameters: 360 parameters:
397 - $ref: "users.yaml#/parameters/id" 361 - $ref: '#/components/parameters/id'
398 - in: body
399 name: body
400 required: true
401 schema:
402 $ref: '#/definitions/UpdateUser'
403 responses: 362 responses:
404 '204': 363 '204':
405 $ref: "commons.yaml#/responses/emptySuccess" 364 $ref: '#/paths/~1users~1me/put/responses/204'
365 requestBody:
366 content:
367 application/json:
368 schema:
369 $ref: '#/components/schemas/UpdateUser'
370 required: true
406 /users/me: 371 /users/me:
407 get: 372 get:
408 summary: Get current user information 373 summary: Get current user information
409 security: 374 security:
410 - OAuth2: [ ] 375 - OAuth2: []
411 tags: 376 tags:
412 - User 377 - User
413 consumes:
414 - application/json
415 produces:
416 - application/json
417 responses: 378 responses:
418 '200': 379 '200':
419 description: successful operation 380 description: successful operation
420 schema: 381 content:
421 type: array 382 application/json:
422 items: 383 schema:
423 $ref: '#/definitions/User' 384 type: array
385 items:
386 $ref: '#/components/schemas/User'
424 put: 387 put:
425 summary: Update current user information 388 summary: Update current user information
426 security: 389 security:
427 - OAuth2: [ ] 390 - OAuth2: []
428 tags: 391 tags:
429 - User 392 - User
430 consumes:
431 - application/json
432 produces:
433 - application/json
434 parameters:
435 - in: body
436 name: body
437 required: true
438 schema:
439 $ref: '#/definitions/UpdateMe'
440 responses: 393 responses:
441 '204': 394 '204':
442 $ref: "commons.yaml#/responses/emptySuccess" 395 description: Successful operation
396 requestBody:
397 content:
398 application/json:
399 schema:
400 $ref: '#/components/schemas/UpdateMe'
401 required: true
443 /users/me/video-quota-used: 402 /users/me/video-quota-used:
444 get: 403 get:
445 summary: Get current user used quota 404 summary: Get current user used quota
446 security: 405 security:
447 - OAuth2: [ ] 406 - OAuth2: []
448 tags: 407 tags:
449 - User 408 - User
450 consumes:
451 - application/json
452 produces:
453 - application/json
454 parameters: []
455 responses: 409 responses:
456 '200': 410 '200':
457 description: successful operation 411 description: successful operation
458 schema: 412 content:
459 type: number 413 application/json:
414 schema:
415 type: number
460 '/users/me/videos/{videoId}/rating': 416 '/users/me/videos/{videoId}/rating':
461 get: 417 get:
462 summary: Get rating of video by its id, among those of the current user 418 summary: 'Get rating of video by its id, among those of the current user'
463 security: 419 security:
464 - OAuth2: [ ] 420 - OAuth2: []
465 tags: 421 tags:
466 - User 422 - User
467 consumes:
468 - application/json
469 produces:
470 - application/json
471 parameters: 423 parameters:
472 - name: videoId 424 - name: videoId
473 in: path 425 in: path
474 required: true 426 required: true
475 type: string
476 description: 'The video id ' 427 description: 'The video id '
428 schema:
429 type: string
477 responses: 430 responses:
478 '200': 431 '200':
479 description: successful operation 432 description: successful operation
480 schema: 433 content:
481 $ref: '#/definitions/GetMeVideoRating' 434 application/json:
435 schema:
436 $ref: '#/components/schemas/GetMeVideoRating'
482 /users/me/videos: 437 /users/me/videos:
483 get: 438 get:
484 summary: Get videos of the current user 439 summary: Get videos of the current user
485 security: 440 security:
486 - OAuth2: [ ] 441 - OAuth2: []
487 tags: 442 tags:
488 - User 443 - User
489 consumes:
490 - application/json
491 produces:
492 - application/json
493 parameters: 444 parameters:
494 - $ref: "commons.yaml#/parameters/start" 445 - $ref: '#/components/parameters/start'
495 - $ref: "commons.yaml#/parameters/count" 446 - $ref: '#/components/parameters/count'
496 - $ref: "commons.yaml#/parameters/sort" 447 - $ref: '#/components/parameters/sort'
497 responses: 448 responses:
498 '200': 449 '200':
499 description: successful operation 450 description: successful operation
500 schema: 451 content:
501 type: array 452 application/json:
502 items: 453 schema:
503 $ref: '#/definitions/Video' 454 type: array
455 items:
456 $ref: '#/components/schemas/Video'
504 /users/register: 457 /users/register:
505 post: 458 post:
506 summary: Register a user 459 summary: Register a user
507 tags: 460 tags:
508 - User 461 - User
509 consumes:
510 - application/json
511 produces:
512 - application/json
513 parameters:
514 - in: body
515 name: body
516 required: true
517 schema:
518 $ref: '#/definitions/RegisterUser'
519 responses: 462 responses:
520 '204': 463 '204':
521 $ref: "commons.yaml#/responses/emptySuccess" 464 $ref: '#/paths/~1users~1me/put/responses/204'
465 requestBody:
466 content:
467 application/json:
468 schema:
469 $ref: '#/components/schemas/RegisterUser'
470 required: true
522 /users/me/avatar/pick: 471 /users/me/avatar/pick:
523 post: 472 post:
524 summary: Update current user avatar 473 summary: Update current user avatar
525 security: 474 security:
526 - OAuth2: [ ] 475 - OAuth2: []
527 tags: 476 tags:
528 - User 477 - User
529 consumes:
530 - multipart/form-data
531 produces:
532 - application/json
533 parameters:
534 - in: formData
535 name: avatarfile
536 type: file
537 description: The file to upload.
538 responses: 478 responses:
539 '200': 479 '200':
540 description: successful operation 480 description: successful operation
541 schema: 481 content:
542 $ref: '#/definitions/Avatar' 482 application/json:
483 schema:
484 $ref: '#/components/schemas/Avatar'
485 requestBody:
486 content:
487 multipart/form-data:
488 schema:
489 type: object
490 properties:
491 avatarfile:
492 description: The file to upload.
493 type: string
494 format: binary
495 encoding:
496 profileImage:
497 # only accept png/jpeg
498 contentType: image/png, image/jpeg
543 /videos: 499 /videos:
544 get: 500 get:
545 summary: Get list of videos 501 summary: Get list of videos
546 tags: 502 tags:
547 - Video 503 - Video
548 consumes:
549 - application/json
550 produces:
551 - application/json
552 parameters: 504 parameters:
553 - name: category 505 - name: category
554 in: query 506 in: query
555 required: false 507 required: false
556 type: number
557 description: category id of the video 508 description: category id of the video
558 - $ref: "commons.yaml#/parameters/start" 509 schema:
559 - $ref: "commons.yaml#/parameters/count" 510 type: number
560 - $ref: "commons.yaml#/parameters/sort" 511 - $ref: '#/components/parameters/start'
512 - $ref: '#/components/parameters/count'
513 - $ref: '#/components/parameters/sort'
561 responses: 514 responses:
562 '200': 515 '200':
563 description: successful operation 516 description: successful operation
564 schema: 517 content:
565 type: array 518 application/json:
566 items: 519 schema:
567 $ref: '#/definitions/Video' 520 type: array
521 items:
522 $ref: '#/components/schemas/Video'
568 /videos/categories: 523 /videos/categories:
569 get: 524 get:
570 summary: Get list of video licences known by the server 525 summary: Get list of video licences known by the server
571 tags: 526 tags:
572 - Video 527 - Video
573 consumes:
574 - application/json
575 produces:
576 - application/json
577 responses: 528 responses:
578 '200': 529 '200':
579 description: successful operation 530 description: successful operation
580 schema: 531 content:
581 type: array 532 application/json:
582 items: 533 schema:
583 type: string 534 type: array
535 items:
536 type: string
584 /videos/licences: 537 /videos/licences:
585 get: 538 get:
586 summary: Get list of video licences known by the server 539 summary: Get list of video licences known by the server
587 tags: 540 tags:
588 - Video 541 - Video
589 consumes:
590 - application/json
591 produces:
592 - application/json
593 responses: 542 responses:
594 '200': 543 '200':
595 description: successful operation 544 description: successful operation
596 schema: 545 content:
597 type: array 546 application/json:
598 items: 547 schema:
599 type: string 548 type: array
549 items:
550 type: string
600 /videos/languages: 551 /videos/languages:
601 get: 552 get:
602 summary: Get list of languages known by the server 553 summary: Get list of languages known by the server
603 tags: 554 tags:
604 - Video 555 - Video
605 consumes:
606 - application/json
607 produces:
608 - application/json
609 responses: 556 responses:
610 '200': 557 '200':
611 description: successful operation 558 description: successful operation
612 schema: 559 content:
613 type: array 560 application/json:
614 items: 561 schema:
615 type: string 562 type: array
563 items:
564 type: string
616 /videos/privacies: 565 /videos/privacies:
617 get: 566 get:
618 summary: Get list of privacy policies supported by the server 567 summary: Get list of privacy policies supported by the server
619 tags: 568 tags:
620 - Video 569 - Video
621 consumes:
622 - application/json
623 produces:
624 - application/json
625 responses: 570 responses:
626 '200': 571 '200':
627 description: successful operation 572 description: successful operation
628 schema: 573 content:
629 type: array 574 application/json:
630 items: 575 schema:
631 type: string 576 type: array
632 "/videos/{id}": 577 items:
578 type: string
579 '/videos/{id}':
633 put: 580 put:
634 summary: Update metadata for a video by its id 581 summary: Update metadata for a video by its id
635 security: 582 security:
636 - OAuth2: [ ] 583 - OAuth2: []
637 tags: 584 tags:
638 - Video 585 - Video
639 consumes:
640 - multipart/form-data
641 produces:
642 - application/json
643 parameters: 586 parameters:
644 - $ref: "videos.yaml#/parameters/id" 587 - $ref: '#/components/parameters/id2'
645 - $ref: "videos.yaml#/parameters/thumbnailfile"
646 - $ref: "videos.yaml#/parameters/previewfile"
647 - $ref: "videos.yaml#/parameters/category"
648 - $ref: "videos.yaml#/parameters/licence"
649 - $ref: "videos.yaml#/parameters/language"
650 - $ref: "videos.yaml#/parameters/description"
651 - $ref: "videos.yaml#/parameters/waitTranscoding"
652 - $ref: "videos.yaml#/parameters/support"
653 - $ref: "videos.yaml#/parameters/nsfw"
654 - $ref: "videos.yaml#/parameters/name"
655 - $ref: "videos.yaml#/parameters/tags"
656 - $ref: "videos.yaml#/parameters/commentsEnabled"
657 - $ref: "videos.yaml#/parameters/privacy"
658 - $ref: "videos.yaml#/parameters/scheduleUpdate"
659 responses: 588 responses:
660 '200': 589 '200':
661 description: successful operation 590 description: successful operation
662 schema: 591 content:
663 $ref: '#/definitions/Video' 592 application/json:
593 schema:
594 $ref: '#/components/schemas/Video'
595 requestBody:
596 content:
597 multipart/form-data:
598 schema:
599 type: object
600 properties:
601 thumbnailfile:
602 description: Video thumbnail file
603 type: string
604 previewfile:
605 description: Video preview file
606 type: string
607 category:
608 description: Video category
609 type: string
610 licence:
611 description: Video licence
612 type: string
613 language:
614 description: Video language
615 type: string
616 description:
617 description: Video description
618 type: string
619 waitTranscoding:
620 description: Whether or not we wait transcoding before publish the video
621 type: string
622 support:
623 description: Text describing how to support the video uploader
624 type: string
625 nsfw:
626 description: Whether or not this video contains sensitive content
627 type: string
628 name:
629 description: Video name
630 type: string
631 tags:
632 description: Video tags
633 type: string
634 commentsEnabled:
635 description: Enable or disable comments for this video
636 type: string
637 scheduleUpdate: &ref_0
638 type: object
639 properties:
640 privacy:
641 type: string
642 enum:
643 - Public
644 - Unlisted
645 description: Video privacy target
646 updateAt:
647 type: string
648 format: date
649 description: When to update the video
650 required:
651 - updateAt
664 get: 652 get:
665 summary: Get a video by its id 653 summary: Get a video by its id
666 tags: 654 tags:
667 - Video 655 - Video
668 consumes:
669 - application/json
670 produces:
671 - application/json
672 parameters: 656 parameters:
673 - $ref: "videos.yaml#/parameters/id" 657 - $ref: '#/components/parameters/id2'
674 responses: 658 responses:
675 '200': 659 '200':
676 description: successful operation 660 description: successful operation
677 schema: 661 content:
678 $ref: '#/definitions/Video' 662 application/json:
663 schema:
664 $ref: '#/components/schemas/Video'
679 delete: 665 delete:
680 summary: Delete a video by its id 666 summary: Delete a video by its id
681 security: 667 security:
682 - OAuth2: [ ] 668 - OAuth2: []
683 tags: 669 tags:
684 - Video 670 - Video
685 consumes:
686 - application/json
687 produces:
688 - application/json
689 parameters: 671 parameters:
690 - $ref: "videos.yaml#/parameters/id" 672 - $ref: '#/components/parameters/id2'
691 responses: 673 responses:
692 '204': 674 '204':
693 $ref: "commons.yaml#/responses/emptySuccess" 675 $ref: '#/paths/~1users~1me/put/responses/204'
694 "/videos/{id}/description": 676 '/videos/{id}/description':
695 get: 677 get:
696 summary: Get a video description by its id 678 summary: Get a video description by its id
697 tags: 679 tags:
698 - Video 680 - Video
699 consumes:
700 - application/json
701 produces:
702 - application/json
703 parameters: 681 parameters:
704 - $ref: "videos.yaml#/parameters/id" 682 - $ref: '#/components/parameters/id2'
705 responses: 683 responses:
706 '200': 684 '200':
707 description: successful operation 685 description: successful operation
708 schema: 686 content:
709 type: string 687 application/json:
710 "/videos/{id}/views": 688 schema:
689 type: string
690 '/videos/{id}/views':
711 post: 691 post:
712 summary: Add a view to the video by its id 692 summary: Add a view to the video by its id
713 tags: 693 tags:
714 - Video 694 - Video
715 consumes:
716 - application/json
717 produces:
718 - application/json
719 parameters: 695 parameters:
720 - $ref: "videos.yaml#/parameters/id" 696 - $ref: '#/components/parameters/id2'
721 responses: 697 responses:
722 '204': 698 '204':
723 $ref: "commons.yaml#/responses/emptySuccess" 699 $ref: '#/paths/~1users~1me/put/responses/204'
724 /videos/upload: 700 /videos/upload:
725 post: 701 post:
726 summary: Upload a video file with its metadata 702 summary: Upload a video file with its metadata
727 security: 703 security:
728 - OAuth2: [ ] 704 - OAuth2: []
729 tags: 705 tags:
730 - Video 706 - Video
731 consumes:
732 - multipart/form-data
733 produces:
734 - application/json
735 parameters:
736 - name: videofile
737 in: formData
738 type: file
739 required: true
740 description: 'Video file'
741 - name: channelId
742 in: formData
743 required: true
744 type: number
745 description: 'Channel id that will contain this video'
746 - $ref: "videos.yaml#/parameters/thumbnailfile"
747 - $ref: "videos.yaml#/parameters/previewfile"
748 - $ref: "videos.yaml#/parameters/category"
749 - $ref: "videos.yaml#/parameters/licence"
750 - $ref: "videos.yaml#/parameters/language"
751 - $ref: "videos.yaml#/parameters/description"
752 - $ref: "videos.yaml#/parameters/waitTranscoding"
753 - $ref: "videos.yaml#/parameters/support"
754 - $ref: "videos.yaml#/parameters/nsfw"
755 - $ref: "videos.yaml#/parameters/name"
756 - $ref: "videos.yaml#/parameters/tags"
757 - $ref: "videos.yaml#/parameters/commentsEnabled"
758 - $ref: "videos.yaml#/parameters/privacy"
759 - $ref: "videos.yaml#/parameters/scheduleUpdate"
760 responses: 707 responses:
761 '200': 708 '200':
762 description: successful operation 709 description: successful operation
763 schema: 710 content:
764 $ref: '#/definitions/VideoUploadResponse' 711 application/json:
712 schema:
713 $ref: '#/components/schemas/VideoUploadResponse'
714 requestBody:
715 content:
716 multipart/form-data:
717 schema:
718 type: object
719 properties:
720 videofile:
721 description: Video file
722 type: string
723 format: binary
724 channelId:
725 description: Channel id that will contain this video
726 type: number
727 thumbnailfile:
728 description: Video thumbnail file
729 type: string
730 previewfile:
731 description: Video preview file
732 type: string
733 category:
734 description: Video category
735 type: string
736 licence:
737 description: Video licence
738 type: string
739 language:
740 description: Video language
741 type: string
742 description:
743 description: Video description
744 type: string
745 waitTranscoding:
746 description: Whether or not we wait transcoding before publish the video
747 type: string
748 support:
749 description: Text describing how to support the video uploader
750 type: string
751 nsfw:
752 description: Whether or not this video contains sensitive content
753 type: string
754 name:
755 description: Video name
756 type: string
757 tags:
758 description: Video tags
759 type: string
760 commentsEnabled:
761 description: Enable or disable comments for this video
762 type: string
763 scheduleUpdate: *ref_0
764 required:
765 - videofile
766 - channelId
765 /videos/abuse: 767 /videos/abuse:
766 get: 768 get:
767 summary: Get list of reported video abuses 769 summary: Get list of reported video abuses
768 security: 770 security:
769 - OAuth2: [ ] 771 - OAuth2: []
770 tags: 772 tags:
771 - VideoAbuse 773 - VideoAbuse
772 consumes:
773 - application/json
774 produces:
775 - application/json
776 parameters: 774 parameters:
777 - $ref: "commons.yaml#/parameters/start" 775 - $ref: '#/components/parameters/start'
778 - $ref: "commons.yaml#/parameters/count" 776 - $ref: '#/components/parameters/count'
779 - $ref: "commons.yaml#/parameters/sort" 777 - $ref: '#/components/parameters/sort'
780 responses: 778 responses:
781 '200': 779 '200':
782 description: successful operation 780 description: successful operation
783 schema: 781 content:
784 type: array 782 application/json:
785 items: 783 schema:
786 $ref: '#/definitions/VideoAbuse' 784 type: array
787 "/videos/{id}/abuse": 785 items:
786 $ref: '#/components/schemas/VideoAbuse'
787 '/videos/{id}/abuse':
788 post: 788 post:
789 summary: Report an abuse, on a video by its id 789 summary: 'Report an abuse, on a video by its id'
790 security: 790 security:
791 - OAuth2: [ ] 791 - OAuth2: []
792 tags: 792 tags:
793 - VideoAbuse 793 - VideoAbuse
794 consumes:
795 - application/json
796 produces:
797 - application/json
798 parameters: 794 parameters:
799 - $ref: "videos.yaml#/parameters/id" 795 - $ref: '#/components/parameters/id2'
800 responses: 796 responses:
801 '204': 797 '204':
802 $ref: "commons.yaml#/responses/emptySuccess" 798 $ref: '#/paths/~1users~1me/put/responses/204'
803 "/videos/{id}/blacklist": 799 '/videos/{id}/blacklist':
804 post: 800 post:
805 summary: Put on blacklist a video by its id 801 summary: Put on blacklist a video by its id
806 security: 802 security:
807 - OAuth2: [ admin, moderator ] 803 - OAuth2:
804 - admin
805 - moderator
808 tags: 806 tags:
809 - VideoBlacklist 807 - VideoBlacklist
810 consumes:
811 - application/json
812 produces:
813 - application/json
814 parameters: 808 parameters:
815 - $ref: "videos.yaml#/parameters/id" 809 - $ref: '#/components/parameters/id2'
816 responses: 810 responses:
817 '204': 811 '204':
818 $ref: "commons.yaml#/responses/emptySuccess" 812 $ref: '#/paths/~1users~1me/put/responses/204'
819 delete: 813 delete:
820 summary: Delete an entry of the blacklist of a video by its id 814 summary: Delete an entry of the blacklist of a video by its id
821 security: 815 security:
822 - OAuth2: [ admin, moderator ] 816 - OAuth2:
817 - admin
818 - moderator
823 tags: 819 tags:
824 - VideoBlacklist 820 - VideoBlacklist
825 consumes:
826 - application/json
827 produces:
828 - application/json
829 parameters: 821 parameters:
830 - $ref: "videos.yaml#/parameters/id" 822 - $ref: '#/components/parameters/id2'
831 responses: 823 responses:
832 '204': 824 '204':
833 $ref: "commons.yaml#/responses/emptySuccess" 825 $ref: '#/paths/~1users~1me/put/responses/204'
834 /videos/blacklist: 826 /videos/blacklist:
835 get: 827 get:
836 summary: Get list of videos on blacklist 828 summary: Get list of videos on blacklist
837 security: 829 security:
838 - OAuth2: [ admin, moderator ] 830 - OAuth2:
831 - admin
832 - moderator
839 tags: 833 tags:
840 - VideoBlacklist 834 - VideoBlacklist
841 consumes:
842 - application/json
843 produces:
844 - application/json
845 parameters: 835 parameters:
846 - $ref: "commons.yaml#/parameters/start" 836 - $ref: '#/components/parameters/start'
847 - $ref: "commons.yaml#/parameters/count" 837 - $ref: '#/components/parameters/count'
848 - $ref: "commons.yaml#/parameters/sort" 838 - $ref: '#/components/parameters/sort'
849 responses: 839 responses:
850 '200': 840 '200':
851 description: successful operation 841 description: successful operation
852 schema: 842 content:
853 type: array 843 application/json:
854 items: 844 schema:
855 $ref: '#/definitions/VideoBlacklist' 845 type: array
846 items:
847 $ref: '#/components/schemas/VideoBlacklist'
856 /video-channels: 848 /video-channels:
857 get: 849 get:
858 summary: Get list of video channels 850 summary: Get list of video channels
859 tags: 851 tags:
860 - VideoChannel 852 - VideoChannel
861 consumes:
862 - application/json
863 produces:
864 - application/json
865 parameters: 853 parameters:
866 - $ref: "commons.yaml#/parameters/start" 854 - $ref: '#/components/parameters/start'
867 - $ref: "commons.yaml#/parameters/count" 855 - $ref: '#/components/parameters/count'
868 - $ref: "commons.yaml#/parameters/sort" 856 - $ref: '#/components/parameters/sort'
869 responses: 857 responses:
870 '200': 858 '200':
871 description: successful operation 859 description: successful operation
872 schema: 860 content:
873 type: array 861 application/json:
874 items: 862 schema:
875 $ref: '#/definitions/VideoChannel' 863 type: array
864 items:
865 $ref: '#/components/schemas/VideoChannel'
876 post: 866 post:
877 summary: Creates a video channel for the current user 867 summary: Creates a video channel for the current user
878 security: 868 security:
879 - OAuth2: [ ] 869 - OAuth2: []
880 tags: 870 tags:
881 - VideoChannel 871 - VideoChannel
882 consumes:
883 - application/json
884 produces:
885 - application/json
886 parameters:
887 - in: body
888 name: body
889 schema:
890 $ref: '#/definitions/VideoChannelInput'
891 responses: 872 responses:
892 '204': 873 '204':
893 $ref: "commons.yaml#/responses/emptySuccess" 874 $ref: '#/paths/~1users~1me/put/responses/204'
894 "/video-channels/{id}": 875 requestBody:
876 $ref: '#/components/requestBodies/VideoChannelInput'
877 '/video-channels/{id}':
895 get: 878 get:
896 summary: Get a video channel by its id 879 summary: Get a video channel by its id
897 tags: 880 tags:
898 - VideoChannel 881 - VideoChannel
899 consumes:
900 - application/json
901 produces:
902 - application/json
903 parameters: 882 parameters:
904 - $ref: "video-channels.yaml#/parameters/id" 883 - $ref: '#/components/parameters/id3'
905 responses: 884 responses:
906 '200': 885 '200':
907 description: successful operation 886 description: successful operation
908 schema: 887 content:
909 $ref: '#/definitions/VideoChannel' 888 application/json:
889 schema:
890 $ref: '#/components/schemas/VideoChannel'
910 put: 891 put:
911 summary: Update a video channel by its id 892 summary: Update a video channel by its id
912 security: 893 security:
913 - OAuth2: [ ] 894 - OAuth2: []
914 tags: 895 tags:
915 - VideoChannel 896 - VideoChannel
916 consumes:
917 - application/json
918 produces:
919 - application/json
920 parameters: 897 parameters:
921 - $ref: "video-channels.yaml#/parameters/id" 898 - $ref: '#/components/parameters/id3'
922 - in: body
923 name: body
924 schema:
925 $ref: '#/definitions/VideoChannelInput'
926 responses: 899 responses:
927 '204': 900 '204':
928 $ref: "commons.yaml#/responses/emptySuccess" 901 $ref: '#/paths/~1users~1me/put/responses/204'
902 requestBody:
903 $ref: '#/components/requestBodies/VideoChannelInput'
929 delete: 904 delete:
930 summary: Delete a video channel by its id 905 summary: Delete a video channel by its id
931 security: 906 security:
932 - OAuth2: [ ] 907 - OAuth2: []
933 tags: 908 tags:
934 - VideoChannel 909 - VideoChannel
935 consumes:
936 - application/json
937 produces:
938 - application/json
939 parameters: 910 parameters:
940 - $ref: "video-channels.yaml#/parameters/id" 911 - $ref: '#/components/parameters/id3'
941 responses: 912 responses:
942 '204': 913 '204':
943 $ref: "commons.yaml#/responses/emptySuccess" 914 $ref: '#/paths/~1users~1me/put/responses/204'
944 "/video-channels/{id}/videos": 915 '/video-channels/{id}/videos':
945 get: 916 get:
946 summary: Get videos of a video channel by its id 917 summary: Get videos of a video channel by its id
947 tags: 918 tags:
948 - VideoChannel 919 - VideoChannel
949 consumes:
950 - application/json
951 produces:
952 - application/json
953 parameters: 920 parameters:
954 - $ref: "video-channels.yaml#/parameters/id" 921 - $ref: '#/components/parameters/id3'
955 responses: 922 responses:
956 '200': 923 '200':
957 description: successful operation 924 description: successful operation
958 schema: 925 content:
959 $ref: '#/definitions/Video' 926 application/json:
960 /accounts/{name}/video-channels: 927 schema:
928 $ref: '#/components/schemas/Video'
929 '/accounts/{name}/video-channels':
961 get: 930 get:
962 summary: Get video channels of an account by its name 931 summary: Get video channels of an account by its name
963 tags: 932 tags:
964 - VideoChannel 933 - VideoChannel
965 consumes:
966 - application/json
967 produces:
968 - application/json
969 parameters: 934 parameters:
970 - $ref: "accounts.yaml#/parameters/name" 935 - $ref: '#/components/parameters/name'
971 responses: 936 responses:
972 '200': 937 '200':
973 description: successful operation 938 description: successful operation
974 schema: 939 content:
975 type: array 940 application/json:
976 items: 941 schema:
977 $ref: '#/definitions/VideoChannel' 942 type: array
978 "/videos/{id}/comment-threads": 943 items:
944 $ref: '#/components/schemas/VideoChannel'
945 '/videos/{id}/comment-threads':
979 get: 946 get:
980 summary: Get the comment threads of a video by its id 947 summary: Get the comment threads of a video by its id
981 tags: 948 tags:
982 - VideoComment 949 - VideoComment
983 consumes:
984 - application/json
985 produces:
986 - application/json
987 parameters: 950 parameters:
988 - $ref: "videos.yaml#/parameters/id" 951 - $ref: '#/components/parameters/id2'
989 - $ref: "commons.yaml#/parameters/start" 952 - $ref: '#/components/parameters/start'
990 - $ref: "commons.yaml#/parameters/count" 953 - $ref: '#/components/parameters/count'
991 - $ref: "commons.yaml#/parameters/sort" 954 - $ref: '#/components/parameters/sort'
992 responses: 955 responses:
993 '200': 956 '200':
994 description: successful operation 957 description: successful operation
995 schema: 958 content:
996 $ref: '#/definitions/CommentThreadResponse' 959 application/json:
960 schema:
961 $ref: '#/components/schemas/CommentThreadResponse'
997 post: 962 post:
998 summary: Creates a comment thread, on a video by its id 963 summary: 'Creates a comment thread, on a video by its id'
999 security: 964 security:
1000 - OAuth2: [ ] 965 - OAuth2: []
1001 tags: 966 tags:
1002 - VideoComment 967 - VideoComment
1003 consumes:
1004 - application/json
1005 produces:
1006 - application/json
1007 parameters: 968 parameters:
1008 - $ref: "videos.yaml#/parameters/id" 969 - $ref: '#/components/parameters/id2'
1009 responses: 970 responses:
1010 '200': 971 '200':
1011 description: successful operation 972 description: successful operation
1012 schema: 973 content:
1013 $ref: '#/definitions/CommentThreadPostResponse' 974 application/json:
1014 "/videos/{id}/comment-threads/{threadId}": 975 schema:
976 $ref: '#/components/schemas/CommentThreadPostResponse'
977 '/videos/{id}/comment-threads/{threadId}':
1015 get: 978 get:
1016 summary: Get the comment thread by its id, of a video by its id 979 summary: 'Get the comment thread by its id, of a video by its id'
1017 tags: 980 tags:
1018 - VideoComment 981 - VideoComment
1019 consumes:
1020 - application/json
1021 produces:
1022 - application/json
1023 parameters: 982 parameters:
1024 - $ref: "videos.yaml#/parameters/id" 983 - $ref: '#/components/parameters/id2'
1025 - $ref: "video-comments.yaml#/parameters/threadId" 984 - name: threadId
985 in: path
986 required: true
987 description: The thread id (root comment id)
988 schema:
989 type: number
1026 responses: 990 responses:
1027 '200': 991 '200':
1028 description: successful operation 992 description: successful operation
1029 schema: 993 content:
1030 $ref: '#/definitions/VideoCommentThreadTree' 994 application/json:
1031 "/videos/{id}/comments/{commentId}": 995 schema:
996 $ref: '#/components/schemas/VideoCommentThreadTree'
997 '/videos/{id}/comments/{commentId}':
1032 post: 998 post:
1033 summary: Creates a comment in a comment thread by its id, of a video by its id 999 summary: 'Creates a comment in a comment thread by its id, of a video by its id'
1034 security: 1000 security:
1035 - OAuth2: [ ] 1001 - OAuth2: []
1036 tags: 1002 tags:
1037 - VideoComment 1003 - VideoComment
1038 consumes:
1039 - application/json
1040 produces:
1041 - application/json
1042 parameters: 1004 parameters:
1043 - $ref: "videos.yaml#/parameters/id" 1005 - $ref: '#/components/parameters/id2'
1044 - $ref: "video-comments.yaml#/parameters/commentId" 1006 - $ref: '#/components/parameters/commentId'
1045 responses: 1007 responses:
1046 '200': 1008 '200':
1047 description: successful operation 1009 description: successful operation
1048 schema: 1010 content:
1049 $ref: '#/definitions/CommentThreadPostResponse' 1011 application/json:
1012 schema:
1013 $ref: '#/components/schemas/CommentThreadPostResponse'
1050 delete: 1014 delete:
1051 summary: Delete a comment in a comment therad by its id, of a video by its id 1015 summary: 'Delete a comment in a comment therad by its id, of a video by its id'
1052 security: 1016 security:
1053 - OAuth2: [ ] 1017 - OAuth2: []
1054 tags: 1018 tags:
1055 - VideoComment 1019 - VideoComment
1056 consumes:
1057 - application/json
1058 produces:
1059 - application/json
1060 parameters: 1020 parameters:
1061 - $ref: "videos.yaml#/parameters/id" 1021 - $ref: '#/components/parameters/id2'
1062 - $ref: "video-comments.yaml#/parameters/commentId" 1022 - $ref: '#/components/parameters/commentId'
1063 responses: 1023 responses:
1064 '204': 1024 '204':
1065 $ref: "commons.yaml#/responses/emptySuccess" 1025 $ref: '#/paths/~1users~1me/put/responses/204'
1066 "/videos/{id}/rate": 1026 '/videos/{id}/rate':
1067 put: 1027 put:
1068 summary: Vote for a video by its id 1028 summary: Vote for a video by its id
1069 security: 1029 security:
1070 - OAuth2: [ ] 1030 - OAuth2: []
1071 tags: 1031 tags:
1072 - VideoRate 1032 - VideoRate
1073 consumes:
1074 - application/json
1075 produces:
1076 - application/json
1077 parameters: 1033 parameters:
1078 - $ref: "videos.yaml#/parameters/id" 1034 - $ref: '#/components/parameters/id2'
1079 responses: 1035 responses:
1080 '204': 1036 '204':
1081 $ref: "commons.yaml#/responses/emptySuccess" 1037 $ref: '#/paths/~1users~1me/put/responses/204'
1082 /search/videos: 1038 /search/videos:
1083 get: 1039 get:
1084 tags: 1040 tags:
1085 - Search 1041 - Search
1086 summary: Get the videos corresponding to a given query 1042 summary: Get the videos corresponding to a given query
1087 consumes:
1088 - application/json
1089 produces:
1090 - application/json
1091 parameters: 1043 parameters:
1092 - $ref: "commons.yaml#/parameters/start" 1044 - $ref: '#/components/parameters/start'
1093 - $ref: "commons.yaml#/parameters/count" 1045 - $ref: '#/components/parameters/count'
1094 - $ref: "commons.yaml#/parameters/sort" 1046 - $ref: '#/components/parameters/sort'
1095 - name: search 1047 - name: search
1096 in: query 1048 in: query
1097 required: true 1049 required: true
1098 type: string 1050 description: String to search
1099 description: 'String to search' 1051 schema:
1052 type: string
1100 responses: 1053 responses:
1101 '200': 1054 '200':
1102 description: successful operation 1055 description: successful operation
1103 schema: 1056 content:
1104 type: array 1057 application/json:
1105 items: 1058 schema:
1106 $ref: '#/definitions/Video'
1107definitions:
1108 VideoConstantNumber:
1109 properties:
1110 id:
1111 type: number
1112 label:
1113 type: string
1114 VideoConstantString:
1115 properties:
1116 id:
1117 type: string
1118 label:
1119 type: string
1120 VideoPrivacy:
1121 type: string
1122 enum: [Public, Unlisted, Private]
1123 Video:
1124 properties:
1125 id:
1126 type: number
1127 uuid:
1128 type: string
1129 createdAt:
1130 type: string
1131 publishedAt:
1132 type: string
1133 updatedAt:
1134 type: string
1135 category:
1136 $ref: "#/definitions/VideoConstantNumber"
1137 licence:
1138 $ref: "#/definitions/VideoConstantNumber"
1139 language:
1140 $ref: "#/definitions/VideoConstantString"
1141 privacy:
1142 $ref: "#/definitions/VideoPrivacy"
1143 description:
1144 type: string
1145 duration:
1146 type: number
1147 isLocal:
1148 type: boolean
1149 name:
1150 type: string
1151 thumbnailPath:
1152 type: string
1153 previewPath:
1154 type: string
1155 embedPath:
1156 type: string
1157 views:
1158 type: number
1159 likes:
1160 type: number
1161 dislikes:
1162 type: number
1163 nsfw:
1164 type: boolean
1165 account:
1166 type: object
1167 properties:
1168 name:
1169 type: string
1170 displayName:
1171 type: string
1172 url:
1173 type: string
1174 host:
1175 type: string
1176 avatar:
1177 $ref: "#/definitions/Avatar"
1178 VideoAbuse:
1179 properties:
1180 id:
1181 type: number
1182 reason:
1183 type: string
1184 reporterAccount:
1185 $ref: "#/definitions/Account"
1186 video:
1187 type: object
1188 properties:
1189 id:
1190 type: number
1191 name:
1192 type: string
1193 uuid:
1194 type: string
1195 url:
1196 type: string
1197 createdAt:
1198 type: string
1199 VideoBlacklist:
1200 properties:
1201 id:
1202 type: number
1203 videoId:
1204 type: number
1205 createdAt:
1206 type: string
1207 updatedAt:
1208 type: string
1209 name:
1210 type: string
1211 uuid:
1212 type: string
1213 description:
1214 type: string
1215 duration:
1216 type: number
1217 views:
1218 type: number
1219 likes:
1220 type: number
1221 dislikes:
1222 type: number
1223 nsfw:
1224 type: boolean
1225 VideoChannel:
1226 properties:
1227 displayName:
1228 type: string
1229 description:
1230 type: string
1231 isLocal:
1232 type: boolean
1233 ownerAccount:
1234 type: object
1235 properties:
1236 id:
1237 type: number
1238 uuid:
1239 type: string
1240 VideoComment:
1241 properties:
1242 id:
1243 type: number
1244 url:
1245 type: string
1246 text:
1247 type: string
1248 threadId:
1249 type: number
1250 inReplyToCommentId:
1251 type: number
1252 videoId:
1253 type: number
1254 createdAt:
1255 type: string
1256 updatedAt:
1257 type: string
1258 totalReplies:
1259 type: number
1260 account:
1261 $ref: "#/definitions/Account"
1262 VideoCommentThreadTree:
1263 properties:
1264 comment:
1265 $ref: "#/definitions/VideoComment"
1266 children:
1267 type: array
1268 items:
1269 $ref: "#/definitions/VideoCommentThreadTree"
1270 Avatar:
1271 properties:
1272 path:
1273 type: string
1274 createdAt:
1275 type: string
1276 updatedAt:
1277 type: string
1278 Actor:
1279 properties:
1280 id:
1281 type: number
1282 uuid:
1283 type: string
1284 url:
1285 type: string
1286 name:
1287 type: string
1288 host:
1289 type: string
1290 followingCount:
1291 type: number
1292 followersCount:
1293 type: number
1294 createdAt:
1295 type: string
1296 updatedAt:
1297 type: string
1298 avatar:
1299 $ref: "#/definitions/Avatar"
1300 Account:
1301 allOf:
1302 - $ref: "#/definitions/Actor"
1303 - properties:
1304 displayName:
1305 type: string
1306 User:
1307 properties:
1308 id:
1309 type: number
1310 username:
1311 type: string
1312 email:
1313 type: string
1314 displayNSFW:
1315 type: boolean
1316 autoPlayVideo:
1317 type: boolean
1318 role:
1319 type: string
1320 enum: [User, Moderator, Administrator]
1321 videoQuota:
1322 type: number
1323 createdAt:
1324 type: string
1325 account:
1326 $ref: "#/definitions/Account"
1327 videoChannels:
1328 type: array
1329 items:
1330 $ref: "#/definitions/VideoChannel"
1331 ServerConfig:
1332 properties:
1333 signup:
1334 type: object
1335 properties:
1336 allowed:
1337 type: boolean
1338 transcoding:
1339 type: object
1340 properties:
1341 enabledResolutions:
1342 type: array
1343 items:
1344 type: number
1345 avatar:
1346 type: object
1347 properties:
1348 file:
1349 type: object
1350 properties:
1351 size:
1352 type: object
1353 properties:
1354 max:
1355 type: number
1356 extensions:
1357 type: array
1358 items:
1359 type: string
1360 video:
1361 type: object
1362 properties:
1363 file:
1364 type: object
1365 properties:
1366 extensions:
1367 type: array 1059 type: array
1368 items: 1060 items:
1369 type: string 1061 $ref: '#/components/schemas/Video'
1370 Follow: 1062servers:
1371 properties: 1063 - url: 'https://peertube.cpy.re/api/v1'
1372 id: 1064 description: Live Server
1373 type: number 1065components:
1374 follower: 1066 parameters:
1375 $ref: "#/definitions/Actor" 1067 start:
1376 following: 1068 name: start
1377 $ref: "#/definitions/Actor" 1069 in: query
1378 score: 1070 required: false
1071 description: Offset
1072 schema:
1379 type: number 1073 type: number
1380 state: 1074 count:
1381 type: string 1075 name: count
1382 enum: [pending, accepted] 1076 in: query
1383 createdAt: 1077 required: false
1384 type: string 1078 description: Number of items
1385 updatedAt: 1079 schema:
1386 type: string
1387 Job:
1388 properties:
1389 id:
1390 type: number 1080 type: number
1391 state: 1081 sort:
1392 type: string 1082 name: sort
1393 enum: [pending, processing, error, success] 1083 in: query
1394 category: 1084 required: false
1395 type: string 1085 description: Sort column (-createdAt for example)
1396 enum: [transcoding, activitypub-http] 1086 schema:
1397 handlerName: 1087 type: string
1398 type: string 1088 name:
1399 handlerInputData: 1089 name: name
1400 type: string 1090 in: path
1401 createdAt: 1091 required: true
1402 type: string 1092 description: >-
1403 updatedAt: 1093 The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
1404 type: string 1094 example)
1405 1095 schema:
1406# Api responses 1096 type: string
1407 AddUserResponse: 1097 id:
1408 properties: 1098 name: id
1409 id: 1099 in: path
1100 required: true
1101 description: The user id
1102 schema:
1410 type: number 1103 type: number
1411 uuid: 1104 id2:
1412 type: string 1105 name: id
1413 VideoUploadResponse: 1106 in: path
1414 properties: 1107 required: true
1415 video: 1108 description: The video id or uuid
1416 type: object 1109 schema:
1417 properties: 1110 type: string
1418 id: 1111 id3:
1419 type: number 1112 name: id
1420 uuid: 1113 in: path
1421 type: string 1114 required: true
1422 CommentThreadResponse: 1115 description: The video channel id or uuid
1423 properties: 1116 schema:
1424 total: 1117 type: string
1118 commentId:
1119 name: threadId
1120 in: path
1121 required: true
1122 description: The comment id
1123 schema:
1425 type: number 1124 type: number
1426 data: 1125 requestBodies:
1427 type: array 1126 VideoChannelInput:
1428 items: 1127 content:
1429 $ref: "#/definitions/VideoComment" 1128 application/json:
1430 CommentThreadPostResponse: 1129 schema:
1431 properties: 1130 $ref: '#/components/schemas/VideoChannelInput'
1432 comment: 1131 securitySchemes:
1433 $ref: "#/definitions/VideoComment" 1132 OAuth2:
1133 description: >
1134 In the header: *Authorization: Bearer <token\>*
1135
1136
1137 Authenticating via OAuth requires the following steps:
1138
1139
1140 - Have an account with sufficient authorization levels
1141
1142 - [Generate](https://docs.joinpeertube.org/lang/en/devdocs/rest.html) a
1143 Bearer Token
1144
1145 - Make Authenticated Requests
1146 type: oauth2
1147 flows:
1148 password:
1149 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
1150 scopes:
1151 admin: Admin scope
1152 moderator: Moderator scope
1153 user: User scope
1154 schemas:
1155 VideoConstantNumber:
1156 properties:
1157 id:
1158 type: number
1159 label:
1160 type: string
1161 VideoConstantString:
1162 properties:
1163 id:
1164 type: string
1165 label:
1166 type: string
1167 VideoPrivacy:
1168 type: string
1169 enum:
1170 - Public
1171 - Unlisted
1172 - Private
1173 Video:
1174 properties:
1175 id:
1176 type: number
1177 uuid:
1178 type: string
1179 createdAt:
1180 type: string
1181 publishedAt:
1182 type: string
1183 updatedAt:
1184 type: string
1185 category:
1186 $ref: '#/components/schemas/VideoConstantNumber'
1187 licence:
1188 $ref: '#/components/schemas/VideoConstantNumber'
1189 language:
1190 $ref: '#/components/schemas/VideoConstantString'
1191 privacy:
1192 $ref: '#/components/schemas/VideoPrivacy'
1193 description:
1194 type: string
1195 duration:
1196 type: number
1197 isLocal:
1198 type: boolean
1199 name:
1200 type: string
1201 thumbnailPath:
1202 type: string
1203 previewPath:
1204 type: string
1205 embedPath:
1206 type: string
1207 views:
1208 type: number
1209 likes:
1210 type: number
1211 dislikes:
1212 type: number
1213 nsfw:
1214 type: boolean
1215 account:
1216 type: object
1217 properties:
1218 name:
1219 type: string
1220 displayName:
1221 type: string
1222 url:
1223 type: string
1224 host:
1225 type: string
1226 avatar:
1227 $ref: '#/components/schemas/Avatar'
1228 VideoAbuse:
1229 properties:
1230 id:
1231 type: number
1232 reason:
1233 type: string
1234 reporterAccount:
1235 $ref: '#/components/schemas/Account'
1236 video:
1237 type: object
1238 properties:
1239 id:
1240 type: number
1241 name:
1242 type: string
1243 uuid:
1244 type: string
1245 url:
1246 type: string
1247 createdAt:
1248 type: string
1249 VideoBlacklist:
1250 properties:
1251 id:
1252 type: number
1253 videoId:
1254 type: number
1255 createdAt:
1256 type: string
1257 updatedAt:
1258 type: string
1259 name:
1260 type: string
1261 uuid:
1262 type: string
1263 description:
1264 type: string
1265 duration:
1266 type: number
1267 views:
1268 type: number
1269 likes:
1270 type: number
1271 dislikes:
1272 type: number
1273 nsfw:
1274 type: boolean
1275 VideoChannel:
1276 properties:
1277 displayName:
1278 type: string
1279 description:
1280 type: string
1281 isLocal:
1282 type: boolean
1283 ownerAccount:
1284 type: object
1285 properties:
1286 id:
1287 type: number
1288 uuid:
1289 type: string
1290 VideoComment:
1291 properties:
1292 id:
1293 type: number
1294 url:
1295 type: string
1296 text:
1297 type: string
1298 threadId:
1299 type: number
1300 inReplyToCommentId:
1301 type: number
1302 videoId:
1303 type: number
1304 createdAt:
1305 type: string
1306 updatedAt:
1307 type: string
1308 totalReplies:
1309 type: number
1310 account:
1311 $ref: '#/components/schemas/Account'
1312 VideoCommentThreadTree:
1313 properties:
1314 comment:
1315 $ref: '#/components/schemas/VideoComment'
1316 children:
1317 type: array
1318 items:
1319 $ref: '#/components/schemas/VideoCommentThreadTree'
1320 Avatar:
1321 properties:
1322 path:
1323 type: string
1324 createdAt:
1325 type: string
1326 updatedAt:
1327 type: string
1328 Actor:
1329 properties:
1330 id:
1331 type: number
1332 uuid:
1333 type: string
1334 url:
1335 type: string
1336 name:
1337 type: string
1338 host:
1339 type: string
1340 followingCount:
1341 type: number
1342 followersCount:
1343 type: number
1344 createdAt:
1345 type: string
1346 updatedAt:
1347 type: string
1348 avatar:
1349 $ref: '#/components/schemas/Avatar'
1350 Account:
1351 allOf:
1352 - $ref: '#/components/schemas/Actor'
1353 - properties:
1354 displayName:
1355 type: string
1356 User:
1357 properties:
1358 id:
1359 type: number
1360 username:
1361 type: string
1362 email:
1363 type: string
1364 displayNSFW:
1365 type: boolean
1366 autoPlayVideo:
1367 type: boolean
1368 role:
1369 type: string
1370 enum:
1371 - User
1372 - Moderator
1373 - Administrator
1374 videoQuota:
1375 type: number
1376 createdAt:
1377 type: string
1378 account:
1379 $ref: '#/components/schemas/Account'
1380 videoChannels:
1381 type: array
1382 items:
1383 $ref: '#/components/schemas/VideoChannel'
1384 ServerConfig:
1385 properties:
1386 signup:
1387 type: object
1388 properties:
1389 allowed:
1390 type: boolean
1391 transcoding:
1392 type: object
1393 properties:
1394 enabledResolutions:
1395 type: array
1396 items:
1397 type: number
1398 avatar:
1399 type: object
1400 properties:
1401 file:
1402 type: object
1403 properties:
1404 size:
1405 type: object
1406 properties:
1407 max:
1408 type: number
1409 extensions:
1410 type: array
1411 items:
1412 type: string
1413 video:
1414 type: object
1415 properties:
1416 file:
1417 type: object
1418 properties:
1419 extensions:
1420 type: array
1421 items:
1422 type: string
1423 Follow:
1424 properties:
1425 id:
1426 type: number
1427 follower:
1428 $ref: '#/components/schemas/Actor'
1429 following:
1430 $ref: '#/components/schemas/Actor'
1431 score:
1432 type: number
1433 state:
1434 type: string
1435 enum:
1436 - pending
1437 - accepted
1438 createdAt:
1439 type: string
1440 updatedAt:
1441 type: string
1442 Job:
1443 properties:
1444 id:
1445 type: number
1446 state:
1447 type: string
1448 enum:
1449 - pending
1450 - processing
1451 - error
1452 - success
1453 category:
1454 type: string
1455 enum:
1456 - transcoding
1457 - activitypub-http
1458 handlerName:
1459 type: string
1460 handlerInputData:
1461 type: string
1462 createdAt:
1463 type: string
1464 updatedAt:
1465 type: string
1466 AddUserResponse:
1467 properties:
1468 id:
1469 type: number
1470 uuid:
1471 type: string
1472 VideoUploadResponse:
1473 properties:
1474 video:
1475 type: object
1476 properties:
1477 id:
1478 type: number
1479 uuid:
1480 type: string
1481 CommentThreadResponse:
1482 properties:
1483 total:
1484 type: number
1485 data:
1486 type: array
1487 items:
1488 $ref: '#/components/schemas/VideoComment'
1489 CommentThreadPostResponse:
1490 properties:
1491 comment:
1492 $ref: '#/components/schemas/VideoComment'
1493 AddUser:
1494 properties:
1495 username:
1496 type: string
1497 description: 'The user username '
1498 password:
1499 type: string
1500 description: 'The user password '
1501 email:
1502 type: string
1503 description: 'The user email '
1504 videoQuota:
1505 type: string
1506 description: 'The user videoQuota '
1507 role:
1508 type: string
1509 description: 'The user role '
1510 required:
1511 - username
1512 - password
1513 - email
1514 - videoQuota
1515 - role
1516 UpdateUser:
1517 properties:
1518 id:
1519 type: string
1520 description: 'The user id '
1521 email:
1522 type: string
1523 description: 'The updated email of the user '
1524 videoQuota:
1525 type: string
1526 description: 'The updated videoQuota of the user '
1527 role:
1528 type: string
1529 description: 'The updated role of the user '
1530 required:
1531 - id
1532 - email
1533 - videoQuota
1534 - role
1535 UpdateMe:
1536 properties:
1537 password:
1538 type: string
1539 description: 'Your new password '
1540 email:
1541 type: string
1542 description: 'Your new email '
1543 displayNSFW:
1544 type: string
1545 description: 'Your new displayNSFW '
1546 autoPlayVideo:
1547 type: string
1548 description: 'Your new autoPlayVideo '
1549 required:
1550 - password
1551 - email
1552 - displayNSFW
1553 - autoPlayVideo
1554 GetMeVideoRating:
1555 properties:
1556 id:
1557 type: string
1558 description: 'Id of the video '
1559 rating:
1560 type: number
1561 description: 'Rating of the video '
1562 required:
1563 - id
1564 - rating
1565 RegisterUser:
1566 properties:
1567 username:
1568 type: string
1569 description: 'The username of the user '
1570 password:
1571 type: string
1572 description: 'The password of the user '
1573 email:
1574 type: string
1575 description: 'The email of the user '
1576 required:
1577 - username
1578 - password
1579 - email
1580 VideoChannelInput:
1581 properties:
1582 name:
1583 type: string
1584 description:
1585 type: string
1434 1586
1435# Request bodies
1436 AddUser:
1437 properties:
1438 username:
1439 type: string
1440 description: 'The user username '
1441 password:
1442 type: string
1443 description: 'The user password '
1444 email:
1445 type: string
1446 description: 'The user email '
1447 videoQuota:
1448 type: string
1449 description: 'The user videoQuota '
1450 role:
1451 type: string
1452 description: 'The user role '
1453 required:
1454 - username
1455 - password
1456 - email
1457 - videoQuota
1458 - role
1459 UpdateUser:
1460 properties:
1461 id:
1462 type: string
1463 description: 'The user id '
1464 email:
1465 type: string
1466 description: 'The updated email of the user '
1467 videoQuota:
1468 type: string
1469 description: 'The updated videoQuota of the user '
1470 role:
1471 type: string
1472 description: 'The updated role of the user '
1473 required:
1474 - id
1475 - email
1476 - videoQuota
1477 - role
1478 UpdateMe:
1479 properties:
1480 password:
1481 type: string
1482 description: 'Your new password '
1483 email:
1484 type: string
1485 description: 'Your new email '
1486 displayNSFW:
1487 type: string
1488 description: 'Your new displayNSFW '
1489 autoPlayVideo:
1490 type: string
1491 description: 'Your new autoPlayVideo '
1492 required:
1493 - password
1494 - email
1495 - displayNSFW
1496 - autoPlayVideo
1497 GetMeVideoRating:
1498 properties:
1499 id:
1500 type: string
1501 description: 'Id of the video '
1502 rating:
1503 type: number
1504 description: 'Rating of the video '
1505 required:
1506 - id
1507 - rating
1508 RegisterUser:
1509 properties:
1510 username:
1511 type: string
1512 description: 'The username of the user '
1513 password:
1514 type: string
1515 description: 'The password of the user '
1516 email:
1517 type: string
1518 description: 'The email of the user '
1519 required:
1520 - username
1521 - password
1522 - email
1523 VideoChannelInput:
1524 properties:
1525 name:
1526 type: string
1527 description:
1528 type: string