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