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