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