]>
Commit | Line | Data |
---|---|---|
1 | openapi: 3.0.0 | |
2 | info: | |
3 | title: PeerTube | |
4 | version: 2.0.0 | |
5 | contact: | |
6 | name: PeerTube Community | |
7 | url: 'https://joinpeertube.org' | |
8 | license: | |
9 | name: AGPLv3.0 | |
10 | url: 'https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE' | |
11 | x-logo: | |
12 | url: 'https://joinpeertube.org/img/brand.png' | |
13 | altText: PeerTube Project Homepage | |
14 | description: | | |
15 | # Introduction | |
16 | The PeerTube API is built on HTTP(S). Our API is RESTful. It has predictable | |
17 | resource URLs. It returns HTTP response codes to indicate errors. It also | |
18 | accepts and returns JSON in the HTTP body. You can use your favorite | |
19 | HTTP/REST library for your programming language to use PeerTube. No official | |
20 | SDK is currently provided, but the spec API is fully compatible with | |
21 | [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO) | |
22 | which generates a client SDK in the language of your choice. | |
23 | ||
24 | # Authentication | |
25 | When you sign up for an account, you are given the possibility to generate | |
26 | sessions, and authenticate using this session token. One session token can | |
27 | currently be used at a time. | |
28 | ||
29 | # Errors | |
30 | The API uses standard HTTP status codes to indicate the success or failure | |
31 | of the API call. The body of the response will be JSON in the following | |
32 | format. | |
33 | ||
34 | ``` | |
35 | { | |
36 | "code": "unauthorized_request", // example inner error code | |
37 | "error": "Token is invalid." // example exposed error message | |
38 | } | |
39 | ``` | |
40 | externalDocs: | |
41 | url: https://docs.joinpeertube.org/api-rest-reference.html | |
42 | tags: | |
43 | - name: Accounts | |
44 | description: > | |
45 | Using some features of PeerTube require authentication, for which Accounts | |
46 | provide different levels of permission as well as associated user | |
47 | information. Accounts also encompass remote accounts discovered across the federation. | |
48 | - name: Config | |
49 | description: > | |
50 | Each server exposes public information regarding supported videos and | |
51 | options. | |
52 | - name: Job | |
53 | description: > | |
54 | Jobs are long-running tasks enqueued and processed by the instance | |
55 | itself. No additional worker registration is currently available. | |
56 | - name: Server Following | |
57 | description: > | |
58 | Managing servers which the instance interacts with is crucial to the | |
59 | concept of federation in PeerTube and external video indexation. The PeerTube | |
60 | server then deals with inter-server ActivityPub operations and propagates | |
61 | information across its social graph by posting activities to actors' inbox | |
62 | endpoints. | |
63 | - name: Video Abuse | |
64 | description: | | |
65 | Video abuses deal with reports of local or remote videos alike. | |
66 | - name: Video | |
67 | description: | | |
68 | Operations dealing with listing, uploading, fetching or modifying videos. | |
69 | - name: Search | |
70 | description: | | |
71 | The search helps to find _videos_ from within the instance and beyond. | |
72 | Videos from other instances federated by the instance (that is, instances | |
73 | followed by the instance) can be found via keywords and other criteria of | |
74 | the advanced search. | |
75 | - name: Video Comment | |
76 | description: > | |
77 | Operations dealing with comments to a video. Comments are organized in | |
78 | threads. | |
79 | - name: Video Channel | |
80 | description: > | |
81 | Operations dealing with creation, modification and video listing of a | |
82 | user's channels. | |
83 | - name: Video Blacklist | |
84 | description: > | |
85 | Operations dealing with blacklisting videos (removing them from view and | |
86 | preventing interactions). | |
87 | - name: Video Rate | |
88 | description: > | |
89 | Voting for a video. | |
90 | x-tagGroups: | |
91 | - name: Accounts | |
92 | tags: | |
93 | - Accounts | |
94 | - User | |
95 | - My User | |
96 | - name: Videos | |
97 | tags: | |
98 | - Video | |
99 | - Video Caption | |
100 | - Video Channel | |
101 | - Video Comment | |
102 | - Video Following | |
103 | - Video Rate | |
104 | - name: Moderation | |
105 | tags: | |
106 | - Video Abuse | |
107 | - Video Blacklist | |
108 | - name: Instance Configuration | |
109 | tags: | |
110 | - Config | |
111 | - Server Following | |
112 | - name: Jobs | |
113 | tags: | |
114 | - Job | |
115 | - name: Search | |
116 | tags: | |
117 | - Search | |
118 | paths: | |
119 | '/accounts/{name}': | |
120 | get: | |
121 | tags: | |
122 | - Accounts | |
123 | summary: Get the account by name | |
124 | parameters: | |
125 | - $ref: '#/components/parameters/name' | |
126 | responses: | |
127 | '200': | |
128 | description: successful operation | |
129 | content: | |
130 | application/json: | |
131 | schema: | |
132 | $ref: '#/components/schemas/Account' | |
133 | '/accounts/{name}/videos': | |
134 | get: | |
135 | tags: | |
136 | - Accounts | |
137 | - Video | |
138 | summary: 'Get videos for an account, provided the name of that account' | |
139 | parameters: | |
140 | - $ref: '#/components/parameters/name' | |
141 | responses: | |
142 | '200': | |
143 | description: successful operation | |
144 | content: | |
145 | application/json: | |
146 | schema: | |
147 | $ref: '#/components/schemas/VideoListResponse' | |
148 | x-code-samples: | |
149 | - lang: JavaScript | |
150 | source: | | |
151 | fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos') | |
152 | .then(function(response) { | |
153 | return response.json() | |
154 | }).then(function(data) { | |
155 | console.log(data) | |
156 | }) | |
157 | - lang: Shell | |
158 | source: | | |
159 | # pip install httpie | |
160 | http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos | |
161 | - lang: Ruby | |
162 | source: | | |
163 | require 'net/http' | |
164 | require 'json' | |
165 | ||
166 | uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos") | |
167 | ||
168 | http = Net::HTTP.new(uri.host, uri.port) | |
169 | http.use_ssl = true | |
170 | ||
171 | response = http.get(uri.request_uri) | |
172 | ||
173 | puts JSON.parse(response.read_body) | |
174 | - lang: Python | |
175 | source: | | |
176 | import requests | |
177 | ||
178 | r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos") | |
179 | json = r.json() | |
180 | ||
181 | print(json) | |
182 | /accounts: | |
183 | get: | |
184 | tags: | |
185 | - Accounts | |
186 | summary: Get all accounts | |
187 | parameters: | |
188 | - $ref: '#/components/parameters/start' | |
189 | - $ref: '#/components/parameters/count' | |
190 | - $ref: '#/components/parameters/sort' | |
191 | responses: | |
192 | '200': | |
193 | description: successful operation | |
194 | content: | |
195 | 'application/json': | |
196 | schema: | |
197 | type: array | |
198 | items: | |
199 | $ref: '#/components/schemas/Account' | |
200 | /config: | |
201 | get: | |
202 | tags: | |
203 | - Config | |
204 | summary: Get the public configuration of the server | |
205 | responses: | |
206 | '200': | |
207 | description: successful operation | |
208 | content: | |
209 | application/json: | |
210 | schema: | |
211 | $ref: '#/components/schemas/ServerConfig' | |
212 | /config/about: | |
213 | get: | |
214 | summary: Get the instance about page content | |
215 | tags: | |
216 | - Config | |
217 | responses: | |
218 | '200': | |
219 | description: successful operation | |
220 | content: | |
221 | application/json: | |
222 | schema: | |
223 | $ref: '#/components/schemas/ServerConfigAbout' | |
224 | /config/custom: | |
225 | get: | |
226 | summary: Get the runtime configuration of the server | |
227 | tags: | |
228 | - Config | |
229 | security: | |
230 | - OAuth2: | |
231 | - admin | |
232 | responses: | |
233 | '200': | |
234 | description: successful operation | |
235 | content: | |
236 | application/json: | |
237 | schema: | |
238 | $ref: '#/components/schemas/ServerConfigCustom' | |
239 | put: | |
240 | summary: Set the runtime configuration of the server | |
241 | tags: | |
242 | - Config | |
243 | security: | |
244 | - OAuth2: | |
245 | - admin | |
246 | responses: | |
247 | '200': | |
248 | description: successful operation | |
249 | delete: | |
250 | summary: Delete the runtime configuration of the server | |
251 | tags: | |
252 | - Config | |
253 | security: | |
254 | - OAuth2: | |
255 | - admin | |
256 | responses: | |
257 | '200': | |
258 | description: successful operation | |
259 | /jobs/{state}: | |
260 | get: | |
261 | summary: Get list of jobs | |
262 | security: | |
263 | - OAuth2: | |
264 | - admin | |
265 | tags: | |
266 | - Job | |
267 | parameters: | |
268 | - name: state | |
269 | in: path | |
270 | required: true | |
271 | description: The state of the job | |
272 | schema: | |
273 | type: string | |
274 | enum: | |
275 | - active | |
276 | - completed | |
277 | - failed | |
278 | - waiting | |
279 | - delayed | |
280 | - $ref: '#/components/parameters/start' | |
281 | - $ref: '#/components/parameters/count' | |
282 | - $ref: '#/components/parameters/sort' | |
283 | responses: | |
284 | '200': | |
285 | description: successful operation | |
286 | content: | |
287 | application/json: | |
288 | schema: | |
289 | type: array | |
290 | items: | |
291 | $ref: '#/components/schemas/Job' | |
292 | '/server/following/{host}': | |
293 | delete: | |
294 | security: | |
295 | - OAuth2: | |
296 | - admin | |
297 | tags: | |
298 | - Server Following | |
299 | summary: Unfollow a server by hostname | |
300 | parameters: | |
301 | - name: host | |
302 | in: path | |
303 | required: true | |
304 | description: 'The host to unfollow ' | |
305 | schema: | |
306 | type: string | |
307 | responses: | |
308 | '201': | |
309 | description: successful operation | |
310 | /server/followers: | |
311 | get: | |
312 | tags: | |
313 | - Server Following | |
314 | summary: Get followers of the server | |
315 | parameters: | |
316 | - $ref: '#/components/parameters/start' | |
317 | - $ref: '#/components/parameters/count' | |
318 | - $ref: '#/components/parameters/sort' | |
319 | responses: | |
320 | '200': | |
321 | description: successful operation | |
322 | content: | |
323 | application/json: | |
324 | schema: | |
325 | type: array | |
326 | items: | |
327 | $ref: '#/components/schemas/Follow' | |
328 | /server/following: | |
329 | get: | |
330 | tags: | |
331 | - Server Following | |
332 | summary: Get servers followed by the server | |
333 | parameters: | |
334 | - $ref: '#/components/parameters/start' | |
335 | - $ref: '#/components/parameters/count' | |
336 | - $ref: '#/components/parameters/sort' | |
337 | responses: | |
338 | '200': | |
339 | description: successful operation | |
340 | content: | |
341 | application/json: | |
342 | schema: | |
343 | type: array | |
344 | items: | |
345 | $ref: '#/components/schemas/Follow' | |
346 | post: | |
347 | security: | |
348 | - OAuth2: | |
349 | - admin | |
350 | tags: | |
351 | - Server Following | |
352 | summary: Follow a server | |
353 | responses: | |
354 | '204': | |
355 | $ref: '#/paths/~1users~1me/put/responses/204' | |
356 | requestBody: | |
357 | content: | |
358 | application/json: | |
359 | schema: | |
360 | $ref: '#/components/schemas/Follow' | |
361 | /users: | |
362 | post: | |
363 | summary: Creates user | |
364 | security: | |
365 | - OAuth2: | |
366 | - admin | |
367 | tags: | |
368 | - User | |
369 | responses: | |
370 | '200': | |
371 | description: successful operation | |
372 | content: | |
373 | application/json: | |
374 | schema: | |
375 | $ref: '#/components/schemas/AddUserResponse' | |
376 | requestBody: | |
377 | content: | |
378 | application/json: | |
379 | schema: | |
380 | $ref: '#/components/schemas/AddUser' | |
381 | description: User to create | |
382 | required: true | |
383 | get: | |
384 | summary: Get a list of users | |
385 | security: | |
386 | - OAuth2: [] | |
387 | tags: | |
388 | - User | |
389 | parameters: | |
390 | - $ref: '#/components/parameters/start' | |
391 | - $ref: '#/components/parameters/count' | |
392 | - $ref: '#/components/parameters/usersSort' | |
393 | responses: | |
394 | '200': | |
395 | description: successful operation | |
396 | content: | |
397 | application/json: | |
398 | schema: | |
399 | type: array | |
400 | items: | |
401 | $ref: '#/components/schemas/User' | |
402 | '/users/{id}': | |
403 | delete: | |
404 | summary: Delete a user by its id | |
405 | security: | |
406 | - OAuth2: | |
407 | - admin | |
408 | tags: | |
409 | - User | |
410 | parameters: | |
411 | - $ref: '#/components/parameters/id' | |
412 | responses: | |
413 | '204': | |
414 | $ref: '#/paths/~1users~1me/put/responses/204' | |
415 | get: | |
416 | summary: Get user by its id | |
417 | security: | |
418 | - OAuth2: [] | |
419 | tags: | |
420 | - User | |
421 | parameters: | |
422 | - $ref: '#/components/parameters/id' | |
423 | responses: | |
424 | '200': | |
425 | description: successful operation | |
426 | content: | |
427 | application/json: | |
428 | schema: | |
429 | $ref: '#/components/schemas/User' | |
430 | put: | |
431 | summary: Update user profile by its id | |
432 | security: | |
433 | - OAuth2: [] | |
434 | tags: | |
435 | - User | |
436 | parameters: | |
437 | - $ref: '#/components/parameters/id' | |
438 | responses: | |
439 | '204': | |
440 | $ref: '#/paths/~1users~1me/put/responses/204' | |
441 | requestBody: | |
442 | content: | |
443 | application/json: | |
444 | schema: | |
445 | $ref: '#/components/schemas/UpdateUser' | |
446 | required: true | |
447 | /users/register: | |
448 | post: | |
449 | summary: Register a user | |
450 | tags: | |
451 | - User | |
452 | responses: | |
453 | '204': | |
454 | $ref: '#/paths/~1users~1me/put/responses/204' | |
455 | requestBody: | |
456 | content: | |
457 | application/json: | |
458 | schema: | |
459 | $ref: '#/components/schemas/RegisterUser' | |
460 | required: true | |
461 | /users/me: | |
462 | get: | |
463 | summary: Get current user information | |
464 | security: | |
465 | - OAuth2: | |
466 | - user | |
467 | tags: | |
468 | - My User | |
469 | responses: | |
470 | '200': | |
471 | description: successful operation | |
472 | content: | |
473 | application/json: | |
474 | schema: | |
475 | type: array | |
476 | items: | |
477 | $ref: '#/components/schemas/User' | |
478 | put: | |
479 | summary: Update current user information | |
480 | security: | |
481 | - OAuth2: | |
482 | - user | |
483 | tags: | |
484 | - My User | |
485 | responses: | |
486 | '204': | |
487 | description: successful operation | |
488 | requestBody: | |
489 | content: | |
490 | application/json: | |
491 | schema: | |
492 | $ref: '#/components/schemas/UpdateMe' | |
493 | required: true | |
494 | /users/me/videos/imports: | |
495 | get: | |
496 | summary: Get video imports of current user | |
497 | security: | |
498 | - OAuth2: | |
499 | - user | |
500 | tags: | |
501 | - My User | |
502 | parameters: | |
503 | - $ref: '#/components/parameters/start' | |
504 | - $ref: '#/components/parameters/count' | |
505 | - $ref: '#/components/parameters/sort' | |
506 | responses: | |
507 | '200': | |
508 | description: successful operation | |
509 | content: | |
510 | application/json: | |
511 | schema: | |
512 | $ref: '#/components/schemas/VideoImport' | |
513 | /users/me/video-quota-used: | |
514 | get: | |
515 | summary: Get current user used quota | |
516 | security: | |
517 | - OAuth2: | |
518 | - user | |
519 | tags: | |
520 | - My User | |
521 | responses: | |
522 | '200': | |
523 | description: successful operation | |
524 | content: | |
525 | application/json: | |
526 | schema: | |
527 | type: number | |
528 | '/users/me/videos/{videoId}/rating': | |
529 | get: | |
530 | summary: 'Get rating of video by its id, among those of the current user' | |
531 | security: | |
532 | - OAuth2: [] | |
533 | tags: | |
534 | - My User | |
535 | parameters: | |
536 | - name: videoId | |
537 | in: path | |
538 | required: true | |
539 | description: 'The video id ' | |
540 | schema: | |
541 | type: string | |
542 | responses: | |
543 | '200': | |
544 | description: successful operation | |
545 | content: | |
546 | application/json: | |
547 | schema: | |
548 | $ref: '#/components/schemas/GetMeVideoRating' | |
549 | /users/me/videos: | |
550 | get: | |
551 | summary: Get videos of the current user | |
552 | security: | |
553 | - OAuth2: | |
554 | - user | |
555 | tags: | |
556 | - My User | |
557 | parameters: | |
558 | - $ref: '#/components/parameters/start' | |
559 | - $ref: '#/components/parameters/count' | |
560 | - $ref: '#/components/parameters/sort' | |
561 | responses: | |
562 | '200': | |
563 | description: successful operation | |
564 | content: | |
565 | application/json: | |
566 | schema: | |
567 | $ref: '#/components/schemas/VideoListResponse' | |
568 | /users/me/subscriptions: | |
569 | get: | |
570 | summary: Get subscriptions of the current user | |
571 | security: | |
572 | - OAuth2: | |
573 | - user | |
574 | tags: | |
575 | - My User | |
576 | parameters: | |
577 | - $ref: '#/components/parameters/start' | |
578 | - $ref: '#/components/parameters/count' | |
579 | - $ref: '#/components/parameters/sort' | |
580 | responses: | |
581 | '200': | |
582 | description: successful operation | |
583 | post: | |
584 | summary: Add subscription to the current user | |
585 | security: | |
586 | - OAuth2: | |
587 | - user | |
588 | tags: | |
589 | - My User | |
590 | responses: | |
591 | '200': | |
592 | description: successful operation | |
593 | /users/me/subscriptions/exist: | |
594 | get: | |
595 | summary: Get if subscriptions exist for the current user | |
596 | security: | |
597 | - OAuth2: | |
598 | - user | |
599 | tags: | |
600 | - My User | |
601 | parameters: | |
602 | - $ref: '#/components/parameters/subscriptionsUris' | |
603 | responses: | |
604 | '200': | |
605 | description: successful operation | |
606 | content: | |
607 | application/json: | |
608 | schema: | |
609 | type: object | |
610 | /users/me/subscriptions/videos: | |
611 | get: | |
612 | summary: Get videos of subscriptions of the current user | |
613 | security: | |
614 | - OAuth2: | |
615 | - user | |
616 | tags: | |
617 | - My User | |
618 | parameters: | |
619 | - $ref: '#/components/parameters/start' | |
620 | - $ref: '#/components/parameters/count' | |
621 | - $ref: '#/components/parameters/sort' | |
622 | responses: | |
623 | '200': | |
624 | description: successful operation | |
625 | content: | |
626 | application/json: | |
627 | schema: | |
628 | $ref: '#/components/schemas/VideoListResponse' | |
629 | '/users/me/subscriptions/{subscriptionHandle}': | |
630 | get: | |
631 | summary: Get subscription of the current user for a given uri | |
632 | security: | |
633 | - OAuth2: | |
634 | - user | |
635 | tags: | |
636 | - My User | |
637 | parameters: | |
638 | - $ref: '#/components/parameters/subscriptionHandle' | |
639 | responses: | |
640 | '200': | |
641 | description: successful operation | |
642 | content: | |
643 | application/json: | |
644 | schema: | |
645 | $ref: '#/components/schemas/VideoChannel' | |
646 | delete: | |
647 | summary: Delete subscription of the current user for a given uri | |
648 | security: | |
649 | - OAuth2: | |
650 | - user | |
651 | tags: | |
652 | - My User | |
653 | parameters: | |
654 | - $ref: '#/components/parameters/subscriptionHandle' | |
655 | responses: | |
656 | '200': | |
657 | description: successful operation | |
658 | /users/me/avatar/pick: | |
659 | post: | |
660 | summary: Update current user avatar | |
661 | security: | |
662 | - OAuth2: [] | |
663 | tags: | |
664 | - My User | |
665 | responses: | |
666 | '200': | |
667 | description: successful operation | |
668 | content: | |
669 | application/json: | |
670 | schema: | |
671 | $ref: '#/components/schemas/Avatar' | |
672 | requestBody: | |
673 | content: | |
674 | multipart/form-data: | |
675 | schema: | |
676 | type: object | |
677 | properties: | |
678 | avatarfile: | |
679 | description: The file to upload. | |
680 | type: string | |
681 | format: binary | |
682 | encoding: | |
683 | avatarfile: | |
684 | contentType: image/png, image/jpeg | |
685 | /videos: | |
686 | get: | |
687 | summary: Get list of videos | |
688 | tags: | |
689 | - Video | |
690 | parameters: | |
691 | - $ref: '#/components/parameters/categoryOneOf' | |
692 | - $ref: '#/components/parameters/tagsOneOf' | |
693 | - $ref: '#/components/parameters/tagsAllOf' | |
694 | - $ref: '#/components/parameters/licenceOneOf' | |
695 | - $ref: '#/components/parameters/languageOneOf' | |
696 | - $ref: '#/components/parameters/nsfw' | |
697 | - $ref: '#/components/parameters/filter' | |
698 | - $ref: '#/components/parameters/start' | |
699 | - $ref: '#/components/parameters/count' | |
700 | - $ref: '#/components/parameters/videosSort' | |
701 | responses: | |
702 | '200': | |
703 | description: successful operation | |
704 | content: | |
705 | application/json: | |
706 | schema: | |
707 | $ref: '#/components/schemas/VideoListResponse' | |
708 | /videos/categories: | |
709 | get: | |
710 | summary: Get list of video categories known by the server | |
711 | tags: | |
712 | - Video | |
713 | responses: | |
714 | '200': | |
715 | description: successful operation | |
716 | content: | |
717 | application/json: | |
718 | schema: | |
719 | type: array | |
720 | items: | |
721 | type: string | |
722 | /videos/licences: | |
723 | get: | |
724 | summary: Get list of video licences known by the server | |
725 | tags: | |
726 | - Video | |
727 | responses: | |
728 | '200': | |
729 | description: successful operation | |
730 | content: | |
731 | application/json: | |
732 | schema: | |
733 | type: array | |
734 | items: | |
735 | type: string | |
736 | /videos/languages: | |
737 | get: | |
738 | summary: Get list of languages known by the server | |
739 | tags: | |
740 | - Video | |
741 | responses: | |
742 | '200': | |
743 | description: successful operation | |
744 | content: | |
745 | application/json: | |
746 | schema: | |
747 | type: array | |
748 | items: | |
749 | type: string | |
750 | /videos/privacies: | |
751 | get: | |
752 | summary: Get list of privacy policies supported by the server | |
753 | tags: | |
754 | - Video | |
755 | responses: | |
756 | '200': | |
757 | description: successful operation | |
758 | content: | |
759 | application/json: | |
760 | schema: | |
761 | type: array | |
762 | items: | |
763 | type: string | |
764 | '/videos/{id}': | |
765 | put: | |
766 | summary: Update metadata for a video by its id | |
767 | security: | |
768 | - OAuth2: [] | |
769 | tags: | |
770 | - Video | |
771 | parameters: | |
772 | - $ref: '#/components/parameters/idOrUUID' | |
773 | responses: | |
774 | '204': | |
775 | description: successful operation | |
776 | requestBody: | |
777 | content: | |
778 | multipart/form-data: | |
779 | schema: | |
780 | type: object | |
781 | properties: | |
782 | thumbnailfile: | |
783 | description: Video thumbnail file | |
784 | type: string | |
785 | format: binary | |
786 | previewfile: | |
787 | description: Video preview file | |
788 | type: string | |
789 | format: binary | |
790 | category: | |
791 | description: Video category | |
792 | type: string | |
793 | licence: | |
794 | description: Video licence | |
795 | type: string | |
796 | language: | |
797 | description: Video language | |
798 | type: string | |
799 | description: | |
800 | description: Video description | |
801 | type: string | |
802 | waitTranscoding: | |
803 | description: Whether or not we wait transcoding before publish the video | |
804 | type: string | |
805 | support: | |
806 | description: Text describing how to support the video uploader | |
807 | type: string | |
808 | nsfw: | |
809 | description: Whether or not this video contains sensitive content | |
810 | type: string | |
811 | name: | |
812 | description: Video name | |
813 | type: string | |
814 | tags: | |
815 | description: Video tags (maximum 5 tags each between 2 and 30 characters) | |
816 | type: array | |
817 | minItems: 1 | |
818 | maxItems: 5 | |
819 | items: | |
820 | type: string | |
821 | minLength: 2 | |
822 | maxLength: 30 | |
823 | commentsEnabled: | |
824 | description: Enable or disable comments for this video | |
825 | type: string | |
826 | originallyPublishedAt: | |
827 | description: Date when the content was originally published | |
828 | type: string | |
829 | format: date-time | |
830 | scheduleUpdate: | |
831 | $ref: '#/components/schemas/VideoScheduledUpdate' | |
832 | encoding: | |
833 | thumbnailfile: | |
834 | contentType: image/jpeg | |
835 | previewfile: | |
836 | contentType: image/jpeg | |
837 | get: | |
838 | summary: Get a video by its id | |
839 | tags: | |
840 | - Video | |
841 | parameters: | |
842 | - $ref: '#/components/parameters/idOrUUID' | |
843 | responses: | |
844 | '200': | |
845 | description: successful operation | |
846 | content: | |
847 | application/json: | |
848 | schema: | |
849 | $ref: '#/components/schemas/VideoDetails' | |
850 | delete: | |
851 | summary: Delete a video by its id | |
852 | security: | |
853 | - OAuth2: [] | |
854 | tags: | |
855 | - Video | |
856 | parameters: | |
857 | - $ref: '#/components/parameters/idOrUUID' | |
858 | responses: | |
859 | '204': | |
860 | $ref: '#/paths/~1users~1me/put/responses/204' | |
861 | '/videos/{id}/description': | |
862 | get: | |
863 | summary: Get a video description by its id | |
864 | tags: | |
865 | - Video | |
866 | parameters: | |
867 | - $ref: '#/components/parameters/idOrUUID' | |
868 | responses: | |
869 | '200': | |
870 | description: successful operation | |
871 | content: | |
872 | application/json: | |
873 | schema: | |
874 | type: string | |
875 | '/videos/{id}/views': | |
876 | post: | |
877 | summary: Add a view to the video by its id | |
878 | tags: | |
879 | - Video | |
880 | parameters: | |
881 | - $ref: '#/components/parameters/idOrUUID' | |
882 | responses: | |
883 | '204': | |
884 | $ref: '#/paths/~1users~1me/put/responses/204' | |
885 | '/videos/{id}/watching': | |
886 | put: | |
887 | summary: Set watching progress of a video by its id for a user | |
888 | tags: | |
889 | - Video | |
890 | security: | |
891 | - OAuth2: [] | |
892 | parameters: | |
893 | - $ref: '#/components/parameters/idOrUUID' | |
894 | requestBody: | |
895 | content: | |
896 | application/json: | |
897 | schema: | |
898 | $ref: '#/components/schemas/UserWatchingVideo' | |
899 | required: true | |
900 | responses: | |
901 | '204': | |
902 | $ref: '#/paths/~1users~1me/put/responses/204' | |
903 | /videos/ownership: | |
904 | get: | |
905 | summary: Get list of video ownership changes requests | |
906 | tags: | |
907 | - Video | |
908 | security: | |
909 | - OAuth2: [] | |
910 | responses: | |
911 | '200': | |
912 | description: successful operation | |
913 | '/videos/ownership/{id}/accept': | |
914 | post: | |
915 | summary: Refuse ownership change request for video by its id | |
916 | tags: | |
917 | - Video | |
918 | security: | |
919 | - OAuth2: [] | |
920 | parameters: | |
921 | - $ref: '#/components/parameters/idOrUUID' | |
922 | responses: | |
923 | '204': | |
924 | $ref: '#/paths/~1users~1me/put/responses/204' | |
925 | '/videos/ownership/{id}/refuse': | |
926 | post: | |
927 | summary: Accept ownership change request for video by its id | |
928 | tags: | |
929 | - Video | |
930 | security: | |
931 | - OAuth2: [] | |
932 | parameters: | |
933 | - $ref: '#/components/parameters/idOrUUID' | |
934 | responses: | |
935 | '204': | |
936 | $ref: '#/paths/~1users~1me/put/responses/204' | |
937 | '/videos/{id}/give-ownership': | |
938 | post: | |
939 | summary: Request change of ownership for a video you own, by its id | |
940 | tags: | |
941 | - Video | |
942 | security: | |
943 | - OAuth2: [] | |
944 | parameters: | |
945 | - $ref: '#/components/parameters/idOrUUID' | |
946 | requestBody: | |
947 | required: true | |
948 | content: | |
949 | application/x-www-form-urlencoded: | |
950 | schema: | |
951 | type: object | |
952 | properties: | |
953 | username: | |
954 | type: string | |
955 | required: | |
956 | - username | |
957 | responses: | |
958 | '204': | |
959 | $ref: '#/paths/~1users~1me/put/responses/204' | |
960 | '400': | |
961 | description: 'Changing video ownership to a remote account is not supported yet' | |
962 | /videos/upload: | |
963 | post: | |
964 | summary: Upload a video file with its metadata | |
965 | security: | |
966 | - OAuth2: [] | |
967 | tags: | |
968 | - Video | |
969 | responses: | |
970 | '200': | |
971 | description: successful operation | |
972 | content: | |
973 | application/json: | |
974 | schema: | |
975 | $ref: '#/components/schemas/VideoUploadResponse' | |
976 | requestBody: | |
977 | content: | |
978 | multipart/form-data: | |
979 | schema: | |
980 | type: object | |
981 | properties: | |
982 | videofile: | |
983 | description: Video file | |
984 | type: string | |
985 | format: binary | |
986 | channelId: | |
987 | description: Channel id that will contain this video | |
988 | type: number | |
989 | thumbnailfile: | |
990 | description: Video thumbnail file | |
991 | type: string | |
992 | format: binary | |
993 | previewfile: | |
994 | description: Video preview file | |
995 | type: string | |
996 | format: binary | |
997 | privacy: | |
998 | $ref: '#/components/schemas/VideoPrivacySet' | |
999 | category: | |
1000 | description: Video category | |
1001 | type: string | |
1002 | licence: | |
1003 | description: Video licence | |
1004 | type: string | |
1005 | language: | |
1006 | description: Video language | |
1007 | type: string | |
1008 | description: | |
1009 | description: Video description | |
1010 | type: string | |
1011 | waitTranscoding: | |
1012 | description: Whether or not we wait transcoding before publish the video | |
1013 | type: string | |
1014 | support: | |
1015 | description: Text describing how to support the video uploader | |
1016 | type: string | |
1017 | nsfw: | |
1018 | description: Whether or not this video contains sensitive content | |
1019 | type: string | |
1020 | name: | |
1021 | description: Video name | |
1022 | type: string | |
1023 | tags: | |
1024 | description: Video tags (maximum 5 tags each between 2 and 30 characters) | |
1025 | type: array | |
1026 | minItems: 1 | |
1027 | maxItems: 5 | |
1028 | items: | |
1029 | type: string | |
1030 | minLength: 2 | |
1031 | maxLength: 30 | |
1032 | commentsEnabled: | |
1033 | description: Enable or disable comments for this video | |
1034 | type: string | |
1035 | originallyPublishedAt: | |
1036 | description: Date when the content was originally published | |
1037 | type: string | |
1038 | format: date-time | |
1039 | scheduleUpdate: | |
1040 | $ref: '#/components/schemas/VideoScheduledUpdate' | |
1041 | required: | |
1042 | - videofile | |
1043 | - channelId | |
1044 | - name | |
1045 | encoding: | |
1046 | videofile: | |
1047 | contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream | |
1048 | thumbnailfile: | |
1049 | contentType: image/jpeg | |
1050 | previewfile: | |
1051 | contentType: image/jpeg | |
1052 | x-code-samples: | |
1053 | - lang: Shell | |
1054 | source: | | |
1055 | ## DEPENDENCIES: httpie, jq | |
1056 | # pip install httpie | |
1057 | USERNAME="<your_username>" | |
1058 | PASSWORD="<your_password>" | |
1059 | FILE_PATH="<your_file_path>" | |
1060 | CHANNEL_ID="<your_channel_id>" | |
1061 | NAME="<video_name>" | |
1062 | ||
1063 | API_PATH="https://peertube2.cpy.re/api/v1" | |
1064 | ## AUTH | |
1065 | client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id") | |
1066 | client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret") | |
1067 | token=$(http -b --form POST "$API_PATH/users/token" \ | |
1068 | client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \ | |
1069 | username=$USERNAME \ | |
1070 | password=$PASSWORD \ | |
1071 | | jq -r ".access_token") | |
1072 | ## VIDEO UPLOAD | |
1073 | http -b --form POST "$API_PATH/videos/upload" \ | |
1074 | videofile@$FILE_PATH \ | |
1075 | channelId=$CHANNEL_ID \ | |
1076 | name=$NAME \ | |
1077 | "Authorization:Bearer $token" | |
1078 | /videos/imports: | |
1079 | post: | |
1080 | summary: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator) | |
1081 | security: | |
1082 | - OAuth2: [] | |
1083 | tags: | |
1084 | - Video | |
1085 | responses: | |
1086 | '200': | |
1087 | description: successful operation | |
1088 | content: | |
1089 | application/json: | |
1090 | schema: | |
1091 | $ref: '#/components/schemas/VideoUploadResponse' | |
1092 | requestBody: | |
1093 | content: | |
1094 | multipart/form-data: | |
1095 | schema: | |
1096 | type: object | |
1097 | properties: | |
1098 | torrentfile: | |
1099 | description: Torrent File | |
1100 | type: string | |
1101 | format: binary | |
1102 | targetUrl: | |
1103 | description: HTTP target URL | |
1104 | type: string | |
1105 | magnetUri: | |
1106 | description: Magnet URI | |
1107 | type: string | |
1108 | channelId: | |
1109 | description: Channel id that will contain this video | |
1110 | type: number | |
1111 | thumbnailfile: | |
1112 | description: Video thumbnail file | |
1113 | type: string | |
1114 | format: binary | |
1115 | previewfile: | |
1116 | description: Video preview file | |
1117 | type: string | |
1118 | format: binary | |
1119 | privacy: | |
1120 | $ref: '#/components/schemas/VideoPrivacySet' | |
1121 | category: | |
1122 | description: Video category | |
1123 | type: string | |
1124 | licence: | |
1125 | description: Video licence | |
1126 | type: string | |
1127 | language: | |
1128 | description: Video language | |
1129 | type: string | |
1130 | description: | |
1131 | description: Video description | |
1132 | type: string | |
1133 | waitTranscoding: | |
1134 | description: Whether or not we wait transcoding before publish the video | |
1135 | type: string | |
1136 | support: | |
1137 | description: Text describing how to support the video uploader | |
1138 | type: string | |
1139 | nsfw: | |
1140 | description: Whether or not this video contains sensitive content | |
1141 | type: string | |
1142 | name: | |
1143 | description: Video name | |
1144 | type: string | |
1145 | tags: | |
1146 | description: Video tags (maximum 5 tags each between 2 and 30 characters) | |
1147 | type: array | |
1148 | minItems: 1 | |
1149 | maxItems: 5 | |
1150 | items: | |
1151 | type: string | |
1152 | minLength: 2 | |
1153 | maxLength: 30 | |
1154 | commentsEnabled: | |
1155 | description: Enable or disable comments for this video | |
1156 | type: string | |
1157 | scheduleUpdate: | |
1158 | $ref: '#/components/schemas/VideoScheduledUpdate' | |
1159 | required: | |
1160 | - channelId | |
1161 | - name | |
1162 | encoding: | |
1163 | torrentfile: | |
1164 | contentType: application/x-bittorrent | |
1165 | thumbnailfile: | |
1166 | contentType: image/jpeg | |
1167 | previewfile: | |
1168 | contentType: image/jpeg | |
1169 | /videos/abuse: | |
1170 | get: | |
1171 | summary: Get list of reported video abuses | |
1172 | security: | |
1173 | - OAuth2: [] | |
1174 | tags: | |
1175 | - Video Abuse | |
1176 | parameters: | |
1177 | - $ref: '#/components/parameters/start' | |
1178 | - $ref: '#/components/parameters/count' | |
1179 | - $ref: '#/components/parameters/abusesSort' | |
1180 | responses: | |
1181 | '200': | |
1182 | description: successful operation | |
1183 | content: | |
1184 | application/json: | |
1185 | schema: | |
1186 | type: array | |
1187 | items: | |
1188 | $ref: '#/components/schemas/VideoAbuse' | |
1189 | '/videos/{id}/abuse': | |
1190 | post: | |
1191 | summary: 'Report an abuse, on a video by its id' | |
1192 | security: | |
1193 | - OAuth2: [] | |
1194 | tags: | |
1195 | - Video Abuse | |
1196 | parameters: | |
1197 | - $ref: '#/components/parameters/idOrUUID' | |
1198 | responses: | |
1199 | '204': | |
1200 | $ref: '#/paths/~1users~1me/put/responses/204' | |
1201 | '/videos/{id}/blacklist': | |
1202 | post: | |
1203 | summary: Put on blacklist a video by its id | |
1204 | security: | |
1205 | - OAuth2: | |
1206 | - admin | |
1207 | - moderator | |
1208 | tags: | |
1209 | - Video Blacklist | |
1210 | parameters: | |
1211 | - $ref: '#/components/parameters/idOrUUID' | |
1212 | responses: | |
1213 | '204': | |
1214 | $ref: '#/paths/~1users~1me/put/responses/204' | |
1215 | delete: | |
1216 | summary: Delete an entry of the blacklist of a video by its id | |
1217 | security: | |
1218 | - OAuth2: | |
1219 | - admin | |
1220 | - moderator | |
1221 | tags: | |
1222 | - Video Blacklist | |
1223 | parameters: | |
1224 | - $ref: '#/components/parameters/idOrUUID' | |
1225 | responses: | |
1226 | '204': | |
1227 | $ref: '#/paths/~1users~1me/put/responses/204' | |
1228 | /videos/blacklist: | |
1229 | get: | |
1230 | summary: Get list of videos on blacklist | |
1231 | security: | |
1232 | - OAuth2: | |
1233 | - admin | |
1234 | - moderator | |
1235 | tags: | |
1236 | - Video Blacklist | |
1237 | parameters: | |
1238 | - $ref: '#/components/parameters/start' | |
1239 | - $ref: '#/components/parameters/count' | |
1240 | - $ref: '#/components/parameters/blacklistsSort' | |
1241 | responses: | |
1242 | '200': | |
1243 | description: successful operation | |
1244 | content: | |
1245 | application/json: | |
1246 | schema: | |
1247 | type: array | |
1248 | items: | |
1249 | $ref: '#/components/schemas/VideoBlacklist' | |
1250 | /videos/{id}/captions: | |
1251 | get: | |
1252 | summary: Get list of video's captions | |
1253 | tags: | |
1254 | - Video Caption | |
1255 | parameters: | |
1256 | - $ref: '#/components/parameters/idOrUUID' | |
1257 | responses: | |
1258 | '200': | |
1259 | description: successful operation | |
1260 | content: | |
1261 | application/json: | |
1262 | schema: | |
1263 | type: object | |
1264 | properties: | |
1265 | total: | |
1266 | type: integer | |
1267 | data: | |
1268 | type: array | |
1269 | items: | |
1270 | $ref: '#/components/schemas/VideoCaption' | |
1271 | /videos/{id}/captions/{captionLanguage}: | |
1272 | put: | |
1273 | summary: Add or replace a video caption | |
1274 | tags: | |
1275 | - Video Caption | |
1276 | parameters: | |
1277 | - $ref: '#/components/parameters/idOrUUID' | |
1278 | - $ref: '#/components/parameters/captionLanguage' | |
1279 | requestBody: | |
1280 | content: | |
1281 | multipart/form-data: | |
1282 | schema: | |
1283 | type: object | |
1284 | properties: | |
1285 | captionfile: | |
1286 | description: The file to upload. | |
1287 | type: string | |
1288 | format: binary | |
1289 | encoding: | |
1290 | captionfile: | |
1291 | contentType: text/vtt, application/x-subrip | |
1292 | responses: | |
1293 | '204': | |
1294 | $ref: '#/paths/~1users~1me/put/responses/204' | |
1295 | delete: | |
1296 | summary: Delete a video caption | |
1297 | tags: | |
1298 | - Video Caption | |
1299 | parameters: | |
1300 | - $ref: '#/components/parameters/idOrUUID' | |
1301 | - $ref: '#/components/parameters/captionLanguage' | |
1302 | responses: | |
1303 | '204': | |
1304 | $ref: '#/paths/~1users~1me/put/responses/204' | |
1305 | /video-channels: | |
1306 | get: | |
1307 | summary: Get list of video channels | |
1308 | tags: | |
1309 | - Video Channel | |
1310 | parameters: | |
1311 | - $ref: '#/components/parameters/start' | |
1312 | - $ref: '#/components/parameters/count' | |
1313 | - $ref: '#/components/parameters/sort' | |
1314 | responses: | |
1315 | '200': | |
1316 | description: successful operation | |
1317 | content: | |
1318 | application/json: | |
1319 | schema: | |
1320 | type: array | |
1321 | items: | |
1322 | $ref: '#/components/schemas/VideoChannel' | |
1323 | post: | |
1324 | summary: Creates a video channel for the current user | |
1325 | security: | |
1326 | - OAuth2: [] | |
1327 | tags: | |
1328 | - Video Channel | |
1329 | responses: | |
1330 | '204': | |
1331 | $ref: '#/paths/~1users~1me/put/responses/204' | |
1332 | requestBody: | |
1333 | content: | |
1334 | application/json: | |
1335 | schema: | |
1336 | $ref: '#/components/schemas/VideoChannelCreate' | |
1337 | '/video-channels/{channelHandle}': | |
1338 | get: | |
1339 | summary: Get a video channel by its id | |
1340 | tags: | |
1341 | - Video Channel | |
1342 | parameters: | |
1343 | - $ref: '#/components/parameters/channelHandle' | |
1344 | responses: | |
1345 | '200': | |
1346 | description: successful operation | |
1347 | content: | |
1348 | application/json: | |
1349 | schema: | |
1350 | $ref: '#/components/schemas/VideoChannel' | |
1351 | put: | |
1352 | summary: Update a video channel by its id | |
1353 | security: | |
1354 | - OAuth2: [] | |
1355 | tags: | |
1356 | - Video Channel | |
1357 | parameters: | |
1358 | - $ref: '#/components/parameters/channelHandle' | |
1359 | responses: | |
1360 | '204': | |
1361 | $ref: '#/paths/~1users~1me/put/responses/204' | |
1362 | requestBody: | |
1363 | content: | |
1364 | application/json: | |
1365 | schema: | |
1366 | $ref: '#/components/schemas/VideoChannelUpdate' | |
1367 | delete: | |
1368 | summary: Delete a video channel by its id | |
1369 | security: | |
1370 | - OAuth2: [] | |
1371 | tags: | |
1372 | - Video Channel | |
1373 | parameters: | |
1374 | - $ref: '#/components/parameters/channelHandle' | |
1375 | responses: | |
1376 | '204': | |
1377 | $ref: '#/paths/~1users~1me/put/responses/204' | |
1378 | '/video-channels/{channelHandle}/videos': | |
1379 | get: | |
1380 | summary: Get videos of a video channel by its id | |
1381 | tags: | |
1382 | - Video | |
1383 | - Video Channel | |
1384 | parameters: | |
1385 | - $ref: '#/components/parameters/channelHandle' | |
1386 | responses: | |
1387 | '200': | |
1388 | description: successful operation | |
1389 | content: | |
1390 | application/json: | |
1391 | schema: | |
1392 | $ref: '#/components/schemas/VideoListResponse' | |
1393 | '/accounts/{name}/video-channels': | |
1394 | get: | |
1395 | summary: Get video channels of an account by its name | |
1396 | tags: | |
1397 | - Video Channel | |
1398 | parameters: | |
1399 | - $ref: '#/components/parameters/name' | |
1400 | responses: | |
1401 | '200': | |
1402 | description: successful operation | |
1403 | content: | |
1404 | application/json: | |
1405 | schema: | |
1406 | type: array | |
1407 | items: | |
1408 | $ref: '#/components/schemas/VideoChannel' | |
1409 | '/accounts/{name}/ratings': | |
1410 | get: | |
1411 | summary: Get ratings of an account by its name | |
1412 | security: | |
1413 | - OAuth2: [] | |
1414 | tags: | |
1415 | - User | |
1416 | parameters: | |
1417 | - $ref: '#/components/parameters/name' | |
1418 | - $ref: '#/components/parameters/start' | |
1419 | - $ref: '#/components/parameters/count' | |
1420 | - $ref: '#/components/parameters/sort' | |
1421 | - name: rating | |
1422 | in: query | |
1423 | required: false | |
1424 | description: Optionally filter which ratings to retrieve | |
1425 | schema: | |
1426 | type: string | |
1427 | enum: | |
1428 | - like | |
1429 | - dislike | |
1430 | responses: | |
1431 | '200': | |
1432 | description: successful operation | |
1433 | content: | |
1434 | application/json: | |
1435 | schema: | |
1436 | type: array | |
1437 | items: | |
1438 | $ref: '#/components/schemas/VideoRating' | |
1439 | '/videos/{id}/comment-threads': | |
1440 | get: | |
1441 | summary: Get the comment threads of a video by its id | |
1442 | tags: | |
1443 | - Video Comment | |
1444 | parameters: | |
1445 | - $ref: '#/components/parameters/idOrUUID' | |
1446 | - $ref: '#/components/parameters/start' | |
1447 | - $ref: '#/components/parameters/count' | |
1448 | - $ref: '#/components/parameters/sort' | |
1449 | responses: | |
1450 | '200': | |
1451 | description: successful operation | |
1452 | content: | |
1453 | application/json: | |
1454 | schema: | |
1455 | $ref: '#/components/schemas/CommentThreadResponse' | |
1456 | post: | |
1457 | summary: 'Creates a comment thread, on a video by its id' | |
1458 | security: | |
1459 | - OAuth2: [] | |
1460 | tags: | |
1461 | - Video Comment | |
1462 | parameters: | |
1463 | - $ref: '#/components/parameters/idOrUUID' | |
1464 | responses: | |
1465 | '200': | |
1466 | description: successful operation | |
1467 | content: | |
1468 | application/json: | |
1469 | schema: | |
1470 | $ref: '#/components/schemas/CommentThreadPostResponse' | |
1471 | '/videos/{id}/comment-threads/{threadId}': | |
1472 | get: | |
1473 | summary: 'Get the comment thread by its id, of a video by its id' | |
1474 | tags: | |
1475 | - Video Comment | |
1476 | parameters: | |
1477 | - $ref: '#/components/parameters/idOrUUID' | |
1478 | - $ref: '#/components/parameters/threadId' | |
1479 | responses: | |
1480 | '200': | |
1481 | description: successful operation | |
1482 | content: | |
1483 | application/json: | |
1484 | schema: | |
1485 | $ref: '#/components/schemas/VideoCommentThreadTree' | |
1486 | '/videos/{id}/comments/{commentId}': | |
1487 | post: | |
1488 | summary: 'Creates a comment in a comment thread by its id, of a video by its id' | |
1489 | security: | |
1490 | - OAuth2: [] | |
1491 | tags: | |
1492 | - Video Comment | |
1493 | parameters: | |
1494 | - $ref: '#/components/parameters/idOrUUID' | |
1495 | - $ref: '#/components/parameters/commentId' | |
1496 | responses: | |
1497 | '200': | |
1498 | description: successful operation | |
1499 | content: | |
1500 | application/json: | |
1501 | schema: | |
1502 | $ref: '#/components/schemas/CommentThreadPostResponse' | |
1503 | delete: | |
1504 | summary: 'Delete a comment in a comment thread by its id, of a video by its id' | |
1505 | security: | |
1506 | - OAuth2: [] | |
1507 | tags: | |
1508 | - Video Comment | |
1509 | parameters: | |
1510 | - $ref: '#/components/parameters/idOrUUID' | |
1511 | - $ref: '#/components/parameters/commentId' | |
1512 | responses: | |
1513 | '204': | |
1514 | $ref: '#/paths/~1users~1me/put/responses/204' | |
1515 | '/videos/{id}/rate': | |
1516 | put: | |
1517 | summary: Vote for a video by its id | |
1518 | security: | |
1519 | - OAuth2: [] | |
1520 | tags: | |
1521 | - Video Rate | |
1522 | parameters: | |
1523 | - $ref: '#/components/parameters/idOrUUID' | |
1524 | responses: | |
1525 | '204': | |
1526 | $ref: '#/paths/~1users~1me/put/responses/204' | |
1527 | /search/videos: | |
1528 | get: | |
1529 | tags: | |
1530 | - Search | |
1531 | summary: Get the videos corresponding to a given query | |
1532 | parameters: | |
1533 | - $ref: '#/components/parameters/start' | |
1534 | - $ref: '#/components/parameters/count' | |
1535 | - $ref: '#/components/parameters/videosSearchSort' | |
1536 | - name: search | |
1537 | in: query | |
1538 | required: true | |
1539 | description: String to search | |
1540 | schema: | |
1541 | type: string | |
1542 | responses: | |
1543 | '200': | |
1544 | description: successful operation | |
1545 | content: | |
1546 | application/json: | |
1547 | schema: | |
1548 | $ref: '#/components/schemas/VideoListResponse' | |
1549 | servers: | |
1550 | - url: 'https://peertube.cpy.re/api/v1' | |
1551 | description: Live Test Server (live data - stable version) | |
1552 | - url: 'https://peertube2.cpy.re/api/v1' | |
1553 | description: Live Test Server (live data - bleeding edge version) | |
1554 | - url: 'https://peertube3.cpy.re/api/v1' | |
1555 | description: Live Test Server (live data - bleeding edge version) | |
1556 | components: | |
1557 | parameters: | |
1558 | start: | |
1559 | name: start | |
1560 | in: query | |
1561 | required: false | |
1562 | description: Offset | |
1563 | schema: | |
1564 | type: number | |
1565 | count: | |
1566 | name: count | |
1567 | in: query | |
1568 | required: false | |
1569 | description: Number of items | |
1570 | schema: | |
1571 | type: number | |
1572 | sort: | |
1573 | name: sort | |
1574 | in: query | |
1575 | required: false | |
1576 | description: Sort column (-createdAt for example) | |
1577 | schema: | |
1578 | type: string | |
1579 | videosSort: | |
1580 | name: sort | |
1581 | in: query | |
1582 | required: false | |
1583 | description: Sort videos by criteria | |
1584 | schema: | |
1585 | type: string | |
1586 | enum: | |
1587 | - -name | |
1588 | - -duration | |
1589 | - -createdAt | |
1590 | - -publishedAt | |
1591 | - -views | |
1592 | - -likes | |
1593 | - -trending | |
1594 | videosSearchSort: | |
1595 | name: sort | |
1596 | in: query | |
1597 | required: false | |
1598 | description: Sort videos by criteria | |
1599 | schema: | |
1600 | type: string | |
1601 | enum: | |
1602 | - -name | |
1603 | - -duration | |
1604 | - -createdAt | |
1605 | - -publishedAt | |
1606 | - -views | |
1607 | - -likes | |
1608 | - -match | |
1609 | blacklistsSort: | |
1610 | name: sort | |
1611 | in: query | |
1612 | required: false | |
1613 | description: Sort blacklists by criteria | |
1614 | schema: | |
1615 | type: string | |
1616 | enum: | |
1617 | - -id | |
1618 | - -name | |
1619 | - -duration | |
1620 | - -views | |
1621 | - -likes | |
1622 | - -dislikes | |
1623 | - -uuid | |
1624 | - -createdAt | |
1625 | usersSort: | |
1626 | name: sort | |
1627 | in: query | |
1628 | required: false | |
1629 | description: Sort users by criteria | |
1630 | schema: | |
1631 | type: string | |
1632 | enum: | |
1633 | - -id | |
1634 | - -username | |
1635 | - -createdAt | |
1636 | abusesSort: | |
1637 | name: sort | |
1638 | in: query | |
1639 | required: false | |
1640 | description: Sort abuses by criteria | |
1641 | schema: | |
1642 | type: string | |
1643 | enum: | |
1644 | - -id | |
1645 | - -createdAt | |
1646 | - -state | |
1647 | name: | |
1648 | name: name | |
1649 | in: path | |
1650 | required: true | |
1651 | description: >- | |
1652 | The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for | |
1653 | example) | |
1654 | schema: | |
1655 | type: string | |
1656 | id: | |
1657 | name: id | |
1658 | in: path | |
1659 | required: true | |
1660 | description: The user id | |
1661 | schema: | |
1662 | type: number | |
1663 | idOrUUID: | |
1664 | name: id | |
1665 | in: path | |
1666 | required: true | |
1667 | description: The video id or uuid | |
1668 | schema: | |
1669 | type: string | |
1670 | captionLanguage: | |
1671 | name: captionLanguage | |
1672 | in: path | |
1673 | required: true | |
1674 | description: The caption language | |
1675 | schema: | |
1676 | type: string | |
1677 | channelHandle: | |
1678 | name: channelHandle | |
1679 | in: path | |
1680 | required: true | |
1681 | description: "The video channel handle (example: 'my_username@example.com' or 'my_username')" | |
1682 | schema: | |
1683 | type: string | |
1684 | subscriptionHandle: | |
1685 | name: subscriptionHandle | |
1686 | in: path | |
1687 | required: true | |
1688 | description: "The subscription handle (example: 'my_username@example.com' or 'my_username')" | |
1689 | schema: | |
1690 | type: string | |
1691 | threadId: | |
1692 | name: threadId | |
1693 | in: path | |
1694 | required: true | |
1695 | description: The thread id (root comment id) | |
1696 | schema: | |
1697 | type: number | |
1698 | commentId: | |
1699 | name: commentId | |
1700 | in: path | |
1701 | required: true | |
1702 | description: The comment id | |
1703 | schema: | |
1704 | type: number | |
1705 | categoryOneOf: | |
1706 | name: categoryOneOf | |
1707 | in: query | |
1708 | required: false | |
1709 | description: category id of the video | |
1710 | schema: | |
1711 | oneOf: | |
1712 | - type: number | |
1713 | - type: array | |
1714 | items: | |
1715 | type: number | |
1716 | style: form | |
1717 | explode: false | |
1718 | tagsOneOf: | |
1719 | name: tagsOneOf | |
1720 | in: query | |
1721 | required: false | |
1722 | description: tag(s) of the video | |
1723 | schema: | |
1724 | oneOf: | |
1725 | - type: string | |
1726 | - type: array | |
1727 | items: | |
1728 | type: string | |
1729 | style: form | |
1730 | explode: false | |
1731 | tagsAllOf: | |
1732 | name: tagsAllOf | |
1733 | in: query | |
1734 | required: false | |
1735 | description: tag(s) of the video, where all should be present in the video | |
1736 | schema: | |
1737 | oneOf: | |
1738 | - type: string | |
1739 | - type: array | |
1740 | items: | |
1741 | type: string | |
1742 | style: form | |
1743 | explode: false | |
1744 | languageOneOf: | |
1745 | name: languageOneOf | |
1746 | in: query | |
1747 | required: false | |
1748 | description: language id of the video | |
1749 | schema: | |
1750 | oneOf: | |
1751 | - type: string | |
1752 | - type: array | |
1753 | items: | |
1754 | type: string | |
1755 | style: form | |
1756 | explode: false | |
1757 | licenceOneOf: | |
1758 | name: licenceOneOf | |
1759 | in: query | |
1760 | required: false | |
1761 | description: licence id of the video | |
1762 | schema: | |
1763 | oneOf: | |
1764 | - type: number | |
1765 | - type: array | |
1766 | items: | |
1767 | type: number | |
1768 | style: form | |
1769 | explode: false | |
1770 | nsfw: | |
1771 | name: nsfw | |
1772 | in: query | |
1773 | required: false | |
1774 | description: whether to include nsfw videos, if any | |
1775 | schema: | |
1776 | type: string | |
1777 | enum: | |
1778 | - 'true' | |
1779 | - 'false' | |
1780 | filter: | |
1781 | name: filter | |
1782 | in: query | |
1783 | required: false | |
1784 | description: > | |
1785 | Special filters (local for instance) which might require special rights: | |
1786 | * `local` - only videos local to the instance | |
1787 | * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges) | |
1788 | schema: | |
1789 | type: string | |
1790 | enum: | |
1791 | - local | |
1792 | - all-local | |
1793 | subscriptionsUris: | |
1794 | name: uris | |
1795 | in: query | |
1796 | required: true | |
1797 | description: list of uris to check if each is part of the user subscriptions | |
1798 | schema: | |
1799 | type: array | |
1800 | items: | |
1801 | type: string | |
1802 | securitySchemes: | |
1803 | OAuth2: | |
1804 | description: > | |
1805 | In the header: *Authorization: Bearer <token\>* | |
1806 | ||
1807 | ||
1808 | Authenticating via OAuth requires the following steps: | |
1809 | ||
1810 | ||
1811 | - Have an account with sufficient authorization levels | |
1812 | ||
1813 | - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a | |
1814 | Bearer Token | |
1815 | ||
1816 | - Make Authenticated Requests | |
1817 | type: oauth2 | |
1818 | flows: | |
1819 | password: | |
1820 | tokenUrl: 'https://peertube.example.com/api/v1/users/token' | |
1821 | scopes: | |
1822 | admin: Admin scope | |
1823 | moderator: Moderator scope | |
1824 | user: User scope | |
1825 | schemas: | |
1826 | VideoConstantNumber: | |
1827 | properties: | |
1828 | id: | |
1829 | type: number | |
1830 | label: | |
1831 | type: string | |
1832 | VideoConstantString: | |
1833 | properties: | |
1834 | id: | |
1835 | type: string | |
1836 | label: | |
1837 | type: string | |
1838 | VideoPrivacySet: | |
1839 | type: integer | |
1840 | enum: | |
1841 | - 1 | |
1842 | - 2 | |
1843 | - 3 | |
1844 | description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3)' | |
1845 | VideoPrivacyConstant: | |
1846 | properties: | |
1847 | id: | |
1848 | type: integer | |
1849 | enum: | |
1850 | - 1 | |
1851 | - 2 | |
1852 | - 3 | |
1853 | label: | |
1854 | type: string | |
1855 | VideoStateConstant: | |
1856 | properties: | |
1857 | id: | |
1858 | type: integer | |
1859 | enum: | |
1860 | - 1 | |
1861 | - 2 | |
1862 | - 3 | |
1863 | description: 'The video state (Published = 1, to transcode = 2, to import = 3)' | |
1864 | label: | |
1865 | type: string | |
1866 | VideoResolutionConstant: | |
1867 | properties: | |
1868 | id: | |
1869 | type: integer | |
1870 | description: 'Video resolution (240, 360, 720 ...)' | |
1871 | label: | |
1872 | type: string | |
1873 | VideoScheduledUpdate: | |
1874 | properties: | |
1875 | privacy: | |
1876 | $ref: '#/components/schemas/VideoPrivacySet' | |
1877 | description: Video privacy target | |
1878 | updateAt: | |
1879 | type: string | |
1880 | format: date | |
1881 | description: When to update the video | |
1882 | required: | |
1883 | - updateAt | |
1884 | VideoAccountSummary: | |
1885 | properties: | |
1886 | id: | |
1887 | type: number | |
1888 | name: | |
1889 | type: string | |
1890 | displayName: | |
1891 | type: string | |
1892 | url: | |
1893 | type: string | |
1894 | host: | |
1895 | type: string | |
1896 | avatar: | |
1897 | nullable: true | |
1898 | $ref: '#/components/schemas/Avatar' | |
1899 | VideoChannelSummary: | |
1900 | properties: | |
1901 | id: | |
1902 | type: number | |
1903 | name: | |
1904 | type: string | |
1905 | displayName: | |
1906 | type: string | |
1907 | url: | |
1908 | type: string | |
1909 | host: | |
1910 | type: string | |
1911 | avatar: | |
1912 | nullable: true | |
1913 | $ref: '#/components/schemas/Avatar' | |
1914 | PlaylistElement: | |
1915 | properties: | |
1916 | position: | |
1917 | type: number | |
1918 | startTimestamp: | |
1919 | type: number | |
1920 | stopTimestamp: | |
1921 | type: number | |
1922 | video: | |
1923 | nullable: true | |
1924 | $ref: '#/components/schemas/Video' | |
1925 | VideoFile: | |
1926 | properties: | |
1927 | magnetUri: | |
1928 | type: string | |
1929 | resolution: | |
1930 | $ref: '#/components/schemas/VideoResolutionConstant' | |
1931 | size: | |
1932 | type: number | |
1933 | description: 'Video file size in bytes' | |
1934 | torrentUrl: | |
1935 | type: string | |
1936 | torrentDownloadUrl: | |
1937 | type: string | |
1938 | fileUrl: | |
1939 | type: string | |
1940 | fileDownloadUrl: | |
1941 | type: string | |
1942 | fps: | |
1943 | type: number | |
1944 | VideoStreamingPlaylists: | |
1945 | properties: | |
1946 | id: | |
1947 | type: number | |
1948 | type: | |
1949 | type: number | |
1950 | enum: | |
1951 | - 1 | |
1952 | description: 'Playlist type (HLS = 1)' | |
1953 | playlistUrl: | |
1954 | type: string | |
1955 | segmentsSha256Url: | |
1956 | type: string | |
1957 | redundancies: | |
1958 | type: array | |
1959 | items: | |
1960 | type: object | |
1961 | properties: | |
1962 | baseUrl: | |
1963 | type: string | |
1964 | Video: | |
1965 | properties: | |
1966 | id: | |
1967 | type: number | |
1968 | uuid: | |
1969 | type: string | |
1970 | createdAt: | |
1971 | type: string | |
1972 | publishedAt: | |
1973 | type: string | |
1974 | updatedAt: | |
1975 | type: string | |
1976 | originallyPublishedAt: | |
1977 | type: string | |
1978 | category: | |
1979 | $ref: '#/components/schemas/VideoConstantNumber' | |
1980 | licence: | |
1981 | $ref: '#/components/schemas/VideoConstantNumber' | |
1982 | language: | |
1983 | $ref: '#/components/schemas/VideoConstantString' | |
1984 | privacy: | |
1985 | $ref: '#/components/schemas/VideoPrivacyConstant' | |
1986 | description: | |
1987 | type: string | |
1988 | duration: | |
1989 | type: number | |
1990 | isLocal: | |
1991 | type: boolean | |
1992 | name: | |
1993 | type: string | |
1994 | thumbnailPath: | |
1995 | type: string | |
1996 | previewPath: | |
1997 | type: string | |
1998 | embedPath: | |
1999 | type: string | |
2000 | views: | |
2001 | type: number | |
2002 | likes: | |
2003 | type: number | |
2004 | dislikes: | |
2005 | type: number | |
2006 | nsfw: | |
2007 | type: boolean | |
2008 | waitTranscoding: | |
2009 | type: boolean | |
2010 | nullable: true | |
2011 | state: | |
2012 | $ref: '#/components/schemas/VideoStateConstant' | |
2013 | scheduledUpdate: | |
2014 | nullable: true | |
2015 | $ref: '#/components/schemas/VideoScheduledUpdate' | |
2016 | blacklisted: | |
2017 | nullable: true | |
2018 | type: boolean | |
2019 | blacklistedReason: | |
2020 | nullable: true | |
2021 | type: string | |
2022 | account: | |
2023 | $ref: '#/components/schemas/VideoAccountSummary' | |
2024 | channel: | |
2025 | $ref: '#/components/schemas/VideoChannelSummary' | |
2026 | userHistory: | |
2027 | nullable: true | |
2028 | type: object | |
2029 | properties: | |
2030 | currentTime: | |
2031 | type: number | |
2032 | VideoDetails: | |
2033 | allOf: | |
2034 | - $ref: '#/components/schemas/Video' | |
2035 | - type: object | |
2036 | properties: | |
2037 | descriptionPath: | |
2038 | type: string | |
2039 | support: | |
2040 | type: string | |
2041 | channel: | |
2042 | $ref: '#/components/schemas/VideoChannel' | |
2043 | account: | |
2044 | $ref: '#/components/schemas/Account' | |
2045 | tags: | |
2046 | type: array | |
2047 | items: | |
2048 | type: string | |
2049 | files: | |
2050 | type: array | |
2051 | items: | |
2052 | $ref: '#/components/schemas/VideoFile' | |
2053 | commentsEnabled: | |
2054 | type: boolean | |
2055 | downloadEnabled: | |
2056 | type: boolean | |
2057 | trackerUrls: | |
2058 | type: array | |
2059 | items: | |
2060 | type: string | |
2061 | streamingPlaylists: | |
2062 | type: array | |
2063 | items: | |
2064 | $ref: '#/components/schemas/VideoStreamingPlaylists' | |
2065 | VideoImportStateConstant: | |
2066 | properties: | |
2067 | id: | |
2068 | type: integer | |
2069 | enum: | |
2070 | - 1 | |
2071 | - 2 | |
2072 | - 3 | |
2073 | description: 'The video import state (Pending = 1, Success = 2, Failed = 3)' | |
2074 | label: | |
2075 | type: string | |
2076 | VideoImport: | |
2077 | properties: | |
2078 | id: | |
2079 | type: number | |
2080 | targetUrl: | |
2081 | type: string | |
2082 | magnetUri: | |
2083 | type: string | |
2084 | torrentName: | |
2085 | type: string | |
2086 | state: | |
2087 | type: object | |
2088 | properties: | |
2089 | id: | |
2090 | $ref: '#/components/schemas/VideoImportStateConstant' | |
2091 | label: | |
2092 | type: string | |
2093 | error: | |
2094 | type: string | |
2095 | createdAt: | |
2096 | type: string | |
2097 | updatedAt: | |
2098 | type: string | |
2099 | video: | |
2100 | $ref: '#/components/schemas/Video' | |
2101 | VideoAbuse: | |
2102 | properties: | |
2103 | id: | |
2104 | type: number | |
2105 | reason: | |
2106 | type: string | |
2107 | reporterAccount: | |
2108 | $ref: '#/components/schemas/Account' | |
2109 | video: | |
2110 | type: object | |
2111 | properties: | |
2112 | id: | |
2113 | type: number | |
2114 | name: | |
2115 | type: string | |
2116 | uuid: | |
2117 | type: string | |
2118 | url: | |
2119 | type: string | |
2120 | createdAt: | |
2121 | type: string | |
2122 | VideoBlacklist: | |
2123 | properties: | |
2124 | id: | |
2125 | type: number | |
2126 | videoId: | |
2127 | type: number | |
2128 | createdAt: | |
2129 | type: string | |
2130 | updatedAt: | |
2131 | type: string | |
2132 | name: | |
2133 | type: string | |
2134 | uuid: | |
2135 | type: string | |
2136 | description: | |
2137 | type: string | |
2138 | duration: | |
2139 | type: number | |
2140 | views: | |
2141 | type: number | |
2142 | likes: | |
2143 | type: number | |
2144 | dislikes: | |
2145 | type: number | |
2146 | nsfw: | |
2147 | type: boolean | |
2148 | VideoChannel: | |
2149 | properties: | |
2150 | displayName: | |
2151 | type: string | |
2152 | description: | |
2153 | type: string | |
2154 | isLocal: | |
2155 | type: boolean | |
2156 | ownerAccount: | |
2157 | type: object | |
2158 | properties: | |
2159 | id: | |
2160 | type: number | |
2161 | uuid: | |
2162 | type: string | |
2163 | VideoComment: | |
2164 | properties: | |
2165 | id: | |
2166 | type: number | |
2167 | url: | |
2168 | type: string | |
2169 | text: | |
2170 | type: string | |
2171 | threadId: | |
2172 | type: number | |
2173 | inReplyToCommentId: | |
2174 | type: number | |
2175 | videoId: | |
2176 | type: number | |
2177 | createdAt: | |
2178 | type: string | |
2179 | updatedAt: | |
2180 | type: string | |
2181 | totalReplies: | |
2182 | type: number | |
2183 | account: | |
2184 | $ref: '#/components/schemas/Account' | |
2185 | VideoCommentThreadTree: | |
2186 | properties: | |
2187 | comment: | |
2188 | $ref: '#/components/schemas/VideoComment' | |
2189 | children: | |
2190 | type: array | |
2191 | items: | |
2192 | $ref: '#/components/schemas/VideoCommentThreadTree' | |
2193 | VideoCaption: | |
2194 | properties: | |
2195 | language: | |
2196 | $ref: '#/components/schemas/VideoConstantString' | |
2197 | captionPath: | |
2198 | type: string | |
2199 | Avatar: | |
2200 | properties: | |
2201 | path: | |
2202 | type: string | |
2203 | createdAt: | |
2204 | type: string | |
2205 | updatedAt: | |
2206 | type: string | |
2207 | Actor: | |
2208 | properties: | |
2209 | id: | |
2210 | type: number | |
2211 | url: | |
2212 | type: string | |
2213 | name: | |
2214 | type: string | |
2215 | host: | |
2216 | type: string | |
2217 | followingCount: | |
2218 | type: number | |
2219 | followersCount: | |
2220 | type: number | |
2221 | createdAt: | |
2222 | type: string | |
2223 | updatedAt: | |
2224 | type: string | |
2225 | avatar: | |
2226 | $ref: '#/components/schemas/Avatar' | |
2227 | Account: | |
2228 | allOf: | |
2229 | - $ref: '#/components/schemas/Actor' | |
2230 | - properties: | |
2231 | userId: | |
2232 | type: string | |
2233 | displayName: | |
2234 | type: string | |
2235 | description: | |
2236 | type: string | |
2237 | User: | |
2238 | properties: | |
2239 | id: | |
2240 | type: number | |
2241 | username: | |
2242 | type: string | |
2243 | email: | |
2244 | type: string | |
2245 | displayNSFW: | |
2246 | type: boolean | |
2247 | autoPlayVideo: | |
2248 | type: boolean | |
2249 | role: | |
2250 | type: integer | |
2251 | enum: | |
2252 | - 0 | |
2253 | - 1 | |
2254 | - 2 | |
2255 | description: 'The user role (Admin = 0, Moderator = 1, User = 2)' | |
2256 | roleLabel: | |
2257 | type: string | |
2258 | enum: | |
2259 | - User | |
2260 | - Moderator | |
2261 | - Administrator | |
2262 | videoQuota: | |
2263 | type: number | |
2264 | videoQuotaDaily: | |
2265 | type: number | |
2266 | createdAt: | |
2267 | type: string | |
2268 | account: | |
2269 | $ref: '#/components/schemas/Account' | |
2270 | videoChannels: | |
2271 | type: array | |
2272 | items: | |
2273 | $ref: '#/components/schemas/VideoChannel' | |
2274 | UserWatchingVideo: | |
2275 | properties: | |
2276 | currentTime: | |
2277 | type: number | |
2278 | ServerConfig: | |
2279 | properties: | |
2280 | instance: | |
2281 | type: object | |
2282 | properties: | |
2283 | name: | |
2284 | type: string | |
2285 | shortDescription: | |
2286 | type: string | |
2287 | defaultClientRoute: | |
2288 | type: string | |
2289 | isNSFW: | |
2290 | type: boolean | |
2291 | defaultNSFWPolicy: | |
2292 | type: string | |
2293 | customizations: | |
2294 | type: object | |
2295 | properties: | |
2296 | javascript: | |
2297 | type: string | |
2298 | css: | |
2299 | type: string | |
2300 | plugin: | |
2301 | type: object | |
2302 | properties: | |
2303 | registered: | |
2304 | type: array | |
2305 | items: | |
2306 | type: string | |
2307 | theme: | |
2308 | type: object | |
2309 | properties: | |
2310 | registered: | |
2311 | type: array | |
2312 | items: | |
2313 | type: string | |
2314 | email: | |
2315 | type: object | |
2316 | properties: | |
2317 | enabled: | |
2318 | type: boolean | |
2319 | contactForm: | |
2320 | type: object | |
2321 | properties: | |
2322 | enabled: | |
2323 | type: boolean | |
2324 | serverVersion: | |
2325 | type: string | |
2326 | serverCommit: | |
2327 | type: string | |
2328 | signup: | |
2329 | type: object | |
2330 | properties: | |
2331 | allowed: | |
2332 | type: boolean | |
2333 | allowedForCurrentIP: | |
2334 | type: boolean | |
2335 | requiresEmailVerification: | |
2336 | type: boolean | |
2337 | transcoding: | |
2338 | type: object | |
2339 | properties: | |
2340 | hls: | |
2341 | type: object | |
2342 | properties: | |
2343 | enabled: | |
2344 | type: boolean | |
2345 | enabledResolutions: | |
2346 | type: array | |
2347 | items: | |
2348 | type: number | |
2349 | import: | |
2350 | type: object | |
2351 | properties: | |
2352 | videos: | |
2353 | type: object | |
2354 | properties: | |
2355 | http: | |
2356 | type: object | |
2357 | properties: | |
2358 | enabled: | |
2359 | type: boolean | |
2360 | torrent: | |
2361 | type: object | |
2362 | properties: | |
2363 | enabled: | |
2364 | type: boolean | |
2365 | autoBlacklist: | |
2366 | type: object | |
2367 | properties: | |
2368 | videos: | |
2369 | type: object | |
2370 | properties: | |
2371 | ofUsers: | |
2372 | type: object | |
2373 | properties: | |
2374 | enabled: | |
2375 | type: boolean | |
2376 | avatar: | |
2377 | type: object | |
2378 | properties: | |
2379 | file: | |
2380 | type: object | |
2381 | properties: | |
2382 | size: | |
2383 | type: object | |
2384 | properties: | |
2385 | max: | |
2386 | type: number | |
2387 | extensions: | |
2388 | type: array | |
2389 | items: | |
2390 | type: string | |
2391 | video: | |
2392 | type: object | |
2393 | properties: | |
2394 | image: | |
2395 | type: object | |
2396 | properties: | |
2397 | extensions: | |
2398 | type: array | |
2399 | items: | |
2400 | type: string | |
2401 | size: | |
2402 | type: object | |
2403 | properties: | |
2404 | max: | |
2405 | type: number | |
2406 | file: | |
2407 | type: object | |
2408 | properties: | |
2409 | extensions: | |
2410 | type: array | |
2411 | items: | |
2412 | type: string | |
2413 | videoCaption: | |
2414 | type: object | |
2415 | properties: | |
2416 | file: | |
2417 | type: object | |
2418 | properties: | |
2419 | size: | |
2420 | type: object | |
2421 | properties: | |
2422 | max: | |
2423 | type: number | |
2424 | extensions: | |
2425 | type: array | |
2426 | items: | |
2427 | type: string | |
2428 | user: | |
2429 | type: object | |
2430 | properties: | |
2431 | videoQuota: | |
2432 | type: number | |
2433 | videoQuotaDaily: | |
2434 | type: number | |
2435 | trending: | |
2436 | type: object | |
2437 | properties: | |
2438 | videos: | |
2439 | type: object | |
2440 | properties: | |
2441 | intervalDays: | |
2442 | type: number | |
2443 | tracker: | |
2444 | type: object | |
2445 | properties: | |
2446 | enabled: | |
2447 | type: boolean | |
2448 | ServerConfigAbout: | |
2449 | properties: | |
2450 | instance: | |
2451 | type: object | |
2452 | properties: | |
2453 | name: | |
2454 | type: string | |
2455 | shortDescription: | |
2456 | type: string | |
2457 | description: | |
2458 | type: string | |
2459 | terms: | |
2460 | type: string | |
2461 | ServerConfigCustom: | |
2462 | properties: | |
2463 | instance: | |
2464 | type: object | |
2465 | properties: | |
2466 | name: | |
2467 | type: string | |
2468 | shortDescription: | |
2469 | type: string | |
2470 | description: | |
2471 | type: string | |
2472 | terms: | |
2473 | type: string | |
2474 | defaultClientRoute: | |
2475 | type: string | |
2476 | isNSFW: | |
2477 | type: boolean | |
2478 | defaultNSFWPolicy: | |
2479 | type: string | |
2480 | customizations: | |
2481 | type: object | |
2482 | properties: | |
2483 | javascript: | |
2484 | type: string | |
2485 | css: | |
2486 | type: string | |
2487 | theme: | |
2488 | type: object | |
2489 | properties: | |
2490 | default: | |
2491 | type: string | |
2492 | services: | |
2493 | type: object | |
2494 | properties: | |
2495 | twitter: | |
2496 | type: object | |
2497 | properties: | |
2498 | username: | |
2499 | type: string | |
2500 | whitelisted: | |
2501 | type: boolean | |
2502 | cache: | |
2503 | type: object | |
2504 | properties: | |
2505 | previews: | |
2506 | type: object | |
2507 | properties: | |
2508 | size: | |
2509 | type: number | |
2510 | captions: | |
2511 | type: object | |
2512 | properties: | |
2513 | size: | |
2514 | type: number | |
2515 | signup: | |
2516 | type: object | |
2517 | properties: | |
2518 | enabled: | |
2519 | type: boolean | |
2520 | limit: | |
2521 | type: number | |
2522 | requiresEmailVerification: | |
2523 | type: boolean | |
2524 | admin: | |
2525 | type: object | |
2526 | properties: | |
2527 | email: | |
2528 | type: string | |
2529 | contactForm: | |
2530 | type: object | |
2531 | properties: | |
2532 | enabled: | |
2533 | type: boolean | |
2534 | user: | |
2535 | type: object | |
2536 | properties: | |
2537 | videoQuota: | |
2538 | type: number | |
2539 | videoQuotaDaily: | |
2540 | type: number | |
2541 | transcoding: | |
2542 | type: object | |
2543 | properties: | |
2544 | enabled: | |
2545 | type: boolean | |
2546 | allowAdditionalExtensions: | |
2547 | type: boolean | |
2548 | allowAudioFiles: | |
2549 | type: boolean | |
2550 | threads: | |
2551 | type: number | |
2552 | resolutions: | |
2553 | type: object | |
2554 | properties: | |
2555 | 240p: | |
2556 | type: boolean | |
2557 | 360p: | |
2558 | type: boolean | |
2559 | 480p: | |
2560 | type: boolean | |
2561 | 720p: | |
2562 | type: boolean | |
2563 | 1080p: | |
2564 | type: boolean | |
2565 | 2160p: | |
2566 | type: boolean | |
2567 | hls: | |
2568 | type: object | |
2569 | properties: | |
2570 | enabled: | |
2571 | type: boolean | |
2572 | import: | |
2573 | type: object | |
2574 | properties: | |
2575 | videos: | |
2576 | type: object | |
2577 | properties: | |
2578 | http: | |
2579 | type: object | |
2580 | properties: | |
2581 | enabled: | |
2582 | type: boolean | |
2583 | torrent: | |
2584 | type: object | |
2585 | properties: | |
2586 | enabled: | |
2587 | type: boolean | |
2588 | autoBlacklist: | |
2589 | type: object | |
2590 | properties: | |
2591 | videos: | |
2592 | type: object | |
2593 | properties: | |
2594 | ofUsers: | |
2595 | type: object | |
2596 | properties: | |
2597 | enabled: | |
2598 | type: boolean | |
2599 | followers: | |
2600 | type: object | |
2601 | properties: | |
2602 | instance: | |
2603 | type: object | |
2604 | properties: | |
2605 | enabled: | |
2606 | type: boolean | |
2607 | manualApproval: | |
2608 | type: boolean | |
2609 | Follow: | |
2610 | properties: | |
2611 | id: | |
2612 | type: number | |
2613 | follower: | |
2614 | $ref: '#/components/schemas/Actor' | |
2615 | following: | |
2616 | $ref: '#/components/schemas/Actor' | |
2617 | score: | |
2618 | type: number | |
2619 | state: | |
2620 | type: string | |
2621 | enum: | |
2622 | - pending | |
2623 | - accepted | |
2624 | createdAt: | |
2625 | type: string | |
2626 | updatedAt: | |
2627 | type: string | |
2628 | Job: | |
2629 | properties: | |
2630 | id: | |
2631 | type: number | |
2632 | state: | |
2633 | type: string | |
2634 | enum: | |
2635 | - pending | |
2636 | - processing | |
2637 | - error | |
2638 | - success | |
2639 | category: | |
2640 | type: string | |
2641 | enum: | |
2642 | - transcoding | |
2643 | - activitypub-http | |
2644 | handlerName: | |
2645 | type: string | |
2646 | handlerInputData: | |
2647 | type: string | |
2648 | createdAt: | |
2649 | type: string | |
2650 | updatedAt: | |
2651 | type: string | |
2652 | AddUserResponse: | |
2653 | properties: | |
2654 | id: | |
2655 | type: number | |
2656 | uuid: | |
2657 | type: string | |
2658 | VideoUploadResponse: | |
2659 | properties: | |
2660 | video: | |
2661 | type: object | |
2662 | properties: | |
2663 | id: | |
2664 | type: number | |
2665 | uuid: | |
2666 | type: string | |
2667 | CommentThreadResponse: | |
2668 | properties: | |
2669 | total: | |
2670 | type: number | |
2671 | data: | |
2672 | type: array | |
2673 | items: | |
2674 | $ref: '#/components/schemas/VideoComment' | |
2675 | CommentThreadPostResponse: | |
2676 | properties: | |
2677 | comment: | |
2678 | $ref: '#/components/schemas/VideoComment' | |
2679 | VideoListResponse: | |
2680 | properties: | |
2681 | total: | |
2682 | type: number | |
2683 | data: | |
2684 | type: array | |
2685 | items: | |
2686 | $ref: '#/components/schemas/Video' | |
2687 | AddUser: | |
2688 | properties: | |
2689 | username: | |
2690 | type: string | |
2691 | description: 'The user username ' | |
2692 | password: | |
2693 | type: string | |
2694 | description: 'The user password ' | |
2695 | email: | |
2696 | type: string | |
2697 | description: 'The user email ' | |
2698 | videoQuota: | |
2699 | type: string | |
2700 | description: 'The user videoQuota ' | |
2701 | videoQuotaDaily: | |
2702 | type: string | |
2703 | description: 'The user daily video quota ' | |
2704 | role: | |
2705 | type: integer | |
2706 | enum: | |
2707 | - 0 | |
2708 | - 1 | |
2709 | - 2 | |
2710 | description: 'The user role (Admin = 0, Moderator = 1, User = 2)' | |
2711 | required: | |
2712 | - username | |
2713 | - password | |
2714 | ||
2715 | - videoQuota | |
2716 | - videoQuotaDaily | |
2717 | - role | |
2718 | UpdateUser: | |
2719 | properties: | |
2720 | id: | |
2721 | type: string | |
2722 | description: 'The user id ' | |
2723 | email: | |
2724 | type: string | |
2725 | description: 'The updated email of the user ' | |
2726 | videoQuota: | |
2727 | type: string | |
2728 | description: 'The updated videoQuota of the user ' | |
2729 | videoQuotaDaily: | |
2730 | type: string | |
2731 | description: 'The updated daily video quota of the user ' | |
2732 | role: | |
2733 | type: integer | |
2734 | enum: | |
2735 | - 0 | |
2736 | - 1 | |
2737 | - 2 | |
2738 | description: 'The user role (Admin = 0, Moderator = 1, User = 2)' | |
2739 | required: | |
2740 | - id | |
2741 | ||
2742 | - videoQuota | |
2743 | - videoQuotaDaily | |
2744 | - role | |
2745 | UpdateMe: | |
2746 | properties: | |
2747 | password: | |
2748 | type: string | |
2749 | description: 'Your new password ' | |
2750 | email: | |
2751 | type: string | |
2752 | description: 'Your new email ' | |
2753 | displayNSFW: | |
2754 | type: string | |
2755 | description: 'Your new displayNSFW ' | |
2756 | autoPlayVideo: | |
2757 | type: string | |
2758 | description: 'Your new autoPlayVideo ' | |
2759 | required: | |
2760 | - password | |
2761 | ||
2762 | - displayNSFW | |
2763 | - autoPlayVideo | |
2764 | GetMeVideoRating: | |
2765 | properties: | |
2766 | id: | |
2767 | type: string | |
2768 | description: 'Id of the video ' | |
2769 | rating: | |
2770 | type: number | |
2771 | description: 'Rating of the video ' | |
2772 | required: | |
2773 | - id | |
2774 | - rating | |
2775 | VideoRating: | |
2776 | properties: | |
2777 | video: | |
2778 | $ref: '#/components/schemas/Video' | |
2779 | rating: | |
2780 | type: number | |
2781 | description: 'Rating of the video' | |
2782 | required: | |
2783 | - video | |
2784 | - rating | |
2785 | RegisterUser: | |
2786 | properties: | |
2787 | username: | |
2788 | type: string | |
2789 | description: 'The username of the user ' | |
2790 | password: | |
2791 | type: string | |
2792 | description: 'The password of the user ' | |
2793 | email: | |
2794 | type: string | |
2795 | description: 'The email of the user ' | |
2796 | displayName: | |
2797 | type: string | |
2798 | description: 'The user display name' | |
2799 | channel: | |
2800 | type: object | |
2801 | properties: | |
2802 | name: | |
2803 | type: string | |
2804 | description: 'The default channel name' | |
2805 | displayName: | |
2806 | type: string | |
2807 | description: 'The default channel display name' | |
2808 | ||
2809 | required: | |
2810 | - username | |
2811 | - password | |
2812 | ||
2813 | VideoChannelCreate: | |
2814 | properties: | |
2815 | name: | |
2816 | type: string | |
2817 | displayName: | |
2818 | type: string | |
2819 | description: | |
2820 | type: string | |
2821 | support: | |
2822 | type: string | |
2823 | required: | |
2824 | - name | |
2825 | - displayName | |
2826 | VideoChannelUpdate: | |
2827 | properties: | |
2828 | displayName: | |
2829 | type: string | |
2830 | description: | |
2831 | type: string | |
2832 | support: | |
2833 | type: string | |
2834 | bulkVideosSupportUpdate: | |
2835 | type: boolean | |
2836 | description: 'Update all videos support field of this channel' | |
2837 |