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