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