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