]>
Commit | Line | Data |
---|---|---|
1 | openapi: 3.0.0 | |
2 | info: | |
3 | title: PeerTube | |
4 | version: 3.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 | The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite | |
16 | HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with | |
17 | [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO) | |
18 | which generates a client SDK in the language of your choice - we generate some client SDKs automatically: | |
19 | ||
20 | - [Python](https://framagit.org/framasoft/peertube/clients/python) | |
21 | - [Go](https://framagit.org/framasoft/peertube/clients/go) | |
22 | - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin) | |
23 | ||
24 | See the [REST API quick start](https://docs.joinpeertube.org/api-rest-getting-started) for a few | |
25 | examples of using the PeerTube API. | |
26 | ||
27 | # Authentication | |
28 | ||
29 | When you sign up for an account on a PeerTube instance, you are given the possibility | |
30 | to generate sessions on it, and authenticate there using an access token. Only __one | |
31 | access token can currently be used at a time__. | |
32 | ||
33 | ## Roles | |
34 | ||
35 | Accounts are given permissions based on their role. There are three roles on | |
36 | PeerTube: Administrator, Moderator, and User. See the [roles guide](https://docs.joinpeertube.org/admin-managing-users?id=roles) for a detail of their permissions. | |
37 | ||
38 | # Errors | |
39 | ||
40 | The API uses standard HTTP status codes to indicate the success or failure | |
41 | of the API call, completed by a [RFC7807-compliant](https://tools.ietf.org/html/rfc7807) response body. | |
42 | ||
43 | ``` | |
44 | HTTP 1.1 404 Not Found | |
45 | Content-Type: application/problem+json; charset=utf-8 | |
46 | ||
47 | { | |
48 | "detail": "Video not found", | |
49 | "docs": "https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo", | |
50 | "status": 404, | |
51 | "title": "Not Found", | |
52 | "type": "about:blank" | |
53 | } | |
54 | ``` | |
55 | ||
56 | We provide error `type` values for [a growing number of cases](https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/server/server-error-code.enum.ts), | |
57 | but it is still optional. Types are used to disambiguate errors that bear the same status code | |
58 | and are non-obvious: | |
59 | ||
60 | ``` | |
61 | HTTP 1.1 403 Forbidden | |
62 | Content-Type: application/problem+json; charset=utf-8 | |
63 | ||
64 | { | |
65 | "detail": "Cannot get this video regarding follow constraints", | |
66 | "docs": "https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo", | |
67 | "status": 403, | |
68 | "title": "Forbidden", | |
69 | "type": "https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/does_not_respect_follow_constraints" | |
70 | } | |
71 | ``` | |
72 | ||
73 | Here a 403 error could otherwise mean that the video is private or blocklisted. | |
74 | ||
75 | ### Validation errors | |
76 | ||
77 | Each parameter is evaluated on its own against a set of rules before the route validator | |
78 | proceeds with potential testing involving parameter combinations. Errors coming from validation | |
79 | errors appear earlier and benefit from a more detailed error description: | |
80 | ||
81 | ``` | |
82 | HTTP 1.1 400 Bad Request | |
83 | Content-Type: application/problem+json; charset=utf-8 | |
84 | ||
85 | { | |
86 | "detail": "Incorrect request parameters: id", | |
87 | "docs": "https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo", | |
88 | "instance": "/api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180", | |
89 | "invalid-params": { | |
90 | "id": { | |
91 | "location": "params", | |
92 | "msg": "Invalid value", | |
93 | "param": "id", | |
94 | "value": "9c9de5e8-0a1e-484a-b099-e80766180" | |
95 | } | |
96 | }, | |
97 | "status": 400, | |
98 | "title": "Bad Request", | |
99 | "type": "about:blank" | |
100 | } | |
101 | ``` | |
102 | ||
103 | Where `id` is the name of the field concerned by the error, within the route definition. | |
104 | `invalid-params.<field>.location` can be either 'params', 'body', 'header', 'query' or 'cookies', and | |
105 | `invalid-params.<field>.value` reports the value that didn't pass validation whose `invalid-params.<field>.msg` | |
106 | is about. | |
107 | ||
108 | ### Deprecated error fields | |
109 | ||
110 | Some fields could be included with previous versions. They are still included but their use is deprecated: | |
111 | - `error`: superseded by `detail` | |
112 | - `code`: superseded by `type` (which is now an URI) | |
113 | ||
114 | # Rate limits | |
115 | ||
116 | We are rate-limiting all endpoints of PeerTube's API. Custom values can be set by administrators: | |
117 | ||
118 | | Endpoint (prefix: `/api/v1`) | Calls | Time frame | | |
119 | |------------------------------|---------------|--------------| | |
120 | | `/*` | 50 | 10 seconds | | |
121 | | `POST /users/token` | 15 | 5 minutes | | |
122 | | `POST /users/register` | 2<sup>*</sup> | 5 minutes | | |
123 | | `POST /users/ask-send-verify-email` | 3 | 5 minutes | | |
124 | ||
125 | Depending on the endpoint, <sup>*</sup>failed requests are not taken into account. A service | |
126 | limit is announced by a `429 Too Many Requests` status code. | |
127 | ||
128 | You can get details about the current state of your rate limit by reading the | |
129 | following headers: | |
130 | ||
131 | | Header | Description | | |
132 | |-------------------------|------------------------------------------------------------| | |
133 | | `X-RateLimit-Limit` | Number of max requests allowed in the current time period | | |
134 | | `X-RateLimit-Remaining` | Number of remaining requests in the current time period | | |
135 | | `X-RateLimit-Reset` | Timestamp of end of current time period as UNIX timestamp | | |
136 | | `Retry-After` | Seconds to delay after the first `429` is received | | |
137 | ||
138 | # CORS | |
139 | ||
140 | This API features [Cross-Origin Resource Sharing (CORS)](https://fetch.spec.whatwg.org/), | |
141 | allowing cross-domain communication from the browser for some routes: | |
142 | ||
143 | | Endpoint | | |
144 | |------------------------- ---| | |
145 | | `/api/*` | | |
146 | | `/download/*` | | |
147 | | `/lazy-static/*` | | |
148 | | `/live/segments-sha256/*` | | |
149 | | `/.well-known/webfinger` | | |
150 | ||
151 | In addition, all routes serving ActivityPub are CORS-enabled for all origins. | |
152 | externalDocs: | |
153 | url: https://docs.joinpeertube.org/api-rest-reference.html | |
154 | tags: | |
155 | - name: Register | |
156 | description: | | |
157 | As a visitor, you can use this API to open an account (if registrations are open on | |
158 | that PeerTube instance). As an admin, you should use the dedicated [User creation | |
159 | API](#operation/addUser) instead. | |
160 | - name: Session | |
161 | x-displayName: Login/Logout | |
162 | description: | | |
163 | Sessions deal with access tokens over time. Only __one session token can currently be used at a time__. | |
164 | - name: Accounts | |
165 | description: > | |
166 | Accounts encompass remote accounts discovered across the federation, | |
167 | and correspond to the main Actor, along with video channels a user can create, which | |
168 | are also Actors. | |
169 | ||
170 | When a comment is posted, it is done with your Account's Actor. | |
171 | - name: Users | |
172 | description: > | |
173 | Using some features of PeerTube require authentication, for which User | |
174 | provide different levels of permission as well as associated user | |
175 | information. Each user has a corresponding local Account for federation. | |
176 | - name: My User | |
177 | description: > | |
178 | Operations related to your own User, when logged-in. | |
179 | - name: My Subscriptions | |
180 | description: > | |
181 | Operations related to your subscriptions to video channels, their | |
182 | new videos, and how to keep up to date with their latest publications! | |
183 | - name: My History | |
184 | description: > | |
185 | Operations related to your watch history. | |
186 | - name: My Notifications | |
187 | description: > | |
188 | Notifications following new videos, follows or reports. They allow you | |
189 | to keep track of the interactions and overall important information that | |
190 | concerns you. You MAY set per-notification type delivery preference, to | |
191 | receive the info either by mail, by in-browser notification or both. | |
192 | - name: Config | |
193 | description: > | |
194 | Each server exposes public information regarding supported videos and | |
195 | options. | |
196 | - name: Job | |
197 | description: > | |
198 | Jobs are long-running tasks enqueued and processed by the instance | |
199 | itself. No additional worker registration is currently available. | |
200 | - name: Instance Follows | |
201 | description: > | |
202 | Managing servers which the instance interacts with is crucial to the | |
203 | concept of federation in PeerTube and external video indexation. The PeerTube | |
204 | server then deals with inter-server ActivityPub operations and propagates | |
205 | information across its social graph by posting activities to actors' inbox | |
206 | endpoints. | |
207 | externalDocs: | |
208 | url: https://docs.joinpeertube.org/admin-following-instances?id=instances-follows | |
209 | - name: Instance Redundancy | |
210 | description: > | |
211 | Redundancy is part of the inter-server solidarity that PeerTube fosters. | |
212 | Manage the list of instances you wish to help by seeding their videos according | |
213 | to the policy of video selection of your choice. Note that you have a similar functionality | |
214 | to mirror individual videos, see [video mirroring](#tag/Video-Mirroring). | |
215 | externalDocs: | |
216 | url: https://docs.joinpeertube.org/admin-following-instances?id=instances-redundancy | |
217 | - name: Plugins | |
218 | description: > | |
219 | Managing plugins installed from a local path or from NPM, or search for new ones. | |
220 | externalDocs: | |
221 | url: https://docs.joinpeertube.org/api-plugins | |
222 | - name: Abuses | |
223 | description: | | |
224 | Abuses deal with reports of local or remote videos/comments/accounts alike. | |
225 | - name: Video | |
226 | description: | | |
227 | Operations dealing with listing, uploading, fetching or modifying videos. | |
228 | - name: Video Upload | |
229 | description: | | |
230 | Operations dealing with adding video or audio. PeerTube supports two upload modes, and three import modes. | |
231 | ||
232 | ### Upload | |
233 | ||
234 | - [_legacy_](#operation/uploadLegacy), where the video file is sent in a single request | |
235 | - [_resumable_](#operation/uploadResumableInit), where the video file is sent in chunks | |
236 | ||
237 | You can upload videos more reliably by using the resumable variant. Its protocol lets | |
238 | you resume an upload operation after a network interruption or other transmission failure, | |
239 | saving time and bandwidth in the event of network failures. | |
240 | ||
241 | Favor using resumable uploads in any of the following cases: | |
242 | - You are transferring large files | |
243 | - The likelihood of a network interruption is high | |
244 | - Uploads are originating from a device with a low-bandwidth or unstable Internet connection, | |
245 | such as a mobile device | |
246 | ||
247 | ### Import | |
248 | ||
249 | - _URL_-based: where the URL points to any service supported by [youtube-dl](https://ytdl-org.github.io/youtube-dl/) | |
250 | - _magnet_-based: where the URI resolves to a BitTorrent ressource containing a single supported video file | |
251 | - _torrent_-based: where the metainfo file resolves to a BitTorrent ressource containing a single supported video file | |
252 | ||
253 | The import function is practical when the desired video/audio is available online. It makes PeerTube | |
254 | download it for you, saving you as much bandwidth and avoiding any instability or limitation your network might have. | |
255 | - name: Video Captions | |
256 | description: Operations dealing with listing, adding and removing closed captions of a video. | |
257 | - name: Video Channels | |
258 | description: Operations dealing with the creation, modification and listing of videos within a channel. | |
259 | - name: Video Comments | |
260 | description: > | |
261 | Operations dealing with comments to a video. Comments are organized in threads: adding a | |
262 | comment in response to the video starts a thread, adding a reply to a comment adds it to | |
263 | its root comment thread. | |
264 | - name: Video Blocks | |
265 | description: Operations dealing with blocking videos (removing them from view and preventing interactions). | |
266 | - name: Video Rates | |
267 | description: Like/dislike a video. | |
268 | - name: Video Playlists | |
269 | description: Operations dealing with playlists of videos. Playlists are bound to users and/or channels. | |
270 | - name: Feeds | |
271 | description: Server syndication feeds | |
272 | - name: Search | |
273 | description: | | |
274 | The search helps to find _videos_ or _channels_ from within the instance and beyond. | |
275 | Videos from other instances federated by the instance (that is, instances | |
276 | followed by the instance) can be found via keywords and other criteria of | |
277 | the advanced search. | |
278 | ||
279 | Administrators can also enable the use of a remote search system, indexing | |
280 | videos and channels not could be not federated by the instance. | |
281 | - name: Homepage | |
282 | description: Get and update the custom homepage | |
283 | - name: Video Mirroring | |
284 | description: | | |
285 | PeerTube instances can mirror videos from one another, and help distribute some videos. | |
286 | ||
287 | For importing videos as your own, refer to [video imports](#operation/importVideo). | |
288 | x-tagGroups: | |
289 | - name: Auth | |
290 | tags: | |
291 | - Register | |
292 | - Session | |
293 | - name: Accounts | |
294 | tags: | |
295 | - Accounts | |
296 | - Users | |
297 | - My User | |
298 | - My Subscriptions | |
299 | - My Notifications | |
300 | - My History | |
301 | - name: Videos | |
302 | tags: | |
303 | - Video | |
304 | - Video Upload | |
305 | - Video Captions | |
306 | - Video Channels | |
307 | - Video Comments | |
308 | - Video Rates | |
309 | - Video Playlists | |
310 | - Video Ownership Change | |
311 | - Video Mirroring | |
312 | - Live Videos | |
313 | - Feeds | |
314 | - name: Search | |
315 | tags: | |
316 | - Search | |
317 | - name: Custom pages | |
318 | tags: | |
319 | - Homepage | |
320 | - name: Moderation | |
321 | tags: | |
322 | - Abuses | |
323 | - Video Blocks | |
324 | - Account Blocks | |
325 | - Server Blocks | |
326 | - name: Instance Configuration | |
327 | tags: | |
328 | - Config | |
329 | - Instance Follows | |
330 | - Instance Redundancy | |
331 | - Plugins | |
332 | - name: Jobs | |
333 | tags: | |
334 | - Job | |
335 | paths: | |
336 | '/accounts/{name}': | |
337 | get: | |
338 | tags: | |
339 | - Accounts | |
340 | summary: Get an account | |
341 | operationId: getAccount | |
342 | parameters: | |
343 | - $ref: '#/components/parameters/name' | |
344 | responses: | |
345 | '200': | |
346 | description: successful operation | |
347 | content: | |
348 | application/json: | |
349 | schema: | |
350 | $ref: '#/components/schemas/Account' | |
351 | '404': | |
352 | description: account not found | |
353 | ||
354 | '/accounts/{name}/videos': | |
355 | get: | |
356 | tags: | |
357 | - Accounts | |
358 | - Video | |
359 | summary: 'List videos of an account' | |
360 | operationId: getAccountVideos | |
361 | parameters: | |
362 | - $ref: '#/components/parameters/name' | |
363 | - $ref: '#/components/parameters/categoryOneOf' | |
364 | - $ref: '#/components/parameters/isLive' | |
365 | - $ref: '#/components/parameters/tagsOneOf' | |
366 | - $ref: '#/components/parameters/tagsAllOf' | |
367 | - $ref: '#/components/parameters/licenceOneOf' | |
368 | - $ref: '#/components/parameters/languageOneOf' | |
369 | - $ref: '#/components/parameters/nsfw' | |
370 | - $ref: '#/components/parameters/filter' | |
371 | - $ref: '#/components/parameters/skipCount' | |
372 | - $ref: '#/components/parameters/start' | |
373 | - $ref: '#/components/parameters/count' | |
374 | - $ref: '#/components/parameters/videosSort' | |
375 | responses: | |
376 | '200': | |
377 | description: successful operation | |
378 | content: | |
379 | application/json: | |
380 | schema: | |
381 | $ref: '#/components/schemas/VideoListResponse' | |
382 | x-codeSamples: | |
383 | - lang: JavaScript | |
384 | source: | | |
385 | fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos') | |
386 | .then(function(response) { | |
387 | return response.json() | |
388 | }).then(function(data) { | |
389 | console.log(data) | |
390 | }) | |
391 | - lang: Shell | |
392 | source: | | |
393 | ## DEPENDENCIES: jq | |
394 | curl -s https://peertube2.cpy.re/api/v1/accounts/{name}/videos | jq | |
395 | - lang: Ruby | |
396 | source: | | |
397 | require 'net/http' | |
398 | require 'json' | |
399 | ||
400 | uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos") | |
401 | ||
402 | http = Net::HTTP.new(uri.host, uri.port) | |
403 | http.use_ssl = true | |
404 | ||
405 | response = http.get(uri.request_uri) | |
406 | ||
407 | puts JSON.parse(response.read_body) | |
408 | - lang: Python | |
409 | source: | | |
410 | import requests | |
411 | ||
412 | r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos") | |
413 | json = r.json() | |
414 | ||
415 | print(json) | |
416 | ||
417 | /accounts: | |
418 | get: | |
419 | tags: | |
420 | - Accounts | |
421 | summary: List accounts | |
422 | operationId: getAccounts | |
423 | parameters: | |
424 | - $ref: '#/components/parameters/start' | |
425 | - $ref: '#/components/parameters/count' | |
426 | - $ref: '#/components/parameters/sort' | |
427 | responses: | |
428 | '200': | |
429 | description: successful operation | |
430 | content: | |
431 | 'application/json': | |
432 | schema: | |
433 | type: array | |
434 | items: | |
435 | $ref: '#/components/schemas/Account' | |
436 | ||
437 | /config: | |
438 | get: | |
439 | tags: | |
440 | - Config | |
441 | summary: Get instance public configuration | |
442 | operationId: getConfig | |
443 | responses: | |
444 | '200': | |
445 | description: successful operation | |
446 | content: | |
447 | application/json: | |
448 | schema: | |
449 | $ref: '#/components/schemas/ServerConfig' | |
450 | examples: | |
451 | nightly: | |
452 | externalValue: https://peertube2.cpy.re/api/v1/config | |
453 | ||
454 | /config/about: | |
455 | get: | |
456 | summary: Get instance "About" information | |
457 | operationId: getAbout | |
458 | tags: | |
459 | - Config | |
460 | responses: | |
461 | '200': | |
462 | description: successful operation | |
463 | content: | |
464 | application/json: | |
465 | schema: | |
466 | $ref: '#/components/schemas/ServerConfigAbout' | |
467 | examples: | |
468 | nightly: | |
469 | externalValue: https://peertube2.cpy.re/api/v1/config/about | |
470 | ||
471 | /config/custom: | |
472 | get: | |
473 | summary: Get instance runtime configuration | |
474 | operationId: getCustomConfig | |
475 | tags: | |
476 | - Config | |
477 | security: | |
478 | - OAuth2: | |
479 | - admin | |
480 | responses: | |
481 | '200': | |
482 | description: successful operation | |
483 | content: | |
484 | application/json: | |
485 | schema: | |
486 | $ref: '#/components/schemas/ServerConfigCustom' | |
487 | put: | |
488 | summary: Set instance runtime configuration | |
489 | operationId: putCustomConfig | |
490 | tags: | |
491 | - Config | |
492 | security: | |
493 | - OAuth2: | |
494 | - admin | |
495 | responses: | |
496 | '200': | |
497 | description: successful operation | |
498 | '400': | |
499 | x-summary: field inconsistencies | |
500 | description: > | |
501 | Arises when: | |
502 | - the emailer is disabled and the instance is open to registrations | |
503 | - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled | |
504 | delete: | |
505 | summary: Delete instance runtime configuration | |
506 | operationId: delCustomConfig | |
507 | tags: | |
508 | - Config | |
509 | security: | |
510 | - OAuth2: | |
511 | - admin | |
512 | responses: | |
513 | '200': | |
514 | description: successful operation | |
515 | ||
516 | /custom-pages/homepage/instance: | |
517 | get: | |
518 | summary: Get instance custom homepage | |
519 | tags: | |
520 | - Homepage | |
521 | responses: | |
522 | '404': | |
523 | description: No homepage set | |
524 | '200': | |
525 | description: successful operation | |
526 | content: | |
527 | application/json: | |
528 | schema: | |
529 | $ref: '#/components/schemas/CustomHomepage' | |
530 | put: | |
531 | summary: Set instance custom homepage | |
532 | tags: | |
533 | - Homepage | |
534 | security: | |
535 | - OAuth2: | |
536 | - admin | |
537 | requestBody: | |
538 | content: | |
539 | application/json: | |
540 | schema: | |
541 | type: object | |
542 | properties: | |
543 | content: | |
544 | type: string | |
545 | description: content of the homepage, that will be injected in the client | |
546 | responses: | |
547 | '204': | |
548 | description: successful operation | |
549 | ||
550 | /jobs/{state}: | |
551 | get: | |
552 | summary: List instance jobs | |
553 | operationId: getJobs | |
554 | security: | |
555 | - OAuth2: | |
556 | - admin | |
557 | tags: | |
558 | - Job | |
559 | parameters: | |
560 | - name: state | |
561 | in: path | |
562 | required: true | |
563 | description: The state of the job ('' for for no filter) | |
564 | schema: | |
565 | type: string | |
566 | enum: | |
567 | - '' | |
568 | - active | |
569 | - completed | |
570 | - failed | |
571 | - waiting | |
572 | - delayed | |
573 | - $ref: '#/components/parameters/jobType' | |
574 | - $ref: '#/components/parameters/start' | |
575 | - $ref: '#/components/parameters/count' | |
576 | - $ref: '#/components/parameters/sort' | |
577 | responses: | |
578 | '200': | |
579 | description: successful operation | |
580 | content: | |
581 | application/json: | |
582 | schema: | |
583 | type: object | |
584 | properties: | |
585 | total: | |
586 | type: integer | |
587 | example: 1 | |
588 | data: | |
589 | type: array | |
590 | maxItems: 100 | |
591 | items: | |
592 | $ref: '#/components/schemas/Job' | |
593 | ||
594 | /server/followers: | |
595 | get: | |
596 | tags: | |
597 | - Instance Follows | |
598 | summary: List instances following the server | |
599 | parameters: | |
600 | - $ref: '#/components/parameters/followState' | |
601 | - $ref: '#/components/parameters/actorType' | |
602 | - $ref: '#/components/parameters/start' | |
603 | - $ref: '#/components/parameters/count' | |
604 | - $ref: '#/components/parameters/sort' | |
605 | responses: | |
606 | '200': | |
607 | description: successful operation | |
608 | content: | |
609 | application/json: | |
610 | schema: | |
611 | type: object | |
612 | properties: | |
613 | total: | |
614 | type: integer | |
615 | example: 1 | |
616 | data: | |
617 | type: array | |
618 | items: | |
619 | $ref: '#/components/schemas/Follow' | |
620 | ||
621 | '/server/followers/{nameWithHost}': | |
622 | delete: | |
623 | summary: Remove or reject a follower to your server | |
624 | security: | |
625 | - OAuth2: | |
626 | - admin | |
627 | tags: | |
628 | - Instance Follows | |
629 | parameters: | |
630 | - name: nameWithHost | |
631 | in: path | |
632 | required: true | |
633 | description: The remote actor handle to remove from your followers | |
634 | schema: | |
635 | type: string | |
636 | format: email | |
637 | responses: | |
638 | '204': | |
639 | description: successful operation | |
640 | '404': | |
641 | description: follower not found | |
642 | ||
643 | '/server/followers/{nameWithHost}/reject': | |
644 | post: | |
645 | summary: Reject a pending follower to your server | |
646 | security: | |
647 | - OAuth2: | |
648 | - admin | |
649 | tags: | |
650 | - Instance Follows | |
651 | parameters: | |
652 | - name: nameWithHost | |
653 | in: path | |
654 | required: true | |
655 | description: The remote actor handle to remove from your followers | |
656 | schema: | |
657 | type: string | |
658 | format: email | |
659 | responses: | |
660 | '204': | |
661 | description: successful operation | |
662 | '404': | |
663 | description: follower not found | |
664 | ||
665 | '/server/followers/{nameWithHost}/accept': | |
666 | post: | |
667 | summary: Accept a pending follower to your server | |
668 | security: | |
669 | - OAuth2: | |
670 | - admin | |
671 | tags: | |
672 | - Instance Follows | |
673 | parameters: | |
674 | - name: nameWithHost | |
675 | in: path | |
676 | required: true | |
677 | description: The remote actor handle to remove from your followers | |
678 | schema: | |
679 | type: string | |
680 | format: email | |
681 | responses: | |
682 | '204': | |
683 | description: successful operation | |
684 | '404': | |
685 | description: follower not found | |
686 | ||
687 | /server/following: | |
688 | get: | |
689 | tags: | |
690 | - Instance Follows | |
691 | summary: List instances followed by the server | |
692 | parameters: | |
693 | - $ref: '#/components/parameters/followState' | |
694 | - $ref: '#/components/parameters/actorType' | |
695 | - $ref: '#/components/parameters/start' | |
696 | - $ref: '#/components/parameters/count' | |
697 | - $ref: '#/components/parameters/sort' | |
698 | responses: | |
699 | '200': | |
700 | description: successful operation | |
701 | content: | |
702 | application/json: | |
703 | schema: | |
704 | type: object | |
705 | properties: | |
706 | total: | |
707 | type: integer | |
708 | example: 1 | |
709 | data: | |
710 | type: array | |
711 | items: | |
712 | $ref: '#/components/schemas/Follow' | |
713 | post: | |
714 | security: | |
715 | - OAuth2: | |
716 | - admin | |
717 | tags: | |
718 | - Instance Follows | |
719 | summary: Follow a list of servers | |
720 | responses: | |
721 | '204': | |
722 | description: successful operation | |
723 | '500': | |
724 | description: cannot follow a non-HTTPS server | |
725 | requestBody: | |
726 | content: | |
727 | application/json: | |
728 | schema: | |
729 | type: object | |
730 | properties: | |
731 | hosts: | |
732 | type: array | |
733 | items: | |
734 | type: string | |
735 | format: hostname | |
736 | uniqueItems: true | |
737 | ||
738 | '/server/following/{host}': | |
739 | delete: | |
740 | summary: Unfollow a server | |
741 | security: | |
742 | - OAuth2: | |
743 | - admin | |
744 | tags: | |
745 | - Instance Follows | |
746 | parameters: | |
747 | - name: host | |
748 | in: path | |
749 | required: true | |
750 | description: The host to unfollow | |
751 | schema: | |
752 | type: string | |
753 | format: hostname | |
754 | responses: | |
755 | '204': | |
756 | description: successful operation | |
757 | '404': | |
758 | description: host not found | |
759 | ||
760 | /users: | |
761 | post: | |
762 | summary: Create a user | |
763 | operationId: addUser | |
764 | security: | |
765 | - OAuth2: | |
766 | - admin | |
767 | tags: | |
768 | - Users | |
769 | responses: | |
770 | '200': | |
771 | description: user created | |
772 | content: | |
773 | application/json: | |
774 | schema: | |
775 | $ref: '#/components/schemas/AddUserResponse' | |
776 | links: | |
777 | # GET /users/{id} | |
778 | GetUser: | |
779 | operationId: getUser | |
780 | parameters: | |
781 | id: '$response.body#/user/id' | |
782 | # PUT /users/{id} | |
783 | PutUser: | |
784 | operationId: putUser | |
785 | parameters: | |
786 | id: '$response.body#/user/id' | |
787 | # DELETE /users/{id} | |
788 | DelUser: | |
789 | operationId: delUser | |
790 | parameters: | |
791 | id: '$response.body#/user/id' | |
792 | '403': | |
793 | description: insufficient authority to create an admin or moderator | |
794 | requestBody: | |
795 | content: | |
796 | application/json: | |
797 | schema: | |
798 | $ref: '#/components/schemas/AddUser' | |
799 | description: | | |
800 | If the smtp server is configured, you can leave the password empty and an email will be sent | |
801 | asking the user to set it first. | |
802 | required: true | |
803 | get: | |
804 | summary: List users | |
805 | operationId: getUsers | |
806 | security: | |
807 | - OAuth2: | |
808 | - admin | |
809 | tags: | |
810 | - Users | |
811 | parameters: | |
812 | - $ref: '#/components/parameters/usersSearch' | |
813 | - $ref: '#/components/parameters/usersBlocked' | |
814 | - $ref: '#/components/parameters/start' | |
815 | - $ref: '#/components/parameters/count' | |
816 | - $ref: '#/components/parameters/usersSort' | |
817 | responses: | |
818 | '200': | |
819 | description: successful operation | |
820 | content: | |
821 | application/json: | |
822 | schema: | |
823 | type: array | |
824 | items: | |
825 | $ref: '#/components/schemas/User' | |
826 | ||
827 | '/users/{id}': | |
828 | parameters: | |
829 | - $ref: '#/components/parameters/id' | |
830 | delete: | |
831 | summary: Delete a user | |
832 | security: | |
833 | - OAuth2: | |
834 | - admin | |
835 | tags: | |
836 | - Users | |
837 | operationId: delUser | |
838 | responses: | |
839 | '204': | |
840 | description: successful operation | |
841 | get: | |
842 | summary: Get a user | |
843 | security: | |
844 | - OAuth2: [] | |
845 | tags: | |
846 | - Users | |
847 | operationId: getUser | |
848 | parameters: | |
849 | - name: withStats | |
850 | in: query | |
851 | description: include statistics about the user (only available as a moderator/admin) | |
852 | schema: | |
853 | type: boolean | |
854 | responses: | |
855 | '200': | |
856 | x-summary: successful operation | |
857 | description: | | |
858 | As an admin/moderator, you can request a response augmented with statistics about the user's | |
859 | moderation relations and videos usage, by using the `withStats` parameter. | |
860 | content: | |
861 | application/json: | |
862 | schema: | |
863 | oneOf: | |
864 | - $ref: '#/components/schemas/User' | |
865 | - $ref: '#/components/schemas/UserWithStats' | |
866 | put: | |
867 | summary: Update a user | |
868 | security: | |
869 | - OAuth2: [] | |
870 | tags: | |
871 | - Users | |
872 | operationId: putUser | |
873 | responses: | |
874 | '204': | |
875 | description: successful operation | |
876 | requestBody: | |
877 | content: | |
878 | application/json: | |
879 | schema: | |
880 | $ref: '#/components/schemas/UpdateUser' | |
881 | required: true | |
882 | ||
883 | /oauth-clients/local: | |
884 | get: | |
885 | summary: Login prerequisite | |
886 | description: You need to retrieve a client id and secret before [logging in](#operation/getOAuthToken). | |
887 | operationId: getOAuthClient | |
888 | tags: | |
889 | - Session | |
890 | responses: | |
891 | '200': | |
892 | description: successful operation | |
893 | content: | |
894 | application/json: | |
895 | schema: | |
896 | $ref: '#/components/schemas/OAuthClient' | |
897 | links: | |
898 | UseOAuthClientToLogin: | |
899 | operationId: getOAuthToken | |
900 | parameters: | |
901 | client_id: '$response.body#/client_id' | |
902 | client_secret: '$response.body#/client_secret' | |
903 | x-codeSamples: | |
904 | - lang: Shell | |
905 | source: | | |
906 | API="https://peertube2.cpy.re/api/v1" | |
907 | ||
908 | ## AUTH | |
909 | curl -s "$API/oauth-clients/local" | |
910 | ||
911 | /users/token: | |
912 | post: | |
913 | summary: Login | |
914 | operationId: getOAuthToken | |
915 | description: With your [client id and secret](#operation/getOAuthClient), you can retrieve an access and refresh tokens. | |
916 | tags: | |
917 | - Session | |
918 | requestBody: | |
919 | content: | |
920 | application/x-www-form-urlencoded: | |
921 | schema: | |
922 | oneOf: | |
923 | - $ref: '#/components/schemas/OAuthToken-password' | |
924 | - $ref: '#/components/schemas/OAuthToken-refresh_token' | |
925 | discriminator: | |
926 | propertyName: grant_type | |
927 | mapping: | |
928 | password: '#/components/schemas/OAuthToken-password' | |
929 | refresh_token: '#/components/schemas/OAuthToken-refresh_token' | |
930 | responses: | |
931 | '200': | |
932 | description: successful operation | |
933 | content: | |
934 | application/json: | |
935 | schema: | |
936 | type: object | |
937 | properties: | |
938 | token_type: | |
939 | type: string | |
940 | example: Bearer | |
941 | access_token: | |
942 | type: string | |
943 | example: 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0 | |
944 | description: valid for 1 day | |
945 | refresh_token: | |
946 | type: string | |
947 | example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7 | |
948 | description: valid for 2 weeks | |
949 | expires_in: | |
950 | type: integer | |
951 | minimum: 0 | |
952 | example: 14399 | |
953 | refresh_token_expires_in: | |
954 | type: integer | |
955 | minimum: 0 | |
956 | example: 1209600 | |
957 | '400': | |
958 | x-summary: client or credentials are invalid | |
959 | description: | | |
960 | Disambiguate via `type`: | |
961 | - `invalid_client` for an unmatched `client_id` | |
962 | - `invalid_grant` for unmatched credentials | |
963 | '401': | |
964 | x-summary: token expired | |
965 | description: | | |
966 | Disambiguate via `type`: | |
967 | - default value for a regular authentication failure | |
968 | - `invalid_token` for an expired token | |
969 | x-codeSamples: | |
970 | - lang: Shell | |
971 | source: | | |
972 | ## DEPENDENCIES: jq | |
973 | API="https://peertube2.cpy.re/api/v1" | |
974 | USERNAME="<your_username>" | |
975 | PASSWORD="<your_password>" | |
976 | ||
977 | ## AUTH | |
978 | client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id") | |
979 | client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret") | |
980 | curl -s "$API/users/token" \ | |
981 | --data client_id="$client_id" \ | |
982 | --data client_secret="$client_secret" \ | |
983 | --data grant_type=password \ | |
984 | --data username="$USERNAME" \ | |
985 | --data password="$PASSWORD" \ | |
986 | | jq -r ".access_token" | |
987 | ||
988 | /users/revoke-token: | |
989 | post: | |
990 | summary: Logout | |
991 | description: Revokes your access token and its associated refresh token, destroying your current session. | |
992 | operationId: revokeOAuthToken | |
993 | tags: | |
994 | - Session | |
995 | security: | |
996 | - OAuth2: [] | |
997 | responses: | |
998 | '200': | |
999 | description: successful operation | |
1000 | ||
1001 | /users/register: | |
1002 | post: | |
1003 | summary: Register a user | |
1004 | operationId: registerUser | |
1005 | tags: | |
1006 | - Users | |
1007 | - Register | |
1008 | responses: | |
1009 | '204': | |
1010 | description: successful operation | |
1011 | requestBody: | |
1012 | content: | |
1013 | application/json: | |
1014 | schema: | |
1015 | $ref: '#/components/schemas/RegisterUser' | |
1016 | required: true | |
1017 | ||
1018 | /users/{id}/verify-email: | |
1019 | post: | |
1020 | summary: Verify a user | |
1021 | operationId: verifyUser | |
1022 | description: | | |
1023 | Following a user registration, the new user will receive an email asking to click a link | |
1024 | containing a secret. | |
1025 | tags: | |
1026 | - Users | |
1027 | - Register | |
1028 | parameters: | |
1029 | - $ref: '#/components/parameters/id' | |
1030 | requestBody: | |
1031 | content: | |
1032 | application/json: | |
1033 | schema: | |
1034 | type: object | |
1035 | properties: | |
1036 | verificationString: | |
1037 | type: string | |
1038 | format: url | |
1039 | isPendingEmail: | |
1040 | type: boolean | |
1041 | required: | |
1042 | - verificationString | |
1043 | responses: | |
1044 | '204': | |
1045 | description: successful operation | |
1046 | '403': | |
1047 | description: invalid verification string | |
1048 | '404': | |
1049 | description: user not found | |
1050 | ||
1051 | /users/ask-send-verify-email: | |
1052 | post: | |
1053 | summary: Resend user verification link | |
1054 | operationId: resendEmailToVerifyUser | |
1055 | tags: | |
1056 | - Users | |
1057 | - Register | |
1058 | responses: | |
1059 | '204': | |
1060 | description: successful operation | |
1061 | ||
1062 | /users/me: | |
1063 | get: | |
1064 | summary: Get my user information | |
1065 | operationId: getUserInfo | |
1066 | security: | |
1067 | - OAuth2: | |
1068 | - user | |
1069 | tags: | |
1070 | - My User | |
1071 | responses: | |
1072 | '200': | |
1073 | description: successful operation | |
1074 | content: | |
1075 | application/json: | |
1076 | schema: | |
1077 | type: array | |
1078 | items: | |
1079 | $ref: '#/components/schemas/User' | |
1080 | put: | |
1081 | summary: Update my user information | |
1082 | operationId: putUserInfo | |
1083 | security: | |
1084 | - OAuth2: | |
1085 | - user | |
1086 | tags: | |
1087 | - My User | |
1088 | responses: | |
1089 | '204': | |
1090 | description: successful operation | |
1091 | requestBody: | |
1092 | content: | |
1093 | application/json: | |
1094 | schema: | |
1095 | $ref: '#/components/schemas/UpdateMe' | |
1096 | required: true | |
1097 | ||
1098 | /users/me/videos/imports: | |
1099 | get: | |
1100 | summary: Get video imports of my user | |
1101 | security: | |
1102 | - OAuth2: | |
1103 | - user | |
1104 | tags: | |
1105 | - Videos | |
1106 | - My User | |
1107 | parameters: | |
1108 | - $ref: '#/components/parameters/start' | |
1109 | - $ref: '#/components/parameters/count' | |
1110 | - $ref: '#/components/parameters/sort' | |
1111 | responses: | |
1112 | '200': | |
1113 | description: successful operation | |
1114 | content: | |
1115 | application/json: | |
1116 | schema: | |
1117 | $ref: '#/components/schemas/VideoImportsList' | |
1118 | ||
1119 | /users/me/video-quota-used: | |
1120 | get: | |
1121 | summary: Get my user used quota | |
1122 | security: | |
1123 | - OAuth2: | |
1124 | - user | |
1125 | tags: | |
1126 | - My User | |
1127 | responses: | |
1128 | '200': | |
1129 | description: successful operation | |
1130 | content: | |
1131 | application/json: | |
1132 | schema: | |
1133 | type: object | |
1134 | properties: | |
1135 | videoQuotaUsed: | |
1136 | type: number | |
1137 | description: The user video quota used so far in bytes | |
1138 | example: 16810141515 | |
1139 | videoQuotaUsedDaily: | |
1140 | type: number | |
1141 | description: The user video quota used today in bytes | |
1142 | example: 1681014151 | |
1143 | ||
1144 | '/users/me/videos/{videoId}/rating': | |
1145 | get: | |
1146 | summary: Get rate of my user for a video | |
1147 | security: | |
1148 | - OAuth2: [] | |
1149 | tags: | |
1150 | - My User | |
1151 | - Video Rates | |
1152 | parameters: | |
1153 | - name: videoId | |
1154 | in: path | |
1155 | required: true | |
1156 | description: The video id | |
1157 | schema: | |
1158 | $ref: '#/components/schemas/Video/properties/id' | |
1159 | responses: | |
1160 | '200': | |
1161 | description: successful operation | |
1162 | content: | |
1163 | application/json: | |
1164 | schema: | |
1165 | $ref: '#/components/schemas/GetMeVideoRating' | |
1166 | ||
1167 | /users/me/videos: | |
1168 | get: | |
1169 | summary: Get videos of my user | |
1170 | security: | |
1171 | - OAuth2: | |
1172 | - user | |
1173 | tags: | |
1174 | - My User | |
1175 | - Videos | |
1176 | parameters: | |
1177 | - $ref: '#/components/parameters/start' | |
1178 | - $ref: '#/components/parameters/count' | |
1179 | - $ref: '#/components/parameters/sort' | |
1180 | responses: | |
1181 | '200': | |
1182 | description: successful operation | |
1183 | content: | |
1184 | application/json: | |
1185 | schema: | |
1186 | $ref: '#/components/schemas/VideoListResponse' | |
1187 | ||
1188 | /users/me/subscriptions: | |
1189 | get: | |
1190 | summary: Get my user subscriptions | |
1191 | security: | |
1192 | - OAuth2: | |
1193 | - user | |
1194 | tags: | |
1195 | - My Subscriptions | |
1196 | parameters: | |
1197 | - $ref: '#/components/parameters/start' | |
1198 | - $ref: '#/components/parameters/count' | |
1199 | - $ref: '#/components/parameters/sort' | |
1200 | responses: | |
1201 | '200': | |
1202 | description: successful operation | |
1203 | content: | |
1204 | application/json: | |
1205 | schema: | |
1206 | $ref: '#/components/schemas/VideoChannelList' | |
1207 | post: | |
1208 | tags: | |
1209 | - My Subscriptions | |
1210 | summary: Add subscription to my user | |
1211 | security: | |
1212 | - OAuth2: | |
1213 | - user | |
1214 | requestBody: | |
1215 | content: | |
1216 | application/json: | |
1217 | schema: | |
1218 | type: object | |
1219 | properties: | |
1220 | uri: | |
1221 | type: string | |
1222 | format: uri | |
1223 | description: uri of the video channels to subscribe to | |
1224 | required: | |
1225 | - uri | |
1226 | examples: | |
1227 | default: | |
1228 | value: | |
1229 | uri: 008a0e54-375d-49d0-8379-143202e24152@video.lqdn.fr | |
1230 | responses: | |
1231 | '200': | |
1232 | description: successful operation | |
1233 | ||
1234 | /users/me/subscriptions/exist: | |
1235 | get: | |
1236 | summary: Get if subscriptions exist for my user | |
1237 | security: | |
1238 | - OAuth2: | |
1239 | - user | |
1240 | tags: | |
1241 | - My Subscriptions | |
1242 | parameters: | |
1243 | - $ref: '#/components/parameters/subscriptionsUris' | |
1244 | responses: | |
1245 | '200': | |
1246 | description: successful operation | |
1247 | content: | |
1248 | application/json: | |
1249 | schema: | |
1250 | type: object | |
1251 | ||
1252 | /users/me/subscriptions/videos: | |
1253 | get: | |
1254 | summary: List videos of subscriptions of my user | |
1255 | security: | |
1256 | - OAuth2: | |
1257 | - user | |
1258 | tags: | |
1259 | - My Subscriptions | |
1260 | - Videos | |
1261 | parameters: | |
1262 | - $ref: '#/components/parameters/categoryOneOf' | |
1263 | - $ref: '#/components/parameters/isLive' | |
1264 | - $ref: '#/components/parameters/tagsOneOf' | |
1265 | - $ref: '#/components/parameters/tagsAllOf' | |
1266 | - $ref: '#/components/parameters/licenceOneOf' | |
1267 | - $ref: '#/components/parameters/languageOneOf' | |
1268 | - $ref: '#/components/parameters/nsfw' | |
1269 | - $ref: '#/components/parameters/filter' | |
1270 | - $ref: '#/components/parameters/skipCount' | |
1271 | - $ref: '#/components/parameters/start' | |
1272 | - $ref: '#/components/parameters/count' | |
1273 | - $ref: '#/components/parameters/videosSort' | |
1274 | responses: | |
1275 | '200': | |
1276 | description: successful operation | |
1277 | content: | |
1278 | application/json: | |
1279 | schema: | |
1280 | $ref: '#/components/schemas/VideoListResponse' | |
1281 | ||
1282 | '/users/me/subscriptions/{subscriptionHandle}': | |
1283 | get: | |
1284 | summary: Get subscription of my user | |
1285 | security: | |
1286 | - OAuth2: | |
1287 | - user | |
1288 | tags: | |
1289 | - My Subscriptions | |
1290 | parameters: | |
1291 | - $ref: '#/components/parameters/subscriptionHandle' | |
1292 | responses: | |
1293 | '200': | |
1294 | description: successful operation | |
1295 | content: | |
1296 | application/json: | |
1297 | schema: | |
1298 | $ref: '#/components/schemas/VideoChannel' | |
1299 | delete: | |
1300 | summary: Delete subscription of my user | |
1301 | security: | |
1302 | - OAuth2: | |
1303 | - user | |
1304 | tags: | |
1305 | - My Subscriptions | |
1306 | parameters: | |
1307 | - $ref: '#/components/parameters/subscriptionHandle' | |
1308 | responses: | |
1309 | '200': | |
1310 | description: successful operation | |
1311 | ||
1312 | /users/me/notifications: | |
1313 | get: | |
1314 | summary: List my notifications | |
1315 | security: | |
1316 | - OAuth2: [] | |
1317 | tags: | |
1318 | - My Notifications | |
1319 | parameters: | |
1320 | - name: unread | |
1321 | in: query | |
1322 | description: only list unread notifications | |
1323 | schema: | |
1324 | type: boolean | |
1325 | - $ref: '#/components/parameters/start' | |
1326 | - $ref: '#/components/parameters/count' | |
1327 | - $ref: '#/components/parameters/sort' | |
1328 | responses: | |
1329 | '200': | |
1330 | description: successful operation | |
1331 | content: | |
1332 | application/json: | |
1333 | schema: | |
1334 | $ref: '#/components/schemas/NotificationListResponse' | |
1335 | ||
1336 | /users/me/notifications/read: | |
1337 | post: | |
1338 | summary: Mark notifications as read by their id | |
1339 | security: | |
1340 | - OAuth2: [] | |
1341 | tags: | |
1342 | - My Notifications | |
1343 | requestBody: | |
1344 | content: | |
1345 | application/json: | |
1346 | schema: | |
1347 | type: object | |
1348 | properties: | |
1349 | ids: | |
1350 | type: array | |
1351 | description: ids of the notifications to mark as read | |
1352 | items: | |
1353 | type: integer | |
1354 | required: | |
1355 | - ids | |
1356 | responses: | |
1357 | '204': | |
1358 | description: successful operation | |
1359 | ||
1360 | /users/me/notifications/read-all: | |
1361 | post: | |
1362 | summary: Mark all my notification as read | |
1363 | security: | |
1364 | - OAuth2: [] | |
1365 | tags: | |
1366 | - My Notifications | |
1367 | responses: | |
1368 | '204': | |
1369 | description: successful operation | |
1370 | ||
1371 | /users/me/notification-settings: | |
1372 | put: | |
1373 | summary: Update my notification settings | |
1374 | security: | |
1375 | - OAuth2: [] | |
1376 | tags: | |
1377 | - My Notifications | |
1378 | requestBody: | |
1379 | content: | |
1380 | application/json: | |
1381 | schema: | |
1382 | type: object | |
1383 | properties: | |
1384 | newVideoFromSubscription: | |
1385 | $ref: '#/components/schemas/NotificationSettingValue' | |
1386 | newCommentOnMyVideo: | |
1387 | $ref: '#/components/schemas/NotificationSettingValue' | |
1388 | abuseAsModerator: | |
1389 | $ref: '#/components/schemas/NotificationSettingValue' | |
1390 | videoAutoBlacklistAsModerator: | |
1391 | $ref: '#/components/schemas/NotificationSettingValue' | |
1392 | blacklistOnMyVideo: | |
1393 | $ref: '#/components/schemas/NotificationSettingValue' | |
1394 | myVideoPublished: | |
1395 | $ref: '#/components/schemas/NotificationSettingValue' | |
1396 | myVideoImportFinished: | |
1397 | $ref: '#/components/schemas/NotificationSettingValue' | |
1398 | newFollow: | |
1399 | $ref: '#/components/schemas/NotificationSettingValue' | |
1400 | newUserRegistration: | |
1401 | $ref: '#/components/schemas/NotificationSettingValue' | |
1402 | commentMention: | |
1403 | $ref: '#/components/schemas/NotificationSettingValue' | |
1404 | newInstanceFollower: | |
1405 | $ref: '#/components/schemas/NotificationSettingValue' | |
1406 | autoInstanceFollowing: | |
1407 | $ref: '#/components/schemas/NotificationSettingValue' | |
1408 | responses: | |
1409 | '204': | |
1410 | description: successful operation | |
1411 | ||
1412 | /users/me/history/videos: | |
1413 | get: | |
1414 | summary: List watched videos history | |
1415 | security: | |
1416 | - OAuth2: [] | |
1417 | tags: | |
1418 | - My History | |
1419 | parameters: | |
1420 | - $ref: '#/components/parameters/start' | |
1421 | - $ref: '#/components/parameters/count' | |
1422 | - $ref: '#/components/parameters/search' | |
1423 | responses: | |
1424 | '200': | |
1425 | description: successful operation | |
1426 | content: | |
1427 | application/json: | |
1428 | schema: | |
1429 | $ref: '#/components/schemas/VideoListResponse' | |
1430 | ||
1431 | /users/me/history/videos/remove: | |
1432 | post: | |
1433 | summary: Clear video history | |
1434 | security: | |
1435 | - OAuth2: [] | |
1436 | tags: | |
1437 | - My History | |
1438 | requestBody: | |
1439 | content: | |
1440 | multipart/form-data: | |
1441 | schema: | |
1442 | type: object | |
1443 | properties: | |
1444 | beforeDate: | |
1445 | description: history before this date will be deleted | |
1446 | type: string | |
1447 | format: date-time | |
1448 | responses: | |
1449 | '204': | |
1450 | description: successful operation | |
1451 | ||
1452 | /users/me/avatar/pick: | |
1453 | post: | |
1454 | summary: Update my user avatar | |
1455 | security: | |
1456 | - OAuth2: [] | |
1457 | tags: | |
1458 | - My User | |
1459 | responses: | |
1460 | '200': | |
1461 | description: successful operation | |
1462 | content: | |
1463 | application/json: | |
1464 | schema: | |
1465 | type: object | |
1466 | properties: | |
1467 | avatar: | |
1468 | $ref: '#/components/schemas/ActorImage' | |
1469 | '413': | |
1470 | description: image file too large | |
1471 | headers: | |
1472 | X-File-Maximum-Size: | |
1473 | schema: | |
1474 | type: string | |
1475 | format: Nginx size | |
1476 | description: Maximum file size for the avatar | |
1477 | requestBody: | |
1478 | content: | |
1479 | multipart/form-data: | |
1480 | schema: | |
1481 | type: object | |
1482 | properties: | |
1483 | avatarfile: | |
1484 | description: The file to upload | |
1485 | type: string | |
1486 | format: binary | |
1487 | encoding: | |
1488 | avatarfile: | |
1489 | contentType: image/png, image/jpeg | |
1490 | ||
1491 | /users/me/avatar: | |
1492 | delete: | |
1493 | summary: Delete my avatar | |
1494 | security: | |
1495 | - OAuth2: [] | |
1496 | tags: | |
1497 | - My User | |
1498 | responses: | |
1499 | '204': | |
1500 | description: successful operation | |
1501 | ||
1502 | /videos/ownership: | |
1503 | get: | |
1504 | summary: List video ownership changes | |
1505 | tags: | |
1506 | - Video Ownership Change | |
1507 | security: | |
1508 | - OAuth2: [] | |
1509 | responses: | |
1510 | '200': | |
1511 | description: successful operation | |
1512 | ||
1513 | '/videos/ownership/{id}/accept': | |
1514 | post: | |
1515 | summary: Accept ownership change request | |
1516 | tags: | |
1517 | - Video Ownership Change | |
1518 | security: | |
1519 | - OAuth2: [] | |
1520 | parameters: | |
1521 | - $ref: '#/components/parameters/idOrUUID' | |
1522 | responses: | |
1523 | '204': | |
1524 | description: successful operation | |
1525 | '403': | |
1526 | description: cannot terminate an ownership change of another user | |
1527 | '404': | |
1528 | description: video owneship change not found | |
1529 | ||
1530 | '/videos/ownership/{id}/refuse': | |
1531 | post: | |
1532 | summary: Refuse ownership change request | |
1533 | tags: | |
1534 | - Video Ownership Change | |
1535 | security: | |
1536 | - OAuth2: [] | |
1537 | parameters: | |
1538 | - $ref: '#/components/parameters/idOrUUID' | |
1539 | responses: | |
1540 | '204': | |
1541 | description: successful operation | |
1542 | '403': | |
1543 | description: cannot terminate an ownership change of another user | |
1544 | '404': | |
1545 | description: video owneship change not found | |
1546 | ||
1547 | '/videos/{id}/give-ownership': | |
1548 | post: | |
1549 | summary: Request ownership change | |
1550 | tags: | |
1551 | - Video Ownership Change | |
1552 | security: | |
1553 | - OAuth2: [] | |
1554 | parameters: | |
1555 | - $ref: '#/components/parameters/idOrUUID' | |
1556 | requestBody: | |
1557 | required: true | |
1558 | content: | |
1559 | application/x-www-form-urlencoded: | |
1560 | schema: | |
1561 | type: object | |
1562 | properties: | |
1563 | username: | |
1564 | type: string | |
1565 | required: | |
1566 | - username | |
1567 | responses: | |
1568 | '204': | |
1569 | description: successful operation | |
1570 | '400': | |
1571 | description: changing video ownership to a remote account is not supported yet | |
1572 | '404': | |
1573 | description: video not found | |
1574 | ||
1575 | /videos: | |
1576 | get: | |
1577 | summary: List videos | |
1578 | operationId: getVideos | |
1579 | tags: | |
1580 | - Video | |
1581 | parameters: | |
1582 | - $ref: '#/components/parameters/categoryOneOf' | |
1583 | - $ref: '#/components/parameters/isLive' | |
1584 | - $ref: '#/components/parameters/tagsOneOf' | |
1585 | - $ref: '#/components/parameters/tagsAllOf' | |
1586 | - $ref: '#/components/parameters/licenceOneOf' | |
1587 | - $ref: '#/components/parameters/languageOneOf' | |
1588 | - $ref: '#/components/parameters/nsfw' | |
1589 | - $ref: '#/components/parameters/filter' | |
1590 | - $ref: '#/components/parameters/skipCount' | |
1591 | - $ref: '#/components/parameters/start' | |
1592 | - $ref: '#/components/parameters/count' | |
1593 | - $ref: '#/components/parameters/videosSort' | |
1594 | responses: | |
1595 | '200': | |
1596 | description: successful operation | |
1597 | content: | |
1598 | application/json: | |
1599 | schema: | |
1600 | $ref: '#/components/schemas/VideoListResponse' | |
1601 | ||
1602 | /videos/categories: | |
1603 | get: | |
1604 | summary: List available video categories | |
1605 | operationId: getCategories | |
1606 | tags: | |
1607 | - Video | |
1608 | responses: | |
1609 | '200': | |
1610 | description: successful operation | |
1611 | content: | |
1612 | application/json: | |
1613 | schema: | |
1614 | type: array | |
1615 | items: | |
1616 | type: string | |
1617 | examples: | |
1618 | nightly: | |
1619 | externalValue: https://peertube2.cpy.re/api/v1/videos/categories | |
1620 | ||
1621 | /videos/licences: | |
1622 | get: | |
1623 | summary: List available video licences | |
1624 | operationId: getLicences | |
1625 | tags: | |
1626 | - Video | |
1627 | responses: | |
1628 | '200': | |
1629 | description: successful operation | |
1630 | content: | |
1631 | application/json: | |
1632 | schema: | |
1633 | type: array | |
1634 | items: | |
1635 | type: string | |
1636 | examples: | |
1637 | nightly: | |
1638 | externalValue: https://peertube2.cpy.re/api/v1/videos/licences | |
1639 | ||
1640 | /videos/languages: | |
1641 | get: | |
1642 | summary: List available video languages | |
1643 | operationId: getLanguages | |
1644 | tags: | |
1645 | - Video | |
1646 | responses: | |
1647 | '200': | |
1648 | description: successful operation | |
1649 | content: | |
1650 | application/json: | |
1651 | schema: | |
1652 | type: array | |
1653 | items: | |
1654 | type: string | |
1655 | examples: | |
1656 | nightly: | |
1657 | externalValue: https://peertube2.cpy.re/api/v1/videos/languages | |
1658 | ||
1659 | /videos/privacies: | |
1660 | get: | |
1661 | summary: List available video privacy policies | |
1662 | operationId: getPrivacyPolicies | |
1663 | tags: | |
1664 | - Video | |
1665 | responses: | |
1666 | '200': | |
1667 | description: successful operation | |
1668 | content: | |
1669 | application/json: | |
1670 | schema: | |
1671 | type: array | |
1672 | items: | |
1673 | type: string | |
1674 | examples: | |
1675 | nightly: | |
1676 | externalValue: https://peertube2.cpy.re/api/v1/videos/privacies | |
1677 | ||
1678 | '/videos/{id}': | |
1679 | put: | |
1680 | summary: Update a video | |
1681 | operationId: putVideo | |
1682 | security: | |
1683 | - OAuth2: [] | |
1684 | tags: | |
1685 | - Video | |
1686 | parameters: | |
1687 | - $ref: '#/components/parameters/idOrUUID' | |
1688 | responses: | |
1689 | '204': | |
1690 | description: successful operation | |
1691 | requestBody: | |
1692 | content: | |
1693 | multipart/form-data: | |
1694 | schema: | |
1695 | type: object | |
1696 | properties: | |
1697 | thumbnailfile: | |
1698 | description: Video thumbnail file | |
1699 | type: string | |
1700 | format: binary | |
1701 | previewfile: | |
1702 | description: Video preview file | |
1703 | type: string | |
1704 | format: binary | |
1705 | category: | |
1706 | $ref: '#/components/schemas/VideoCategorySet' | |
1707 | licence: | |
1708 | $ref: '#/components/schemas/VideoLicenceSet' | |
1709 | language: | |
1710 | $ref: '#/components/schemas/VideoLanguageSet' | |
1711 | privacy: | |
1712 | $ref: '#/components/schemas/VideoPrivacySet' | |
1713 | description: | |
1714 | description: Video description | |
1715 | type: string | |
1716 | waitTranscoding: | |
1717 | description: Whether or not we wait transcoding before publish the video | |
1718 | type: string | |
1719 | support: | |
1720 | description: A text tell the audience how to support the video creator | |
1721 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 | |
1722 | type: string | |
1723 | nsfw: | |
1724 | description: Whether or not this video contains sensitive content | |
1725 | type: boolean | |
1726 | name: | |
1727 | description: Video name | |
1728 | type: string | |
1729 | minLength: 3 | |
1730 | maxLength: 120 | |
1731 | tags: | |
1732 | description: Video tags (maximum 5 tags each between 2 and 30 characters) | |
1733 | type: array | |
1734 | minItems: 1 | |
1735 | maxItems: 5 | |
1736 | items: | |
1737 | type: string | |
1738 | minLength: 2 | |
1739 | maxLength: 30 | |
1740 | commentsEnabled: | |
1741 | description: Enable or disable comments for this video | |
1742 | type: boolean | |
1743 | originallyPublishedAt: | |
1744 | description: Date when the content was originally published | |
1745 | type: string | |
1746 | format: date-time | |
1747 | scheduleUpdate: | |
1748 | $ref: '#/components/schemas/VideoScheduledUpdate' | |
1749 | encoding: | |
1750 | thumbnailfile: | |
1751 | contentType: image/jpeg | |
1752 | previewfile: | |
1753 | contentType: image/jpeg | |
1754 | get: | |
1755 | summary: Get a video | |
1756 | operationId: getVideo | |
1757 | tags: | |
1758 | - Video | |
1759 | parameters: | |
1760 | - $ref: '#/components/parameters/idOrUUID' | |
1761 | responses: | |
1762 | '200': | |
1763 | description: successful operation | |
1764 | content: | |
1765 | application/json: | |
1766 | schema: | |
1767 | $ref: '#/components/schemas/VideoDetails' | |
1768 | delete: | |
1769 | summary: Delete a video | |
1770 | operationId: delVideo | |
1771 | security: | |
1772 | - OAuth2: [] | |
1773 | tags: | |
1774 | - Video | |
1775 | parameters: | |
1776 | - $ref: '#/components/parameters/idOrUUID' | |
1777 | responses: | |
1778 | '204': | |
1779 | description: successful operation | |
1780 | ||
1781 | '/videos/{id}/description': | |
1782 | get: | |
1783 | summary: Get complete video description | |
1784 | operationId: getVideoDesc | |
1785 | tags: | |
1786 | - Video | |
1787 | parameters: | |
1788 | - $ref: '#/components/parameters/idOrUUID' | |
1789 | responses: | |
1790 | '200': | |
1791 | description: successful operation | |
1792 | content: | |
1793 | application/json: | |
1794 | schema: | |
1795 | nullable: true | |
1796 | type: string | |
1797 | minLength: 3 | |
1798 | maxLength: 10000 | |
1799 | example: | | |
1800 | **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)** | |
1801 | ||
1802 | '/videos/{id}/views': | |
1803 | post: | |
1804 | summary: Add a view to a video | |
1805 | operationId: addView | |
1806 | tags: | |
1807 | - Video | |
1808 | parameters: | |
1809 | - $ref: '#/components/parameters/idOrUUID' | |
1810 | responses: | |
1811 | '204': | |
1812 | description: successful operation | |
1813 | ||
1814 | '/videos/{id}/watching': | |
1815 | put: | |
1816 | summary: Set watching progress of a video | |
1817 | operationId: setProgress | |
1818 | tags: | |
1819 | - Video | |
1820 | security: | |
1821 | - OAuth2: [] | |
1822 | parameters: | |
1823 | - $ref: '#/components/parameters/idOrUUID' | |
1824 | requestBody: | |
1825 | content: | |
1826 | application/json: | |
1827 | schema: | |
1828 | $ref: '#/components/schemas/UserWatchingVideo' | |
1829 | required: true | |
1830 | responses: | |
1831 | '204': | |
1832 | description: successful operation | |
1833 | ||
1834 | /videos/upload: | |
1835 | post: | |
1836 | summary: Upload a video | |
1837 | description: Uses a single request to upload a video. | |
1838 | operationId: uploadLegacy | |
1839 | security: | |
1840 | - OAuth2: [] | |
1841 | tags: | |
1842 | - Video | |
1843 | - Video Upload | |
1844 | responses: | |
1845 | '200': | |
1846 | description: successful operation | |
1847 | content: | |
1848 | application/json: | |
1849 | schema: | |
1850 | $ref: '#/components/schemas/VideoUploadResponse' | |
1851 | '403': | |
1852 | description: video didn't pass upload filter | |
1853 | '408': | |
1854 | description: upload has timed out | |
1855 | '413': | |
1856 | x-summary: video file too large, due to quota or max body size limit set by the reverse-proxy | |
1857 | description: | | |
1858 | If the response has no body, it means the reverse-proxy didn't let it through. Otherwise disambiguate via `type`: | |
1859 | - `quota_reached` for quota limits wether daily or global | |
1860 | headers: | |
1861 | X-File-Maximum-Size: | |
1862 | schema: | |
1863 | type: string | |
1864 | format: Nginx size | |
1865 | description: Maximum file size for the video | |
1866 | '415': | |
1867 | description: video type unsupported | |
1868 | '422': | |
1869 | description: video unreadable | |
1870 | requestBody: | |
1871 | content: | |
1872 | multipart/form-data: | |
1873 | schema: | |
1874 | $ref: '#/components/schemas/VideoUploadRequestLegacy' | |
1875 | encoding: | |
1876 | videofile: | |
1877 | contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream | |
1878 | thumbnailfile: | |
1879 | contentType: image/jpeg | |
1880 | previewfile: | |
1881 | contentType: image/jpeg | |
1882 | x-codeSamples: | |
1883 | - lang: Shell | |
1884 | source: | | |
1885 | ## DEPENDENCIES: jq | |
1886 | USERNAME="<your_username>" | |
1887 | PASSWORD="<your_password>" | |
1888 | FILE_PATH="<your_file_path>" | |
1889 | CHANNEL_ID="<your_channel_id>" | |
1890 | NAME="<video_name>" | |
1891 | API="https://peertube2.cpy.re/api/v1" | |
1892 | ||
1893 | ## AUTH | |
1894 | client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id") | |
1895 | client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret") | |
1896 | token=$(curl -s "$API/users/token" \ | |
1897 | --data client_id="$client_id" \ | |
1898 | --data client_secret="$client_secret" \ | |
1899 | --data grant_type=password \ | |
1900 | --data username="$USERNAME" \ | |
1901 | --data password="$PASSWORD" \ | |
1902 | | jq -r ".access_token") | |
1903 | ||
1904 | ## VIDEO UPLOAD | |
1905 | curl -s "$API/videos/upload" \ | |
1906 | -H "Authorization: Bearer $token" \ | |
1907 | --max-time 600 \ | |
1908 | --form videofile=@"$FILE_PATH" \ | |
1909 | --form channelId=$CHANNEL_ID \ | |
1910 | --form name="$NAME" | |
1911 | ||
1912 | /videos/upload-resumable: | |
1913 | post: | |
1914 | summary: Initialize the resumable upload of a video | |
1915 | description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to initialize the upload of a video | |
1916 | operationId: uploadResumableInit | |
1917 | security: | |
1918 | - OAuth2: [] | |
1919 | tags: | |
1920 | - Video | |
1921 | - Video Upload | |
1922 | parameters: | |
1923 | - name: X-Upload-Content-Length | |
1924 | in: header | |
1925 | schema: | |
1926 | type: number | |
1927 | example: 2469036 | |
1928 | required: true | |
1929 | description: Number of bytes that will be uploaded in subsequent requests. Set this value to the size of the file you are uploading. | |
1930 | - name: X-Upload-Content-Type | |
1931 | in: header | |
1932 | schema: | |
1933 | type: string | |
1934 | format: mimetype | |
1935 | example: video/mp4 | |
1936 | required: true | |
1937 | description: MIME type of the file that you are uploading. Depending on your instance settings, acceptable values might vary. | |
1938 | requestBody: | |
1939 | content: | |
1940 | application/json: | |
1941 | schema: | |
1942 | $ref: '#/components/schemas/VideoUploadRequestResumable' | |
1943 | responses: | |
1944 | '200': | |
1945 | description: file already exists, send a [`resume`](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) request instead | |
1946 | '201': | |
1947 | description: created | |
1948 | headers: | |
1949 | Location: | |
1950 | schema: | |
1951 | type: string | |
1952 | format: url | |
1953 | example: /api/v1/videos/upload-resumable?upload_id=471e97554f21dec3b8bb5d4602939c51 | |
1954 | Content-Length: | |
1955 | schema: | |
1956 | type: number | |
1957 | example: 0 | |
1958 | '413': | |
1959 | x-summary: video file too large, due to quota, absolute max file size or concurrent partial upload limit | |
1960 | description: | | |
1961 | Disambiguate via `type`: | |
1962 | - `max_file_size_reached` for the absolute file size limit | |
1963 | - `quota_reached` for quota limits whether daily or global | |
1964 | '415': | |
1965 | description: video type unsupported | |
1966 | put: | |
1967 | summary: Send chunk for the resumable upload of a video | |
1968 | description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to continue, pause or resume the upload of a video | |
1969 | operationId: uploadResumable | |
1970 | security: | |
1971 | - OAuth2: [] | |
1972 | tags: | |
1973 | - Video | |
1974 | - Video Upload | |
1975 | parameters: | |
1976 | - name: upload_id | |
1977 | in: query | |
1978 | required: true | |
1979 | description: | | |
1980 | Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is | |
1981 | not valid anymore and you need to initialize a new upload. | |
1982 | schema: | |
1983 | type: string | |
1984 | - name: Content-Range | |
1985 | in: header | |
1986 | schema: | |
1987 | type: string | |
1988 | example: bytes 0-262143/2469036 | |
1989 | required: true | |
1990 | description: | | |
1991 | Specifies the bytes in the file that the request is uploading. | |
1992 | ||
1993 | For example, a value of `bytes 0-262143/1000000` shows that the request is sending the first | |
1994 | 262144 bytes (256 x 1024) in a 2,469,036 byte file. | |
1995 | - name: Content-Length | |
1996 | in: header | |
1997 | schema: | |
1998 | type: number | |
1999 | example: 262144 | |
2000 | required: true | |
2001 | description: | | |
2002 | Size of the chunk that the request is sending. | |
2003 | ||
2004 | The chunk size __must be a multiple of 256 KB__, and unlike [Google Resumable](https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol) | |
2005 | doesn't mandate for chunks to have the same size throughout the upload sequence. | |
2006 | ||
2007 | Remember that larger chunks are more efficient. PeerTube's web client uses chunks varying from | |
2008 | 1048576 bytes (~1MB) and increases or reduces size depending on connection health. | |
2009 | requestBody: | |
2010 | content: | |
2011 | application/octet-stream: | |
2012 | schema: | |
2013 | type: string | |
2014 | format: binary | |
2015 | responses: | |
2016 | '200': | |
2017 | description: last chunk received | |
2018 | headers: | |
2019 | Content-Length: | |
2020 | schema: | |
2021 | type: number | |
2022 | content: | |
2023 | application/json: | |
2024 | schema: | |
2025 | $ref: '#/components/schemas/VideoUploadResponse' | |
2026 | '308': | |
2027 | description: resume incomplete | |
2028 | headers: | |
2029 | Range: | |
2030 | schema: | |
2031 | type: string | |
2032 | example: bytes=0-262143 | |
2033 | Content-Length: | |
2034 | schema: | |
2035 | type: number | |
2036 | example: 0 | |
2037 | '403': | |
2038 | description: video didn't pass upload filter | |
2039 | '404': | |
2040 | description: upload not found | |
2041 | '409': | |
2042 | description: chunk doesn't match range | |
2043 | '422': | |
2044 | description: video unreadable | |
2045 | '429': | |
2046 | description: too many concurrent requests | |
2047 | delete: | |
2048 | summary: Cancel the resumable upload of a video, deleting any data uploaded so far | |
2049 | description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to cancel the upload of a video | |
2050 | operationId: uploadResumableCancel | |
2051 | security: | |
2052 | - OAuth2: [] | |
2053 | tags: | |
2054 | - Video | |
2055 | - Video Upload | |
2056 | parameters: | |
2057 | - name: upload_id | |
2058 | in: query | |
2059 | required: true | |
2060 | description: | | |
2061 | Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is | |
2062 | not valid anymore and the upload session has already been deleted with its data ;-) | |
2063 | schema: | |
2064 | type: string | |
2065 | - name: Content-Length | |
2066 | in: header | |
2067 | required: true | |
2068 | schema: | |
2069 | type: number | |
2070 | example: 0 | |
2071 | responses: | |
2072 | '204': | |
2073 | description: upload cancelled | |
2074 | headers: | |
2075 | Content-Length: | |
2076 | schema: | |
2077 | type: number | |
2078 | example: 0 | |
2079 | '404': | |
2080 | description: upload not found | |
2081 | ||
2082 | /videos/imports: | |
2083 | post: | |
2084 | summary: Import a video | |
2085 | description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator) | |
2086 | operationId: importVideo | |
2087 | security: | |
2088 | - OAuth2: [] | |
2089 | tags: | |
2090 | - Video | |
2091 | - Video Upload | |
2092 | requestBody: | |
2093 | content: | |
2094 | multipart/form-data: | |
2095 | schema: | |
2096 | $ref: '#/components/schemas/VideoCreateImport' | |
2097 | encoding: | |
2098 | torrentfile: | |
2099 | contentType: application/x-bittorrent | |
2100 | thumbnailfile: | |
2101 | contentType: image/jpeg | |
2102 | previewfile: | |
2103 | contentType: image/jpeg | |
2104 | responses: | |
2105 | '200': | |
2106 | description: successful operation | |
2107 | content: | |
2108 | application/json: | |
2109 | schema: | |
2110 | $ref: '#/components/schemas/VideoUploadResponse' | |
2111 | '400': | |
2112 | description: '`magnetUri` or `targetUrl` or a torrent file missing' | |
2113 | '403': | |
2114 | description: video didn't pass pre-import filter | |
2115 | '409': | |
2116 | description: HTTP or Torrent/magnetURI import not enabled | |
2117 | ||
2118 | /videos/live: | |
2119 | post: | |
2120 | summary: Create a live | |
2121 | operationId: addLive | |
2122 | security: | |
2123 | - OAuth2: [] | |
2124 | tags: | |
2125 | - Live Videos | |
2126 | - Video | |
2127 | responses: | |
2128 | '200': | |
2129 | description: successful operation | |
2130 | content: | |
2131 | application/json: | |
2132 | schema: | |
2133 | $ref: '#/components/schemas/VideoUploadResponse' | |
2134 | '400': | |
2135 | x-summary: validation error, or conflicting `saveReplay` and `permanentLive` parameter set | |
2136 | description: | | |
2137 | Disambiguate via `type`: | |
2138 | - default type for a validation error | |
2139 | - `live_conflicting_permanent_and_save_replay` for conflicting parameters set | |
2140 | '403': | |
2141 | x-summary: live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded | |
2142 | description: | | |
2143 | Disambiguate via `type`: | |
2144 | - `live_not_enabled` for a disabled live feature | |
2145 | - `live_not_allowing_replay` for a disabled replay feature | |
2146 | - `max_instance_lives_limit_reached` for the absolute concurrent live limit | |
2147 | - `max_user_lives_limit_reached` for the user concurrent live limit | |
2148 | requestBody: | |
2149 | content: | |
2150 | multipart/form-data: | |
2151 | schema: | |
2152 | type: object | |
2153 | properties: | |
2154 | channelId: | |
2155 | description: Channel id that will contain this live video | |
2156 | type: integer | |
2157 | saveReplay: | |
2158 | type: boolean | |
2159 | permanentLive: | |
2160 | description: User can stream multiple times in a permanent live | |
2161 | type: boolean | |
2162 | thumbnailfile: | |
2163 | description: Live video/replay thumbnail file | |
2164 | type: string | |
2165 | format: binary | |
2166 | previewfile: | |
2167 | description: Live video/replay preview file | |
2168 | type: string | |
2169 | format: binary | |
2170 | privacy: | |
2171 | $ref: '#/components/schemas/VideoPrivacySet' | |
2172 | category: | |
2173 | $ref: '#/components/schemas/VideoCategorySet' | |
2174 | licence: | |
2175 | $ref: '#/components/schemas/VideoLicenceSet' | |
2176 | language: | |
2177 | $ref: '#/components/schemas/VideoLanguageSet' | |
2178 | description: | |
2179 | description: Live video/replay description | |
2180 | type: string | |
2181 | support: | |
2182 | description: A text tell the audience how to support the creator | |
2183 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 | |
2184 | type: string | |
2185 | nsfw: | |
2186 | description: Whether or not this live video/replay contains sensitive content | |
2187 | type: boolean | |
2188 | name: | |
2189 | description: Live video/replay name | |
2190 | type: string | |
2191 | minLength: 3 | |
2192 | maxLength: 120 | |
2193 | tags: | |
2194 | description: Live video/replay tags (maximum 5 tags each between 2 and 30 characters) | |
2195 | type: array | |
2196 | minItems: 1 | |
2197 | maxItems: 5 | |
2198 | items: | |
2199 | type: string | |
2200 | minLength: 2 | |
2201 | maxLength: 30 | |
2202 | commentsEnabled: | |
2203 | description: Enable or disable comments for this live video/replay | |
2204 | type: boolean | |
2205 | downloadEnabled: | |
2206 | description: Enable or disable downloading for the replay of this live | |
2207 | type: boolean | |
2208 | required: | |
2209 | - channelId | |
2210 | - name | |
2211 | encoding: | |
2212 | thumbnailfile: | |
2213 | contentType: image/jpeg | |
2214 | previewfile: | |
2215 | contentType: image/jpeg | |
2216 | ||
2217 | /videos/live/{id}: | |
2218 | get: | |
2219 | summary: Get information about a live | |
2220 | operationId: getLiveId | |
2221 | security: | |
2222 | - OAuth2: [] | |
2223 | tags: | |
2224 | - Live Videos | |
2225 | - Video | |
2226 | parameters: | |
2227 | - $ref: '#/components/parameters/idOrUUID' | |
2228 | responses: | |
2229 | '200': | |
2230 | description: successful operation | |
2231 | content: | |
2232 | application/json: | |
2233 | schema: | |
2234 | $ref: '#/components/schemas/LiveVideoResponse' | |
2235 | put: | |
2236 | summary: Update information about a live | |
2237 | operationId: updateLiveId | |
2238 | security: | |
2239 | - OAuth2: [] | |
2240 | tags: | |
2241 | - Live Videos | |
2242 | - Video | |
2243 | parameters: | |
2244 | - $ref: '#/components/parameters/idOrUUID' | |
2245 | requestBody: | |
2246 | content: | |
2247 | application/json: | |
2248 | schema: | |
2249 | $ref: '#/components/schemas/LiveVideoUpdate' | |
2250 | responses: | |
2251 | '204': | |
2252 | description: successful operation | |
2253 | '400': | |
2254 | description: bad parameters or trying to update a live that has already started | |
2255 | '403': | |
2256 | description: trying to save replay of the live but saving replay is not enabled on the instance | |
2257 | ||
2258 | /users/me/abuses: | |
2259 | get: | |
2260 | summary: List my abuses | |
2261 | operationId: getMyAbuses | |
2262 | security: | |
2263 | - OAuth2: [] | |
2264 | tags: | |
2265 | - Abuses | |
2266 | - My User | |
2267 | parameters: | |
2268 | - name: id | |
2269 | in: query | |
2270 | description: only list the report with this id | |
2271 | schema: | |
2272 | type: integer | |
2273 | - name: state | |
2274 | in: query | |
2275 | schema: | |
2276 | $ref: '#/components/schemas/AbuseStateSet' | |
2277 | - $ref: '#/components/parameters/abusesSort' | |
2278 | - $ref: '#/components/parameters/start' | |
2279 | - $ref: '#/components/parameters/count' | |
2280 | responses: | |
2281 | '200': | |
2282 | description: successful operation | |
2283 | content: | |
2284 | application/json: | |
2285 | schema: | |
2286 | type: object | |
2287 | properties: | |
2288 | total: | |
2289 | type: integer | |
2290 | example: 1 | |
2291 | data: | |
2292 | type: array | |
2293 | items: | |
2294 | $ref: '#/components/schemas/Abuse' | |
2295 | ||
2296 | /abuses: | |
2297 | get: | |
2298 | summary: List abuses | |
2299 | operationId: getAbuses | |
2300 | security: | |
2301 | - OAuth2: | |
2302 | - admin | |
2303 | - moderator | |
2304 | tags: | |
2305 | - Abuses | |
2306 | parameters: | |
2307 | - name: id | |
2308 | in: query | |
2309 | description: only list the report with this id | |
2310 | schema: | |
2311 | type: integer | |
2312 | - name: predefinedReason | |
2313 | in: query | |
2314 | description: predefined reason the listed reports should contain | |
2315 | schema: | |
2316 | $ref: '#/components/schemas/PredefinedAbuseReasons' | |
2317 | - name: search | |
2318 | in: query | |
2319 | description: plain search that will match with video titles, reporter names and more | |
2320 | schema: | |
2321 | type: string | |
2322 | - name: state | |
2323 | in: query | |
2324 | schema: | |
2325 | $ref: '#/components/schemas/AbuseStateSet' | |
2326 | - name: searchReporter | |
2327 | in: query | |
2328 | description: only list reports of a specific reporter | |
2329 | schema: | |
2330 | type: string | |
2331 | - name: searchReportee | |
2332 | description: only list reports of a specific reportee | |
2333 | in: query | |
2334 | schema: | |
2335 | type: string | |
2336 | - name: searchVideo | |
2337 | in: query | |
2338 | description: only list reports of a specific video | |
2339 | schema: | |
2340 | type: string | |
2341 | - name: searchVideoChannel | |
2342 | in: query | |
2343 | description: only list reports of a specific video channel | |
2344 | schema: | |
2345 | type: string | |
2346 | - name: videoIs | |
2347 | in: query | |
2348 | description: only list deleted or blocklisted videos | |
2349 | schema: | |
2350 | type: string | |
2351 | enum: | |
2352 | - 'deleted' | |
2353 | - 'blacklisted' | |
2354 | - name: filter | |
2355 | in: query | |
2356 | description: only list account, comment or video reports | |
2357 | schema: | |
2358 | type: string | |
2359 | enum: | |
2360 | - 'video' | |
2361 | - 'comment' | |
2362 | - 'account' | |
2363 | - $ref: '#/components/parameters/start' | |
2364 | - $ref: '#/components/parameters/count' | |
2365 | - $ref: '#/components/parameters/abusesSort' | |
2366 | responses: | |
2367 | '200': | |
2368 | description: successful operation | |
2369 | content: | |
2370 | application/json: | |
2371 | schema: | |
2372 | type: object | |
2373 | properties: | |
2374 | total: | |
2375 | type: integer | |
2376 | example: 1 | |
2377 | data: | |
2378 | type: array | |
2379 | items: | |
2380 | $ref: '#/components/schemas/Abuse' | |
2381 | post: | |
2382 | summary: Report an abuse | |
2383 | security: | |
2384 | - OAuth2: [] | |
2385 | tags: | |
2386 | - Abuses | |
2387 | requestBody: | |
2388 | required: true | |
2389 | content: | |
2390 | application/json: | |
2391 | schema: | |
2392 | type: object | |
2393 | properties: | |
2394 | reason: | |
2395 | description: Reason why the user reports this video | |
2396 | type: string | |
2397 | minLength: 2 | |
2398 | maxLength: 3000 | |
2399 | predefinedReasons: | |
2400 | $ref: '#/components/schemas/PredefinedAbuseReasons' | |
2401 | video: | |
2402 | type: object | |
2403 | properties: | |
2404 | id: | |
2405 | description: Video id to report | |
2406 | allOf: | |
2407 | - $ref: '#/components/schemas/Video/properties/id' | |
2408 | startAt: | |
2409 | type: integer | |
2410 | format: seconds | |
2411 | description: Timestamp in the video that marks the beginning of the report | |
2412 | minimum: 0 | |
2413 | endAt: | |
2414 | type: integer | |
2415 | format: seconds | |
2416 | description: Timestamp in the video that marks the ending of the report | |
2417 | minimum: 0 | |
2418 | comment: | |
2419 | type: object | |
2420 | properties: | |
2421 | id: | |
2422 | description: Comment id to report | |
2423 | allOf: | |
2424 | - $ref: '#/components/schemas/VideoComment/properties/id' | |
2425 | account: | |
2426 | type: object | |
2427 | properties: | |
2428 | id: | |
2429 | description: Account id to report | |
2430 | type: integer | |
2431 | required: | |
2432 | - reason | |
2433 | responses: | |
2434 | '200': | |
2435 | description: successful operation | |
2436 | content: | |
2437 | application/json: | |
2438 | schema: | |
2439 | type: object | |
2440 | properties: | |
2441 | abuse: | |
2442 | type: object | |
2443 | properties: | |
2444 | id: | |
2445 | $ref: '#/components/schemas/id' | |
2446 | '400': | |
2447 | description: incorrect request parameters | |
2448 | ||
2449 | '/abuses/{abuseId}': | |
2450 | put: | |
2451 | summary: Update an abuse | |
2452 | security: | |
2453 | - OAuth2: | |
2454 | - admin | |
2455 | - moderator | |
2456 | tags: | |
2457 | - Abuses | |
2458 | parameters: | |
2459 | - $ref: '#/components/parameters/abuseId' | |
2460 | requestBody: | |
2461 | content: | |
2462 | application/json: | |
2463 | schema: | |
2464 | type: object | |
2465 | properties: | |
2466 | state: | |
2467 | $ref: '#/components/schemas/AbuseStateSet' | |
2468 | moderationComment: | |
2469 | type: string | |
2470 | description: Update the report comment visible only to the moderation team | |
2471 | minLength: 2 | |
2472 | maxLength: 3000 | |
2473 | responses: | |
2474 | '204': | |
2475 | description: successful operation | |
2476 | '404': | |
2477 | description: abuse not found | |
2478 | delete: | |
2479 | tags: | |
2480 | - Abuses | |
2481 | summary: Delete an abuse | |
2482 | security: | |
2483 | - OAuth2: | |
2484 | - admin | |
2485 | - moderator | |
2486 | parameters: | |
2487 | - $ref: '#/components/parameters/abuseId' | |
2488 | responses: | |
2489 | '204': | |
2490 | description: successful operation | |
2491 | '404': | |
2492 | description: block not found | |
2493 | ||
2494 | '/abuses/{abuseId}/messages': | |
2495 | get: | |
2496 | summary: List messages of an abuse | |
2497 | security: | |
2498 | - OAuth2: [] | |
2499 | tags: | |
2500 | - Abuses | |
2501 | parameters: | |
2502 | - $ref: '#/components/parameters/abuseId' | |
2503 | responses: | |
2504 | '200': | |
2505 | description: successful operation | |
2506 | content: | |
2507 | application/json: | |
2508 | schema: | |
2509 | type: object | |
2510 | properties: | |
2511 | total: | |
2512 | type: integer | |
2513 | example: 1 | |
2514 | data: | |
2515 | type: array | |
2516 | items: | |
2517 | $ref: '#/components/schemas/AbuseMessage' | |
2518 | post: | |
2519 | summary: Add message to an abuse | |
2520 | security: | |
2521 | - OAuth2: [] | |
2522 | tags: | |
2523 | - Abuses | |
2524 | parameters: | |
2525 | - $ref: '#/components/parameters/abuseId' | |
2526 | requestBody: | |
2527 | required: true | |
2528 | content: | |
2529 | application/json: | |
2530 | schema: | |
2531 | type: object | |
2532 | properties: | |
2533 | message: | |
2534 | description: Message to send | |
2535 | type: string | |
2536 | minLength: 2 | |
2537 | maxLength: 3000 | |
2538 | required: | |
2539 | - message | |
2540 | responses: | |
2541 | '200': | |
2542 | description: successful operation | |
2543 | '400': | |
2544 | description: incorrect request parameters | |
2545 | ||
2546 | '/abuses/{abuseId}/messages/{abuseMessageId}': | |
2547 | delete: | |
2548 | summary: Delete an abuse message | |
2549 | security: | |
2550 | - OAuth2: [] | |
2551 | tags: | |
2552 | - Abuses | |
2553 | parameters: | |
2554 | - $ref: '#/components/parameters/abuseId' | |
2555 | - $ref: '#/components/parameters/abuseMessageId' | |
2556 | responses: | |
2557 | '204': | |
2558 | description: successful operation | |
2559 | ||
2560 | '/videos/{id}/blacklist': | |
2561 | post: | |
2562 | summary: Block a video | |
2563 | operationId: addVideoBlock | |
2564 | security: | |
2565 | - OAuth2: | |
2566 | - admin | |
2567 | - moderator | |
2568 | tags: | |
2569 | - Video Blocks | |
2570 | parameters: | |
2571 | - $ref: '#/components/parameters/idOrUUID' | |
2572 | responses: | |
2573 | '204': | |
2574 | description: successful operation | |
2575 | delete: | |
2576 | summary: Unblock a video by its id | |
2577 | operationId: delVideoBlock | |
2578 | security: | |
2579 | - OAuth2: | |
2580 | - admin | |
2581 | - moderator | |
2582 | tags: | |
2583 | - Video Blocks | |
2584 | parameters: | |
2585 | - $ref: '#/components/parameters/idOrUUID' | |
2586 | responses: | |
2587 | '204': | |
2588 | description: successful operation | |
2589 | '404': | |
2590 | description: block not found | |
2591 | ||
2592 | /videos/blacklist: | |
2593 | get: | |
2594 | tags: | |
2595 | - Video Blocks | |
2596 | summary: List video blocks | |
2597 | operationId: getVideoBlocks | |
2598 | security: | |
2599 | - OAuth2: | |
2600 | - admin | |
2601 | - moderator | |
2602 | parameters: | |
2603 | - name: type | |
2604 | in: query | |
2605 | description: > | |
2606 | list only blocks that match this type: | |
2607 | ||
2608 | - `1`: manual block | |
2609 | ||
2610 | - `2`: automatic block that needs review | |
2611 | schema: | |
2612 | type: integer | |
2613 | enum: | |
2614 | - 1 | |
2615 | - 2 | |
2616 | - name: search | |
2617 | in: query | |
2618 | description: plain search that will match with video titles, and more | |
2619 | schema: | |
2620 | type: string | |
2621 | - $ref: '#/components/parameters/start' | |
2622 | - $ref: '#/components/parameters/count' | |
2623 | - $ref: '#/components/parameters/blacklistsSort' | |
2624 | responses: | |
2625 | '200': | |
2626 | description: successful operation | |
2627 | content: | |
2628 | application/json: | |
2629 | schema: | |
2630 | type: object | |
2631 | properties: | |
2632 | total: | |
2633 | type: integer | |
2634 | example: 1 | |
2635 | data: | |
2636 | type: array | |
2637 | items: | |
2638 | $ref: '#/components/schemas/VideoBlacklist' | |
2639 | ||
2640 | /videos/{id}/captions: | |
2641 | get: | |
2642 | summary: List captions of a video | |
2643 | operationId: getVideoCaptions | |
2644 | tags: | |
2645 | - Video Captions | |
2646 | parameters: | |
2647 | - $ref: '#/components/parameters/idOrUUID' | |
2648 | responses: | |
2649 | '200': | |
2650 | description: successful operation | |
2651 | content: | |
2652 | application/json: | |
2653 | schema: | |
2654 | type: object | |
2655 | properties: | |
2656 | total: | |
2657 | type: integer | |
2658 | example: 1 | |
2659 | data: | |
2660 | type: array | |
2661 | items: | |
2662 | $ref: '#/components/schemas/VideoCaption' | |
2663 | ||
2664 | /videos/{id}/captions/{captionLanguage}: | |
2665 | put: | |
2666 | summary: Add or replace a video caption | |
2667 | operationId: addVideoCaption | |
2668 | security: | |
2669 | - OAuth2: | |
2670 | - user | |
2671 | tags: | |
2672 | - Video Captions | |
2673 | parameters: | |
2674 | - $ref: '#/components/parameters/idOrUUID' | |
2675 | - $ref: '#/components/parameters/captionLanguage' | |
2676 | requestBody: | |
2677 | content: | |
2678 | multipart/form-data: | |
2679 | schema: | |
2680 | type: object | |
2681 | properties: | |
2682 | captionfile: | |
2683 | description: The file to upload. | |
2684 | type: string | |
2685 | format: binary | |
2686 | encoding: | |
2687 | captionfile: | |
2688 | contentType: text/vtt, application/x-subrip, text/plain | |
2689 | responses: | |
2690 | '204': | |
2691 | description: successful operation | |
2692 | '404': | |
2693 | description: video or language not found | |
2694 | delete: | |
2695 | summary: Delete a video caption | |
2696 | operationId: delVideoCaption | |
2697 | security: | |
2698 | - OAuth2: | |
2699 | - user | |
2700 | tags: | |
2701 | - Video Captions | |
2702 | parameters: | |
2703 | - $ref: '#/components/parameters/idOrUUID' | |
2704 | - $ref: '#/components/parameters/captionLanguage' | |
2705 | responses: | |
2706 | '204': | |
2707 | description: successful operation | |
2708 | '404': | |
2709 | description: video or language or caption for that language not found | |
2710 | ||
2711 | /video-channels: | |
2712 | get: | |
2713 | summary: List video channels | |
2714 | operationId: getVideoChannels | |
2715 | tags: | |
2716 | - Video Channels | |
2717 | parameters: | |
2718 | - $ref: '#/components/parameters/start' | |
2719 | - $ref: '#/components/parameters/count' | |
2720 | - $ref: '#/components/parameters/sort' | |
2721 | responses: | |
2722 | '200': | |
2723 | description: successful operation | |
2724 | content: | |
2725 | application/json: | |
2726 | schema: | |
2727 | $ref: '#/components/schemas/VideoChannelList' | |
2728 | post: | |
2729 | summary: Create a video channel | |
2730 | operationId: addVideoChannel | |
2731 | security: | |
2732 | - OAuth2: [] | |
2733 | tags: | |
2734 | - Video Channels | |
2735 | responses: | |
2736 | '204': | |
2737 | description: successful operation | |
2738 | content: | |
2739 | application/json: | |
2740 | schema: | |
2741 | type: object | |
2742 | properties: | |
2743 | videoChannel: | |
2744 | type: object | |
2745 | properties: | |
2746 | id: | |
2747 | $ref: '#/components/schemas/VideoChannel/properties/id' | |
2748 | requestBody: | |
2749 | content: | |
2750 | application/json: | |
2751 | schema: | |
2752 | $ref: '#/components/schemas/VideoChannelCreate' | |
2753 | ||
2754 | '/video-channels/{channelHandle}': | |
2755 | get: | |
2756 | summary: Get a video channel | |
2757 | operationId: getVideoChannel | |
2758 | tags: | |
2759 | - Video Channels | |
2760 | parameters: | |
2761 | - $ref: '#/components/parameters/channelHandle' | |
2762 | responses: | |
2763 | '200': | |
2764 | description: successful operation | |
2765 | content: | |
2766 | application/json: | |
2767 | schema: | |
2768 | $ref: '#/components/schemas/VideoChannel' | |
2769 | put: | |
2770 | summary: Update a video channel | |
2771 | operationId: putVideoChannel | |
2772 | security: | |
2773 | - OAuth2: [] | |
2774 | tags: | |
2775 | - Video Channels | |
2776 | parameters: | |
2777 | - $ref: '#/components/parameters/channelHandle' | |
2778 | responses: | |
2779 | '204': | |
2780 | description: successful operation | |
2781 | requestBody: | |
2782 | content: | |
2783 | application/json: | |
2784 | schema: | |
2785 | $ref: '#/components/schemas/VideoChannelUpdate' | |
2786 | delete: | |
2787 | summary: Delete a video channel | |
2788 | operationId: delVideoChannel | |
2789 | security: | |
2790 | - OAuth2: [] | |
2791 | tags: | |
2792 | - Video Channels | |
2793 | parameters: | |
2794 | - $ref: '#/components/parameters/channelHandle' | |
2795 | responses: | |
2796 | '204': | |
2797 | description: successful operation | |
2798 | ||
2799 | '/video-channels/{channelHandle}/videos': | |
2800 | get: | |
2801 | summary: List videos of a video channel | |
2802 | operationId: getVideoChannelVideos | |
2803 | tags: | |
2804 | - Video | |
2805 | - Video Channels | |
2806 | parameters: | |
2807 | - $ref: '#/components/parameters/channelHandle' | |
2808 | - $ref: '#/components/parameters/categoryOneOf' | |
2809 | - $ref: '#/components/parameters/isLive' | |
2810 | - $ref: '#/components/parameters/tagsOneOf' | |
2811 | - $ref: '#/components/parameters/tagsAllOf' | |
2812 | - $ref: '#/components/parameters/licenceOneOf' | |
2813 | - $ref: '#/components/parameters/languageOneOf' | |
2814 | - $ref: '#/components/parameters/nsfw' | |
2815 | - $ref: '#/components/parameters/filter' | |
2816 | - $ref: '#/components/parameters/skipCount' | |
2817 | - $ref: '#/components/parameters/start' | |
2818 | - $ref: '#/components/parameters/count' | |
2819 | - $ref: '#/components/parameters/videosSort' | |
2820 | responses: | |
2821 | '200': | |
2822 | description: successful operation | |
2823 | content: | |
2824 | application/json: | |
2825 | schema: | |
2826 | $ref: '#/components/schemas/VideoListResponse' | |
2827 | ||
2828 | '/video-channels/{channelHandle}/avatar/pick': | |
2829 | post: | |
2830 | summary: Update channel avatar | |
2831 | security: | |
2832 | - OAuth2: [] | |
2833 | tags: | |
2834 | - Video Channels | |
2835 | parameters: | |
2836 | - $ref: '#/components/parameters/channelHandle' | |
2837 | responses: | |
2838 | '200': | |
2839 | description: successful operation | |
2840 | content: | |
2841 | application/json: | |
2842 | schema: | |
2843 | type: object | |
2844 | properties: | |
2845 | avatar: | |
2846 | $ref: '#/components/schemas/ActorImage' | |
2847 | '413': | |
2848 | description: image file too large | |
2849 | headers: | |
2850 | X-File-Maximum-Size: | |
2851 | schema: | |
2852 | type: string | |
2853 | format: Nginx size | |
2854 | description: Maximum file size for the avatar | |
2855 | requestBody: | |
2856 | content: | |
2857 | multipart/form-data: | |
2858 | schema: | |
2859 | type: object | |
2860 | properties: | |
2861 | avatarfile: | |
2862 | description: The file to upload. | |
2863 | type: string | |
2864 | format: binary | |
2865 | encoding: | |
2866 | avatarfile: | |
2867 | contentType: image/png, image/jpeg | |
2868 | ||
2869 | '/video-channels/{channelHandle}/avatar': | |
2870 | delete: | |
2871 | summary: Delete channel avatar | |
2872 | security: | |
2873 | - OAuth2: [] | |
2874 | tags: | |
2875 | - Video Channels | |
2876 | parameters: | |
2877 | - $ref: '#/components/parameters/channelHandle' | |
2878 | responses: | |
2879 | '204': | |
2880 | description: successful operation | |
2881 | ||
2882 | '/video-channels/{channelHandle}/banner/pick': | |
2883 | post: | |
2884 | summary: Update channel banner | |
2885 | security: | |
2886 | - OAuth2: [] | |
2887 | tags: | |
2888 | - Video Channels | |
2889 | parameters: | |
2890 | - $ref: '#/components/parameters/channelHandle' | |
2891 | responses: | |
2892 | '200': | |
2893 | description: successful operation | |
2894 | content: | |
2895 | application/json: | |
2896 | schema: | |
2897 | type: object | |
2898 | properties: | |
2899 | banner: | |
2900 | $ref: '#/components/schemas/ActorImage' | |
2901 | '413': | |
2902 | description: image file too large | |
2903 | headers: | |
2904 | X-File-Maximum-Size: | |
2905 | schema: | |
2906 | type: string | |
2907 | format: Nginx size | |
2908 | description: Maximum file size for the banner | |
2909 | requestBody: | |
2910 | content: | |
2911 | multipart/form-data: | |
2912 | schema: | |
2913 | type: object | |
2914 | properties: | |
2915 | bannerfile: | |
2916 | description: The file to upload. | |
2917 | type: string | |
2918 | format: binary | |
2919 | encoding: | |
2920 | bannerfile: | |
2921 | contentType: image/png, image/jpeg | |
2922 | ||
2923 | '/video-channels/{channelHandle}/banner': | |
2924 | delete: | |
2925 | summary: Delete channel banner | |
2926 | security: | |
2927 | - OAuth2: [] | |
2928 | tags: | |
2929 | - Video Channels | |
2930 | parameters: | |
2931 | - $ref: '#/components/parameters/channelHandle' | |
2932 | responses: | |
2933 | '204': | |
2934 | description: successful operation | |
2935 | ||
2936 | /video-playlists/privacies: | |
2937 | get: | |
2938 | summary: List available playlist privacy policies | |
2939 | operationId: getPlaylistPrivacyPolicies | |
2940 | tags: | |
2941 | - Video Playlists | |
2942 | responses: | |
2943 | '200': | |
2944 | description: successful operation | |
2945 | content: | |
2946 | application/json: | |
2947 | schema: | |
2948 | type: array | |
2949 | items: | |
2950 | type: string | |
2951 | examples: | |
2952 | nightly: | |
2953 | externalValue: https://peertube2.cpy.re/api/v1/video-playlists/privacies | |
2954 | ||
2955 | /video-playlists: | |
2956 | get: | |
2957 | summary: List video playlists | |
2958 | operationId: getPlaylists | |
2959 | tags: | |
2960 | - Video Playlists | |
2961 | parameters: | |
2962 | - $ref: '#/components/parameters/start' | |
2963 | - $ref: '#/components/parameters/count' | |
2964 | - $ref: '#/components/parameters/sort' | |
2965 | responses: | |
2966 | '200': | |
2967 | description: successful operation | |
2968 | content: | |
2969 | application/json: | |
2970 | schema: | |
2971 | type: object | |
2972 | properties: | |
2973 | total: | |
2974 | type: integer | |
2975 | example: 1 | |
2976 | data: | |
2977 | type: array | |
2978 | items: | |
2979 | $ref: '#/components/schemas/VideoPlaylist' | |
2980 | post: | |
2981 | summary: Create a video playlist | |
2982 | description: If the video playlist is set as public, `videoChannelId` is mandatory. | |
2983 | operationId: addPlaylist | |
2984 | security: | |
2985 | - OAuth2: [] | |
2986 | tags: | |
2987 | - Video Playlists | |
2988 | responses: | |
2989 | '200': | |
2990 | description: successful operation | |
2991 | content: | |
2992 | application/json: | |
2993 | schema: | |
2994 | type: object | |
2995 | properties: | |
2996 | videoPlaylist: | |
2997 | type: object | |
2998 | properties: | |
2999 | id: | |
3000 | $ref: '#/components/schemas/VideoPlaylist/properties/id' | |
3001 | uuid: | |
3002 | $ref: '#/components/schemas/VideoPlaylist/properties/uuid' | |
3003 | requestBody: | |
3004 | content: | |
3005 | multipart/form-data: | |
3006 | schema: | |
3007 | type: object | |
3008 | properties: | |
3009 | displayName: | |
3010 | description: Video playlist display name | |
3011 | type: string | |
3012 | minLength: 1 | |
3013 | maxLength: 120 | |
3014 | thumbnailfile: | |
3015 | description: Video playlist thumbnail file | |
3016 | type: string | |
3017 | format: binary | |
3018 | privacy: | |
3019 | $ref: '#/components/schemas/VideoPlaylistPrivacySet' | |
3020 | description: | |
3021 | description: Video playlist description | |
3022 | type: string | |
3023 | minLength: 3 | |
3024 | maxLength: 1000 | |
3025 | videoChannelId: | |
3026 | allOf: | |
3027 | - $ref: '#/components/schemas/id' | |
3028 | description: Video channel in which the playlist will be published | |
3029 | required: | |
3030 | - displayName | |
3031 | encoding: | |
3032 | thumbnailfile: | |
3033 | contentType: image/jpeg | |
3034 | ||
3035 | /video-playlists/{playlistId}: | |
3036 | get: | |
3037 | summary: Get a video playlist | |
3038 | tags: | |
3039 | - Video Playlists | |
3040 | parameters: | |
3041 | - $ref: '#/components/parameters/playlistId' | |
3042 | responses: | |
3043 | '200': | |
3044 | description: successful operation | |
3045 | content: | |
3046 | application/json: | |
3047 | schema: | |
3048 | $ref: '#/components/schemas/VideoPlaylist' | |
3049 | put: | |
3050 | summary: Update a video playlist | |
3051 | description: 'If the video playlist is set as public, the playlist must have a assigned channel.' | |
3052 | security: | |
3053 | - OAuth2: [] | |
3054 | tags: | |
3055 | - Video Playlists | |
3056 | responses: | |
3057 | '204': | |
3058 | description: successful operation | |
3059 | parameters: | |
3060 | - $ref: '#/components/parameters/playlistId' | |
3061 | requestBody: | |
3062 | content: | |
3063 | multipart/form-data: | |
3064 | schema: | |
3065 | type: object | |
3066 | properties: | |
3067 | displayName: | |
3068 | description: Video playlist display name | |
3069 | type: string | |
3070 | minLength: 1 | |
3071 | maxLength: 120 | |
3072 | thumbnailfile: | |
3073 | description: Video playlist thumbnail file | |
3074 | type: string | |
3075 | format: binary | |
3076 | privacy: | |
3077 | $ref: '#/components/schemas/VideoPlaylistPrivacySet' | |
3078 | description: | |
3079 | description: Video playlist description | |
3080 | type: string | |
3081 | videoChannelId: | |
3082 | allOf: | |
3083 | - $ref: '#/components/schemas/id' | |
3084 | description: Video channel in which the playlist will be published | |
3085 | encoding: | |
3086 | thumbnailfile: | |
3087 | contentType: image/jpeg | |
3088 | delete: | |
3089 | summary: Delete a video playlist | |
3090 | security: | |
3091 | - OAuth2: [] | |
3092 | tags: | |
3093 | - Video Playlists | |
3094 | parameters: | |
3095 | - $ref: '#/components/parameters/playlistId' | |
3096 | responses: | |
3097 | '204': | |
3098 | description: successful operation | |
3099 | ||
3100 | /video-playlists/{playlistId}/videos: | |
3101 | get: | |
3102 | summary: 'List videos of a playlist' | |
3103 | operationId: getVideoPlaylistVideos | |
3104 | tags: | |
3105 | - Videos | |
3106 | - Video Playlists | |
3107 | parameters: | |
3108 | - $ref: '#/components/parameters/playlistId' | |
3109 | responses: | |
3110 | '200': | |
3111 | description: successful operation | |
3112 | content: | |
3113 | application/json: | |
3114 | schema: | |
3115 | $ref: '#/components/schemas/VideoListResponse' | |
3116 | post: | |
3117 | summary: Add a video in a playlist | |
3118 | operationId: addVideoPlaylistVideo | |
3119 | security: | |
3120 | - OAuth2: [] | |
3121 | tags: | |
3122 | - Videos | |
3123 | - Video Playlists | |
3124 | parameters: | |
3125 | - $ref: '#/components/parameters/playlistId' | |
3126 | responses: | |
3127 | '200': | |
3128 | description: successful operation | |
3129 | content: | |
3130 | application/json: | |
3131 | schema: | |
3132 | type: object | |
3133 | properties: | |
3134 | videoPlaylistElement: | |
3135 | type: object | |
3136 | properties: | |
3137 | id: | |
3138 | type: integer | |
3139 | example: 2 | |
3140 | requestBody: | |
3141 | content: | |
3142 | application/json: | |
3143 | schema: | |
3144 | type: object | |
3145 | properties: | |
3146 | videoId: | |
3147 | oneOf: | |
3148 | - $ref: '#/components/schemas/Video/properties/uuid' | |
3149 | - $ref: '#/components/schemas/Video/properties/id' | |
3150 | description: Video to add in the playlist | |
3151 | startTimestamp: | |
3152 | type: integer | |
3153 | format: seconds | |
3154 | description: Start the video at this specific timestamp | |
3155 | stopTimestamp: | |
3156 | type: integer | |
3157 | format: seconds | |
3158 | description: Stop the video at this specific timestamp | |
3159 | required: | |
3160 | - videoId | |
3161 | ||
3162 | /video-playlists/{playlistId}/videos/reorder: | |
3163 | post: | |
3164 | summary: 'Reorder a playlist' | |
3165 | operationId: reorderVideoPlaylist | |
3166 | security: | |
3167 | - OAuth2: [] | |
3168 | tags: | |
3169 | - Video Playlists | |
3170 | parameters: | |
3171 | - $ref: '#/components/parameters/playlistId' | |
3172 | responses: | |
3173 | '204': | |
3174 | description: successful operation | |
3175 | requestBody: | |
3176 | content: | |
3177 | application/json: | |
3178 | schema: | |
3179 | type: object | |
3180 | properties: | |
3181 | startPosition: | |
3182 | type: integer | |
3183 | description: 'Start position of the element to reorder' | |
3184 | minimum: 1 | |
3185 | insertAfterPosition: | |
3186 | type: integer | |
3187 | description: 'New position for the block to reorder, to add the block before the first element' | |
3188 | minimum: 0 | |
3189 | reorderLength: | |
3190 | type: integer | |
3191 | description: 'How many element from `startPosition` to reorder' | |
3192 | minimum: 1 | |
3193 | required: | |
3194 | - startPosition | |
3195 | - insertAfterPosition | |
3196 | ||
3197 | /video-playlists/{playlistId}/videos/{playlistElementId}: | |
3198 | put: | |
3199 | summary: Update a playlist element | |
3200 | operationId: putVideoPlaylistVideo | |
3201 | security: | |
3202 | - OAuth2: [] | |
3203 | tags: | |
3204 | - Video Playlists | |
3205 | parameters: | |
3206 | - $ref: '#/components/parameters/playlistId' | |
3207 | - $ref: '#/components/parameters/playlistElementId' | |
3208 | responses: | |
3209 | '204': | |
3210 | description: successful operation | |
3211 | requestBody: | |
3212 | content: | |
3213 | application/json: | |
3214 | schema: | |
3215 | type: object | |
3216 | properties: | |
3217 | startTimestamp: | |
3218 | type: integer | |
3219 | format: seconds | |
3220 | description: Start the video at this specific timestamp | |
3221 | stopTimestamp: | |
3222 | type: integer | |
3223 | format: seconds | |
3224 | description: Stop the video at this specific timestamp | |
3225 | delete: | |
3226 | summary: Delete an element from a playlist | |
3227 | operationId: delVideoPlaylistVideo | |
3228 | security: | |
3229 | - OAuth2: [] | |
3230 | tags: | |
3231 | - Video Playlists | |
3232 | parameters: | |
3233 | - $ref: '#/components/parameters/playlistId' | |
3234 | - $ref: '#/components/parameters/playlistElementId' | |
3235 | responses: | |
3236 | '204': | |
3237 | description: successful operation | |
3238 | ||
3239 | '/users/me/video-playlists/videos-exist': | |
3240 | get: | |
3241 | summary: Check video exists in my playlists | |
3242 | security: | |
3243 | - OAuth2: [] | |
3244 | tags: | |
3245 | - Video Playlists | |
3246 | parameters: | |
3247 | - name: videoIds | |
3248 | in: query | |
3249 | required: true | |
3250 | description: The video ids to check | |
3251 | schema: | |
3252 | type: array | |
3253 | items: | |
3254 | $ref: '#/components/schemas/Video/properties/id' | |
3255 | responses: | |
3256 | '200': | |
3257 | description: successful operation | |
3258 | content: | |
3259 | application/json: | |
3260 | schema: | |
3261 | type: object | |
3262 | properties: | |
3263 | videoId: | |
3264 | type: array | |
3265 | items: | |
3266 | type: object | |
3267 | properties: | |
3268 | playlistElementId: | |
3269 | type: integer | |
3270 | playlistId: | |
3271 | type: integer | |
3272 | startTimestamp: | |
3273 | type: integer | |
3274 | format: seconds | |
3275 | stopTimestamp: | |
3276 | type: integer | |
3277 | format: seconds | |
3278 | ||
3279 | '/accounts/{name}/video-channels': | |
3280 | get: | |
3281 | summary: List video channels of an account | |
3282 | tags: | |
3283 | - Video Channels | |
3284 | - Accounts | |
3285 | parameters: | |
3286 | - $ref: '#/components/parameters/name' | |
3287 | - name: withStats | |
3288 | in: query | |
3289 | description: include view statistics for the last 30 days (only if authentified as the account user) | |
3290 | schema: | |
3291 | type: boolean | |
3292 | - $ref: '#/components/parameters/start' | |
3293 | - $ref: '#/components/parameters/count' | |
3294 | - $ref: '#/components/parameters/sort' | |
3295 | responses: | |
3296 | '200': | |
3297 | description: successful operation | |
3298 | content: | |
3299 | application/json: | |
3300 | schema: | |
3301 | $ref: '#/components/schemas/VideoChannelList' | |
3302 | ||
3303 | '/accounts/{name}/ratings': | |
3304 | get: | |
3305 | summary: List ratings of an account | |
3306 | security: | |
3307 | - OAuth2: [] | |
3308 | tags: | |
3309 | - Accounts | |
3310 | parameters: | |
3311 | - $ref: '#/components/parameters/name' | |
3312 | - $ref: '#/components/parameters/start' | |
3313 | - $ref: '#/components/parameters/count' | |
3314 | - $ref: '#/components/parameters/sort' | |
3315 | - name: rating | |
3316 | in: query | |
3317 | required: false | |
3318 | description: Optionally filter which ratings to retrieve | |
3319 | schema: | |
3320 | type: string | |
3321 | enum: | |
3322 | - like | |
3323 | - dislike | |
3324 | responses: | |
3325 | '200': | |
3326 | description: successful operation | |
3327 | content: | |
3328 | application/json: | |
3329 | schema: | |
3330 | type: array | |
3331 | items: | |
3332 | $ref: '#/components/schemas/VideoRating' | |
3333 | ||
3334 | '/videos/{id}/comment-threads': | |
3335 | get: | |
3336 | summary: List threads of a video | |
3337 | tags: | |
3338 | - Video Comments | |
3339 | parameters: | |
3340 | - $ref: '#/components/parameters/idOrUUID' | |
3341 | - $ref: '#/components/parameters/start' | |
3342 | - $ref: '#/components/parameters/count' | |
3343 | - $ref: '#/components/parameters/commentsSort' | |
3344 | responses: | |
3345 | '200': | |
3346 | description: successful operation | |
3347 | content: | |
3348 | application/json: | |
3349 | schema: | |
3350 | $ref: '#/components/schemas/CommentThreadResponse' | |
3351 | post: | |
3352 | summary: Create a thread | |
3353 | security: | |
3354 | - OAuth2: [] | |
3355 | tags: | |
3356 | - Video Comments | |
3357 | parameters: | |
3358 | - $ref: '#/components/parameters/idOrUUID' | |
3359 | responses: | |
3360 | '200': | |
3361 | description: successful operation | |
3362 | content: | |
3363 | application/json: | |
3364 | schema: | |
3365 | $ref: '#/components/schemas/CommentThreadPostResponse' | |
3366 | '404': | |
3367 | description: video does not exist | |
3368 | requestBody: | |
3369 | content: | |
3370 | application/json: | |
3371 | schema: | |
3372 | type: object | |
3373 | properties: | |
3374 | text: | |
3375 | allOf: | |
3376 | - $ref: '#/components/schemas/VideoComment/properties/text' | |
3377 | format: markdown | |
3378 | maxLength: 10000 | |
3379 | required: | |
3380 | - text | |
3381 | ||
3382 | '/videos/{id}/comment-threads/{threadId}': | |
3383 | get: | |
3384 | summary: Get a thread | |
3385 | tags: | |
3386 | - Video Comments | |
3387 | parameters: | |
3388 | - $ref: '#/components/parameters/idOrUUID' | |
3389 | - $ref: '#/components/parameters/threadId' | |
3390 | responses: | |
3391 | '200': | |
3392 | description: successful operation | |
3393 | content: | |
3394 | application/json: | |
3395 | schema: | |
3396 | $ref: '#/components/schemas/VideoCommentThreadTree' | |
3397 | ||
3398 | '/videos/{id}/comments/{commentId}': | |
3399 | post: | |
3400 | summary: Reply to a thread of a video | |
3401 | security: | |
3402 | - OAuth2: [] | |
3403 | tags: | |
3404 | - Video Comments | |
3405 | parameters: | |
3406 | - $ref: '#/components/parameters/idOrUUID' | |
3407 | - $ref: '#/components/parameters/commentId' | |
3408 | responses: | |
3409 | '200': | |
3410 | description: successful operation | |
3411 | content: | |
3412 | application/json: | |
3413 | schema: | |
3414 | $ref: '#/components/schemas/CommentThreadPostResponse' | |
3415 | '404': | |
3416 | description: thread or video does not exist | |
3417 | requestBody: | |
3418 | content: | |
3419 | application/json: | |
3420 | schema: | |
3421 | type: object | |
3422 | properties: | |
3423 | text: | |
3424 | allOf: | |
3425 | - $ref: '#/components/schemas/VideoComment/properties/text' | |
3426 | format: markdown | |
3427 | maxLength: 10000 | |
3428 | required: | |
3429 | - text | |
3430 | delete: | |
3431 | summary: Delete a comment or a reply | |
3432 | security: | |
3433 | - OAuth2: [] | |
3434 | tags: | |
3435 | - Video Comments | |
3436 | parameters: | |
3437 | - $ref: '#/components/parameters/idOrUUID' | |
3438 | - $ref: '#/components/parameters/commentId' | |
3439 | responses: | |
3440 | '204': | |
3441 | description: successful operation | |
3442 | '403': | |
3443 | description: cannot remove comment of another user | |
3444 | '404': | |
3445 | description: comment or video does not exist | |
3446 | '409': | |
3447 | description: comment is already deleted | |
3448 | ||
3449 | '/videos/{id}/rate': | |
3450 | put: | |
3451 | summary: Like/dislike a video | |
3452 | security: | |
3453 | - OAuth2: [] | |
3454 | tags: | |
3455 | - Video Rates | |
3456 | parameters: | |
3457 | - $ref: '#/components/parameters/idOrUUID' | |
3458 | requestBody: | |
3459 | content: | |
3460 | application/json: | |
3461 | schema: | |
3462 | type: object | |
3463 | properties: | |
3464 | rating: | |
3465 | type: string | |
3466 | enum: | |
3467 | - like | |
3468 | - dislike | |
3469 | required: | |
3470 | - rating | |
3471 | responses: | |
3472 | '204': | |
3473 | description: successful operation | |
3474 | '404': | |
3475 | description: video does not exist | |
3476 | ||
3477 | /search/videos: | |
3478 | get: | |
3479 | tags: | |
3480 | - Search | |
3481 | summary: Search videos | |
3482 | operationId: searchVideos | |
3483 | parameters: | |
3484 | - name: search | |
3485 | in: query | |
3486 | required: true | |
3487 | allowEmptyValue: false | |
3488 | description: > | |
3489 | String to search. If the user can make a remote URI search, and the string is an URI then the | |
3490 | PeerTube instance will fetch the remote object and add it to its database. Then, | |
3491 | you can use the REST API to fetch the complete video information and interact with it. | |
3492 | schema: | |
3493 | type: string | |
3494 | - $ref: '#/components/parameters/categoryOneOf' | |
3495 | - $ref: '#/components/parameters/isLive' | |
3496 | - $ref: '#/components/parameters/tagsOneOf' | |
3497 | - $ref: '#/components/parameters/tagsAllOf' | |
3498 | - $ref: '#/components/parameters/licenceOneOf' | |
3499 | - $ref: '#/components/parameters/languageOneOf' | |
3500 | - $ref: '#/components/parameters/nsfw' | |
3501 | - $ref: '#/components/parameters/filter' | |
3502 | - $ref: '#/components/parameters/skipCount' | |
3503 | - $ref: '#/components/parameters/start' | |
3504 | - $ref: '#/components/parameters/count' | |
3505 | - $ref: '#/components/parameters/searchTarget' | |
3506 | - $ref: '#/components/parameters/videosSearchSort' | |
3507 | - name: startDate | |
3508 | in: query | |
3509 | description: Get videos that are published after this date | |
3510 | schema: | |
3511 | type: string | |
3512 | format: date-time | |
3513 | - name: endDate | |
3514 | in: query | |
3515 | description: Get videos that are published before this date | |
3516 | schema: | |
3517 | type: string | |
3518 | format: date-time | |
3519 | - name: originallyPublishedStartDate | |
3520 | in: query | |
3521 | description: Get videos that are originally published after this date | |
3522 | schema: | |
3523 | type: string | |
3524 | format: date-time | |
3525 | - name: originallyPublishedEndDate | |
3526 | in: query | |
3527 | description: Get videos that are originally published before this date | |
3528 | schema: | |
3529 | type: string | |
3530 | format: date-time | |
3531 | - name: durationMin | |
3532 | in: query | |
3533 | description: Get videos that have this minimum duration | |
3534 | schema: | |
3535 | type: integer | |
3536 | - name: durationMax | |
3537 | in: query | |
3538 | description: Get videos that have this maximum duration | |
3539 | schema: | |
3540 | type: integer | |
3541 | callbacks: | |
3542 | 'searchTarget === search-index': | |
3543 | $ref: '#/components/callbacks/searchIndex' | |
3544 | responses: | |
3545 | '200': | |
3546 | description: successful operation | |
3547 | content: | |
3548 | application/json: | |
3549 | schema: | |
3550 | $ref: '#/components/schemas/VideoListResponse' | |
3551 | '500': | |
3552 | description: search index unavailable | |
3553 | ||
3554 | /search/video-channels: | |
3555 | get: | |
3556 | tags: | |
3557 | - Search | |
3558 | summary: Search channels | |
3559 | operationId: searchChannels | |
3560 | parameters: | |
3561 | - name: search | |
3562 | in: query | |
3563 | required: true | |
3564 | description: > | |
3565 | String to search. If the user can make a remote URI search, and the string is an URI then the | |
3566 | PeerTube instance will fetch the remote object and add it to its database. Then, | |
3567 | you can use the REST API to fetch the complete channel information and interact with it. | |
3568 | schema: | |
3569 | type: string | |
3570 | - $ref: '#/components/parameters/start' | |
3571 | - $ref: '#/components/parameters/count' | |
3572 | - $ref: '#/components/parameters/searchTarget' | |
3573 | - $ref: '#/components/parameters/sort' | |
3574 | callbacks: | |
3575 | 'searchTarget === search-index': | |
3576 | $ref: '#/components/callbacks/searchIndex' | |
3577 | responses: | |
3578 | '200': | |
3579 | description: successful operation | |
3580 | content: | |
3581 | application/json: | |
3582 | schema: | |
3583 | $ref: '#/components/schemas/VideoChannelList' | |
3584 | '500': | |
3585 | description: search index unavailable | |
3586 | ||
3587 | /server/blocklist/accounts: | |
3588 | get: | |
3589 | tags: | |
3590 | - Account Blocks | |
3591 | summary: List account blocks | |
3592 | security: | |
3593 | - OAuth2: | |
3594 | - admin | |
3595 | parameters: | |
3596 | - $ref: '#/components/parameters/start' | |
3597 | - $ref: '#/components/parameters/count' | |
3598 | - $ref: '#/components/parameters/sort' | |
3599 | responses: | |
3600 | '200': | |
3601 | description: successful operation | |
3602 | post: | |
3603 | tags: | |
3604 | - Account Blocks | |
3605 | summary: Block an account | |
3606 | security: | |
3607 | - OAuth2: | |
3608 | - admin | |
3609 | requestBody: | |
3610 | content: | |
3611 | application/json: | |
3612 | schema: | |
3613 | type: object | |
3614 | properties: | |
3615 | accountName: | |
3616 | type: string | |
3617 | example: chocobozzz@example.org | |
3618 | description: account to block, in the form `username@domain` | |
3619 | required: | |
3620 | - accountName | |
3621 | responses: | |
3622 | '200': | |
3623 | description: successful operation | |
3624 | '409': | |
3625 | description: self-blocking forbidden | |
3626 | ||
3627 | '/server/blocklist/accounts/{accountName}': | |
3628 | delete: | |
3629 | tags: | |
3630 | - Account Blocks | |
3631 | summary: Unblock an account by its handle | |
3632 | security: | |
3633 | - OAuth2: | |
3634 | - admin | |
3635 | parameters: | |
3636 | - name: accountName | |
3637 | in: path | |
3638 | required: true | |
3639 | description: account to unblock, in the form `username@domain` | |
3640 | schema: | |
3641 | type: string | |
3642 | responses: | |
3643 | '201': | |
3644 | description: successful operation | |
3645 | '404': | |
3646 | description: account or account block does not exist | |
3647 | ||
3648 | /server/blocklist/servers: | |
3649 | get: | |
3650 | tags: | |
3651 | - Server Blocks | |
3652 | summary: List server blocks | |
3653 | security: | |
3654 | - OAuth2: | |
3655 | - admin | |
3656 | parameters: | |
3657 | - $ref: '#/components/parameters/start' | |
3658 | - $ref: '#/components/parameters/count' | |
3659 | - $ref: '#/components/parameters/sort' | |
3660 | responses: | |
3661 | '200': | |
3662 | description: successful operation | |
3663 | post: | |
3664 | tags: | |
3665 | - Server Blocks | |
3666 | summary: Block a server | |
3667 | security: | |
3668 | - OAuth2: | |
3669 | - admin | |
3670 | requestBody: | |
3671 | content: | |
3672 | application/json: | |
3673 | schema: | |
3674 | type: object | |
3675 | properties: | |
3676 | host: | |
3677 | type: string | |
3678 | format: hostname | |
3679 | description: server domain to block | |
3680 | required: | |
3681 | - host | |
3682 | responses: | |
3683 | '204': | |
3684 | description: successful operation | |
3685 | '409': | |
3686 | description: self-blocking forbidden | |
3687 | ||
3688 | '/server/blocklist/servers/{host}': | |
3689 | delete: | |
3690 | tags: | |
3691 | - Server Blocks | |
3692 | summary: Unblock a server by its domain | |
3693 | security: | |
3694 | - OAuth2: | |
3695 | - admin | |
3696 | parameters: | |
3697 | - name: host | |
3698 | in: path | |
3699 | required: true | |
3700 | description: server domain to unblock | |
3701 | schema: | |
3702 | type: string | |
3703 | format: hostname | |
3704 | responses: | |
3705 | '204': | |
3706 | description: successful operation | |
3707 | '404': | |
3708 | description: account block does not exist | |
3709 | ||
3710 | /server/redundancy/{host}: | |
3711 | put: | |
3712 | tags: | |
3713 | - Instance Redundancy | |
3714 | summary: Update a server redundancy policy | |
3715 | security: | |
3716 | - OAuth2: | |
3717 | - admin | |
3718 | parameters: | |
3719 | - name: host | |
3720 | in: path | |
3721 | required: true | |
3722 | description: server domain to mirror | |
3723 | schema: | |
3724 | type: string | |
3725 | format: hostname | |
3726 | requestBody: | |
3727 | content: | |
3728 | application/json: | |
3729 | schema: | |
3730 | type: object | |
3731 | properties: | |
3732 | redundancyAllowed: | |
3733 | type: boolean | |
3734 | description: allow mirroring of the host's local videos | |
3735 | required: | |
3736 | - redundancyAllowed | |
3737 | responses: | |
3738 | '204': | |
3739 | description: successful operation | |
3740 | '404': | |
3741 | description: server is not already known | |
3742 | ||
3743 | /server/redundancy/videos: | |
3744 | get: | |
3745 | tags: | |
3746 | - Video Mirroring | |
3747 | summary: List videos being mirrored | |
3748 | operationId: getMirroredVideos | |
3749 | security: | |
3750 | - OAuth2: | |
3751 | - admin | |
3752 | parameters: | |
3753 | - name: target | |
3754 | in: query | |
3755 | required: true | |
3756 | description: direction of the mirror | |
3757 | schema: | |
3758 | type: string | |
3759 | enum: | |
3760 | - my-videos | |
3761 | - remote-videos | |
3762 | - $ref: '#/components/parameters/start' | |
3763 | - $ref: '#/components/parameters/count' | |
3764 | - $ref: '#/components/parameters/videoRedundanciesSort' | |
3765 | responses: | |
3766 | '200': | |
3767 | description: successful operation | |
3768 | content: | |
3769 | application/json: | |
3770 | schema: | |
3771 | type: array | |
3772 | items: | |
3773 | $ref: '#/components/schemas/VideoRedundancy' | |
3774 | post: | |
3775 | tags: | |
3776 | - Video Mirroring | |
3777 | summary: Mirror a video | |
3778 | operationId: putMirroredVideo | |
3779 | security: | |
3780 | - OAuth2: | |
3781 | - admin | |
3782 | requestBody: | |
3783 | content: | |
3784 | application/json: | |
3785 | schema: | |
3786 | type: object | |
3787 | properties: | |
3788 | videoId: | |
3789 | $ref: '#/components/schemas/Video/properties/id' | |
3790 | required: | |
3791 | - videoId | |
3792 | responses: | |
3793 | '204': | |
3794 | description: successful operation | |
3795 | '400': | |
3796 | description: cannot mirror a local video | |
3797 | '404': | |
3798 | description: video does not exist | |
3799 | '409': | |
3800 | description: video is already mirrored | |
3801 | ||
3802 | /server/redundancy/videos/{redundancyId}: | |
3803 | delete: | |
3804 | tags: | |
3805 | - Video Mirroring | |
3806 | summary: Delete a mirror done on a video | |
3807 | operationId: delMirroredVideo | |
3808 | security: | |
3809 | - OAuth2: | |
3810 | - admin | |
3811 | parameters: | |
3812 | - name: redundancyId | |
3813 | in: path | |
3814 | required: true | |
3815 | description: id of an existing redundancy on a video | |
3816 | schema: | |
3817 | type: string | |
3818 | responses: | |
3819 | '204': | |
3820 | description: successful operation | |
3821 | '404': | |
3822 | description: video redundancy not found | |
3823 | ||
3824 | '/feeds/video-comments.{format}': | |
3825 | get: | |
3826 | tags: | |
3827 | - Feeds | |
3828 | summary: List comments on videos | |
3829 | operationId: getSyndicatedComments | |
3830 | parameters: | |
3831 | - name: format | |
3832 | in: path | |
3833 | required: true | |
3834 | description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' | |
3835 | schema: | |
3836 | type: string | |
3837 | enum: | |
3838 | - xml | |
3839 | - rss | |
3840 | - rss2 | |
3841 | - atom | |
3842 | - atom1 | |
3843 | - json | |
3844 | - json1 | |
3845 | - name: videoId | |
3846 | in: query | |
3847 | description: 'limit listing to a specific video' | |
3848 | schema: | |
3849 | type: string | |
3850 | - name: accountId | |
3851 | in: query | |
3852 | description: 'limit listing to a specific account' | |
3853 | schema: | |
3854 | type: string | |
3855 | - name: accountName | |
3856 | in: query | |
3857 | description: 'limit listing to a specific account' | |
3858 | schema: | |
3859 | type: string | |
3860 | - name: videoChannelId | |
3861 | in: query | |
3862 | description: 'limit listing to a specific video channel' | |
3863 | schema: | |
3864 | type: string | |
3865 | - name: videoChannelName | |
3866 | in: query | |
3867 | description: 'limit listing to a specific video channel' | |
3868 | schema: | |
3869 | type: string | |
3870 | responses: | |
3871 | '204': | |
3872 | description: successful operation | |
3873 | headers: | |
3874 | Cache-Control: | |
3875 | schema: | |
3876 | type: string | |
3877 | default: 'max-age=900' # 15 min cache | |
3878 | content: | |
3879 | application/xml: | |
3880 | schema: | |
3881 | $ref: '#/components/schemas/VideoCommentsForXML' | |
3882 | examples: | |
3883 | nightly: | |
3884 | externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local | |
3885 | application/rss+xml: | |
3886 | schema: | |
3887 | $ref: '#/components/schemas/VideoCommentsForXML' | |
3888 | examples: | |
3889 | nightly: | |
3890 | externalValue: https://peertube2.cpy.re/feeds/video-comments.rss?filter=local | |
3891 | text/xml: | |
3892 | schema: | |
3893 | $ref: '#/components/schemas/VideoCommentsForXML' | |
3894 | examples: | |
3895 | nightly: | |
3896 | externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local | |
3897 | application/atom+xml: | |
3898 | schema: | |
3899 | $ref: '#/components/schemas/VideoCommentsForXML' | |
3900 | examples: | |
3901 | nightly: | |
3902 | externalValue: https://peertube2.cpy.re/feeds/video-comments.atom?filter=local | |
3903 | application/json: | |
3904 | schema: | |
3905 | type: object | |
3906 | examples: | |
3907 | nightly: | |
3908 | externalValue: https://peertube2.cpy.re/feeds/video-comments.json?filter=local | |
3909 | '400': | |
3910 | x-summary: field inconsistencies | |
3911 | description: > | |
3912 | Arises when: | |
3913 | - videoId filter is mixed with a channel filter | |
3914 | '404': | |
3915 | description: video, video channel or account not found | |
3916 | '406': | |
3917 | description: accept header unsupported | |
3918 | ||
3919 | '/feeds/videos.{format}': | |
3920 | get: | |
3921 | tags: | |
3922 | - Feeds | |
3923 | summary: List videos | |
3924 | operationId: getSyndicatedVideos | |
3925 | parameters: | |
3926 | - name: format | |
3927 | in: path | |
3928 | required: true | |
3929 | description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' | |
3930 | schema: | |
3931 | type: string | |
3932 | enum: | |
3933 | - xml | |
3934 | - rss | |
3935 | - rss2 | |
3936 | - atom | |
3937 | - atom1 | |
3938 | - json | |
3939 | - json1 | |
3940 | - name: accountId | |
3941 | in: query | |
3942 | description: 'limit listing to a specific account' | |
3943 | schema: | |
3944 | type: string | |
3945 | - name: accountName | |
3946 | in: query | |
3947 | description: 'limit listing to a specific account' | |
3948 | schema: | |
3949 | type: string | |
3950 | - name: videoChannelId | |
3951 | in: query | |
3952 | description: 'limit listing to a specific video channel' | |
3953 | schema: | |
3954 | type: string | |
3955 | - name: videoChannelName | |
3956 | in: query | |
3957 | description: 'limit listing to a specific video channel' | |
3958 | schema: | |
3959 | type: string | |
3960 | - $ref: '#/components/parameters/sort' | |
3961 | - $ref: '#/components/parameters/nsfw' | |
3962 | - $ref: '#/components/parameters/filter' | |
3963 | responses: | |
3964 | '204': | |
3965 | description: successful operation | |
3966 | headers: | |
3967 | Cache-Control: | |
3968 | schema: | |
3969 | type: string | |
3970 | default: 'max-age=900' # 15 min cache | |
3971 | content: | |
3972 | application/xml: | |
3973 | schema: | |
3974 | $ref: '#/components/schemas/VideosForXML' | |
3975 | examples: | |
3976 | nightly: | |
3977 | externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local | |
3978 | application/rss+xml: | |
3979 | schema: | |
3980 | $ref: '#/components/schemas/VideosForXML' | |
3981 | examples: | |
3982 | nightly: | |
3983 | externalValue: https://peertube2.cpy.re/feeds/videos.rss?filter=local | |
3984 | text/xml: | |
3985 | schema: | |
3986 | $ref: '#/components/schemas/VideosForXML' | |
3987 | examples: | |
3988 | nightly: | |
3989 | externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local | |
3990 | application/atom+xml: | |
3991 | schema: | |
3992 | $ref: '#/components/schemas/VideosForXML' | |
3993 | examples: | |
3994 | nightly: | |
3995 | externalValue: https://peertube2.cpy.re/feeds/videos.atom?filter=local | |
3996 | application/json: | |
3997 | schema: | |
3998 | type: object | |
3999 | examples: | |
4000 | nightly: | |
4001 | externalValue: https://peertube2.cpy.re/feeds/videos.json?filter=local | |
4002 | '404': | |
4003 | description: video channel or account not found | |
4004 | '406': | |
4005 | description: accept header unsupported | |
4006 | ||
4007 | '/feeds/subscriptions.{format}': | |
4008 | get: | |
4009 | tags: | |
4010 | - Feeds | |
4011 | - Account | |
4012 | summary: List videos of subscriptions tied to a token | |
4013 | operationId: getSyndicatedSubscriptionVideos | |
4014 | parameters: | |
4015 | - name: format | |
4016 | in: path | |
4017 | required: true | |
4018 | description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' | |
4019 | schema: | |
4020 | type: string | |
4021 | enum: | |
4022 | - xml | |
4023 | - rss | |
4024 | - rss2 | |
4025 | - atom | |
4026 | - atom1 | |
4027 | - json | |
4028 | - json1 | |
4029 | - name: accountId | |
4030 | in: query | |
4031 | description: limit listing to a specific account | |
4032 | schema: | |
4033 | type: string | |
4034 | required: true | |
4035 | - name: token | |
4036 | in: query | |
4037 | description: private token allowing access | |
4038 | schema: | |
4039 | type: string | |
4040 | required: true | |
4041 | - $ref: '#/components/parameters/sort' | |
4042 | - $ref: '#/components/parameters/nsfw' | |
4043 | - $ref: '#/components/parameters/filter' | |
4044 | responses: | |
4045 | '204': | |
4046 | description: successful operation | |
4047 | headers: | |
4048 | Cache-Control: | |
4049 | schema: | |
4050 | type: string | |
4051 | default: 'max-age=900' # 15 min cache | |
4052 | content: | |
4053 | application/xml: | |
4054 | schema: | |
4055 | $ref: '#/components/schemas/VideosForXML' | |
4056 | application/rss+xml: | |
4057 | schema: | |
4058 | $ref: '#/components/schemas/VideosForXML' | |
4059 | text/xml: | |
4060 | schema: | |
4061 | $ref: '#/components/schemas/VideosForXML' | |
4062 | application/atom+xml: | |
4063 | schema: | |
4064 | $ref: '#/components/schemas/VideosForXML' | |
4065 | application/json: | |
4066 | schema: | |
4067 | type: object | |
4068 | '406': | |
4069 | description: accept header unsupported | |
4070 | ||
4071 | /plugins: | |
4072 | get: | |
4073 | tags: | |
4074 | - Plugins | |
4075 | summary: List plugins | |
4076 | operationId: getPlugins | |
4077 | security: | |
4078 | - OAuth2: | |
4079 | - admin | |
4080 | parameters: | |
4081 | - name: pluginType | |
4082 | in: query | |
4083 | schema: | |
4084 | type: integer | |
4085 | - name: uninstalled | |
4086 | in: query | |
4087 | schema: | |
4088 | type: boolean | |
4089 | - $ref: '#/components/parameters/start' | |
4090 | - $ref: '#/components/parameters/count' | |
4091 | - $ref: '#/components/parameters/sort' | |
4092 | responses: | |
4093 | '200': | |
4094 | description: successful operation | |
4095 | content: | |
4096 | application/json: | |
4097 | schema: | |
4098 | $ref: '#/components/schemas/PluginResponse' | |
4099 | ||
4100 | /plugins/available: | |
4101 | get: | |
4102 | tags: | |
4103 | - Plugins | |
4104 | summary: List available plugins | |
4105 | operationId: getAvailablePlugins | |
4106 | security: | |
4107 | - OAuth2: | |
4108 | - admin | |
4109 | parameters: | |
4110 | - name: search | |
4111 | in: query | |
4112 | schema: | |
4113 | type: string | |
4114 | - name: pluginType | |
4115 | in: query | |
4116 | schema: | |
4117 | type: integer | |
4118 | - name: currentPeerTubeEngine | |
4119 | in: query | |
4120 | schema: | |
4121 | type: string | |
4122 | - $ref: '#/components/parameters/start' | |
4123 | - $ref: '#/components/parameters/count' | |
4124 | - $ref: '#/components/parameters/sort' | |
4125 | responses: | |
4126 | '200': | |
4127 | description: successful operation | |
4128 | content: | |
4129 | application/json: | |
4130 | schema: | |
4131 | $ref: '#/components/schemas/PluginResponse' | |
4132 | '503': | |
4133 | description: plugin index unavailable | |
4134 | ||
4135 | /plugins/install: | |
4136 | post: | |
4137 | tags: | |
4138 | - Plugins | |
4139 | summary: Install a plugin | |
4140 | operationId: addPlugin | |
4141 | security: | |
4142 | - OAuth2: | |
4143 | - admin | |
4144 | requestBody: | |
4145 | content: | |
4146 | application/json: | |
4147 | schema: | |
4148 | oneOf: | |
4149 | - type: object | |
4150 | properties: | |
4151 | npmName: | |
4152 | type: string | |
4153 | example: peertube-plugin-auth-ldap | |
4154 | required: | |
4155 | - npmName | |
4156 | additionalProperties: false | |
4157 | - type: object | |
4158 | properties: | |
4159 | path: | |
4160 | type: string | |
4161 | required: | |
4162 | - path | |
4163 | additionalProperties: false | |
4164 | responses: | |
4165 | '204': | |
4166 | description: successful operation | |
4167 | '400': | |
4168 | description: should have either `npmName` or `path` set | |
4169 | ||
4170 | /plugins/update: | |
4171 | post: | |
4172 | tags: | |
4173 | - Plugins | |
4174 | summary: Update a plugin | |
4175 | operationId: updatePlugin | |
4176 | security: | |
4177 | - OAuth2: | |
4178 | - admin | |
4179 | requestBody: | |
4180 | content: | |
4181 | application/json: | |
4182 | schema: | |
4183 | oneOf: | |
4184 | - type: object | |
4185 | properties: | |
4186 | npmName: | |
4187 | type: string | |
4188 | example: peertube-plugin-auth-ldap | |
4189 | required: | |
4190 | - npmName | |
4191 | additionalProperties: false | |
4192 | - type: object | |
4193 | properties: | |
4194 | path: | |
4195 | type: string | |
4196 | required: | |
4197 | - path | |
4198 | additionalProperties: false | |
4199 | responses: | |
4200 | '204': | |
4201 | description: successful operation | |
4202 | '400': | |
4203 | description: should have either `npmName` or `path` set | |
4204 | '404': | |
4205 | description: existing plugin not found | |
4206 | ||
4207 | /plugins/uninstall: | |
4208 | post: | |
4209 | tags: | |
4210 | - Plugins | |
4211 | summary: Uninstall a plugin | |
4212 | operationId: uninstallPlugin | |
4213 | security: | |
4214 | - OAuth2: | |
4215 | - admin | |
4216 | requestBody: | |
4217 | content: | |
4218 | application/json: | |
4219 | schema: | |
4220 | type: object | |
4221 | properties: | |
4222 | npmName: | |
4223 | type: string | |
4224 | description: name of the plugin/theme in its package.json | |
4225 | example: peertube-plugin-auth-ldap | |
4226 | required: | |
4227 | - npmName | |
4228 | responses: | |
4229 | '204': | |
4230 | description: successful operation | |
4231 | '404': | |
4232 | description: existing plugin not found | |
4233 | ||
4234 | /plugins/{npmName}: | |
4235 | get: | |
4236 | tags: | |
4237 | - Plugins | |
4238 | summary: Get a plugin | |
4239 | operationId: getPlugin | |
4240 | security: | |
4241 | - OAuth2: | |
4242 | - admin | |
4243 | parameters: | |
4244 | - $ref: '#/components/parameters/npmName' | |
4245 | responses: | |
4246 | '200': | |
4247 | description: successful operation | |
4248 | content: | |
4249 | application/json: | |
4250 | schema: | |
4251 | $ref: '#/components/schemas/Plugin' | |
4252 | '404': | |
4253 | description: plugin not found | |
4254 | ||
4255 | /plugins/{npmName}/settings: | |
4256 | put: | |
4257 | tags: | |
4258 | - Plugins | |
4259 | summary: Set a plugin's settings | |
4260 | security: | |
4261 | - OAuth2: | |
4262 | - admin | |
4263 | parameters: | |
4264 | - $ref: '#/components/parameters/npmName' | |
4265 | requestBody: | |
4266 | content: | |
4267 | application/json: | |
4268 | schema: | |
4269 | type: object | |
4270 | properties: | |
4271 | settings: | |
4272 | type: object | |
4273 | additionalProperties: true | |
4274 | responses: | |
4275 | '204': | |
4276 | description: successful operation | |
4277 | '404': | |
4278 | description: plugin not found | |
4279 | ||
4280 | /plugins/{npmName}/public-settings: | |
4281 | get: | |
4282 | tags: | |
4283 | - Plugins | |
4284 | summary: Get a plugin's public settings | |
4285 | parameters: | |
4286 | - $ref: '#/components/parameters/npmName' | |
4287 | responses: | |
4288 | '200': | |
4289 | description: successful operation | |
4290 | content: | |
4291 | application/json: | |
4292 | schema: | |
4293 | type: object | |
4294 | additionalProperties: true | |
4295 | '404': | |
4296 | description: plugin not found | |
4297 | ||
4298 | /plugins/{npmName}/registered-settings: | |
4299 | get: | |
4300 | tags: | |
4301 | - Plugins | |
4302 | summary: Get a plugin's registered settings | |
4303 | security: | |
4304 | - OAuth2: | |
4305 | - admin | |
4306 | parameters: | |
4307 | - $ref: '#/components/parameters/npmName' | |
4308 | responses: | |
4309 | '200': | |
4310 | description: successful operation | |
4311 | content: | |
4312 | application/json: | |
4313 | schema: | |
4314 | type: object | |
4315 | additionalProperties: true | |
4316 | '404': | |
4317 | description: plugin not found | |
4318 | ||
4319 | servers: | |
4320 | - url: 'https://peertube2.cpy.re/api/v1' | |
4321 | description: Live Test Server (live data - latest nightly version) | |
4322 | - url: 'https://peertube3.cpy.re/api/v1' | |
4323 | description: Live Test Server (live data - latest RC version) | |
4324 | - url: 'https://peertube.cpy.re/api/v1' | |
4325 | description: Live Test Server (live data - stable version) | |
4326 | components: | |
4327 | parameters: | |
4328 | start: | |
4329 | name: start | |
4330 | in: query | |
4331 | required: false | |
4332 | description: Offset used to paginate results | |
4333 | schema: | |
4334 | type: integer | |
4335 | minimum: 0 | |
4336 | count: | |
4337 | name: count | |
4338 | in: query | |
4339 | required: false | |
4340 | description: "Number of items to return" | |
4341 | schema: | |
4342 | type: integer | |
4343 | default: 15 | |
4344 | maximum: 100 | |
4345 | minimum: 1 | |
4346 | sort: | |
4347 | name: sort | |
4348 | in: query | |
4349 | required: false | |
4350 | description: Sort column | |
4351 | schema: | |
4352 | type: string | |
4353 | example: -createdAt | |
4354 | search: | |
4355 | name: search | |
4356 | in: query | |
4357 | required: false | |
4358 | description: Plain text search, applied to various parts of the model depending on endpoint | |
4359 | schema: | |
4360 | type: string | |
4361 | searchTarget: | |
4362 | name: searchTarget | |
4363 | in: query | |
4364 | required: false | |
4365 | description: > | |
4366 | If the administrator enabled search index support, you can override the default search target. | |
4367 | ||
4368 | ||
4369 | **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. | |
4370 | It means the instance may not yet know the objects you fetched. If you want to load video/channel information: | |
4371 | * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), | |
4372 | then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. | |
4373 | After that, you can use the classic REST API endpoints to fetch the complete object or interact with it | |
4374 | * If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch | |
4375 | the data from the origin instance API | |
4376 | schema: | |
4377 | type: string | |
4378 | enum: | |
4379 | - 'local' | |
4380 | - 'search-index' | |
4381 | videosSort: | |
4382 | name: sort | |
4383 | in: query | |
4384 | required: false | |
4385 | description: Sort videos by criteria | |
4386 | schema: | |
4387 | type: string | |
4388 | enum: | |
4389 | - name | |
4390 | - -duration | |
4391 | - -createdAt | |
4392 | - -publishedAt | |
4393 | - -views | |
4394 | - -likes | |
4395 | - -trending | |
4396 | - -hot | |
4397 | videosSearchSort: | |
4398 | name: sort | |
4399 | in: query | |
4400 | required: false | |
4401 | description: Sort videos by criteria | |
4402 | schema: | |
4403 | type: string | |
4404 | enum: | |
4405 | - name | |
4406 | - -duration | |
4407 | - -createdAt | |
4408 | - -publishedAt | |
4409 | - -views | |
4410 | - -likes | |
4411 | - -match | |
4412 | commentsSort: | |
4413 | name: sort | |
4414 | in: query | |
4415 | required: false | |
4416 | description: Sort comments by criteria | |
4417 | schema: | |
4418 | type: string | |
4419 | enum: | |
4420 | - -createdAt | |
4421 | - -totalReplies | |
4422 | blacklistsSort: | |
4423 | name: sort | |
4424 | in: query | |
4425 | required: false | |
4426 | description: Sort blocklists by criteria | |
4427 | schema: | |
4428 | type: string | |
4429 | enum: | |
4430 | - -id | |
4431 | - name | |
4432 | - -duration | |
4433 | - -views | |
4434 | - -likes | |
4435 | - -dislikes | |
4436 | - -uuid | |
4437 | - -createdAt | |
4438 | usersSearch: | |
4439 | name: search | |
4440 | in: query | |
4441 | required: false | |
4442 | description: Plain text search that will match with user usernames or emails | |
4443 | schema: | |
4444 | type: string | |
4445 | usersBlocked: | |
4446 | name: blocked | |
4447 | in: query | |
4448 | required: false | |
4449 | description: Filter results down to (un)banned users | |
4450 | schema: | |
4451 | type: boolean | |
4452 | usersSort: | |
4453 | name: sort | |
4454 | in: query | |
4455 | required: false | |
4456 | description: Sort users by criteria | |
4457 | schema: | |
4458 | type: string | |
4459 | enum: | |
4460 | - -id | |
4461 | - -username | |
4462 | - -createdAt | |
4463 | abusesSort: | |
4464 | name: sort | |
4465 | in: query | |
4466 | required: false | |
4467 | description: Sort abuses by criteria | |
4468 | schema: | |
4469 | type: string | |
4470 | enum: | |
4471 | - -id | |
4472 | - -createdAt | |
4473 | - -state | |
4474 | videoRedundanciesSort: | |
4475 | name: sort | |
4476 | in: query | |
4477 | required: false | |
4478 | description: Sort abuses by criteria | |
4479 | schema: | |
4480 | type: string | |
4481 | enum: | |
4482 | - name | |
4483 | name: | |
4484 | name: name | |
4485 | in: path | |
4486 | required: true | |
4487 | description: The username or handle of the account | |
4488 | schema: | |
4489 | type: string | |
4490 | example: chocobozzz | chocobozzz@example.org | |
4491 | id: | |
4492 | name: id | |
4493 | in: path | |
4494 | required: true | |
4495 | description: The user id | |
4496 | schema: | |
4497 | $ref: '#/components/schemas/id' | |
4498 | idOrUUID: | |
4499 | name: id | |
4500 | in: path | |
4501 | required: true | |
4502 | description: The object id or uuid | |
4503 | schema: | |
4504 | oneOf: | |
4505 | - $ref: '#/components/schemas/id' | |
4506 | - $ref: '#/components/schemas/UUIDv4' | |
4507 | playlistId: | |
4508 | name: playlistId | |
4509 | in: path | |
4510 | required: true | |
4511 | description: Playlist id | |
4512 | schema: | |
4513 | $ref: '#/components/schemas/VideoPlaylist/properties/id' | |
4514 | playlistElementId: | |
4515 | name: playlistElementId | |
4516 | in: path | |
4517 | required: true | |
4518 | description: Playlist element id | |
4519 | schema: | |
4520 | $ref: '#/components/schemas/id' | |
4521 | abuseId: | |
4522 | name: abuseId | |
4523 | in: path | |
4524 | required: true | |
4525 | description: Abuse id | |
4526 | schema: | |
4527 | $ref: '#/components/schemas/Abuse/properties/id' | |
4528 | abuseMessageId: | |
4529 | name: abuseMessageId | |
4530 | in: path | |
4531 | required: true | |
4532 | description: Abuse message id | |
4533 | schema: | |
4534 | $ref: '#/components/schemas/AbuseMessage/properties/id' | |
4535 | captionLanguage: | |
4536 | name: captionLanguage | |
4537 | in: path | |
4538 | required: true | |
4539 | description: The caption language | |
4540 | schema: | |
4541 | $ref: '#/components/schemas/VideoLanguageSet' | |
4542 | channelHandle: | |
4543 | name: channelHandle | |
4544 | in: path | |
4545 | required: true | |
4546 | description: The video channel handle | |
4547 | schema: | |
4548 | type: string | |
4549 | example: my_username | my_username@example.com | |
4550 | subscriptionHandle: | |
4551 | name: subscriptionHandle | |
4552 | in: path | |
4553 | required: true | |
4554 | description: The subscription handle | |
4555 | schema: | |
4556 | type: string | |
4557 | example: my_username | my_username@example.com | |
4558 | threadId: | |
4559 | name: threadId | |
4560 | in: path | |
4561 | required: true | |
4562 | description: The thread id (root comment id) | |
4563 | schema: | |
4564 | type: integer | |
4565 | commentId: | |
4566 | name: commentId | |
4567 | in: path | |
4568 | required: true | |
4569 | description: The comment id | |
4570 | schema: | |
4571 | $ref: '#/components/schemas/VideoComment/properties/id' | |
4572 | isLive: | |
4573 | name: isLive | |
4574 | in: query | |
4575 | required: false | |
4576 | description: whether or not the video is a live | |
4577 | schema: | |
4578 | type: boolean | |
4579 | categoryOneOf: | |
4580 | name: categoryOneOf | |
4581 | in: query | |
4582 | required: false | |
4583 | description: category id of the video (see [/videos/categories](#operation/getCategories)) | |
4584 | schema: | |
4585 | oneOf: | |
4586 | - $ref: '#/components/schemas/VideoCategorySet' | |
4587 | - type: array | |
4588 | items: | |
4589 | $ref: '#/components/schemas/VideoCategorySet' | |
4590 | style: form | |
4591 | explode: false | |
4592 | tagsOneOf: | |
4593 | name: tagsOneOf | |
4594 | in: query | |
4595 | required: false | |
4596 | description: tag(s) of the video | |
4597 | schema: | |
4598 | oneOf: | |
4599 | - type: string | |
4600 | - type: array | |
4601 | maxItems: 5 | |
4602 | items: | |
4603 | type: string | |
4604 | style: form | |
4605 | explode: false | |
4606 | tagsAllOf: | |
4607 | name: tagsAllOf | |
4608 | in: query | |
4609 | required: false | |
4610 | description: tag(s) of the video, where all should be present in the video | |
4611 | schema: | |
4612 | oneOf: | |
4613 | - type: string | |
4614 | - type: array | |
4615 | items: | |
4616 | type: string | |
4617 | style: form | |
4618 | explode: false | |
4619 | languageOneOf: | |
4620 | name: languageOneOf | |
4621 | in: query | |
4622 | required: false | |
4623 | description: language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language | |
4624 | schema: | |
4625 | oneOf: | |
4626 | - $ref: '#/components/schemas/VideoLanguageSet' | |
4627 | - type: array | |
4628 | items: | |
4629 | $ref: '#/components/schemas/VideoLanguageSet' | |
4630 | style: form | |
4631 | explode: false | |
4632 | licenceOneOf: | |
4633 | name: licenceOneOf | |
4634 | in: query | |
4635 | required: false | |
4636 | description: licence id of the video (see [/videos/licences](#operation/getLicences)) | |
4637 | schema: | |
4638 | oneOf: | |
4639 | - $ref: '#/components/schemas/VideoLicenceSet' | |
4640 | - type: array | |
4641 | items: | |
4642 | $ref: '#/components/schemas/VideoLicenceSet' | |
4643 | style: form | |
4644 | explode: false | |
4645 | skipCount: | |
4646 | name: skipCount | |
4647 | in: query | |
4648 | required: false | |
4649 | description: if you don't need the `total` in the response | |
4650 | schema: | |
4651 | type: string | |
4652 | enum: | |
4653 | - 'true' | |
4654 | - 'false' | |
4655 | default: 'false' | |
4656 | nsfw: | |
4657 | name: nsfw | |
4658 | in: query | |
4659 | required: false | |
4660 | description: whether to include nsfw videos, if any | |
4661 | schema: | |
4662 | type: string | |
4663 | enum: | |
4664 | - 'true' | |
4665 | - 'false' | |
4666 | filter: | |
4667 | name: filter | |
4668 | in: query | |
4669 | required: false | |
4670 | description: > | |
4671 | Special filters which might require special rights: | |
4672 | * `local` - only videos local to the instance | |
4673 | * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges) | |
4674 | * `all` - all videos, showing private and unlisted videos (requires Admin privileges) | |
4675 | schema: | |
4676 | type: string | |
4677 | enum: | |
4678 | - local | |
4679 | - all-local | |
4680 | subscriptionsUris: | |
4681 | name: uris | |
4682 | in: query | |
4683 | required: true | |
4684 | description: list of uris to check if each is part of the user subscriptions | |
4685 | schema: | |
4686 | type: array | |
4687 | items: | |
4688 | type: string | |
4689 | format: uri | |
4690 | npmName: | |
4691 | name: npmName | |
4692 | in: path | |
4693 | required: true | |
4694 | description: name of the plugin/theme on npmjs.com or in its package.json | |
4695 | schema: | |
4696 | type: string | |
4697 | example: peertube-plugin-auth-ldap | |
4698 | jobType: | |
4699 | name: jobType | |
4700 | in: query | |
4701 | required: false | |
4702 | description: job type | |
4703 | schema: | |
4704 | type: string | |
4705 | enum: | |
4706 | - activitypub-follow | |
4707 | - activitypub-http-broadcast | |
4708 | - activitypub-http-fetcher | |
4709 | - activitypub-http-unicast | |
4710 | ||
4711 | - video-transcoding | |
4712 | - video-file-import | |
4713 | - video-import | |
4714 | - videos-views | |
4715 | - activitypub-refresher | |
4716 | - video-redundancy | |
4717 | - video-live-ending | |
4718 | followState: | |
4719 | name: state | |
4720 | in: query | |
4721 | schema: | |
4722 | type: string | |
4723 | enum: | |
4724 | - pending | |
4725 | - accepted | |
4726 | actorType: | |
4727 | name: actorType | |
4728 | in: query | |
4729 | schema: | |
4730 | type: string | |
4731 | enum: | |
4732 | - Person | |
4733 | - Application | |
4734 | - Group | |
4735 | - Service | |
4736 | - Organization | |
4737 | securitySchemes: | |
4738 | OAuth2: | |
4739 | description: | | |
4740 | Authenticating via OAuth requires the following steps: | |
4741 | - Have an activated account | |
4742 | - [Generate] an access token for that account at `/api/v1/users/token`. | |
4743 | - Make requests with the *Authorization: Bearer <token\>* header | |
4744 | - Profit, depending on the role assigned to the account | |
4745 | ||
4746 | Note that the __access token is valid for 1 day__ and is given | |
4747 | along with a __refresh token valid for 2 weeks__. | |
4748 | ||
4749 | [Generate]: https://docs.joinpeertube.org/api-rest-getting-started | |
4750 | type: oauth2 | |
4751 | flows: | |
4752 | password: | |
4753 | tokenUrl: /api/v1/users/token | |
4754 | scopes: | |
4755 | admin: Admin scope | |
4756 | moderator: Moderator scope | |
4757 | user: User scope | |
4758 | schemas: | |
4759 | # Resuable core properties | |
4760 | id: | |
4761 | type: integer | |
4762 | minimum: 1 | |
4763 | example: 42 | |
4764 | UUIDv4: | |
4765 | type: string | |
4766 | format: uuid | |
4767 | example: 9c9de5e8-0a1e-484a-b099-e80766180a6d | |
4768 | pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' | |
4769 | minLength: 36 | |
4770 | maxLength: 36 | |
4771 | username: | |
4772 | type: string | |
4773 | description: immutable name of the user, used to find or mention its actor | |
4774 | example: chocobozzz | |
4775 | pattern: '/^[a-z0-9._]+$/' | |
4776 | minLength: 1 | |
4777 | maxLength: 50 | |
4778 | usernameChannel: | |
4779 | type: string | |
4780 | description: immutable name of the channel, used to interact with its actor | |
4781 | example: framasoft_videos | |
4782 | pattern: '/^[a-zA-Z0-9\\-_.:]+$/' | |
4783 | minLength: 1 | |
4784 | maxLength: 50 | |
4785 | password: | |
4786 | type: string | |
4787 | format: password | |
4788 | minLength: 6 | |
4789 | maxLength: 255 | |
4790 | ||
4791 | VideoCategorySet: | |
4792 | type: integer | |
4793 | description: category id of the video (see [/videos/categories](#operation/getCategories)) | |
4794 | example: 15 | |
4795 | VideoConstantNumber-Category: | |
4796 | properties: | |
4797 | id: | |
4798 | $ref: '#/components/schemas/VideoCategorySet' | |
4799 | label: | |
4800 | type: string | |
4801 | example: Science & Technology | |
4802 | ||
4803 | VideoLicenceSet: | |
4804 | type: integer | |
4805 | description: licence id of the video (see [/videos/licences](#operation/getLicences)) | |
4806 | example: 2 | |
4807 | VideoConstantNumber-Licence: | |
4808 | properties: | |
4809 | id: | |
4810 | $ref: '#/components/schemas/VideoLicenceSet' | |
4811 | label: | |
4812 | type: string | |
4813 | example: Attribution - Share Alike | |
4814 | ||
4815 | VideoLanguageSet: | |
4816 | type: string | |
4817 | description: language id of the video (see [/videos/languages](#operation/getLanguages)) | |
4818 | example: en | |
4819 | VideoConstantString-Language: | |
4820 | properties: | |
4821 | id: | |
4822 | $ref: '#/components/schemas/VideoLanguageSet' | |
4823 | label: | |
4824 | type: string | |
4825 | example: English | |
4826 | ||
4827 | VideoPlaylistPrivacySet: | |
4828 | type: integer | |
4829 | enum: | |
4830 | - 1 | |
4831 | - 2 | |
4832 | - 3 | |
4833 | description: Video playlist privacy policy (see [/video-playlists/privacies]) | |
4834 | VideoPlaylistPrivacyConstant: | |
4835 | properties: | |
4836 | id: | |
4837 | $ref: '#/components/schemas/VideoPlaylistPrivacySet' | |
4838 | label: | |
4839 | type: string | |
4840 | ||
4841 | VideoPlaylistTypeSet: | |
4842 | type: integer | |
4843 | enum: | |
4844 | - 1 | |
4845 | - 2 | |
4846 | description: The video playlist type (Regular = `1`, Watch Later = `2`) | |
4847 | VideoPlaylistTypeConstant: | |
4848 | properties: | |
4849 | id: | |
4850 | $ref: '#/components/schemas/VideoPlaylistTypeSet' | |
4851 | label: | |
4852 | type: string | |
4853 | ||
4854 | VideoPrivacySet: | |
4855 | type: integer | |
4856 | enum: | |
4857 | - 1 | |
4858 | - 2 | |
4859 | - 3 | |
4860 | - 4 | |
4861 | description: privacy id of the video (see [/videos/privacies](#operation/getPrivacyPolicies)) | |
4862 | VideoPrivacyConstant: | |
4863 | properties: | |
4864 | id: | |
4865 | $ref: '#/components/schemas/VideoPrivacySet' | |
4866 | label: | |
4867 | type: string | |
4868 | ||
4869 | NSFWPolicy: | |
4870 | type: string | |
4871 | enum: | |
4872 | - display | |
4873 | - blur | |
4874 | - do_not_list | |
4875 | ||
4876 | UserRole: | |
4877 | type: integer | |
4878 | enum: | |
4879 | - 0 | |
4880 | - 1 | |
4881 | - 2 | |
4882 | description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)' | |
4883 | example: 2 | |
4884 | UserAdminFlags: | |
4885 | type: integer | |
4886 | enum: | |
4887 | - 0 | |
4888 | - 1 | |
4889 | description: 'Admin flags for the user (None = `0`, Bypass video blocklist = `1`)' | |
4890 | example: 1 | |
4891 | ||
4892 | VideoStateConstant: | |
4893 | properties: | |
4894 | id: | |
4895 | type: integer | |
4896 | enum: | |
4897 | - 1 | |
4898 | - 2 | |
4899 | - 3 | |
4900 | description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)' | |
4901 | label: | |
4902 | type: string | |
4903 | ||
4904 | AbuseStateSet: | |
4905 | type: integer | |
4906 | enum: | |
4907 | - 1 | |
4908 | - 2 | |
4909 | - 3 | |
4910 | description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)' | |
4911 | AbuseStateConstant: | |
4912 | properties: | |
4913 | id: | |
4914 | $ref: '#/components/schemas/AbuseStateSet' | |
4915 | label: | |
4916 | type: string | |
4917 | AbusePredefinedReasons: | |
4918 | type: array | |
4919 | items: | |
4920 | type: string | |
4921 | enum: | |
4922 | - violentOrAbusive | |
4923 | - hatefulOrAbusive | |
4924 | - spamOrMisleading | |
4925 | - privacy | |
4926 | - rights | |
4927 | - serverRules | |
4928 | - thumbnails | |
4929 | - captions | |
4930 | example: [spamOrMisleading] | |
4931 | ||
4932 | VideoResolutionSet: | |
4933 | type: integer | |
4934 | description: | | |
4935 | Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`) | |
4936 | ||
4937 | `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos. | |
4938 | example: 240 | |
4939 | VideoResolutionConstant: | |
4940 | description: resolutions and their labels for the video | |
4941 | properties: | |
4942 | id: | |
4943 | $ref: '#/components/schemas/VideoResolutionSet' | |
4944 | label: | |
4945 | type: string | |
4946 | example: 240p | |
4947 | VideoScheduledUpdate: | |
4948 | properties: | |
4949 | privacy: | |
4950 | $ref: '#/components/schemas/VideoPrivacySet' | |
4951 | updateAt: | |
4952 | type: string | |
4953 | format: date | |
4954 | description: When to update the video | |
4955 | required: | |
4956 | - updateAt | |
4957 | AccountSummary: | |
4958 | properties: | |
4959 | id: | |
4960 | type: integer | |
4961 | name: | |
4962 | type: string | |
4963 | displayName: | |
4964 | type: string | |
4965 | url: | |
4966 | type: string | |
4967 | format: url | |
4968 | host: | |
4969 | type: string | |
4970 | format: hostname | |
4971 | avatar: | |
4972 | nullable: true | |
4973 | allOf: | |
4974 | - $ref: '#/components/schemas/ActorImage' | |
4975 | VideoChannelSummary: | |
4976 | properties: | |
4977 | id: | |
4978 | $ref: '#/components/schemas/id' | |
4979 | name: | |
4980 | type: string | |
4981 | displayName: | |
4982 | type: string | |
4983 | url: | |
4984 | type: string | |
4985 | format: url | |
4986 | host: | |
4987 | type: string | |
4988 | format: hostname | |
4989 | avatar: | |
4990 | nullable: true | |
4991 | allOf: | |
4992 | - $ref: '#/components/schemas/ActorImage' | |
4993 | PlaylistElement: | |
4994 | properties: | |
4995 | position: | |
4996 | type: integer | |
4997 | startTimestamp: | |
4998 | type: integer | |
4999 | format: seconds | |
5000 | stopTimestamp: | |
5001 | type: integer | |
5002 | format: seconds | |
5003 | video: | |
5004 | nullable: true | |
5005 | allOf: | |
5006 | - $ref: '#/components/schemas/Video' | |
5007 | VideoFile: | |
5008 | readOnly: true | |
5009 | properties: | |
5010 | magnetUri: | |
5011 | type: string | |
5012 | format: uri | |
5013 | description: magnet URI allowing to resolve the video via BitTorrent without a metainfo file | |
5014 | example: magnet:?xs=https%3A%2F%2Fframatube.org%2Fstatic%2Ftorrents%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.torrent&xt=urn:btih:38b4747ff788b30bf61f59d1965cd38f9e48e01f&dn=What+is+PeerTube%3F&tr=wss%3A%2F%2Fframatube.org%2Ftracker%2Fsocket&tr=https%3A%2F%2Fframatube.org%2Ftracker%2Fannounce&ws=https%3A%2F%2Fframatube.org%2Fstatic%2Fwebseed%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.mp4 | |
5015 | pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i | |
5016 | resolution: | |
5017 | $ref: '#/components/schemas/VideoResolutionConstant' | |
5018 | size: | |
5019 | type: integer | |
5020 | description: Video file size in bytes | |
5021 | torrentUrl: | |
5022 | type: string | |
5023 | description: Direct URL of the torrent file | |
5024 | format: url | |
5025 | torrentDownloadUrl: | |
5026 | type: string | |
5027 | description: URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog) | |
5028 | format: url | |
5029 | fileUrl: | |
5030 | type: string | |
5031 | description: Direct URL of the video | |
5032 | format: url | |
5033 | fileDownloadUrl: | |
5034 | type: string | |
5035 | description: URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog) | |
5036 | format: url | |
5037 | fps: | |
5038 | type: number | |
5039 | description: Frames per second of the video file | |
5040 | metadataUrl: | |
5041 | type: string | |
5042 | format: url | |
5043 | description: URL dereferencing the output of ffprobe on the file | |
5044 | VideoStreamingPlaylists: | |
5045 | allOf: | |
5046 | - type: object | |
5047 | properties: | |
5048 | id: | |
5049 | $ref: '#/components/schemas/id' | |
5050 | type: | |
5051 | type: integer | |
5052 | enum: | |
5053 | - 1 | |
5054 | description: | | |
5055 | Playlist type: | |
5056 | - `1`: HLS | |
5057 | - $ref: '#/components/schemas/VideoStreamingPlaylists-HLS' | |
5058 | VideoStreamingPlaylists-HLS: | |
5059 | properties: | |
5060 | playlistUrl: | |
5061 | type: string | |
5062 | format: url | |
5063 | segmentsSha256Url: | |
5064 | type: string | |
5065 | format: url | |
5066 | files: | |
5067 | type: array | |
5068 | description: | | |
5069 | Video files associated to this playlist. | |
5070 | ||
5071 | The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) | |
5072 | items: | |
5073 | $ref: '#/components/schemas/VideoFile' | |
5074 | redundancies: | |
5075 | type: array | |
5076 | items: | |
5077 | type: object | |
5078 | properties: | |
5079 | baseUrl: | |
5080 | type: string | |
5081 | format: url | |
5082 | VideoInfo: | |
5083 | properties: | |
5084 | id: | |
5085 | $ref: '#/components/schemas/Video/properties/id' | |
5086 | uuid: | |
5087 | $ref: '#/components/schemas/Video/properties/uuid' | |
5088 | name: | |
5089 | $ref: '#/components/schemas/Video/properties/name' | |
5090 | Video: | |
5091 | properties: | |
5092 | id: | |
5093 | description: object id for the video | |
5094 | allOf: | |
5095 | - $ref: '#/components/schemas/id' | |
5096 | uuid: | |
5097 | description: universal identifier for the video, that can be used across instances | |
5098 | allOf: | |
5099 | - $ref: '#/components/schemas/UUIDv4' | |
5100 | isLive: | |
5101 | type: boolean | |
5102 | createdAt: | |
5103 | type: string | |
5104 | format: date-time | |
5105 | example: 2017-10-01T10:52:46.396Z | |
5106 | description: time at which the video object was first drafted | |
5107 | publishedAt: | |
5108 | type: string | |
5109 | format: date-time | |
5110 | example: 2018-10-01T10:52:46.396Z | |
5111 | description: time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution. | |
5112 | updatedAt: | |
5113 | type: string | |
5114 | format: date-time | |
5115 | example: 2021-05-04T08:01:01.502Z | |
5116 | description: last time the video's metadata was modified | |
5117 | originallyPublishedAt: | |
5118 | type: string | |
5119 | format: date-time | |
5120 | example: 2010-10-01T10:52:46.396Z | |
5121 | description: used to represent a date of first publication, prior to the practical publication date of `publishedAt` | |
5122 | category: | |
5123 | allOf: | |
5124 | - $ref: '#/components/schemas/VideoConstantNumber-Category' | |
5125 | description: category in which the video is classified | |
5126 | licence: | |
5127 | allOf: | |
5128 | - $ref: '#/components/schemas/VideoConstantNumber-Licence' | |
5129 | description: licence under which the video is distributed | |
5130 | language: | |
5131 | allOf: | |
5132 | - $ref: '#/components/schemas/VideoConstantString-Language' | |
5133 | description: main language used in the video | |
5134 | privacy: | |
5135 | allOf: | |
5136 | - $ref: '#/components/schemas/VideoPrivacyConstant' | |
5137 | description: privacy policy used to distribute the video | |
5138 | description: | |
5139 | type: string | |
5140 | example: | | |
5141 | **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n | |
5142 | **Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\r\n*A decentralized video hosting network, based on fr... | |
5143 | minLength: 3 | |
5144 | maxLength: 250 | |
5145 | description: | | |
5146 | truncated description of the video, written in Markdown. | |
5147 | Resolve `descriptionPath` to get the full description of maximum `10000` characters. | |
5148 | duration: | |
5149 | type: integer | |
5150 | example: 1419 | |
5151 | format: seconds | |
5152 | description: duration of the video in seconds | |
5153 | isLocal: | |
5154 | type: boolean | |
5155 | name: | |
5156 | type: string | |
5157 | description: title of the video | |
5158 | example: What is PeerTube? | |
5159 | minLength: 3 | |
5160 | maxLength: 120 | |
5161 | thumbnailPath: | |
5162 | type: string | |
5163 | example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg | |
5164 | previewPath: | |
5165 | type: string | |
5166 | example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg | |
5167 | embedPath: | |
5168 | type: string | |
5169 | example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee | |
5170 | views: | |
5171 | type: integer | |
5172 | example: 1337 | |
5173 | likes: | |
5174 | type: integer | |
5175 | example: 42 | |
5176 | dislikes: | |
5177 | type: integer | |
5178 | example: 7 | |
5179 | nsfw: | |
5180 | type: boolean | |
5181 | waitTranscoding: | |
5182 | type: boolean | |
5183 | nullable: true | |
5184 | state: | |
5185 | allOf: | |
5186 | - $ref: '#/components/schemas/VideoStateConstant' | |
5187 | description: represents the internal state of the video processing within the PeerTube instance | |
5188 | scheduledUpdate: | |
5189 | nullable: true | |
5190 | allOf: | |
5191 | - $ref: '#/components/schemas/VideoScheduledUpdate' | |
5192 | blacklisted: | |
5193 | nullable: true | |
5194 | type: boolean | |
5195 | blacklistedReason: | |
5196 | nullable: true | |
5197 | type: string | |
5198 | account: | |
5199 | $ref: '#/components/schemas/AccountSummary' | |
5200 | channel: | |
5201 | $ref: '#/components/schemas/VideoChannelSummary' | |
5202 | userHistory: | |
5203 | nullable: true | |
5204 | type: object | |
5205 | properties: | |
5206 | currentTime: | |
5207 | type: integer | |
5208 | VideoDetails: | |
5209 | allOf: | |
5210 | - $ref: '#/components/schemas/Video' | |
5211 | - type: object | |
5212 | properties: | |
5213 | descriptionPath: | |
5214 | type: string | |
5215 | example: /api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180a6d/description | |
5216 | description: path at which to get the full description of maximum `10000` characters | |
5217 | support: | |
5218 | type: string | |
5219 | description: A text tell the audience how to support the video creator | |
5220 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 | |
5221 | minLength: 3 | |
5222 | maxLength: 1000 | |
5223 | channel: | |
5224 | $ref: '#/components/schemas/VideoChannel' | |
5225 | account: | |
5226 | $ref: '#/components/schemas/Account' | |
5227 | tags: | |
5228 | example: [flowers, gardening] | |
5229 | type: array | |
5230 | minItems: 1 | |
5231 | maxItems: 5 | |
5232 | items: | |
5233 | type: string | |
5234 | minLength: 2 | |
5235 | maxLength: 30 | |
5236 | commentsEnabled: | |
5237 | type: boolean | |
5238 | downloadEnabled: | |
5239 | type: boolean | |
5240 | trackerUrls: | |
5241 | type: array | |
5242 | items: | |
5243 | type: string | |
5244 | format: url | |
5245 | example: | |
5246 | - https://peertube2.cpy.re/tracker/announce | |
5247 | - wss://peertube2.cpy.re/tracker/socket | |
5248 | files: | |
5249 | type: array | |
5250 | items: | |
5251 | $ref: '#/components/schemas/VideoFile' | |
5252 | description: | | |
5253 | WebTorrent/raw video files. If WebTorrent is disabled on the server: | |
5254 | ||
5255 | - field will be empty | |
5256 | - video files will be found in `streamingPlaylists[].files` field | |
5257 | streamingPlaylists: | |
5258 | type: array | |
5259 | items: | |
5260 | $ref: '#/components/schemas/VideoStreamingPlaylists' | |
5261 | description: | | |
5262 | HLS playlists/manifest files. If HLS is disabled on the server: | |
5263 | ||
5264 | - field will be empty | |
5265 | - video files will be found in `files` field | |
5266 | FileRedundancyInformation: | |
5267 | properties: | |
5268 | id: | |
5269 | $ref: '#/components/schemas/id' | |
5270 | fileUrl: | |
5271 | type: string | |
5272 | format: url | |
5273 | strategy: | |
5274 | type: string | |
5275 | enum: | |
5276 | - manual | |
5277 | - most-views | |
5278 | - trending | |
5279 | - recently-added | |
5280 | size: | |
5281 | type: integer | |
5282 | createdAt: | |
5283 | type: string | |
5284 | format: date-time | |
5285 | updatedAt: | |
5286 | type: string | |
5287 | format: date-time | |
5288 | expiresOn: | |
5289 | type: string | |
5290 | format: date-time | |
5291 | VideoRedundancy: | |
5292 | properties: | |
5293 | id: | |
5294 | $ref: '#/components/schemas/id' | |
5295 | name: | |
5296 | type: string | |
5297 | url: | |
5298 | type: string | |
5299 | format: url | |
5300 | uuid: | |
5301 | $ref: '#/components/schemas/UUIDv4' | |
5302 | redundancies: | |
5303 | type: object | |
5304 | properties: | |
5305 | files: | |
5306 | type: array | |
5307 | items: | |
5308 | $ref: '#/components/schemas/FileRedundancyInformation' | |
5309 | streamingPlaylists: | |
5310 | type: array | |
5311 | items: | |
5312 | $ref: '#/components/schemas/FileRedundancyInformation' | |
5313 | VideoImportStateConstant: | |
5314 | properties: | |
5315 | id: | |
5316 | type: integer | |
5317 | enum: | |
5318 | - 1 | |
5319 | - 2 | |
5320 | - 3 | |
5321 | description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)' | |
5322 | label: | |
5323 | type: string | |
5324 | example: Pending | |
5325 | VideoCreateImport: | |
5326 | allOf: | |
5327 | - type: object | |
5328 | additionalProperties: false | |
5329 | oneOf: | |
5330 | - properties: | |
5331 | targetUrl: | |
5332 | $ref: '#/components/schemas/VideoImport/properties/targetUrl' | |
5333 | required: [targetUrl] | |
5334 | - properties: | |
5335 | magnetUri: | |
5336 | $ref: '#/components/schemas/VideoImport/properties/magnetUri' | |
5337 | required: [magnetUri] | |
5338 | - properties: | |
5339 | torrentfile: | |
5340 | $ref: '#/components/schemas/VideoImport/properties/torrentfile' | |
5341 | required: [torrentfile] | |
5342 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | |
5343 | required: | |
5344 | - channelId | |
5345 | - name | |
5346 | VideoImport: | |
5347 | properties: | |
5348 | id: | |
5349 | readOnly: true | |
5350 | allOf: | |
5351 | - $ref: '#/components/schemas/id' | |
5352 | targetUrl: | |
5353 | type: string | |
5354 | format: url | |
5355 | description: remote URL where to find the import's source video | |
5356 | example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d | |
5357 | magnetUri: | |
5358 | type: string | |
5359 | format: uri | |
5360 | description: magnet URI allowing to resolve the import's source video | |
5361 | example: magnet:?xs=https%3A%2F%2Fframatube.org%2Fstatic%2Ftorrents%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.torrent&xt=urn:btih:38b4747ff788b30bf61f59d1965cd38f9e48e01f&dn=What+is+PeerTube%3F&tr=wss%3A%2F%2Fframatube.org%2Ftracker%2Fsocket&tr=https%3A%2F%2Fframatube.org%2Ftracker%2Fannounce&ws=https%3A%2F%2Fframatube.org%2Fstatic%2Fwebseed%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.mp4 | |
5362 | pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i | |
5363 | torrentfile: | |
5364 | writeOnly: true | |
5365 | type: string | |
5366 | format: binary | |
5367 | description: Torrent file containing only the video file | |
5368 | torrentName: | |
5369 | readOnly: true | |
5370 | type: string | |
5371 | state: | |
5372 | readOnly: true | |
5373 | allOf: | |
5374 | - $ref: '#/components/schemas/VideoImportStateConstant' | |
5375 | error: | |
5376 | readOnly: true | |
5377 | type: string | |
5378 | createdAt: | |
5379 | readOnly: true | |
5380 | type: string | |
5381 | format: date-time | |
5382 | updatedAt: | |
5383 | readOnly: true | |
5384 | type: string | |
5385 | format: date-time | |
5386 | video: | |
5387 | readOnly: true | |
5388 | nullable: true | |
5389 | allOf: | |
5390 | - $ref: '#/components/schemas/Video' | |
5391 | VideoImportsList: | |
5392 | properties: | |
5393 | total: | |
5394 | type: integer | |
5395 | example: 1 | |
5396 | data: | |
5397 | type: array | |
5398 | maxItems: 100 | |
5399 | items: | |
5400 | $ref: '#/components/schemas/VideoImport' | |
5401 | Abuse: | |
5402 | properties: | |
5403 | id: | |
5404 | $ref: '#/components/schemas/id' | |
5405 | reason: | |
5406 | type: string | |
5407 | example: The video is a spam | |
5408 | minLength: 2 | |
5409 | maxLength: 3000 | |
5410 | predefinedReasons: | |
5411 | $ref: '#/components/schemas/AbusePredefinedReasons' | |
5412 | reporterAccount: | |
5413 | $ref: '#/components/schemas/Account' | |
5414 | state: | |
5415 | $ref: '#/components/schemas/AbuseStateConstant' | |
5416 | moderationComment: | |
5417 | type: string | |
5418 | example: Decided to ban the server since it spams us regularly | |
5419 | minLength: 2 | |
5420 | maxLength: 3000 | |
5421 | video: | |
5422 | $ref: '#/components/schemas/VideoInfo' | |
5423 | createdAt: | |
5424 | type: string | |
5425 | format: date-time | |
5426 | AbuseMessage: | |
5427 | properties: | |
5428 | id: | |
5429 | $ref: '#/components/schemas/id' | |
5430 | message: | |
5431 | type: string | |
5432 | minLength: 2 | |
5433 | maxLength: 3000 | |
5434 | byModerator: | |
5435 | type: boolean | |
5436 | createdAt: | |
5437 | type: string | |
5438 | format: date-time | |
5439 | account: | |
5440 | $ref: '#/components/schemas/AccountSummary' | |
5441 | VideoBlacklist: | |
5442 | properties: | |
5443 | id: | |
5444 | $ref: '#/components/schemas/id' | |
5445 | videoId: | |
5446 | $ref: '#/components/schemas/Video/properties/id' | |
5447 | createdAt: | |
5448 | type: string | |
5449 | format: date-time | |
5450 | updatedAt: | |
5451 | type: string | |
5452 | format: date-time | |
5453 | name: | |
5454 | type: string | |
5455 | minLength: 3 | |
5456 | maxLength: 120 | |
5457 | uuid: | |
5458 | $ref: '#/components/schemas/UUIDv4' | |
5459 | description: | |
5460 | type: string | |
5461 | minLength: 3 | |
5462 | maxLength: 10000 | |
5463 | duration: | |
5464 | type: integer | |
5465 | views: | |
5466 | type: integer | |
5467 | likes: | |
5468 | type: integer | |
5469 | dislikes: | |
5470 | type: integer | |
5471 | nsfw: | |
5472 | type: boolean | |
5473 | VideoPlaylist: | |
5474 | properties: | |
5475 | id: | |
5476 | $ref: '#/components/schemas/id' | |
5477 | uuid: | |
5478 | $ref: '#/components/schemas/UUIDv4' | |
5479 | createdAt: | |
5480 | type: string | |
5481 | format: date-time | |
5482 | updatedAt: | |
5483 | type: string | |
5484 | format: date-time | |
5485 | description: | |
5486 | type: string | |
5487 | minLength: 3 | |
5488 | maxLength: 1000 | |
5489 | displayName: | |
5490 | type: string | |
5491 | minLength: 1 | |
5492 | maxLength: 120 | |
5493 | isLocal: | |
5494 | type: boolean | |
5495 | videoLength: | |
5496 | type: integer | |
5497 | minimum: 0 | |
5498 | thumbnailPath: | |
5499 | type: string | |
5500 | privacy: | |
5501 | $ref: '#/components/schemas/VideoPlaylistPrivacyConstant' | |
5502 | type: | |
5503 | $ref: '#/components/schemas/VideoPlaylistTypeConstant' | |
5504 | ownerAccount: | |
5505 | $ref: '#/components/schemas/AccountSummary' | |
5506 | videoChannel: | |
5507 | $ref: '#/components/schemas/VideoChannelSummary' | |
5508 | VideoComment: | |
5509 | properties: | |
5510 | id: | |
5511 | $ref: '#/components/schemas/id' | |
5512 | url: | |
5513 | type: string | |
5514 | format: url | |
5515 | text: | |
5516 | type: string | |
5517 | format: html | |
5518 | description: Text of the comment | |
5519 | minLength: 1 | |
5520 | example: This video is wonderful! | |
5521 | threadId: | |
5522 | $ref: '#/components/schemas/id' | |
5523 | inReplyToCommentId: | |
5524 | nullable: true | |
5525 | allOf: | |
5526 | - $ref: '#/components/schemas/id' | |
5527 | videoId: | |
5528 | $ref: '#/components/schemas/Video/properties/id' | |
5529 | createdAt: | |
5530 | type: string | |
5531 | format: date-time | |
5532 | updatedAt: | |
5533 | type: string | |
5534 | format: date-time | |
5535 | deletedAt: | |
5536 | nullable: true | |
5537 | type: string | |
5538 | format: date-time | |
5539 | default: null | |
5540 | isDeleted: | |
5541 | type: boolean | |
5542 | default: false | |
5543 | totalRepliesFromVideoAuthor: | |
5544 | type: integer | |
5545 | minimum: 0 | |
5546 | totalReplies: | |
5547 | type: integer | |
5548 | minimum: 0 | |
5549 | account: | |
5550 | $ref: '#/components/schemas/Account' | |
5551 | VideoCommentThreadTree: | |
5552 | properties: | |
5553 | comment: | |
5554 | $ref: '#/components/schemas/VideoComment' | |
5555 | children: | |
5556 | type: array | |
5557 | items: | |
5558 | $ref: '#/components/schemas/VideoCommentThreadTree' | |
5559 | VideoCaption: | |
5560 | properties: | |
5561 | language: | |
5562 | $ref: '#/components/schemas/VideoConstantString-Language' | |
5563 | captionPath: | |
5564 | type: string | |
5565 | ActorImage: | |
5566 | properties: | |
5567 | path: | |
5568 | type: string | |
5569 | createdAt: | |
5570 | type: string | |
5571 | format: date-time | |
5572 | updatedAt: | |
5573 | type: string | |
5574 | format: date-time | |
5575 | ActorInfo: | |
5576 | properties: | |
5577 | id: | |
5578 | $ref: '#/components/schemas/id' | |
5579 | name: | |
5580 | type: string | |
5581 | displayName: | |
5582 | type: string | |
5583 | host: | |
5584 | type: string | |
5585 | format: hostname | |
5586 | avatar: | |
5587 | nullable: true | |
5588 | type: object | |
5589 | properties: | |
5590 | path: | |
5591 | type: string | |
5592 | Actor: | |
5593 | properties: | |
5594 | id: | |
5595 | $ref: '#/components/schemas/id' | |
5596 | url: | |
5597 | type: string | |
5598 | format: url | |
5599 | name: | |
5600 | description: immutable name of the actor, used to find or mention it | |
5601 | allOf: | |
5602 | - $ref: '#/components/schemas/username' | |
5603 | host: | |
5604 | type: string | |
5605 | format: hostname | |
5606 | description: server on which the actor is resident | |
5607 | hostRedundancyAllowed: | |
5608 | type: boolean | |
5609 | description: whether this actor's host allows redundancy of its videos | |
5610 | followingCount: | |
5611 | type: integer | |
5612 | minimum: 0 | |
5613 | description: number of actors subscribed to by this actor, as seen by this instance | |
5614 | followersCount: | |
5615 | type: integer | |
5616 | minimum: 0 | |
5617 | description: number of followers of this actor, as seen by this instance | |
5618 | createdAt: | |
5619 | type: string | |
5620 | format: date-time | |
5621 | updatedAt: | |
5622 | type: string | |
5623 | format: date-time | |
5624 | avatar: | |
5625 | $ref: '#/components/schemas/ActorImage' | |
5626 | Account: | |
5627 | allOf: | |
5628 | - $ref: '#/components/schemas/Actor' | |
5629 | - properties: | |
5630 | userId: | |
5631 | description: object id for the user tied to this account | |
5632 | allOf: | |
5633 | - $ref: '#/components/schemas/User/properties/id' | |
5634 | displayName: | |
5635 | type: string | |
5636 | description: editable name of the account, displayed in its representations | |
5637 | minLength: 3 | |
5638 | maxLength: 120 | |
5639 | description: | |
5640 | type: string | |
5641 | description: text or bio displayed on the account's profile | |
5642 | UserWatchingVideo: | |
5643 | properties: | |
5644 | currentTime: | |
5645 | type: integer | |
5646 | format: seconds | |
5647 | description: timestamp within the video, in seconds | |
5648 | example: 5 | |
5649 | ServerConfig: | |
5650 | properties: | |
5651 | instance: | |
5652 | type: object | |
5653 | properties: | |
5654 | name: | |
5655 | type: string | |
5656 | shortDescription: | |
5657 | type: string | |
5658 | defaultClientRoute: | |
5659 | type: string | |
5660 | isNSFW: | |
5661 | type: boolean | |
5662 | defaultNSFWPolicy: | |
5663 | type: string | |
5664 | customizations: | |
5665 | type: object | |
5666 | properties: | |
5667 | javascript: | |
5668 | type: string | |
5669 | css: | |
5670 | type: string | |
5671 | search: | |
5672 | type: object | |
5673 | properties: | |
5674 | remoteUri: | |
5675 | type: object | |
5676 | properties: | |
5677 | users: | |
5678 | type: boolean | |
5679 | anonymous: | |
5680 | type: boolean | |
5681 | plugin: | |
5682 | type: object | |
5683 | properties: | |
5684 | registered: | |
5685 | type: array | |
5686 | items: | |
5687 | type: string | |
5688 | theme: | |
5689 | type: object | |
5690 | properties: | |
5691 | registered: | |
5692 | type: array | |
5693 | items: | |
5694 | type: string | |
5695 | email: | |
5696 | type: object | |
5697 | properties: | |
5698 | enabled: | |
5699 | type: boolean | |
5700 | contactForm: | |
5701 | type: object | |
5702 | properties: | |
5703 | enabled: | |
5704 | type: boolean | |
5705 | serverVersion: | |
5706 | type: string | |
5707 | serverCommit: | |
5708 | type: string | |
5709 | signup: | |
5710 | type: object | |
5711 | properties: | |
5712 | allowed: | |
5713 | type: boolean | |
5714 | allowedForCurrentIP: | |
5715 | type: boolean | |
5716 | requiresEmailVerification: | |
5717 | type: boolean | |
5718 | transcoding: | |
5719 | type: object | |
5720 | properties: | |
5721 | hls: | |
5722 | type: object | |
5723 | properties: | |
5724 | enabled: | |
5725 | type: boolean | |
5726 | webtorrent: | |
5727 | type: object | |
5728 | properties: | |
5729 | enabled: | |
5730 | type: boolean | |
5731 | enabledResolutions: | |
5732 | type: array | |
5733 | items: | |
5734 | $ref: '#/components/schemas/VideoResolutionSet' | |
5735 | import: | |
5736 | type: object | |
5737 | properties: | |
5738 | videos: | |
5739 | type: object | |
5740 | properties: | |
5741 | http: | |
5742 | type: object | |
5743 | properties: | |
5744 | enabled: | |
5745 | type: boolean | |
5746 | torrent: | |
5747 | type: object | |
5748 | properties: | |
5749 | enabled: | |
5750 | type: boolean | |
5751 | autoBlacklist: | |
5752 | type: object | |
5753 | properties: | |
5754 | videos: | |
5755 | type: object | |
5756 | properties: | |
5757 | ofUsers: | |
5758 | type: object | |
5759 | properties: | |
5760 | enabled: | |
5761 | type: boolean | |
5762 | avatar: | |
5763 | type: object | |
5764 | properties: | |
5765 | file: | |
5766 | type: object | |
5767 | properties: | |
5768 | size: | |
5769 | type: object | |
5770 | properties: | |
5771 | max: | |
5772 | type: integer | |
5773 | extensions: | |
5774 | type: array | |
5775 | items: | |
5776 | type: string | |
5777 | video: | |
5778 | type: object | |
5779 | properties: | |
5780 | image: | |
5781 | type: object | |
5782 | properties: | |
5783 | extensions: | |
5784 | type: array | |
5785 | items: | |
5786 | type: string | |
5787 | size: | |
5788 | type: object | |
5789 | properties: | |
5790 | max: | |
5791 | type: integer | |
5792 | file: | |
5793 | type: object | |
5794 | properties: | |
5795 | extensions: | |
5796 | type: array | |
5797 | items: | |
5798 | type: string | |
5799 | videoCaption: | |
5800 | type: object | |
5801 | properties: | |
5802 | file: | |
5803 | type: object | |
5804 | properties: | |
5805 | size: | |
5806 | type: object | |
5807 | properties: | |
5808 | max: | |
5809 | type: integer | |
5810 | extensions: | |
5811 | type: array | |
5812 | items: | |
5813 | type: string | |
5814 | user: | |
5815 | type: object | |
5816 | properties: | |
5817 | videoQuota: | |
5818 | type: integer | |
5819 | example: 16810141515 | |
5820 | videoQuotaDaily: | |
5821 | type: integer | |
5822 | example: 1681014151 | |
5823 | trending: | |
5824 | type: object | |
5825 | properties: | |
5826 | videos: | |
5827 | type: object | |
5828 | properties: | |
5829 | intervalDays: | |
5830 | type: integer | |
5831 | tracker: | |
5832 | type: object | |
5833 | properties: | |
5834 | enabled: | |
5835 | type: boolean | |
5836 | followings: | |
5837 | type: object | |
5838 | properties: | |
5839 | instance: | |
5840 | type: object | |
5841 | properties: | |
5842 | autoFollowIndex: | |
5843 | type: object | |
5844 | properties: | |
5845 | indexUrl: | |
5846 | type: string | |
5847 | format: url | |
5848 | homepage: | |
5849 | type: object | |
5850 | properties: | |
5851 | enabled: | |
5852 | type: boolean | |
5853 | ||
5854 | ServerConfigAbout: | |
5855 | properties: | |
5856 | instance: | |
5857 | type: object | |
5858 | properties: | |
5859 | name: | |
5860 | type: string | |
5861 | shortDescription: | |
5862 | type: string | |
5863 | description: | |
5864 | type: string | |
5865 | terms: | |
5866 | type: string | |
5867 | ServerConfigCustom: | |
5868 | properties: | |
5869 | instance: | |
5870 | type: object | |
5871 | properties: | |
5872 | name: | |
5873 | type: string | |
5874 | shortDescription: | |
5875 | type: string | |
5876 | description: | |
5877 | type: string | |
5878 | terms: | |
5879 | type: string | |
5880 | defaultClientRoute: | |
5881 | type: string | |
5882 | isNSFW: | |
5883 | type: boolean | |
5884 | defaultNSFWPolicy: | |
5885 | type: string | |
5886 | customizations: | |
5887 | type: object | |
5888 | properties: | |
5889 | javascript: | |
5890 | type: string | |
5891 | css: | |
5892 | type: string | |
5893 | theme: | |
5894 | type: object | |
5895 | properties: | |
5896 | default: | |
5897 | type: string | |
5898 | services: | |
5899 | type: object | |
5900 | properties: | |
5901 | twitter: | |
5902 | type: object | |
5903 | properties: | |
5904 | username: | |
5905 | type: string | |
5906 | whitelisted: | |
5907 | type: boolean | |
5908 | cache: | |
5909 | type: object | |
5910 | properties: | |
5911 | previews: | |
5912 | type: object | |
5913 | properties: | |
5914 | size: | |
5915 | type: integer | |
5916 | captions: | |
5917 | type: object | |
5918 | properties: | |
5919 | size: | |
5920 | type: integer | |
5921 | signup: | |
5922 | type: object | |
5923 | properties: | |
5924 | enabled: | |
5925 | type: boolean | |
5926 | limit: | |
5927 | type: integer | |
5928 | requiresEmailVerification: | |
5929 | type: boolean | |
5930 | admin: | |
5931 | type: object | |
5932 | properties: | |
5933 | email: | |
5934 | type: string | |
5935 | format: email | |
5936 | contactForm: | |
5937 | type: object | |
5938 | properties: | |
5939 | enabled: | |
5940 | type: boolean | |
5941 | user: | |
5942 | type: object | |
5943 | description: Settings that apply to new users, if registration is enabled | |
5944 | properties: | |
5945 | videoQuota: | |
5946 | type: integer | |
5947 | example: 16810141515 | |
5948 | videoQuotaDaily: | |
5949 | type: integer | |
5950 | example: 1681014151 | |
5951 | transcoding: | |
5952 | type: object | |
5953 | description: Settings pertaining to transcoding jobs | |
5954 | properties: | |
5955 | enabled: | |
5956 | type: boolean | |
5957 | allowAdditionalExtensions: | |
5958 | type: boolean | |
5959 | description: Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos | |
5960 | allowAudioFiles: | |
5961 | type: boolean | |
5962 | description: If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file | |
5963 | threads: | |
5964 | type: integer | |
5965 | description: Amount of threads used by ffmpeg for 1 transcoding job | |
5966 | concurrency: | |
5967 | type: number | |
5968 | description: Amount of transcoding jobs to execute in parallel | |
5969 | profile: | |
5970 | type: string | |
5971 | enum: | |
5972 | - default | |
5973 | description: | | |
5974 | New profiles can be added by plugins ; available in core PeerTube: 'default'. | |
5975 | resolutions: | |
5976 | type: object | |
5977 | description: Resolutions to transcode _new videos_ to | |
5978 | properties: | |
5979 | 0p: | |
5980 | type: boolean | |
5981 | 240p: | |
5982 | type: boolean | |
5983 | 360p: | |
5984 | type: boolean | |
5985 | 480p: | |
5986 | type: boolean | |
5987 | 720p: | |
5988 | type: boolean | |
5989 | 1080p: | |
5990 | type: boolean | |
5991 | 1440p: | |
5992 | type: boolean | |
5993 | 2160p: | |
5994 | type: boolean | |
5995 | webtorrent: | |
5996 | type: object | |
5997 | description: WebTorrent-specific settings | |
5998 | properties: | |
5999 | enabled: | |
6000 | type: boolean | |
6001 | hls: | |
6002 | type: object | |
6003 | description: HLS-specific settings | |
6004 | properties: | |
6005 | enabled: | |
6006 | type: boolean | |
6007 | import: | |
6008 | type: object | |
6009 | properties: | |
6010 | videos: | |
6011 | type: object | |
6012 | properties: | |
6013 | http: | |
6014 | type: object | |
6015 | properties: | |
6016 | enabled: | |
6017 | type: boolean | |
6018 | torrent: | |
6019 | type: object | |
6020 | properties: | |
6021 | enabled: | |
6022 | type: boolean | |
6023 | autoBlacklist: | |
6024 | type: object | |
6025 | properties: | |
6026 | videos: | |
6027 | type: object | |
6028 | properties: | |
6029 | ofUsers: | |
6030 | type: object | |
6031 | properties: | |
6032 | enabled: | |
6033 | type: boolean | |
6034 | followers: | |
6035 | type: object | |
6036 | properties: | |
6037 | instance: | |
6038 | type: object | |
6039 | properties: | |
6040 | enabled: | |
6041 | type: boolean | |
6042 | manualApproval: | |
6043 | type: boolean | |
6044 | ||
6045 | CustomHomepage: | |
6046 | properties: | |
6047 | content: | |
6048 | type: string | |
6049 | ||
6050 | Follow: | |
6051 | properties: | |
6052 | id: | |
6053 | $ref: '#/components/schemas/id' | |
6054 | follower: | |
6055 | $ref: '#/components/schemas/Actor' | |
6056 | following: | |
6057 | $ref: '#/components/schemas/Actor' | |
6058 | score: | |
6059 | type: number | |
6060 | description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`. | |
6061 | state: | |
6062 | type: string | |
6063 | enum: | |
6064 | - pending | |
6065 | - accepted | |
6066 | createdAt: | |
6067 | type: string | |
6068 | format: date-time | |
6069 | updatedAt: | |
6070 | type: string | |
6071 | format: date-time | |
6072 | ||
6073 | PredefinedAbuseReasons: | |
6074 | description: Reason categories that help triage reports | |
6075 | type: array | |
6076 | maxItems: 8 | |
6077 | items: | |
6078 | type: string | |
6079 | enum: | |
6080 | - violentOrAbusive | |
6081 | - hatefulOrAbusive | |
6082 | - spamOrMisleading | |
6083 | - privacy | |
6084 | - rights | |
6085 | - serverRules | |
6086 | - thumbnails | |
6087 | - captions | |
6088 | ||
6089 | Job: | |
6090 | properties: | |
6091 | id: | |
6092 | $ref: '#/components/schemas/id' | |
6093 | state: | |
6094 | type: string | |
6095 | enum: | |
6096 | - active | |
6097 | - completed | |
6098 | - failed | |
6099 | - waiting | |
6100 | - delayed | |
6101 | type: | |
6102 | type: string | |
6103 | enum: | |
6104 | - activitypub-http-unicast | |
6105 | - activitypub-http-broadcast | |
6106 | - activitypub-http-fetcher | |
6107 | - activitypub-follow | |
6108 | - video-file-import | |
6109 | - video-transcoding | |
6110 | ||
6111 | - video-import | |
6112 | - videos-views | |
6113 | - activitypub-refresher | |
6114 | - video-redundancy | |
6115 | data: | |
6116 | type: object | |
6117 | additionalProperties: true | |
6118 | error: | |
6119 | type: object | |
6120 | additionalProperties: true | |
6121 | createdAt: | |
6122 | type: string | |
6123 | format: date-time | |
6124 | finishedOn: | |
6125 | type: string | |
6126 | format: date-time | |
6127 | processedOn: | |
6128 | type: string | |
6129 | format: date-time | |
6130 | AddUserResponse: | |
6131 | properties: | |
6132 | user: | |
6133 | type: object | |
6134 | properties: | |
6135 | id: | |
6136 | $ref: '#/components/schemas/id' | |
6137 | account: | |
6138 | type: object | |
6139 | properties: | |
6140 | id: | |
6141 | $ref: '#/components/schemas/id' | |
6142 | VideoUploadRequestCommon: | |
6143 | properties: | |
6144 | name: | |
6145 | description: Video name | |
6146 | type: string | |
6147 | example: What is PeerTube? | |
6148 | minLength: 3 | |
6149 | maxLength: 120 | |
6150 | channelId: | |
6151 | description: Channel id that will contain this video | |
6152 | type: integer | |
6153 | example: 3 | |
6154 | minimum: 1 | |
6155 | privacy: | |
6156 | $ref: '#/components/schemas/VideoPrivacySet' | |
6157 | category: | |
6158 | $ref: '#/components/schemas/VideoCategorySet' | |
6159 | licence: | |
6160 | $ref: '#/components/schemas/VideoLicenceSet' | |
6161 | language: | |
6162 | $ref: '#/components/schemas/VideoLanguageSet' | |
6163 | description: | |
6164 | description: Video description | |
6165 | type: string | |
6166 | example: | | |
6167 | **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)** | |
6168 | waitTranscoding: | |
6169 | description: Whether or not we wait transcoding before publish the video | |
6170 | type: boolean | |
6171 | support: | |
6172 | description: A text tell the audience how to support the video creator | |
6173 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 | |
6174 | type: string | |
6175 | nsfw: | |
6176 | description: Whether or not this video contains sensitive content | |
6177 | type: boolean | |
6178 | tags: | |
6179 | description: Video tags (maximum 5 tags each between 2 and 30 characters) | |
6180 | type: array | |
6181 | minItems: 1 | |
6182 | maxItems: 5 | |
6183 | uniqueItems: true | |
6184 | example: | |
6185 | - framasoft | |
6186 | - peertube | |
6187 | items: | |
6188 | type: string | |
6189 | minLength: 2 | |
6190 | maxLength: 30 | |
6191 | commentsEnabled: | |
6192 | description: Enable or disable comments for this video | |
6193 | type: boolean | |
6194 | downloadEnabled: | |
6195 | description: Enable or disable downloading for this video | |
6196 | type: boolean | |
6197 | originallyPublishedAt: | |
6198 | description: Date when the content was originally published | |
6199 | type: string | |
6200 | format: date-time | |
6201 | scheduleUpdate: | |
6202 | $ref: '#/components/schemas/VideoScheduledUpdate' | |
6203 | thumbnailfile: | |
6204 | description: Video thumbnail file | |
6205 | type: string | |
6206 | format: binary | |
6207 | previewfile: | |
6208 | description: Video preview file | |
6209 | type: string | |
6210 | format: binary | |
6211 | required: | |
6212 | - channelId | |
6213 | - name | |
6214 | VideoUploadRequestLegacy: | |
6215 | allOf: | |
6216 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | |
6217 | - type: object | |
6218 | required: | |
6219 | - videofile | |
6220 | properties: | |
6221 | videofile: | |
6222 | description: Video file | |
6223 | type: string | |
6224 | format: binary | |
6225 | VideoUploadRequestResumable: | |
6226 | allOf: | |
6227 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | |
6228 | - type: object | |
6229 | required: | |
6230 | - filename | |
6231 | properties: | |
6232 | filename: | |
6233 | description: Video filename including extension | |
6234 | type: string | |
6235 | format: filename | |
6236 | example: what_is_peertube.mp4 | |
6237 | thumbnailfile: | |
6238 | description: Video thumbnail file | |
6239 | type: string | |
6240 | format: binary | |
6241 | previewfile: | |
6242 | description: Video preview file | |
6243 | type: string | |
6244 | format: binary | |
6245 | VideoUploadResponse: | |
6246 | properties: | |
6247 | video: | |
6248 | type: object | |
6249 | properties: | |
6250 | id: | |
6251 | $ref: '#/components/schemas/Video/properties/id' | |
6252 | uuid: | |
6253 | $ref: '#/components/schemas/Video/properties/uuid' | |
6254 | CommentThreadResponse: | |
6255 | properties: | |
6256 | total: | |
6257 | type: integer | |
6258 | example: 1 | |
6259 | data: | |
6260 | type: array | |
6261 | maxItems: 100 | |
6262 | items: | |
6263 | $ref: '#/components/schemas/VideoComment' | |
6264 | CommentThreadPostResponse: | |
6265 | properties: | |
6266 | comment: | |
6267 | $ref: '#/components/schemas/VideoComment' | |
6268 | VideoListResponse: | |
6269 | properties: | |
6270 | total: | |
6271 | type: integer | |
6272 | example: 1 | |
6273 | data: | |
6274 | type: array | |
6275 | maxItems: 100 | |
6276 | items: | |
6277 | $ref: '#/components/schemas/Video' | |
6278 | User: | |
6279 | properties: | |
6280 | account: | |
6281 | $ref: '#/components/schemas/Account' | |
6282 | autoPlayNextVideo: | |
6283 | type: boolean | |
6284 | description: Automatically start playing the upcoming video after the currently playing video | |
6285 | autoPlayNextVideoPlaylist: | |
6286 | type: boolean | |
6287 | description: Automatically start playing the video on the playlist after the currently playing video | |
6288 | autoPlayVideo: | |
6289 | type: boolean | |
6290 | description: Automatically start playing the video on the watch page | |
6291 | blocked: | |
6292 | type: boolean | |
6293 | blockedReason: | |
6294 | type: string | |
6295 | createdAt: | |
6296 | type: string | |
6297 | email: | |
6298 | type: string | |
6299 | format: email | |
6300 | description: The user email | |
6301 | emailVerified: | |
6302 | type: boolean | |
6303 | description: Has the user confirmed their email address? | |
6304 | id: | |
6305 | allOf: | |
6306 | - $ref: '#/components/schemas/id' | |
6307 | readOnly: true | |
6308 | pluginAuth: | |
6309 | type: string | |
6310 | description: Auth plugin to use to authenticate the user | |
6311 | lastLoginDate: | |
6312 | type: string | |
6313 | format: date-time | |
6314 | noInstanceConfigWarningModal: | |
6315 | type: boolean | |
6316 | noWelcomeModal: | |
6317 | type: boolean | |
6318 | nsfwPolicy: | |
6319 | $ref: '#/components/schemas/NSFWPolicy' | |
6320 | role: | |
6321 | $ref: '#/components/schemas/UserRole' | |
6322 | roleLabel: | |
6323 | type: string | |
6324 | enum: | |
6325 | - User | |
6326 | - Moderator | |
6327 | - Administrator | |
6328 | theme: | |
6329 | type: string | |
6330 | description: Theme enabled by this user | |
6331 | username: | |
6332 | $ref: '#/components/schemas/username' | |
6333 | videoChannels: | |
6334 | type: array | |
6335 | items: | |
6336 | $ref: '#/components/schemas/VideoChannel' | |
6337 | videoQuota: | |
6338 | type: integer | |
6339 | description: The user video quota in bytes | |
6340 | example: -1 | |
6341 | videoQuotaDaily: | |
6342 | type: integer | |
6343 | description: The user daily video quota in bytes | |
6344 | example: -1 | |
6345 | webtorrentEnabled: | |
6346 | type: boolean | |
6347 | description: Enable P2P in the player | |
6348 | UserWithStats: | |
6349 | allOf: | |
6350 | - $ref: '#/components/schemas/User' | |
6351 | - properties: | |
6352 | # optionally present fields: they require WITH_STATS scope | |
6353 | videosCount: | |
6354 | type: integer | |
6355 | description: Count of videos published | |
6356 | abusesCount: | |
6357 | type: integer | |
6358 | description: Count of reports/abuses of which the user is a target | |
6359 | abusesAcceptedCount: | |
6360 | type: integer | |
6361 | description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team | |
6362 | abusesCreatedCount: | |
6363 | type: integer | |
6364 | description: Count of reports/abuses created by the user | |
6365 | videoCommentsCount: | |
6366 | type: integer | |
6367 | description: Count of comments published | |
6368 | AddUser: | |
6369 | properties: | |
6370 | username: | |
6371 | $ref: '#/components/schemas/username' | |
6372 | password: | |
6373 | $ref: '#/components/schemas/password' | |
6374 | email: | |
6375 | type: string | |
6376 | format: email | |
6377 | description: The user email | |
6378 | videoQuota: | |
6379 | type: integer | |
6380 | description: The user video quota in bytes | |
6381 | example: -1 | |
6382 | videoQuotaDaily: | |
6383 | type: integer | |
6384 | description: The user daily video quota in bytes | |
6385 | example: -1 | |
6386 | channelName: | |
6387 | $ref: '#/components/schemas/usernameChannel' | |
6388 | role: | |
6389 | $ref: '#/components/schemas/UserRole' | |
6390 | adminFlags: | |
6391 | $ref: '#/components/schemas/UserAdminFlags' | |
6392 | required: | |
6393 | - username | |
6394 | - password | |
6395 | ||
6396 | - videoQuota | |
6397 | - videoQuotaDaily | |
6398 | - role | |
6399 | UpdateUser: | |
6400 | properties: | |
6401 | email: | |
6402 | description: The updated email of the user | |
6403 | allOf: | |
6404 | - $ref: '#/components/schemas/User/properties/email' | |
6405 | emailVerified: | |
6406 | type: boolean | |
6407 | description: Set the email as verified | |
6408 | videoQuota: | |
6409 | type: integer | |
6410 | description: The updated video quota of the user in bytes | |
6411 | videoQuotaDaily: | |
6412 | type: integer | |
6413 | description: The updated daily video quota of the user in bytes | |
6414 | pluginAuth: | |
6415 | type: string | |
6416 | nullable: true | |
6417 | description: The auth plugin to use to authenticate the user | |
6418 | example: 'peertube-plugin-auth-saml2' | |
6419 | role: | |
6420 | $ref: '#/components/schemas/UserRole' | |
6421 | adminFlags: | |
6422 | $ref: '#/components/schemas/UserAdminFlags' | |
6423 | UpdateMe: | |
6424 | # see shared/models/users/user-update-me.model.ts: | |
6425 | properties: | |
6426 | password: | |
6427 | $ref: '#/components/schemas/password' | |
6428 | currentPassword: | |
6429 | $ref: '#/components/schemas/password' | |
6430 | email: | |
6431 | description: new email used for login and service communications | |
6432 | allOf: | |
6433 | - $ref: '#/components/schemas/User/properties/email' | |
6434 | displayName: | |
6435 | type: string | |
6436 | description: new name of the user in its representations | |
6437 | minLength: 3 | |
6438 | maxLength: 120 | |
6439 | displayNSFW: | |
6440 | type: string | |
6441 | description: new NSFW display policy | |
6442 | enum: | |
6443 | - 'true' | |
6444 | - 'false' | |
6445 | - both | |
6446 | webTorrentEnabled: | |
6447 | type: boolean | |
6448 | description: whether to enable P2P in the player or not | |
6449 | autoPlayVideo: | |
6450 | type: boolean | |
6451 | description: new preference regarding playing videos automatically | |
6452 | autoPlayNextVideo: | |
6453 | type: boolean | |
6454 | description: new preference regarding playing following videos automatically | |
6455 | autoPlayNextVideoPlaylist: | |
6456 | type: boolean | |
6457 | description: new preference regarding playing following playlist videos automatically | |
6458 | videosHistoryEnabled: | |
6459 | type: boolean | |
6460 | description: whether to keep track of watched history or not | |
6461 | videoLanguages: | |
6462 | type: array | |
6463 | items: | |
6464 | type: string | |
6465 | description: list of languages to filter videos down to | |
6466 | theme: | |
6467 | type: string | |
6468 | noInstanceConfigWarningModal: | |
6469 | type: boolean | |
6470 | noWelcomeModal: | |
6471 | type: boolean | |
6472 | GetMeVideoRating: | |
6473 | properties: | |
6474 | id: | |
6475 | $ref: '#/components/schemas/id' | |
6476 | rating: | |
6477 | type: string | |
6478 | enum: | |
6479 | - like | |
6480 | - dislike | |
6481 | - none | |
6482 | description: Rating of the video | |
6483 | required: | |
6484 | - id | |
6485 | - rating | |
6486 | VideoRating: | |
6487 | properties: | |
6488 | video: | |
6489 | $ref: '#/components/schemas/Video' | |
6490 | rating: | |
6491 | type: string | |
6492 | enum: | |
6493 | - like | |
6494 | - dislike | |
6495 | - none | |
6496 | description: Rating of the video | |
6497 | required: | |
6498 | - video | |
6499 | - rating | |
6500 | RegisterUser: | |
6501 | properties: | |
6502 | username: | |
6503 | description: immutable name of the user, used to find or mention its actor | |
6504 | allOf: | |
6505 | - $ref: '#/components/schemas/username' | |
6506 | password: | |
6507 | $ref: '#/components/schemas/password' | |
6508 | email: | |
6509 | type: string | |
6510 | format: email | |
6511 | description: email of the user, used for login or service communications | |
6512 | displayName: | |
6513 | type: string | |
6514 | description: editable name of the user, displayed in its representations | |
6515 | minLength: 1 | |
6516 | maxLength: 120 | |
6517 | channel: | |
6518 | type: object | |
6519 | description: channel base information used to create the first channel of the user | |
6520 | properties: | |
6521 | name: | |
6522 | $ref: '#/components/schemas/usernameChannel' | |
6523 | displayName: | |
6524 | $ref: '#/components/schemas/VideoChannel/properties/displayName' | |
6525 | required: | |
6526 | - username | |
6527 | - password | |
6528 | ||
6529 | ||
6530 | OAuthClient: | |
6531 | properties: | |
6532 | client_id: | |
6533 | type: string | |
6534 | pattern: /^[a-z0-9]$/ | |
6535 | maxLength: 32 | |
6536 | minLength: 32 | |
6537 | example: v1ikx5hnfop4mdpnci8nsqh93c45rldf | |
6538 | client_secret: | |
6539 | type: string | |
6540 | pattern: /^[a-zA-Z0-9]$/ | |
6541 | maxLength: 32 | |
6542 | minLength: 32 | |
6543 | example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt | |
6544 | OAuthToken-password: | |
6545 | allOf: | |
6546 | - $ref: '#/components/schemas/OAuthClient' | |
6547 | - type: object | |
6548 | properties: | |
6549 | grant_type: | |
6550 | type: string | |
6551 | enum: | |
6552 | - password | |
6553 | - refresh_token | |
6554 | default: password | |
6555 | username: | |
6556 | $ref: '#/components/schemas/User/properties/username' | |
6557 | password: | |
6558 | $ref: '#/components/schemas/password' | |
6559 | required: | |
6560 | - client_id | |
6561 | - client_secret | |
6562 | - grant_type | |
6563 | - username | |
6564 | - password | |
6565 | OAuthToken-refresh_token: | |
6566 | allOf: | |
6567 | - $ref: '#/components/schemas/OAuthClient' | |
6568 | - type: object | |
6569 | properties: | |
6570 | grant_type: | |
6571 | type: string | |
6572 | enum: | |
6573 | - password | |
6574 | - refresh_token | |
6575 | default: password | |
6576 | refresh_token: | |
6577 | type: string | |
6578 | example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7 | |
6579 | required: | |
6580 | - client_id | |
6581 | - client_secret | |
6582 | - grant_type | |
6583 | - refresh_token | |
6584 | ||
6585 | VideoChannel: | |
6586 | properties: | |
6587 | # GET/POST/PUT properties | |
6588 | displayName: | |
6589 | type: string | |
6590 | description: editable name of the channel, displayed in its representations | |
6591 | example: Videos of Framasoft | |
6592 | minLength: 1 | |
6593 | maxLength: 120 | |
6594 | description: | |
6595 | type: string | |
6596 | example: Videos made with <3 by Framasoft | |
6597 | minLength: 3 | |
6598 | maxLength: 1000 | |
6599 | support: | |
6600 | type: string | |
6601 | description: text shown by default on all videos of this channel, to tell the audience how to support it | |
6602 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 | |
6603 | minLength: 3 | |
6604 | maxLength: 1000 | |
6605 | # GET-only properties | |
6606 | id: | |
6607 | readOnly: true | |
6608 | allOf: | |
6609 | - $ref: '#/components/schemas/id' | |
6610 | isLocal: | |
6611 | readOnly: true | |
6612 | type: boolean | |
6613 | updatedAt: | |
6614 | readOnly: true | |
6615 | type: string | |
6616 | format: date-time | |
6617 | ownerAccount: | |
6618 | readOnly: true | |
6619 | nullable: true | |
6620 | type: object | |
6621 | properties: | |
6622 | id: | |
6623 | type: integer | |
6624 | uuid: | |
6625 | $ref: '#/components/schemas/UUIDv4' | |
6626 | VideoChannelCreate: | |
6627 | allOf: | |
6628 | - $ref: '#/components/schemas/VideoChannel' | |
6629 | - properties: | |
6630 | name: | |
6631 | description: username of the channel to create | |
6632 | allOf: | |
6633 | - $ref: '#/components/schemas/usernameChannel' | |
6634 | required: | |
6635 | - name | |
6636 | - displayName | |
6637 | VideoChannelUpdate: | |
6638 | allOf: | |
6639 | - $ref: '#/components/schemas/VideoChannel' | |
6640 | - properties: | |
6641 | bulkVideosSupportUpdate: | |
6642 | type: boolean | |
6643 | description: Update the support field for all videos of this channel | |
6644 | VideoChannelList: | |
6645 | properties: | |
6646 | total: | |
6647 | type: integer | |
6648 | example: 1 | |
6649 | data: | |
6650 | type: array | |
6651 | items: | |
6652 | allOf: | |
6653 | - $ref: '#/components/schemas/VideoChannel' | |
6654 | - $ref: '#/components/schemas/Actor' | |
6655 | ||
6656 | MRSSPeerLink: | |
6657 | type: object | |
6658 | xml: | |
6659 | name: 'media:peerLink' | |
6660 | properties: | |
6661 | href: | |
6662 | type: string | |
6663 | xml: | |
6664 | attribute: true | |
6665 | type: | |
6666 | type: string | |
6667 | enum: | |
6668 | - application/x-bittorrent | |
6669 | xml: | |
6670 | attribute: true | |
6671 | MRSSGroupContent: | |
6672 | type: object | |
6673 | xml: | |
6674 | name: 'media:content' | |
6675 | properties: | |
6676 | url: | |
6677 | type: string | |
6678 | format: url | |
6679 | xml: | |
6680 | attribute: true | |
6681 | fileSize: | |
6682 | type: integer | |
6683 | xml: | |
6684 | attribute: true | |
6685 | type: | |
6686 | type: string | |
6687 | xml: | |
6688 | attribute: true | |
6689 | framerate: | |
6690 | type: integer | |
6691 | xml: | |
6692 | attribute: true | |
6693 | duration: | |
6694 | type: integer | |
6695 | xml: | |
6696 | attribute: true | |
6697 | height: | |
6698 | type: integer | |
6699 | xml: | |
6700 | attribute: true | |
6701 | lang: | |
6702 | type: string | |
6703 | xml: | |
6704 | attribute: true | |
6705 | VideoCommentsForXML: | |
6706 | type: array | |
6707 | xml: | |
6708 | wrapped: true | |
6709 | name: 'channel' | |
6710 | items: | |
6711 | type: object | |
6712 | xml: | |
6713 | name: 'item' | |
6714 | properties: | |
6715 | link: | |
6716 | type: string | |
6717 | format: url | |
6718 | guid: | |
6719 | type: string | |
6720 | pubDate: | |
6721 | type: string | |
6722 | format: date-time | |
6723 | 'content:encoded': | |
6724 | type: string | |
6725 | 'dc:creator': | |
6726 | type: string | |
6727 | VideosForXML: | |
6728 | type: array | |
6729 | xml: | |
6730 | wrapped: true | |
6731 | name: 'channel' | |
6732 | items: | |
6733 | type: object | |
6734 | xml: | |
6735 | name: 'item' | |
6736 | properties: | |
6737 | link: | |
6738 | type: string | |
6739 | format: url | |
6740 | description: video watch page URL | |
6741 | guid: | |
6742 | type: string | |
6743 | description: video canonical URL | |
6744 | pubDate: | |
6745 | type: string | |
6746 | format: date-time | |
6747 | description: video publication date | |
6748 | description: | |
6749 | type: string | |
6750 | description: video description | |
6751 | 'content:encoded': | |
6752 | type: string | |
6753 | description: video description | |
6754 | 'dc:creator': | |
6755 | type: string | |
6756 | description: publisher user name | |
6757 | 'media:category': | |
6758 | type: integer | |
6759 | description: video category (MRSS) | |
6760 | 'media:community': | |
6761 | type: object | |
6762 | description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS) | |
6763 | properties: | |
6764 | 'media:statistics': | |
6765 | type: object | |
6766 | properties: | |
6767 | views: | |
6768 | type: integer | |
6769 | xml: | |
6770 | attribute: true | |
6771 | 'media:embed': | |
6772 | type: object | |
6773 | properties: | |
6774 | url: | |
6775 | type: string | |
6776 | format: url | |
6777 | description: video embed path, relative to the canonical URL domain (MRSS) | |
6778 | xml: | |
6779 | attribute: true | |
6780 | 'media:player': | |
6781 | type: object | |
6782 | properties: | |
6783 | url: | |
6784 | type: string | |
6785 | format: url | |
6786 | description: video watch path, relative to the canonical URL domain (MRSS) | |
6787 | xml: | |
6788 | attribute: true | |
6789 | 'media:thumbnail': | |
6790 | type: object | |
6791 | properties: | |
6792 | url: | |
6793 | type: string | |
6794 | format: url | |
6795 | xml: | |
6796 | attribute: true | |
6797 | height: | |
6798 | type: integer | |
6799 | xml: | |
6800 | attribute: true | |
6801 | width: | |
6802 | type: integer | |
6803 | xml: | |
6804 | attribute: true | |
6805 | 'media:title': | |
6806 | type: string | |
6807 | description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles. | |
6808 | 'media:description': | |
6809 | type: string | |
6810 | 'media:rating': | |
6811 | type: string | |
6812 | enum: | |
6813 | - nonadult | |
6814 | - adult | |
6815 | description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS) | |
6816 | 'enclosure': | |
6817 | type: object | |
6818 | description: main streamable file for the video | |
6819 | properties: | |
6820 | url: | |
6821 | type: string | |
6822 | format: url | |
6823 | xml: | |
6824 | attribute: true | |
6825 | type: | |
6826 | type: string | |
6827 | enum: | |
6828 | - application/x-bittorrent | |
6829 | xml: | |
6830 | attribute: true | |
6831 | length: | |
6832 | type: integer | |
6833 | xml: | |
6834 | attribute: true | |
6835 | 'media:group': | |
6836 | type: array | |
6837 | description: list of streamable files for the video. see [media:peerLink](https://www.rssboard.org/media-rss#media-peerlink) and [media:content](https://www.rssboard.org/media-rss#media-content) or (MRSS) | |
6838 | items: | |
6839 | anyOf: | |
6840 | - $ref: '#/components/schemas/MRSSPeerLink' | |
6841 | - $ref: '#/components/schemas/MRSSGroupContent' | |
6842 | NotificationSettingValue: | |
6843 | type: integer | |
6844 | description: > | |
6845 | Notification type | |
6846 | ||
6847 | - `0` NONE | |
6848 | ||
6849 | - `1` WEB | |
6850 | ||
6851 | - `2` EMAIL | |
6852 | enum: | |
6853 | - 0 | |
6854 | - 1 | |
6855 | - 3 | |
6856 | Notification: | |
6857 | properties: | |
6858 | id: | |
6859 | $ref: '#/components/schemas/id' | |
6860 | type: | |
6861 | type: integer | |
6862 | description: > | |
6863 | Notification type, following the `UserNotificationType` enum: | |
6864 | ||
6865 | - `1` NEW_VIDEO_FROM_SUBSCRIPTION | |
6866 | ||
6867 | - `2` NEW_COMMENT_ON_MY_VIDEO | |
6868 | ||
6869 | - `3` NEW_ABUSE_FOR_MODERATORS | |
6870 | ||
6871 | - `4` BLACKLIST_ON_MY_VIDEO | |
6872 | ||
6873 | - `5` UNBLACKLIST_ON_MY_VIDEO | |
6874 | ||
6875 | - `6` MY_VIDEO_PUBLISHED | |
6876 | ||
6877 | - `7` MY_VIDEO_IMPORT_SUCCESS | |
6878 | ||
6879 | - `8` MY_VIDEO_IMPORT_ERROR | |
6880 | ||
6881 | - `9` NEW_USER_REGISTRATION | |
6882 | ||
6883 | - `10` NEW_FOLLOW | |
6884 | ||
6885 | - `11` COMMENT_MENTION | |
6886 | ||
6887 | - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS | |
6888 | ||
6889 | - `13` NEW_INSTANCE_FOLLOWER | |
6890 | ||
6891 | - `14` AUTO_INSTANCE_FOLLOWING | |
6892 | read: | |
6893 | type: boolean | |
6894 | video: | |
6895 | nullable: true | |
6896 | allOf: | |
6897 | - $ref: '#/components/schemas/VideoInfo' | |
6898 | - type: object | |
6899 | properties: | |
6900 | channel: | |
6901 | $ref: '#/components/schemas/ActorInfo' | |
6902 | videoImport: | |
6903 | nullable: true | |
6904 | type: object | |
6905 | properties: | |
6906 | id: | |
6907 | $ref: '#/components/schemas/id' | |
6908 | video: | |
6909 | nullable: true | |
6910 | $ref: '#/components/schemas/VideoInfo' | |
6911 | torrentName: | |
6912 | type: string | |
6913 | nullable: true | |
6914 | magnetUri: | |
6915 | $ref: '#/components/schemas/VideoImport/properties/magnetUri' | |
6916 | targetUri: | |
6917 | type: string | |
6918 | format: uri | |
6919 | nullable: true | |
6920 | comment: | |
6921 | nullable: true | |
6922 | type: object | |
6923 | properties: | |
6924 | id: | |
6925 | $ref: '#/components/schemas/id' | |
6926 | threadId: | |
6927 | type: integer | |
6928 | video: | |
6929 | $ref: '#/components/schemas/VideoInfo' | |
6930 | account: | |
6931 | $ref: '#/components/schemas/ActorInfo' | |
6932 | videoAbuse: | |
6933 | nullable: true | |
6934 | type: object | |
6935 | properties: | |
6936 | id: | |
6937 | $ref: '#/components/schemas/id' | |
6938 | video: | |
6939 | allOf: | |
6940 | - $ref: '#/components/schemas/VideoInfo' | |
6941 | videoBlacklist: | |
6942 | nullable: true | |
6943 | type: object | |
6944 | properties: | |
6945 | id: | |
6946 | $ref: '#/components/schemas/id' | |
6947 | video: | |
6948 | allOf: | |
6949 | - $ref: '#/components/schemas/VideoInfo' | |
6950 | account: | |
6951 | nullable: true | |
6952 | allOf: | |
6953 | - $ref: '#/components/schemas/ActorInfo' | |
6954 | actorFollow: | |
6955 | type: object | |
6956 | nullable: true | |
6957 | properties: | |
6958 | id: | |
6959 | $ref: '#/components/schemas/id' | |
6960 | follower: | |
6961 | $ref: '#/components/schemas/ActorInfo' | |
6962 | state: | |
6963 | type: string | |
6964 | enum: | |
6965 | - pending | |
6966 | - accepted | |
6967 | following: | |
6968 | type: object | |
6969 | properties: | |
6970 | type: | |
6971 | type: string | |
6972 | enum: | |
6973 | - account | |
6974 | - channel | |
6975 | - instance | |
6976 | name: | |
6977 | type: string | |
6978 | displayName: | |
6979 | type: string | |
6980 | host: | |
6981 | type: string | |
6982 | format: hostname | |
6983 | createdAt: | |
6984 | type: string | |
6985 | format: date-time | |
6986 | updatedAt: | |
6987 | type: string | |
6988 | format: date-time | |
6989 | NotificationListResponse: | |
6990 | properties: | |
6991 | total: | |
6992 | type: integer | |
6993 | example: 1 | |
6994 | data: | |
6995 | type: array | |
6996 | maxItems: 100 | |
6997 | items: | |
6998 | $ref: '#/components/schemas/Notification' | |
6999 | Plugin: | |
7000 | properties: | |
7001 | name: | |
7002 | type: string | |
7003 | example: peertube-plugin-auth-ldap | |
7004 | type: | |
7005 | type: integer | |
7006 | description: > | |
7007 | - `1`: PLUGIN | |
7008 | ||
7009 | - `2`: THEME | |
7010 | enum: | |
7011 | - 1 | |
7012 | - 2 | |
7013 | latestVersion: | |
7014 | type: string | |
7015 | example: 0.0.3 | |
7016 | version: | |
7017 | type: string | |
7018 | example: 0.0.1 | |
7019 | enabled: | |
7020 | type: boolean | |
7021 | uninstalled: | |
7022 | type: boolean | |
7023 | peertubeEngine: | |
7024 | type: string | |
7025 | example: 2.2.0 | |
7026 | description: | |
7027 | type: string | |
7028 | homepage: | |
7029 | type: string | |
7030 | format: url | |
7031 | example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap | |
7032 | settings: | |
7033 | type: object | |
7034 | additionalProperties: true | |
7035 | createdAt: | |
7036 | type: string | |
7037 | format: date-time | |
7038 | updatedAt: | |
7039 | type: string | |
7040 | format: date-time | |
7041 | PluginResponse: | |
7042 | properties: | |
7043 | total: | |
7044 | type: integer | |
7045 | example: 1 | |
7046 | data: | |
7047 | type: array | |
7048 | maxItems: 100 | |
7049 | items: | |
7050 | $ref: '#/components/schemas/Plugin' | |
7051 | ||
7052 | LiveVideoUpdate: | |
7053 | properties: | |
7054 | saveReplay: | |
7055 | type: boolean | |
7056 | permanentLive: | |
7057 | description: User can stream multiple times in a permanent live | |
7058 | type: boolean | |
7059 | ||
7060 | LiveVideoResponse: | |
7061 | properties: | |
7062 | rtmpUrl: | |
7063 | type: string | |
7064 | streamKey: | |
7065 | type: string | |
7066 | description: RTMP stream key to use to stream into this live video | |
7067 | saveReplay: | |
7068 | type: boolean | |
7069 | permanentLive: | |
7070 | description: User can stream multiple times in a permanent live | |
7071 | type: boolean | |
7072 | ||
7073 | ||
7074 | ||
7075 | callbacks: | |
7076 | searchIndex: | |
7077 | 'https://search.example.org/api/v1/search/videos': | |
7078 | post: | |
7079 | summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget` | |
7080 | responses: | |
7081 | '200': | |
7082 | description: successful operation | |
7083 | content: | |
7084 | application/json: | |
7085 | schema: | |
7086 | $ref: '#/components/schemas/VideoListResponse' |