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