]>
Commit | Line | Data |
---|---|---|
1569a818 DG |
1 | swagger: '2.0' |
2 | info: | |
5e1c08eb | 3 | title: PeerTube |
164e6c87 | 4 | version: 1.0.0-beta |
1569a818 | 5 | description: Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular. |
ea65a476 | 6 | host: peertube.example.com |
94ff4c23 C |
7 | securityDefinitions: |
8 | OAuth2: | |
9 | description: 'In the header: *Authorization: Bearer mytoken*' | |
10 | type: oauth2 | |
11 | flow: password | |
12 | # Not implemented yet | |
13 | # authorizationUrl: https://example.com/oauth/authorize | |
14 | tokenUrl: https://peertube.example.com/api/v1/users/token | |
ea65a476 C |
15 | basePath: '/api/v1' |
16 | schemes: | |
17 | - https | |
1569a818 | 18 | paths: |
ad9e39fb | 19 | '/accounts/{name}': |
1569a818 DG |
20 | get: |
21 | tags: | |
22 | - Accounts | |
23 | consumes: | |
24 | - application/json | |
25 | produces: | |
26 | - application/json | |
27 | parameters: | |
330eaf12 C |
28 | - $ref: "accounts.yaml#/parameters/name" |
29 | - $ref: "commons.yaml#/parameters/start" | |
30 | - $ref: "commons.yaml#/parameters/count" | |
31 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
32 | responses: |
33 | '200': | |
34 | description: successful operation | |
35 | schema: | |
36 | $ref: '#/definitions/Account' | |
ad9e39fb | 37 | '/accounts/{name}/videos': |
6b738c7a C |
38 | get: |
39 | tags: | |
40 | - Accounts | |
41 | consumes: | |
42 | - application/json | |
43 | produces: | |
44 | - application/json | |
45 | parameters: | |
330eaf12 | 46 | - $ref: "accounts.yaml#/parameters/name" |
6b738c7a C |
47 | responses: |
48 | '200': | |
49 | description: successful operation | |
50 | schema: | |
51 | $ref: '#/definitions/Video' | |
1569a818 DG |
52 | /accounts: |
53 | get: | |
54 | tags: | |
55 | - Accounts | |
56 | consumes: | |
57 | - application/json | |
58 | produces: | |
59 | - application/json | |
60 | responses: | |
61 | '200': | |
62 | description: successful operation | |
63 | schema: | |
64 | type: array | |
65 | items: | |
66 | $ref: '#/definitions/Account' | |
67 | /config: | |
68 | get: | |
69 | tags: | |
70 | - Config | |
71 | consumes: | |
72 | - application/json | |
73 | produces: | |
74 | - application/json | |
75 | responses: | |
76 | '200': | |
77 | description: successful operation | |
78 | schema: | |
5d00a3d7 | 79 | $ref: '#/definitions/ServerConfig' |
244e76a5 RK |
80 | /feeds/videos.{format}: |
81 | get: | |
82 | tags: | |
83 | - Feeds | |
244e76a5 | 84 | produces: |
9d3ef9fe C |
85 | - application/atom+xml |
86 | - application/rss+xml | |
244e76a5 RK |
87 | - application/json |
88 | parameters: | |
89 | - name: format | |
90 | in: path | |
91 | required: true | |
92 | type: string | |
48dce1c9 | 93 | enum: [ 'xml', 'atom', 'json'] |
244e76a5 RK |
94 | default: 'xml' |
95 | description: 'The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and json to JSON FEED 1.0' | |
96 | - name: accountId | |
97 | in: query | |
98 | required: false | |
99 | type: number | |
100 | description: 'The id of the local account to filter to (beware, users IDs and not actors IDs which will return empty feeds' | |
101 | - name: accountName | |
102 | in: query | |
103 | required: false | |
104 | type: string | |
105 | description: 'The name of the local account to filter to' | |
106 | responses: | |
107 | '200': | |
108 | description: successful operation | |
1569a818 DG |
109 | /jobs: |
110 | get: | |
94ff4c23 C |
111 | security: |
112 | - OAuth2: [ ] | |
1569a818 DG |
113 | tags: |
114 | - Job | |
115 | consumes: | |
116 | - application/json | |
117 | produces: | |
118 | - application/json | |
44cb3b85 DG |
119 | parameters: |
120 | - name: state | |
121 | in: path | |
122 | required: true | |
123 | type: string | |
330eaf12 C |
124 | description: 'The state of the job' |
125 | - $ref: "commons.yaml#/parameters/start" | |
126 | - $ref: "commons.yaml#/parameters/count" | |
127 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
128 | responses: |
129 | '200': | |
130 | description: successful operation | |
131 | schema: | |
132 | type: array | |
133 | items: | |
5d00a3d7 | 134 | $ref: '#/definitions/Job' |
1569a818 DG |
135 | '/server/following/{host}': |
136 | delete: | |
94ff4c23 C |
137 | security: |
138 | - OAuth2: [ ] | |
1569a818 DG |
139 | tags: |
140 | - ServerFollowing | |
141 | consumes: | |
142 | - application/json | |
143 | produces: | |
144 | - application/json | |
145 | parameters: | |
146 | - name: host | |
147 | in: path | |
148 | required: true | |
149 | type: string | |
150 | description: 'The host to unfollow ' | |
151 | responses: | |
152 | '201': | |
153 | description: successful operation | |
154 | /server/followers: | |
155 | get: | |
156 | tags: | |
157 | - ServerFollowing | |
158 | consumes: | |
159 | - application/json | |
160 | produces: | |
161 | - application/json | |
44cb3b85 | 162 | parameters: |
330eaf12 C |
163 | - $ref: "commons.yaml#/parameters/start" |
164 | - $ref: "commons.yaml#/parameters/count" | |
165 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
166 | responses: |
167 | '200': | |
168 | description: successful operation | |
169 | schema: | |
170 | type: array | |
171 | items: | |
172 | $ref: '#/definitions/Follow' | |
173 | /server/following: | |
174 | get: | |
175 | tags: | |
176 | - ServerFollowing | |
177 | consumes: | |
178 | - application/json | |
179 | produces: | |
180 | - application/json | |
44cb3b85 | 181 | parameters: |
330eaf12 C |
182 | - $ref: "commons.yaml#/parameters/start" |
183 | - $ref: "commons.yaml#/parameters/count" | |
184 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
185 | responses: |
186 | '200': | |
187 | description: successful operation | |
188 | schema: | |
189 | type: array | |
190 | items: | |
191 | $ref: '#/definitions/Follow' | |
192 | post: | |
94ff4c23 C |
193 | security: |
194 | - OAuth2: [ ] | |
1569a818 DG |
195 | tags: |
196 | - ServerFollowing | |
197 | consumes: | |
198 | - application/json | |
199 | produces: | |
200 | - application/json | |
201 | parameters: | |
202 | - in: body | |
203 | name: body | |
204 | schema: | |
205 | $ref: '#/definitions/Follow' | |
206 | responses: | |
207 | '204': | |
330eaf12 | 208 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 DG |
209 | /users: |
210 | post: | |
94ff4c23 C |
211 | security: |
212 | - OAuth2: [ ] | |
1569a818 DG |
213 | tags: |
214 | - User | |
215 | consumes: | |
216 | - application/json | |
217 | produces: | |
218 | - application/json | |
219 | parameters: | |
220 | - in: body | |
221 | name: body | |
222 | required: true | |
61b66b36 | 223 | description: 'User to create' |
1569a818 DG |
224 | schema: |
225 | $ref: '#/definitions/AddUser' | |
226 | responses: | |
227 | '200': | |
228 | description: successful operation | |
229 | schema: | |
230 | $ref: '#/definitions/AddUserResponse' | |
231 | get: | |
94ff4c23 C |
232 | security: |
233 | - OAuth2: [ ] | |
1569a818 DG |
234 | tags: |
235 | - User | |
236 | consumes: | |
237 | - application/json | |
238 | produces: | |
239 | - application/json | |
44cb3b85 | 240 | parameters: |
330eaf12 C |
241 | - $ref: "commons.yaml#/parameters/start" |
242 | - $ref: "commons.yaml#/parameters/count" | |
243 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
244 | responses: |
245 | '200': | |
246 | description: successful operation | |
247 | schema: | |
248 | type: array | |
249 | items: | |
250 | $ref: '#/definitions/User' | |
251 | '/users/{id}': | |
252 | delete: | |
94ff4c23 C |
253 | security: |
254 | - OAuth2: [ ] | |
1569a818 DG |
255 | tags: |
256 | - User | |
257 | consumes: | |
258 | - application/json | |
259 | produces: | |
260 | - application/json | |
261 | parameters: | |
330eaf12 | 262 | - $ref: "users.yaml#/parameters/id" |
1569a818 DG |
263 | responses: |
264 | '204': | |
330eaf12 | 265 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 | 266 | get: |
94ff4c23 C |
267 | security: |
268 | - OAuth2: [ ] | |
1569a818 DG |
269 | tags: |
270 | - User | |
271 | consumes: | |
272 | - application/json | |
273 | produces: | |
274 | - application/json | |
275 | parameters: | |
330eaf12 | 276 | - $ref: "users.yaml#/parameters/id" |
1569a818 DG |
277 | responses: |
278 | '200': | |
279 | description: successful operation | |
280 | schema: | |
281 | $ref: '#/definitions/User' | |
282 | put: | |
94ff4c23 C |
283 | security: |
284 | - OAuth2: [ ] | |
1569a818 DG |
285 | tags: |
286 | - User | |
287 | consumes: | |
288 | - application/json | |
289 | produces: | |
290 | - application/json | |
291 | parameters: | |
330eaf12 | 292 | - $ref: "users.yaml#/parameters/id" |
1569a818 DG |
293 | - in: body |
294 | name: body | |
295 | required: true | |
296 | schema: | |
297 | $ref: '#/definitions/UpdateUser' | |
298 | responses: | |
299 | '204': | |
330eaf12 | 300 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 DG |
301 | /users/me: |
302 | get: | |
94ff4c23 C |
303 | security: |
304 | - OAuth2: [ ] | |
1569a818 DG |
305 | tags: |
306 | - User | |
307 | consumes: | |
308 | - application/json | |
309 | produces: | |
310 | - application/json | |
311 | responses: | |
312 | '200': | |
313 | description: successful operation | |
314 | schema: | |
315 | type: array | |
316 | items: | |
317 | $ref: '#/definitions/User' | |
318 | put: | |
94ff4c23 C |
319 | security: |
320 | - OAuth2: [ ] | |
1569a818 DG |
321 | tags: |
322 | - User | |
323 | consumes: | |
324 | - application/json | |
325 | produces: | |
326 | - application/json | |
327 | parameters: | |
328 | - in: body | |
329 | name: body | |
330 | required: true | |
331 | schema: | |
332 | $ref: '#/definitions/UpdateMe' | |
333 | responses: | |
334 | '204': | |
330eaf12 | 335 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 DG |
336 | /users/me/video-quota-used: |
337 | get: | |
94ff4c23 C |
338 | security: |
339 | - OAuth2: [ ] | |
1569a818 DG |
340 | tags: |
341 | - User | |
342 | consumes: | |
343 | - application/json | |
344 | produces: | |
345 | - application/json | |
346 | parameters: [] | |
347 | responses: | |
348 | '200': | |
349 | description: successful operation | |
350 | schema: | |
351 | type: number | |
352 | '/users/me/videos/{videoId}/rating': | |
353 | get: | |
94ff4c23 C |
354 | security: |
355 | - OAuth2: [ ] | |
1569a818 DG |
356 | tags: |
357 | - User | |
358 | consumes: | |
359 | - application/json | |
360 | produces: | |
361 | - application/json | |
362 | parameters: | |
363 | - name: videoId | |
364 | in: path | |
365 | required: true | |
366 | type: string | |
367 | description: 'The video id ' | |
368 | responses: | |
369 | '200': | |
370 | description: successful operation | |
371 | schema: | |
372 | $ref: '#/definitions/GetMeVideoRating' | |
373 | /users/me/videos: | |
374 | get: | |
94ff4c23 C |
375 | security: |
376 | - OAuth2: [ ] | |
1569a818 DG |
377 | tags: |
378 | - User | |
379 | consumes: | |
380 | - application/json | |
381 | produces: | |
382 | - application/json | |
44cb3b85 | 383 | parameters: |
330eaf12 C |
384 | - $ref: "commons.yaml#/parameters/start" |
385 | - $ref: "commons.yaml#/parameters/count" | |
386 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
387 | responses: |
388 | '200': | |
389 | description: successful operation | |
390 | schema: | |
391 | type: array | |
392 | items: | |
393 | $ref: '#/definitions/Video' | |
394 | /users/register: | |
395 | post: | |
396 | tags: | |
397 | - User | |
398 | consumes: | |
399 | - application/json | |
400 | produces: | |
401 | - application/json | |
402 | parameters: | |
403 | - in: body | |
404 | name: body | |
405 | required: true | |
406 | schema: | |
407 | $ref: '#/definitions/RegisterUser' | |
408 | responses: | |
409 | '204': | |
330eaf12 | 410 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 DG |
411 | /users/me/avatar/pick: |
412 | post: | |
94ff4c23 C |
413 | security: |
414 | - OAuth2: [ ] | |
1569a818 DG |
415 | tags: |
416 | - User | |
417 | consumes: | |
418 | - multipart/form-data | |
419 | produces: | |
420 | - application/json | |
421 | parameters: | |
422 | - in: formData | |
423 | name: avatarfile | |
424 | type: file | |
425 | description: The file to upload. | |
426 | responses: | |
427 | '200': | |
428 | description: successful operation | |
429 | schema: | |
430 | $ref: '#/definitions/Avatar' | |
c360c494 | 431 | /videos: |
1569a818 DG |
432 | get: |
433 | tags: | |
434 | - Video | |
435 | consumes: | |
436 | - application/json | |
437 | produces: | |
438 | - application/json | |
44cb3b85 | 439 | parameters: |
61b909b9 P |
440 | - name: category |
441 | in: query | |
442 | required: false | |
443 | type: number | |
444 | description: category id of the video | |
330eaf12 C |
445 | - $ref: "commons.yaml#/parameters/start" |
446 | - $ref: "commons.yaml#/parameters/count" | |
447 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
448 | responses: |
449 | '200': | |
450 | description: successful operation | |
451 | schema: | |
452 | type: array | |
453 | items: | |
454 | $ref: '#/definitions/Video' | |
c360c494 | 455 | /videos/categories: |
1569a818 DG |
456 | get: |
457 | tags: | |
458 | - Video | |
459 | consumes: | |
460 | - application/json | |
461 | produces: | |
462 | - application/json | |
463 | responses: | |
464 | '200': | |
465 | description: successful operation | |
466 | schema: | |
467 | type: array | |
468 | items: | |
469 | type: string | |
c360c494 | 470 | /videos/licences: |
1569a818 DG |
471 | get: |
472 | tags: | |
473 | - Video | |
474 | consumes: | |
475 | - application/json | |
476 | produces: | |
477 | - application/json | |
478 | responses: | |
479 | '200': | |
480 | description: successful operation | |
481 | schema: | |
482 | type: array | |
483 | items: | |
484 | type: string | |
c360c494 | 485 | /videos/languages: |
1569a818 DG |
486 | get: |
487 | tags: | |
488 | - Video | |
489 | consumes: | |
490 | - application/json | |
491 | produces: | |
492 | - application/json | |
493 | responses: | |
494 | '200': | |
495 | description: successful operation | |
496 | schema: | |
497 | type: array | |
498 | items: | |
499 | type: string | |
c360c494 | 500 | /videos/privacies: |
1569a818 DG |
501 | get: |
502 | tags: | |
503 | - Video | |
504 | consumes: | |
505 | - application/json | |
506 | produces: | |
507 | - application/json | |
508 | responses: | |
509 | '200': | |
510 | description: successful operation | |
511 | schema: | |
512 | type: array | |
513 | items: | |
514 | type: string | |
c360c494 | 515 | "/videos/{id}": |
1569a818 | 516 | put: |
94ff4c23 C |
517 | security: |
518 | - OAuth2: [ ] | |
1569a818 DG |
519 | tags: |
520 | - Video | |
521 | consumes: | |
61b66b36 | 522 | - multipart/form-data |
1569a818 DG |
523 | produces: |
524 | - application/json | |
525 | parameters: | |
330eaf12 C |
526 | - $ref: "videos.yaml#/parameters/id" |
527 | - $ref: "videos.yaml#/parameters/thumbnailfile" | |
528 | - $ref: "videos.yaml#/parameters/previewfile" | |
529 | - $ref: "videos.yaml#/parameters/category" | |
530 | - $ref: "videos.yaml#/parameters/licence" | |
531 | - $ref: "videos.yaml#/parameters/language" | |
532 | - $ref: "videos.yaml#/parameters/description" | |
533 | - $ref: "videos.yaml#/parameters/waitTranscoding" | |
534 | - $ref: "videos.yaml#/parameters/support" | |
535 | - $ref: "videos.yaml#/parameters/nsfw" | |
536 | - $ref: "videos.yaml#/parameters/name" | |
537 | - $ref: "videos.yaml#/parameters/tags" | |
538 | - $ref: "videos.yaml#/parameters/commentsEnabled" | |
7f2cfe3a | 539 | - $ref: "videos.yaml#/parameters/downloadEnabled" |
330eaf12 C |
540 | - $ref: "videos.yaml#/parameters/privacy" |
541 | - $ref: "videos.yaml#/parameters/scheduleUpdate" | |
1569a818 DG |
542 | responses: |
543 | '200': | |
544 | description: successful operation | |
545 | schema: | |
546 | $ref: '#/definitions/Video' | |
547 | get: | |
548 | tags: | |
549 | - Video | |
550 | consumes: | |
551 | - application/json | |
552 | produces: | |
553 | - application/json | |
554 | parameters: | |
330eaf12 | 555 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
556 | responses: |
557 | '200': | |
558 | description: successful operation | |
559 | schema: | |
560 | $ref: '#/definitions/Video' | |
561 | delete: | |
94ff4c23 C |
562 | security: |
563 | - OAuth2: [ ] | |
1569a818 DG |
564 | tags: |
565 | - Video | |
566 | consumes: | |
567 | - application/json | |
568 | produces: | |
569 | - application/json | |
570 | parameters: | |
330eaf12 | 571 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
572 | responses: |
573 | '204': | |
330eaf12 | 574 | $ref: "commons.yaml#/responses/emptySuccess" |
c360c494 | 575 | "/videos/{id}/description": |
1569a818 DG |
576 | get: |
577 | tags: | |
578 | - Video | |
579 | consumes: | |
580 | - application/json | |
581 | produces: | |
582 | - application/json | |
583 | parameters: | |
330eaf12 | 584 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
585 | responses: |
586 | '200': | |
587 | description: successful operation | |
588 | schema: | |
589 | type: string | |
c360c494 | 590 | "/videos/{id}/views": |
1569a818 DG |
591 | post: |
592 | tags: | |
593 | - Video | |
594 | consumes: | |
595 | - application/json | |
596 | produces: | |
597 | - application/json | |
598 | parameters: | |
330eaf12 | 599 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
600 | responses: |
601 | '204': | |
330eaf12 | 602 | $ref: "commons.yaml#/responses/emptySuccess" |
c360c494 | 603 | /videos/upload: |
1569a818 | 604 | post: |
94ff4c23 C |
605 | security: |
606 | - OAuth2: [ ] | |
1569a818 DG |
607 | tags: |
608 | - Video | |
609 | consumes: | |
610 | - multipart/form-data | |
611 | produces: | |
612 | - application/json | |
613 | parameters: | |
61b66b36 C |
614 | - name: videofile |
615 | in: formData | |
1569a818 | 616 | type: file |
61b66b36 C |
617 | required: true |
618 | description: 'Video file' | |
61b66b36 C |
619 | - name: channelId |
620 | in: formData | |
621 | required: true | |
622 | type: number | |
623 | description: 'Channel id that will contain this video' | |
330eaf12 C |
624 | - $ref: "videos.yaml#/parameters/thumbnailfile" |
625 | - $ref: "videos.yaml#/parameters/previewfile" | |
626 | - $ref: "videos.yaml#/parameters/category" | |
627 | - $ref: "videos.yaml#/parameters/licence" | |
628 | - $ref: "videos.yaml#/parameters/language" | |
629 | - $ref: "videos.yaml#/parameters/description" | |
630 | - $ref: "videos.yaml#/parameters/waitTranscoding" | |
631 | - $ref: "videos.yaml#/parameters/support" | |
632 | - $ref: "videos.yaml#/parameters/nsfw" | |
633 | - $ref: "videos.yaml#/parameters/name" | |
634 | - $ref: "videos.yaml#/parameters/tags" | |
635 | - $ref: "videos.yaml#/parameters/commentsEnabled" | |
7f2cfe3a | 636 | - $ref: "videos.yaml#/parameters/downloadEnabled" |
330eaf12 C |
637 | - $ref: "videos.yaml#/parameters/privacy" |
638 | - $ref: "videos.yaml#/parameters/scheduleUpdate" | |
1569a818 DG |
639 | responses: |
640 | '200': | |
641 | description: successful operation | |
642 | schema: | |
643 | $ref: '#/definitions/VideoUploadResponse' | |
c360c494 | 644 | /videos/abuse: |
1569a818 | 645 | get: |
94ff4c23 C |
646 | security: |
647 | - OAuth2: [ ] | |
1569a818 DG |
648 | tags: |
649 | - VideoAbuse | |
650 | consumes: | |
651 | - application/json | |
652 | produces: | |
653 | - application/json | |
44cb3b85 | 654 | parameters: |
330eaf12 C |
655 | - $ref: "commons.yaml#/parameters/start" |
656 | - $ref: "commons.yaml#/parameters/count" | |
657 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
658 | responses: |
659 | '200': | |
660 | description: successful operation | |
661 | schema: | |
662 | type: array | |
663 | items: | |
664 | $ref: '#/definitions/VideoAbuse' | |
c360c494 | 665 | "/videos/{id}/abuse": |
1569a818 | 666 | post: |
94ff4c23 C |
667 | security: |
668 | - OAuth2: [ ] | |
1569a818 DG |
669 | tags: |
670 | - VideoAbuse | |
671 | consumes: | |
672 | - application/json | |
673 | produces: | |
674 | - application/json | |
675 | parameters: | |
330eaf12 | 676 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
677 | responses: |
678 | '204': | |
330eaf12 C |
679 | $ref: "commons.yaml#/responses/emptySuccess" |
680 | "/videos/{id}/blacklist": | |
1569a818 | 681 | post: |
94ff4c23 C |
682 | security: |
683 | - OAuth2: [ ] | |
1569a818 DG |
684 | tags: |
685 | - VideoBlacklist | |
686 | consumes: | |
687 | - application/json | |
688 | produces: | |
689 | - application/json | |
690 | parameters: | |
330eaf12 | 691 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
692 | responses: |
693 | '204': | |
330eaf12 | 694 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 | 695 | delete: |
94ff4c23 C |
696 | security: |
697 | - OAuth2: [ ] | |
1569a818 DG |
698 | tags: |
699 | - VideoBlacklist | |
700 | consumes: | |
701 | - application/json | |
702 | produces: | |
703 | - application/json | |
704 | parameters: | |
330eaf12 | 705 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
706 | responses: |
707 | '204': | |
330eaf12 | 708 | $ref: "commons.yaml#/responses/emptySuccess" |
c360c494 | 709 | /videos/blacklist: |
1569a818 | 710 | get: |
94ff4c23 C |
711 | security: |
712 | - OAuth2: [ ] | |
1569a818 DG |
713 | tags: |
714 | - VideoBlacklist | |
715 | consumes: | |
716 | - application/json | |
717 | produces: | |
718 | - application/json | |
44cb3b85 | 719 | parameters: |
330eaf12 C |
720 | - $ref: "commons.yaml#/parameters/start" |
721 | - $ref: "commons.yaml#/parameters/count" | |
722 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
723 | responses: |
724 | '200': | |
725 | description: successful operation | |
726 | schema: | |
727 | type: array | |
728 | items: | |
729 | $ref: '#/definitions/VideoBlacklist' | |
48dce1c9 | 730 | /video-channels: |
1569a818 DG |
731 | get: |
732 | tags: | |
733 | - VideoChannel | |
734 | consumes: | |
735 | - application/json | |
736 | produces: | |
737 | - application/json | |
44cb3b85 | 738 | parameters: |
330eaf12 C |
739 | - $ref: "commons.yaml#/parameters/start" |
740 | - $ref: "commons.yaml#/parameters/count" | |
741 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
742 | responses: |
743 | '200': | |
744 | description: successful operation | |
745 | schema: | |
746 | type: array | |
747 | items: | |
748 | $ref: '#/definitions/VideoChannel' | |
749 | post: | |
94ff4c23 C |
750 | security: |
751 | - OAuth2: [ ] | |
1569a818 DG |
752 | tags: |
753 | - VideoChannel | |
754 | consumes: | |
755 | - application/json | |
756 | produces: | |
757 | - application/json | |
758 | parameters: | |
759 | - in: body | |
760 | name: body | |
761 | schema: | |
762 | $ref: '#/definitions/VideoChannelInput' | |
763 | responses: | |
764 | '204': | |
330eaf12 | 765 | $ref: "commons.yaml#/responses/emptySuccess" |
cc918ac3 | 766 | "/video-channels/{id}": |
1569a818 DG |
767 | get: |
768 | tags: | |
769 | - VideoChannel | |
770 | consumes: | |
771 | - application/json | |
772 | produces: | |
773 | - application/json | |
774 | parameters: | |
330eaf12 | 775 | - $ref: "video-channels.yaml#/parameters/id" |
1569a818 DG |
776 | responses: |
777 | '200': | |
778 | description: successful operation | |
779 | schema: | |
780 | $ref: '#/definitions/VideoChannel' | |
781 | put: | |
94ff4c23 C |
782 | security: |
783 | - OAuth2: [ ] | |
1569a818 DG |
784 | tags: |
785 | - VideoChannel | |
786 | consumes: | |
787 | - application/json | |
788 | produces: | |
789 | - application/json | |
790 | parameters: | |
330eaf12 | 791 | - $ref: "video-channels.yaml#/parameters/id" |
1569a818 DG |
792 | - in: body |
793 | name: body | |
794 | schema: | |
795 | $ref: '#/definitions/VideoChannelInput' | |
796 | responses: | |
797 | '204': | |
330eaf12 | 798 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 | 799 | delete: |
94ff4c23 C |
800 | security: |
801 | - OAuth2: [ ] | |
1569a818 DG |
802 | tags: |
803 | - VideoChannel | |
804 | consumes: | |
805 | - application/json | |
806 | produces: | |
807 | - application/json | |
808 | parameters: | |
330eaf12 | 809 | - $ref: "video-channels.yaml#/parameters/id" |
cc918ac3 C |
810 | responses: |
811 | '204': | |
330eaf12 | 812 | $ref: "commons.yaml#/responses/emptySuccess" |
cc918ac3 C |
813 | "/video-channels/{id}/videos": |
814 | get: | |
815 | tags: | |
816 | - VideoChannel | |
817 | consumes: | |
818 | - application/json | |
819 | produces: | |
820 | - application/json | |
821 | parameters: | |
330eaf12 | 822 | - $ref: "video-channels.yaml#/parameters/id" |
1569a818 | 823 | responses: |
cc918ac3 | 824 | '200': |
1569a818 | 825 | description: successful operation |
cc918ac3 C |
826 | schema: |
827 | $ref: '#/definitions/Video' | |
ad9e39fb | 828 | /accounts/{name}/video-channels: |
6b738c7a C |
829 | get: |
830 | tags: | |
831 | - VideoChannel | |
832 | consumes: | |
833 | - application/json | |
834 | produces: | |
835 | - application/json | |
836 | parameters: | |
330eaf12 | 837 | - $ref: "accounts.yaml#/parameters/name" |
6b738c7a C |
838 | responses: |
839 | '200': | |
840 | description: successful operation | |
841 | schema: | |
cc918ac3 C |
842 | type: array |
843 | items: | |
844 | $ref: '#/definitions/VideoChannel' | |
330eaf12 | 845 | "/videos/{id}/comment-threads": |
1569a818 DG |
846 | get: |
847 | tags: | |
848 | - VideoComment | |
849 | consumes: | |
850 | - application/json | |
851 | produces: | |
852 | - application/json | |
853 | parameters: | |
330eaf12 C |
854 | - $ref: "videos.yaml#/parameters/id" |
855 | - $ref: "commons.yaml#/parameters/start" | |
856 | - $ref: "commons.yaml#/parameters/count" | |
857 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
858 | responses: |
859 | '200': | |
860 | description: successful operation | |
5e1c08eb | 861 | schema: |
c360c494 | 862 | $ref: '#/definitions/CommentThreadResponse' |
1569a818 | 863 | post: |
94ff4c23 C |
864 | security: |
865 | - OAuth2: [ ] | |
1569a818 DG |
866 | tags: |
867 | - VideoComment | |
868 | consumes: | |
869 | - application/json | |
870 | produces: | |
871 | - application/json | |
872 | parameters: | |
330eaf12 | 873 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
874 | responses: |
875 | '200': | |
876 | description: successful operation | |
c360c494 DG |
877 | schema: |
878 | $ref: '#/definitions/CommentThreadPostResponse' | |
330eaf12 | 879 | "/videos/{id}/comment-threads/{threadId}": |
1569a818 DG |
880 | get: |
881 | tags: | |
882 | - VideoComment | |
883 | consumes: | |
884 | - application/json | |
885 | produces: | |
886 | - application/json | |
887 | parameters: | |
330eaf12 C |
888 | - $ref: "videos.yaml#/parameters/id" |
889 | - $ref: "video-comments.yaml#/parameters/threadId" | |
1569a818 DG |
890 | responses: |
891 | '200': | |
892 | description: successful operation | |
5e1c08eb C |
893 | schema: |
894 | $ref: '#/definitions/VideoCommentThreadTree' | |
330eaf12 | 895 | "/videos/{id}/comments/{commentId}": |
1569a818 | 896 | post: |
94ff4c23 C |
897 | security: |
898 | - OAuth2: [ ] | |
1569a818 DG |
899 | tags: |
900 | - VideoComment | |
901 | consumes: | |
902 | - application/json | |
903 | produces: | |
904 | - application/json | |
905 | parameters: | |
330eaf12 C |
906 | - $ref: "videos.yaml#/parameters/id" |
907 | - $ref: "video-comments.yaml#/parameters/commentId" | |
1569a818 DG |
908 | responses: |
909 | '200': | |
910 | description: successful operation | |
c360c494 DG |
911 | schema: |
912 | $ref: '#/definitions/CommentThreadPostResponse' | |
1569a818 | 913 | delete: |
94ff4c23 C |
914 | security: |
915 | - OAuth2: [ ] | |
1569a818 DG |
916 | tags: |
917 | - VideoComment | |
918 | consumes: | |
919 | - application/json | |
920 | produces: | |
921 | - application/json | |
922 | parameters: | |
330eaf12 C |
923 | - $ref: "videos.yaml#/parameters/id" |
924 | - $ref: "video-comments.yaml#/parameters/commentId" | |
1569a818 DG |
925 | responses: |
926 | '204': | |
330eaf12 | 927 | $ref: "commons.yaml#/responses/emptySuccess" |
c360c494 | 928 | "/videos/{id}/rate": |
1569a818 | 929 | put: |
94ff4c23 C |
930 | security: |
931 | - OAuth2: [ ] | |
1569a818 DG |
932 | tags: |
933 | - VideoRate | |
934 | consumes: | |
935 | - application/json | |
936 | produces: | |
937 | - application/json | |
938 | parameters: | |
330eaf12 | 939 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
940 | responses: |
941 | '204': | |
330eaf12 | 942 | $ref: "commons.yaml#/responses/emptySuccess" |
fb72c193 DL |
943 | /search/videos: |
944 | get: | |
945 | tags: | |
946 | - Search | |
947 | consumes: | |
948 | - application/json | |
949 | produces: | |
950 | - application/json | |
951 | parameters: | |
952 | - $ref: "commons.yaml#/parameters/start" | |
953 | - $ref: "commons.yaml#/parameters/count" | |
954 | - $ref: "commons.yaml#/parameters/sort" | |
655b5490 | 955 | - name: search |
fb72c193 DL |
956 | in: query |
957 | required: true | |
958 | type: string | |
959 | description: 'String to search' | |
960 | responses: | |
961 | '200': | |
962 | description: successful operation | |
963 | schema: | |
964 | type: array | |
965 | items: | |
966 | $ref: '#/definitions/Video' | |
1569a818 | 967 | definitions: |
9d3ef9fe | 968 | VideoConstantNumber: |
5d00a3d7 C |
969 | properties: |
970 | id: | |
971 | type: number | |
972 | label: | |
973 | type: string | |
9d3ef9fe C |
974 | VideoConstantString: |
975 | properties: | |
976 | id: | |
977 | type: string | |
978 | label: | |
979 | type: string | |
61b66b36 C |
980 | VideoPrivacy: |
981 | type: string | |
982 | enum: [Public, Unlisted, Private] | |
1569a818 DG |
983 | Video: |
984 | properties: | |
985 | id: | |
986 | type: number | |
987 | uuid: | |
988 | type: string | |
1569a818 DG |
989 | createdAt: |
990 | type: string | |
61b66b36 C |
991 | publishedAt: |
992 | type: string | |
1569a818 DG |
993 | updatedAt: |
994 | type: string | |
1569a818 | 995 | category: |
9d3ef9fe | 996 | $ref: "#/definitions/VideoConstantNumber" |
1569a818 | 997 | licence: |
9d3ef9fe | 998 | $ref: "#/definitions/VideoConstantNumber" |
1569a818 | 999 | language: |
9d3ef9fe | 1000 | $ref: "#/definitions/VideoConstantString" |
61b66b36 C |
1001 | privacy: |
1002 | $ref: "#/definitions/VideoPrivacy" | |
1569a818 DG |
1003 | description: |
1004 | type: string | |
1005 | duration: | |
1006 | type: number | |
1007 | isLocal: | |
1008 | type: boolean | |
1009 | name: | |
1010 | type: string | |
1569a818 DG |
1011 | thumbnailPath: |
1012 | type: string | |
1013 | previewPath: | |
1014 | type: string | |
1015 | embedPath: | |
1016 | type: string | |
1017 | views: | |
1018 | type: number | |
1019 | likes: | |
1020 | type: number | |
1021 | dislikes: | |
1022 | type: number | |
1023 | nsfw: | |
1024 | type: boolean | |
b64c950a | 1025 | account: |
61b66b36 C |
1026 | type: object |
1027 | properties: | |
1028 | name: | |
1029 | type: string | |
1030 | displayName: | |
1031 | type: string | |
1032 | url: | |
1033 | type: string | |
1034 | host: | |
1035 | type: string | |
1036 | avatar: | |
1037 | $ref: "#/definitions/Avatar" | |
1569a818 DG |
1038 | VideoAbuse: |
1039 | properties: | |
1040 | id: | |
1041 | type: number | |
1042 | reason: | |
1043 | type: string | |
19a3b914 C |
1044 | reporterAccount: |
1045 | $ref: "#/definitions/Account" | |
1046 | video: | |
61b66b36 C |
1047 | type: object |
1048 | properties: | |
1049 | id: | |
1050 | type: number | |
1051 | name: | |
1052 | type: string | |
1053 | uuid: | |
1054 | type: string | |
1055 | url: | |
1056 | type: string | |
1569a818 DG |
1057 | createdAt: |
1058 | type: string | |
1059 | VideoBlacklist: | |
1060 | properties: | |
1061 | id: | |
1062 | type: number | |
1063 | videoId: | |
1064 | type: number | |
1065 | createdAt: | |
1066 | type: string | |
1067 | updatedAt: | |
1068 | type: string | |
1069 | name: | |
1070 | type: string | |
1071 | uuid: | |
1072 | type: string | |
1073 | description: | |
1074 | type: string | |
1075 | duration: | |
1076 | type: number | |
1077 | views: | |
1078 | type: number | |
1079 | likes: | |
1080 | type: number | |
1081 | dislikes: | |
1082 | type: number | |
1083 | nsfw: | |
1084 | type: boolean | |
1085 | VideoChannel: | |
1086 | properties: | |
1087 | displayName: | |
1088 | type: string | |
1089 | description: | |
1090 | type: string | |
1091 | isLocal: | |
1092 | type: boolean | |
6b738c7a | 1093 | ownerAccount: |
1569a818 | 1094 | type: object |
5d00a3d7 | 1095 | properties: |
6b738c7a C |
1096 | id: |
1097 | type: number | |
5d00a3d7 | 1098 | uuid: |
1569a818 | 1099 | type: string |
1569a818 DG |
1100 | VideoComment: |
1101 | properties: | |
1102 | id: | |
1103 | type: number | |
1104 | url: | |
1105 | type: string | |
1106 | text: | |
1107 | type: string | |
1108 | threadId: | |
1109 | type: number | |
1110 | inReplyToCommentId: | |
1111 | type: number | |
1112 | videoId: | |
1113 | type: number | |
1114 | createdAt: | |
1115 | type: string | |
1116 | updatedAt: | |
1117 | type: string | |
1118 | totalReplies: | |
1119 | type: number | |
1120 | account: | |
1121 | $ref: "#/definitions/Account" | |
5e1c08eb C |
1122 | VideoCommentThreadTree: |
1123 | properties: | |
1124 | comment: | |
1125 | $ref: "#/definitions/VideoComment" | |
1126 | children: | |
1127 | type: array | |
1128 | items: | |
1129 | $ref: "#/definitions/VideoCommentThreadTree" | |
1569a818 DG |
1130 | Avatar: |
1131 | properties: | |
1132 | path: | |
1133 | type: string | |
1134 | createdAt: | |
1135 | type: string | |
1136 | updatedAt: | |
1137 | type: string | |
1138 | Actor: | |
1139 | properties: | |
1140 | id: | |
1141 | type: number | |
1142 | uuid: | |
1143 | type: string | |
1144 | url: | |
1145 | type: string | |
1146 | name: | |
1147 | type: string | |
1148 | host: | |
1149 | type: string | |
1150 | followingCount: | |
1151 | type: number | |
1152 | followersCount: | |
1153 | type: number | |
1154 | createdAt: | |
1155 | type: string | |
1156 | updatedAt: | |
1157 | type: string | |
1158 | avatar: | |
1159 | $ref: "#/definitions/Avatar" | |
1160 | Account: | |
1161 | allOf: | |
1162 | - $ref: "#/definitions/Actor" | |
1163 | - properties: | |
1164 | displayName: | |
1165 | type: string | |
1166 | User: | |
1167 | properties: | |
1168 | id: | |
1169 | type: number | |
1170 | username: | |
1171 | type: string | |
1172 | email: | |
1173 | type: string | |
1174 | displayNSFW: | |
1175 | type: boolean | |
1176 | autoPlayVideo: | |
1177 | type: boolean | |
1178 | role: | |
1179 | type: string | |
5d00a3d7 | 1180 | enum: [User, Moderator, Administrator] |
1569a818 DG |
1181 | videoQuota: |
1182 | type: number | |
1183 | createdAt: | |
1184 | type: string | |
1185 | account: | |
1186 | $ref: "#/definitions/Account" | |
1187 | videoChannels: | |
1188 | type: array | |
1189 | items: | |
1190 | $ref: "#/definitions/VideoChannel" | |
1191 | ServerConfig: | |
1192 | properties: | |
5d00a3d7 | 1193 | signup: |
1569a818 DG |
1194 | type: object |
1195 | properties: | |
1196 | allowed: | |
1197 | type: boolean | |
1198 | transcoding: | |
1199 | type: object | |
1200 | properties: | |
1201 | enabledResolutions: | |
1202 | type: array | |
1203 | items: | |
1204 | type: number | |
1205 | avatar: | |
1206 | type: object | |
1207 | properties: | |
1208 | file: | |
1209 | type: object | |
1210 | properties: | |
1211 | size: | |
1212 | type: object | |
1213 | properties: | |
1214 | max: | |
1215 | type: number | |
5d00a3d7 | 1216 | extensions: |
1569a818 DG |
1217 | type: array |
1218 | items: | |
1219 | type: string | |
1220 | video: | |
1221 | type: object | |
1222 | properties: | |
1223 | file: | |
1224 | type: object | |
5d00a3d7 C |
1225 | properties: |
1226 | extensions: | |
1569a818 DG |
1227 | type: array |
1228 | items: | |
1229 | type: string | |
1230 | Follow: | |
1231 | properties: | |
1232 | id: | |
1233 | type: number | |
1234 | follower: | |
1235 | $ref: "#/definitions/Actor" | |
1236 | following: | |
1237 | $ref: "#/definitions/Actor" | |
1238 | score: | |
1239 | type: number | |
1240 | state: | |
1241 | type: string | |
1242 | enum: [pending, accepted] | |
1243 | createdAt: | |
1244 | type: string | |
1245 | updatedAt: | |
1246 | type: string | |
1247 | Job: | |
1248 | properties: | |
1249 | id: | |
1250 | type: number | |
1251 | state: | |
1252 | type: string | |
1253 | enum: [pending, processing, error, success] | |
1254 | category: | |
1255 | type: string | |
1256 | enum: [transcoding, activitypub-http] | |
1257 | handlerName: | |
1258 | type: string | |
1259 | handlerInputData: | |
1260 | type: string | |
1261 | createdAt: | |
1262 | type: string | |
1263 | updatedAt: | |
1264 | type: string | |
1265 | ||
61b66b36 | 1266 | # Api responses |
1569a818 DG |
1267 | AddUserResponse: |
1268 | properties: | |
1269 | id: | |
1270 | type: number | |
1271 | uuid: | |
1272 | type: string | |
1273 | VideoUploadResponse: | |
1274 | properties: | |
61b66b36 C |
1275 | video: |
1276 | type: object | |
1277 | properties: | |
1278 | id: | |
1279 | type: number | |
1280 | uuid: | |
1281 | type: string | |
c360c494 DG |
1282 | CommentThreadResponse: |
1283 | properties: | |
1284 | total: | |
1285 | type: number | |
1286 | data: | |
1287 | type: array | |
1288 | items: | |
1289 | $ref: "#/definitions/VideoComment" | |
1290 | CommentThreadPostResponse: | |
1291 | properties: | |
1292 | comment: | |
1293 | $ref: "#/definitions/VideoComment" | |
1569a818 | 1294 | |
61b66b36 | 1295 | # Request bodies |
1569a818 DG |
1296 | AddUser: |
1297 | properties: | |
1298 | username: | |
1299 | type: string | |
1300 | description: 'The user username ' | |
1301 | password: | |
1302 | type: string | |
1303 | description: 'The user password ' | |
1304 | email: | |
1305 | type: string | |
1306 | description: 'The user email ' | |
1307 | videoQuota: | |
1308 | type: string | |
1309 | description: 'The user videoQuota ' | |
1310 | role: | |
1311 | type: string | |
1312 | description: 'The user role ' | |
1313 | required: | |
1314 | - username | |
1315 | - password | |
1316 | ||
1317 | - videoQuota | |
1318 | - role | |
1319 | UpdateUser: | |
1320 | properties: | |
1321 | id: | |
1322 | type: string | |
1323 | description: 'The user id ' | |
1324 | email: | |
1325 | type: string | |
1326 | description: 'The updated email of the user ' | |
1327 | videoQuota: | |
1328 | type: string | |
1329 | description: 'The updated videoQuota of the user ' | |
1330 | role: | |
1331 | type: string | |
1332 | description: 'The updated role of the user ' | |
1333 | required: | |
1334 | - id | |
1335 | ||
1336 | - videoQuota | |
1337 | - role | |
1338 | UpdateMe: | |
1339 | properties: | |
1340 | password: | |
1341 | type: string | |
1342 | description: 'Your new password ' | |
1343 | email: | |
1344 | type: string | |
1345 | description: 'Your new email ' | |
1346 | displayNSFW: | |
1347 | type: string | |
1348 | description: 'Your new displayNSFW ' | |
1349 | autoPlayVideo: | |
1350 | type: string | |
1351 | description: 'Your new autoPlayVideo ' | |
1352 | required: | |
1353 | - password | |
1354 | ||
1355 | - displayNSFW | |
1356 | - autoPlayVideo | |
1357 | GetMeVideoRating: | |
1358 | properties: | |
1359 | id: | |
1360 | type: string | |
1361 | description: 'Id of the video ' | |
1362 | rating: | |
1363 | type: number | |
1364 | description: 'Rating of the video ' | |
1365 | required: | |
1366 | - id | |
1367 | - rating | |
1368 | RegisterUser: | |
1369 | properties: | |
1370 | username: | |
1371 | type: string | |
1372 | description: 'The username of the user ' | |
1373 | password: | |
1374 | type: string | |
1375 | description: 'The password of the user ' | |
1376 | email: | |
1377 | type: string | |
1378 | description: 'The email of the user ' | |
1379 | required: | |
1380 | - username | |
1381 | - password | |
1382 | ||
1383 | VideoChannelInput: | |
1384 | properties: | |
1385 | name: | |
1386 | type: string | |
1387 | description: | |
330eaf12 | 1388 | type: string |