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