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