aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc/api/openapi.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'support/doc/api/openapi.yaml')
-rw-r--r--support/doc/api/openapi.yaml2665
1 files changed, 1683 insertions, 982 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index 8ff81d317..f2bb945f9 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -1,1388 +1,2089 @@
1swagger: '2.0' 1openapi: 3.0.0
2info: 2info:
3 title: PeerTube 3 title: PeerTube
4 version: 1.0.0-beta 4 version: 1.2.0
5 description: Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular. 5 contact:
6host: peertube.example.com 6 name: PeerTube Community
7securityDefinitions: 7 url: 'https://joinpeertube.org'
8 OAuth2: 8 license:
9 description: 'In the header: *Authorization: Bearer mytoken*' 9 name: AGPLv3.0
10 type: oauth2 10 url: 'https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE'
11 flow: password 11 x-logo:
12 # Not implemented yet 12 url: 'https://joinpeertube.org/img/brand.png'
13 # authorizationUrl: https://example.com/oauth/authorize 13 altText: PeerTube Project Homepage
14 tokenUrl: https://peertube.example.com/api/v1/users/token 14 description: |
15basePath: '/api/v1' 15 # Introduction
16schemes: 16 The PeerTube API is built on HTTP(S). Our API is RESTful. It has predictable
17 - https 17 resource URLs. It returns HTTP response codes to indicate errors. It also
18 accepts and returns JSON in the HTTP body. You can use your favorite
19 HTTP/REST library for your programming language to use PeerTube. No official
20 SDK is currently provided, but the spec API is fully compatible with
21 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
22 which generates a client SDK in the language of your choice.
23
24 # Authentication
25 When you sign up for an account, you are given the possibility to generate
26 sessions, and authenticate using this session token. One session token can
27 currently be used at a time.
28
29 # Errors
30 The API uses standard HTTP status codes to indicate the success or failure
31 of the API call. The body of the response will be JSON in the following
32 format.
33
34 ```
35 {
36 "code": "unauthorized_request", // example inner error code
37 "error": "Token is invalid." // example exposed error message
38 }
39 ```
40externalDocs:
41 url: https://docs.joinpeertube.org/api.html
42tags:
43 - name: Accounts
44 description: >
45 Using some features of PeerTube require authentication, for which Accounts
46 provide different levels of permission as well as associated user
47 information. Accounts also encompass remote accounts discovered across the federation.
48 - name: Config
49 description: >
50 Each server exposes public information regarding supported videos and
51 options.
52 - name: Feeds
53 description: |
54 Feeds of videos and feeds of comments allow to see updates and get them in
55 an aggregator or script of your choice.
56 - name: Job
57 description: >
58 Jobs are long-running tasks enqueued and processed by the instance
59 itself. No additional worker registration is currently available.
60 - name: Server Following
61 description: >
62 Managing servers which the instance interacts with is crucial to the
63 concept of federation in PeerTube and external video indexation. The PeerTube
64 server then deals with inter-server ActivityPub operations and propagates
65 information across its social graph by posting activities to actors' inbox
66 endpoints.
67 - name: Video Abuse
68 description: |
69 Video abuses deal with reports of local or remote videos alike.
70 - name: Video
71 description: |
72 Operations dealing with listing, uploading, fetching or modifying videos.
73 - name: Search
74 description: |
75 The search helps to find _videos_ from within the instance and beyond.
76 Videos from other instances federated by the instance (that is, instances
77 followed by the instance) can be found via keywords and other criteria of
78 the advanced search.
79 - name: Video Comment
80 description: >
81 Operations dealing with comments to a video. Comments are organized in
82 threads.
83 - name: Video Channel
84 description: >
85 Operations dealing with creation, modification and video listing of a
86 user's channels.
87 - name: Video Blacklist
88 description: >
89 Operations dealing with blacklisting videos (removing them from view and
90 preventing interactions).
91 - name: Video Rate
92 description: >
93 Voting for a video.
94x-tagGroups:
95 - name: Accounts
96 tags:
97 - Accounts
98 - User
99 - name: Videos
100 tags:
101 - Video
102 - Video Channel
103 - Video Comment
104 - Video Following
105 - Video Rate
106 - name: Moderation
107 tags:
108 - Video Abuse
109 - Video Blacklist
110 - name: Instance Configuration
111 tags:
112 - Config
113 - Server Following
114 - name: Notifications
115 tags:
116 - Feeds
117 - name: Jobs
118 tags:
119 - Job
120 - name: Search
121 tags:
122 - Search
18paths: 123paths:
19 '/accounts/{name}': 124 '/accounts/{name}':
20 get: 125 get:
21 tags: 126 tags:
22 - Accounts 127 - Accounts
23 consumes: 128 summary: Get the account by name
24 - application/json
25 produces:
26 - application/json
27 parameters: 129 parameters:
28 - $ref: "accounts.yaml#/parameters/name" 130 - $ref: '#/components/parameters/name'
29 - $ref: "commons.yaml#/parameters/start" 131 - $ref: '#/components/parameters/start'
30 - $ref: "commons.yaml#/parameters/count" 132 - $ref: '#/components/parameters/count'
31 - $ref: "commons.yaml#/parameters/sort" 133 - $ref: '#/components/parameters/sort'
32 responses: 134 responses:
33 '200': 135 '200':
34 description: successful operation 136 description: successful operation
35 schema: 137 content:
36 $ref: '#/definitions/Account' 138 application/json:
139 schema:
140 $ref: '#/components/schemas/Account'
37 '/accounts/{name}/videos': 141 '/accounts/{name}/videos':
38 get: 142 get:
39 tags: 143 tags:
40 - Accounts 144 - Accounts
41 consumes: 145 - Video
42 - application/json 146 summary: 'Get videos for an account, provided the name of that account'
43 produces:
44 - application/json
45 parameters: 147 parameters:
46 - $ref: "accounts.yaml#/parameters/name" 148 - $ref: '#/components/parameters/name'
47 responses: 149 responses:
48 '200': 150 '200':
49 description: successful operation 151 description: successful operation
50 schema: 152 content:
51 $ref: '#/definitions/Video' 153 application/json:
154 schema:
155 $ref: '#/components/schemas/Video'
156 x-code-samples:
157 - lang: JavaScript
158 source: |
159 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
160 .then(function(response) {
161 return response.json()
162 }).then(function(data) {
163 console.log(data)
164 })
165 - lang: Shell
166 source: |
167 # pip install httpie
168 http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
169 - lang: Ruby
170 source: |
171 require 'uri'
172 require 'net/http'
173
174 url = URI("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
175
176 http = Net::HTTP.new(url.host, url.port)
177 http.use_ssl = true
178 http.verify_mode = OpenSSL::SSL::VERIFY_NONE
179
180 request = Net::HTTP::Post.new(url)
181 request["content-type"] = 'application/json'
182 response = http.request(request)
183 puts response.read_body
184 - lang: Python
185 source: |
186 import http.client
187
188 conn = http.client.HTTPSConnection("https://peertube2.cpy.re/api/v1")
189
190 headers = {
191 'content-type': "application/json"
192 }
193
194 conn.request("POST", "/accounts/{name}/videos", None, headers)
195
196 res = conn.getresponse()
197 data = res.read()
198
199 print(data.decode("utf-8"))
52 /accounts: 200 /accounts:
53 get: 201 get:
54 tags: 202 tags:
55 - Accounts 203 - Accounts
56 consumes: 204 summary: Get all accounts
57 - application/json
58 produces:
59 - application/json
60 responses: 205 responses:
61 '200': 206 '200':
62 description: successful operation 207 description: successful operation
63 schema: 208 content:
64 type: array 209 'application/json':
65 items: 210 schema:
66 $ref: '#/definitions/Account' 211 type: array
212 items:
213 $ref: '#/components/schemas/Account'
67 /config: 214 /config:
68 get: 215 get:
69 tags: 216 tags:
70 - Config 217 - Config
71 consumes: 218 summary: Get the public configuration of the server
72 - application/json
73 produces:
74 - application/json
75 responses: 219 responses:
76 '200': 220 '200':
77 description: successful operation 221 description: successful operation
78 schema: 222 content:
79 $ref: '#/definitions/ServerConfig' 223 application/json:
80 /feeds/videos.{format}: 224 schema:
225 $ref: '#/components/schemas/ServerConfig'
226 /config/about:
227 get:
228 summary: Get the instance about page content
229 tags:
230 - Config
231 responses:
232 '200':
233 description: successful operation
234 /config/custom:
81 get: 235 get:
236 summary: Get the runtime configuration of the server
237 tags:
238 - Config
239 security:
240 - OAuth2:
241 - admin
242 responses:
243 '200':
244 description: successful operation
245 put:
246 summary: Set the runtime configuration of the server
247 tags:
248 - Config
249 security:
250 - OAuth2:
251 - admin
252 responses:
253 '200':
254 description: successful operation
255 delete:
256 summary: Delete the runtime configuration of the server
257 tags:
258 - Config
259 security:
260 - OAuth2:
261 - admin
262 responses:
263 '200':
264 description: successful operation
265 '/feeds/videos.{format}':
266 get:
267 summary: >-
268 Get the feed of videos for the server, with optional filter by account
269 name or id
82 tags: 270 tags:
83 - Feeds 271 - Feeds
84 produces:
85 - application/atom+xml
86 - application/rss+xml
87 - application/json
88 parameters: 272 parameters:
89 - name: format 273 - name: format
90 in: path 274 in: path
91 required: true 275 required: true
92 type: string 276 description: >-
93 enum: [ 'xml', 'atom', 'json'] 277 The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and
94 default: 'xml' 278 json to JSON FEED 1.0
95 description: 'The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and json to JSON FEED 1.0' 279 schema:
280 type: string
281 enum:
282 - xml
283 - atom
284 - json
285 default: xml
96 - name: accountId 286 - name: accountId
97 in: query 287 in: query
98 required: false 288 required: false
99 type: number 289 description: >-
100 description: 'The id of the local account to filter to (beware, users IDs and not actors IDs which will return empty feeds' 290 The id of the local account to filter to (beware, users IDs and not
291 actors IDs which will return empty feeds
292 schema:
293 type: number
101 - name: accountName 294 - name: accountName
102 in: query 295 in: query
103 required: false 296 required: false
104 type: string 297 description: The name of the local account to filter to
105 description: 'The name of the local account to filter to' 298 schema:
299 type: string
106 responses: 300 responses:
107 '200': 301 '200':
108 description: successful operation 302 description: successful operation
109 /jobs: 303 /jobs/{state}:
110 get: 304 get:
305 summary: Get list of jobs
111 security: 306 security:
112 - OAuth2: [ ] 307 - OAuth2:
308 - admin
113 tags: 309 tags:
114 - Job 310 - Job
115 consumes:
116 - application/json
117 produces:
118 - application/json
119 parameters: 311 parameters:
120 - name: state 312 - name: state
121 in: path 313 in: path
122 required: true 314 required: true
123 type: string 315 description: The state of the job
124 description: 'The state of the job' 316 schema:
125 - $ref: "commons.yaml#/parameters/start" 317 type: string
126 - $ref: "commons.yaml#/parameters/count" 318 enum:
127 - $ref: "commons.yaml#/parameters/sort" 319 - active
320 - completed
321 - failed
322 - waiting
323 - delayed
324 - $ref: '#/components/parameters/start'
325 - $ref: '#/components/parameters/count'
326 - $ref: '#/components/parameters/sort'
128 responses: 327 responses:
129 '200': 328 '200':
130 description: successful operation 329 description: successful operation
131 schema: 330 content:
132 type: array 331 application/json:
133 items: 332 schema:
134 $ref: '#/definitions/Job' 333 type: array
334 items:
335 $ref: '#/components/schemas/Job'
135 '/server/following/{host}': 336 '/server/following/{host}':
136 delete: 337 delete:
137 security: 338 security:
138 - OAuth2: [ ] 339 - OAuth2:
340 - admin
139 tags: 341 tags:
140 - ServerFollowing 342 - Server Following
141 consumes: 343 summary: Unfollow a server by hostname
142 - application/json
143 produces:
144 - application/json
145 parameters: 344 parameters:
146 - name: host 345 - name: host
147 in: path 346 in: path
148 required: true 347 required: true
149 type: string
150 description: 'The host to unfollow ' 348 description: 'The host to unfollow '
349 schema:
350 type: string
151 responses: 351 responses:
152 '201': 352 '201':
153 description: successful operation 353 description: successful operation
154 /server/followers: 354 /server/followers:
155 get: 355 get:
156 tags: 356 tags:
157 - ServerFollowing 357 - Server Following
158 consumes: 358 summary: Get followers of the server
159 - application/json
160 produces:
161 - application/json
162 parameters: 359 parameters:
163 - $ref: "commons.yaml#/parameters/start" 360 - $ref: '#/components/parameters/start'
164 - $ref: "commons.yaml#/parameters/count" 361 - $ref: '#/components/parameters/count'
165 - $ref: "commons.yaml#/parameters/sort" 362 - $ref: '#/components/parameters/sort'
166 responses: 363 responses:
167 '200': 364 '200':
168 description: successful operation 365 description: successful operation
169 schema: 366 content:
170 type: array 367 application/json:
171 items: 368 schema:
172 $ref: '#/definitions/Follow' 369 type: array
370 items:
371 $ref: '#/components/schemas/Follow'
173 /server/following: 372 /server/following:
174 get: 373 get:
175 tags: 374 tags:
176 - ServerFollowing 375 - Server Following
177 consumes: 376 summary: Get servers followed by the server
178 - application/json
179 produces:
180 - application/json
181 parameters: 377 parameters:
182 - $ref: "commons.yaml#/parameters/start" 378 - $ref: '#/components/parameters/start'
183 - $ref: "commons.yaml#/parameters/count" 379 - $ref: '#/components/parameters/count'
184 - $ref: "commons.yaml#/parameters/sort" 380 - $ref: '#/components/parameters/sort'
185 responses: 381 responses:
186 '200': 382 '200':
187 description: successful operation 383 description: successful operation
188 schema: 384 content:
189 type: array 385 application/json:
190 items: 386 schema:
191 $ref: '#/definitions/Follow' 387 type: array
388 items:
389 $ref: '#/components/schemas/Follow'
192 post: 390 post:
193 security: 391 security:
194 - OAuth2: [ ] 392 - OAuth2:
393 - admin
195 tags: 394 tags:
196 - ServerFollowing 395 - Server Following
197 consumes: 396 summary: Follow a server
198 - application/json
199 produces:
200 - application/json
201 parameters:
202 - in: body
203 name: body
204 schema:
205 $ref: '#/definitions/Follow'
206 responses: 397 responses:
207 '204': 398 '204':
208 $ref: "commons.yaml#/responses/emptySuccess" 399 $ref: '#/paths/~1users~1me/put/responses/204'
400 requestBody:
401 content:
402 application/json:
403 schema:
404 $ref: '#/components/schemas/Follow'
209 /users: 405 /users:
210 post: 406 post:
407 summary: Creates user
211 security: 408 security:
212 - OAuth2: [ ] 409 - OAuth2:
410 - admin
213 tags: 411 tags:
214 - User 412 - User
215 consumes:
216 - application/json
217 produces:
218 - application/json
219 parameters:
220 - in: body
221 name: body
222 required: true
223 description: 'User to create'
224 schema:
225 $ref: '#/definitions/AddUser'
226 responses: 413 responses:
227 '200': 414 '200':
228 description: successful operation 415 description: successful operation
229 schema: 416 content:
230 $ref: '#/definitions/AddUserResponse' 417 application/json:
418 schema:
419 $ref: '#/components/schemas/AddUserResponse'
420 requestBody:
421 content:
422 application/json:
423 schema:
424 $ref: '#/components/schemas/AddUser'
425 description: User to create
426 required: true
231 get: 427 get:
428 summary: Get a list of users
232 security: 429 security:
233 - OAuth2: [ ] 430 - OAuth2: []
234 tags: 431 tags:
235 - User 432 - User
236 consumes:
237 - application/json
238 produces:
239 - application/json
240 parameters: 433 parameters:
241 - $ref: "commons.yaml#/parameters/start" 434 - $ref: '#/components/parameters/start'
242 - $ref: "commons.yaml#/parameters/count" 435 - $ref: '#/components/parameters/count'
243 - $ref: "commons.yaml#/parameters/sort" 436 - $ref: '#/components/parameters/usersSort'
244 responses: 437 responses:
245 '200': 438 '200':
246 description: successful operation 439 description: successful operation
247 schema: 440 content:
248 type: array 441 application/json:
249 items: 442 schema:
250 $ref: '#/definitions/User' 443 type: array
444 items:
445 $ref: '#/components/schemas/User'
251 '/users/{id}': 446 '/users/{id}':
252 delete: 447 delete:
448 summary: Delete a user by its id
253 security: 449 security:
254 - OAuth2: [ ] 450 - OAuth2:
451 - admin
255 tags: 452 tags:
256 - User 453 - User
257 consumes:
258 - application/json
259 produces:
260 - application/json
261 parameters: 454 parameters:
262 - $ref: "users.yaml#/parameters/id" 455 - $ref: '#/components/parameters/id'
263 responses: 456 responses:
264 '204': 457 '204':
265 $ref: "commons.yaml#/responses/emptySuccess" 458 $ref: '#/paths/~1users~1me/put/responses/204'
266 get: 459 get:
460 summary: Get user by its id
267 security: 461 security:
268 - OAuth2: [ ] 462 - OAuth2: []
269 tags: 463 tags:
270 - User 464 - User
271 consumes:
272 - application/json
273 produces:
274 - application/json
275 parameters: 465 parameters:
276 - $ref: "users.yaml#/parameters/id" 466 - $ref: '#/components/parameters/id'
277 responses: 467 responses:
278 '200': 468 '200':
279 description: successful operation 469 description: successful operation
280 schema: 470 content:
281 $ref: '#/definitions/User' 471 application/json:
472 schema:
473 $ref: '#/components/schemas/User'
282 put: 474 put:
475 summary: Update user profile by its id
283 security: 476 security:
284 - OAuth2: [ ] 477 - OAuth2: []
285 tags: 478 tags:
286 - User 479 - User
287 consumes:
288 - application/json
289 produces:
290 - application/json
291 parameters: 480 parameters:
292 - $ref: "users.yaml#/parameters/id" 481 - $ref: '#/components/parameters/id'
293 - in: body
294 name: body
295 required: true
296 schema:
297 $ref: '#/definitions/UpdateUser'
298 responses: 482 responses:
299 '204': 483 '204':
300 $ref: "commons.yaml#/responses/emptySuccess" 484 $ref: '#/paths/~1users~1me/put/responses/204'
485 requestBody:
486 content:
487 application/json:
488 schema:
489 $ref: '#/components/schemas/UpdateUser'
490 required: true
301 /users/me: 491 /users/me:
302 get: 492 get:
493 summary: Get current user information
303 security: 494 security:
304 - OAuth2: [ ] 495 - OAuth2:
496 - user
305 tags: 497 tags:
306 - User 498 - User
307 consumes:
308 - application/json
309 produces:
310 - application/json
311 responses: 499 responses:
312 '200': 500 '200':
313 description: successful operation 501 description: successful operation
314 schema: 502 content:
315 type: array 503 application/json:
316 items: 504 schema:
317 $ref: '#/definitions/User' 505 type: array
506 items:
507 $ref: '#/components/schemas/User'
318 put: 508 put:
509 summary: Update current user information
319 security: 510 security:
320 - OAuth2: [ ] 511 - OAuth2:
512 - user
321 tags: 513 tags:
322 - User 514 - User
323 consumes:
324 - application/json
325 produces:
326 - application/json
327 parameters:
328 - in: body
329 name: body
330 required: true
331 schema:
332 $ref: '#/definitions/UpdateMe'
333 responses: 515 responses:
334 '204': 516 '204':
335 $ref: "commons.yaml#/responses/emptySuccess" 517 description: Successful operation
518 requestBody:
519 content:
520 application/json:
521 schema:
522 $ref: '#/components/schemas/UpdateMe'
523 required: true
336 /users/me/video-quota-used: 524 /users/me/video-quota-used:
337 get: 525 get:
526 summary: Get current user used quota
338 security: 527 security:
339 - OAuth2: [ ] 528 - OAuth2:
529 - user
340 tags: 530 tags:
341 - User 531 - User
342 consumes:
343 - application/json
344 produces:
345 - application/json
346 parameters: []
347 responses: 532 responses:
348 '200': 533 '200':
349 description: successful operation 534 description: successful operation
350 schema: 535 content:
351 type: number 536 application/json:
537 schema:
538 type: number
352 '/users/me/videos/{videoId}/rating': 539 '/users/me/videos/{videoId}/rating':
353 get: 540 get:
541 summary: 'Get rating of video by its id, among those of the current user'
354 security: 542 security:
355 - OAuth2: [ ] 543 - OAuth2: []
356 tags: 544 tags:
357 - User 545 - User
358 consumes:
359 - application/json
360 produces:
361 - application/json
362 parameters: 546 parameters:
363 - name: videoId 547 - name: videoId
364 in: path 548 in: path
365 required: true 549 required: true
366 type: string
367 description: 'The video id ' 550 description: 'The video id '
551 schema:
552 type: string
368 responses: 553 responses:
369 '200': 554 '200':
370 description: successful operation 555 description: successful operation
371 schema: 556 content:
372 $ref: '#/definitions/GetMeVideoRating' 557 application/json:
558 schema:
559 $ref: '#/components/schemas/GetMeVideoRating'
373 /users/me/videos: 560 /users/me/videos:
374 get: 561 get:
562 summary: Get videos of the current user
375 security: 563 security:
376 - OAuth2: [ ] 564 - OAuth2:
565 - user
377 tags: 566 tags:
378 - User 567 - User
379 consumes:
380 - application/json
381 produces:
382 - application/json
383 parameters: 568 parameters:
384 - $ref: "commons.yaml#/parameters/start" 569 - $ref: '#/components/parameters/start'
385 - $ref: "commons.yaml#/parameters/count" 570 - $ref: '#/components/parameters/count'
386 - $ref: "commons.yaml#/parameters/sort" 571 - $ref: '#/components/parameters/sort'
572 responses:
573 '200':
574 description: successful operation
575 content:
576 application/json:
577 schema:
578 type: array
579 items:
580 $ref: '#/components/schemas/Video'
581 /users/me/subscriptions:
582 get:
583 summary: Get subscriptions of the current user
584 security:
585 - OAuth2:
586 - user
587 tags:
588 - User
589 parameters:
590 - $ref: '#/components/parameters/start'
591 - $ref: '#/components/parameters/count'
592 - $ref: '#/components/parameters/sort'
387 responses: 593 responses:
388 '200': 594 '200':
389 description: successful operation 595 description: successful operation
390 schema:
391 type: array
392 items:
393 $ref: '#/definitions/Video'
394 /users/register:
395 post: 596 post:
597 summary: Add subscription to the current user
598 security:
599 - OAuth2:
600 - user
601 tags:
602 - User
603 responses:
604 '200':
605 description: successful operation
606 /users/me/subscriptions/exist:
607 get:
608 summary: Get if subscriptions exist for the current user
609 security:
610 - OAuth2:
611 - user
396 tags: 612 tags:
397 - User 613 - User
398 consumes:
399 - application/json
400 produces:
401 - application/json
402 parameters: 614 parameters:
403 - in: body 615 - $ref: '#/components/parameters/subscriptionsUris'
404 name: body 616 responses:
405 required: true 617 '200':
406 schema: 618 description: successful operation
407 $ref: '#/definitions/RegisterUser' 619 content:
620 application/json:
621 schema:
622 type: object
623 /users/me/subscriptions/videos:
624 get:
625 summary: Get videos of subscriptions of the current user
626 security:
627 - OAuth2:
628 - user
629 tags:
630 - User
631 parameters:
632 - $ref: '#/components/parameters/start'
633 - $ref: '#/components/parameters/count'
634 - $ref: '#/components/parameters/sort'
635 responses:
636 '200':
637 description: successful operation
638 content:
639 application/json:
640 schema:
641 type: array
642 items:
643 $ref: '#/components/schemas/Video'
644 '/users/me/subscriptions/{uri}':
645 get:
646 summary: Get subscription of the current user for a given uri
647 security:
648 - OAuth2:
649 - user
650 tags:
651 - User
652 responses:
653 '200':
654 description: successful operation
655 content:
656 application/json:
657 schema:
658 $ref: '#/components/schemas/VideoChannel'
659 delete:
660 summary: Delete subscription of the current user for a given uri
661 security:
662 - OAuth2:
663 - user
664 tags:
665 - User
666 responses:
667 '200':
668 description: successful operation
669 /users/register:
670 post:
671 summary: Register a user
672 tags:
673 - User
408 responses: 674 responses:
409 '204': 675 '204':
410 $ref: "commons.yaml#/responses/emptySuccess" 676 $ref: '#/paths/~1users~1me/put/responses/204'
677 requestBody:
678 content:
679 application/json:
680 schema:
681 $ref: '#/components/schemas/RegisterUser'
682 required: true
411 /users/me/avatar/pick: 683 /users/me/avatar/pick:
412 post: 684 post:
685 summary: Update current user avatar
413 security: 686 security:
414 - OAuth2: [ ] 687 - OAuth2: []
415 tags: 688 tags:
416 - User 689 - User
417 consumes:
418 - multipart/form-data
419 produces:
420 - application/json
421 parameters:
422 - in: formData
423 name: avatarfile
424 type: file
425 description: The file to upload.
426 responses: 690 responses:
427 '200': 691 '200':
428 description: successful operation 692 description: successful operation
429 schema: 693 content:
430 $ref: '#/definitions/Avatar' 694 application/json:
695 schema:
696 $ref: '#/components/schemas/Avatar'
697 requestBody:
698 content:
699 multipart/form-data:
700 schema:
701 type: object
702 properties:
703 avatarfile:
704 description: The file to upload.
705 type: string
706 format: binary
707 encoding:
708 profileImage:
709 # only accept png/jpeg
710 contentType: image/png, image/jpeg
431 /videos: 711 /videos:
432 get: 712 get:
713 summary: Get list of videos
433 tags: 714 tags:
434 - Video 715 - Video
435 consumes:
436 - application/json
437 produces:
438 - application/json
439 parameters: 716 parameters:
440 - name: category 717 - $ref: '#/components/parameters/categoryOneOf'
441 in: query 718 - $ref: '#/components/parameters/tagsOneOf'
442 required: false 719 - $ref: '#/components/parameters/tagsAllOf'
443 type: number 720 - $ref: '#/components/parameters/licenceOneOf'
444 description: category id of the video 721 - $ref: '#/components/parameters/languageOneOf'
445 - $ref: "commons.yaml#/parameters/start" 722 - $ref: '#/components/parameters/nsfw'
446 - $ref: "commons.yaml#/parameters/count" 723 - $ref: '#/components/parameters/filter'
447 - $ref: "commons.yaml#/parameters/sort" 724 - $ref: '#/components/parameters/start'
725 - $ref: '#/components/parameters/count'
726 - $ref: '#/components/parameters/videosSort'
448 responses: 727 responses:
449 '200': 728 '200':
450 description: successful operation 729 description: successful operation
451 schema: 730 content:
452 type: array 731 application/json:
453 items: 732 schema:
454 $ref: '#/definitions/Video' 733 type: array
734 items:
735 $ref: '#/components/schemas/Video'
455 /videos/categories: 736 /videos/categories:
456 get: 737 get:
738 summary: Get list of video licences known by the server
457 tags: 739 tags:
458 - Video 740 - Video
459 consumes:
460 - application/json
461 produces:
462 - application/json
463 responses: 741 responses:
464 '200': 742 '200':
465 description: successful operation 743 description: successful operation
466 schema: 744 content:
467 type: array 745 application/json:
468 items: 746 schema:
469 type: string 747 type: array
748 items:
749 type: string
470 /videos/licences: 750 /videos/licences:
471 get: 751 get:
752 summary: Get list of video licences known by the server
472 tags: 753 tags:
473 - Video 754 - Video
474 consumes:
475 - application/json
476 produces:
477 - application/json
478 responses: 755 responses:
479 '200': 756 '200':
480 description: successful operation 757 description: successful operation
481 schema: 758 content:
482 type: array 759 application/json:
483 items: 760 schema:
484 type: string 761 type: array
762 items:
763 type: string
485 /videos/languages: 764 /videos/languages:
486 get: 765 get:
766 summary: Get list of languages known by the server
487 tags: 767 tags:
488 - Video 768 - Video
489 consumes:
490 - application/json
491 produces:
492 - application/json
493 responses: 769 responses:
494 '200': 770 '200':
495 description: successful operation 771 description: successful operation
496 schema: 772 content:
497 type: array 773 application/json:
498 items: 774 schema:
499 type: string 775 type: array
776 items:
777 type: string
500 /videos/privacies: 778 /videos/privacies:
501 get: 779 get:
780 summary: Get list of privacy policies supported by the server
502 tags: 781 tags:
503 - Video 782 - Video
504 consumes:
505 - application/json
506 produces:
507 - application/json
508 responses: 783 responses:
509 '200': 784 '200':
510 description: successful operation 785 description: successful operation
511 schema: 786 content:
512 type: array 787 application/json:
513 items: 788 schema:
514 type: string 789 type: array
515 "/videos/{id}": 790 items:
791 type: string
792 '/videos/{id}':
516 put: 793 put:
794 summary: Update metadata for a video by its id
517 security: 795 security:
518 - OAuth2: [ ] 796 - OAuth2: []
519 tags: 797 tags:
520 - Video 798 - Video
521 consumes:
522 - multipart/form-data
523 produces:
524 - application/json
525 parameters: 799 parameters:
526 - $ref: "videos.yaml#/parameters/id" 800 - $ref: '#/components/parameters/id2'
527 - $ref: "videos.yaml#/parameters/thumbnailfile"
528 - $ref: "videos.yaml#/parameters/previewfile"
529 - $ref: "videos.yaml#/parameters/category"
530 - $ref: "videos.yaml#/parameters/licence"
531 - $ref: "videos.yaml#/parameters/language"
532 - $ref: "videos.yaml#/parameters/description"
533 - $ref: "videos.yaml#/parameters/waitTranscoding"
534 - $ref: "videos.yaml#/parameters/support"
535 - $ref: "videos.yaml#/parameters/nsfw"
536 - $ref: "videos.yaml#/parameters/name"
537 - $ref: "videos.yaml#/parameters/tags"
538 - $ref: "videos.yaml#/parameters/commentsEnabled"
539 - $ref: "videos.yaml#/parameters/downloadEnabled"
540 - $ref: "videos.yaml#/parameters/privacy"
541 - $ref: "videos.yaml#/parameters/scheduleUpdate"
542 responses: 801 responses:
543 '200': 802 '200':
544 description: successful operation 803 description: successful operation
545 schema: 804 content:
546 $ref: '#/definitions/Video' 805 application/json:
806 schema:
807 $ref: '#/components/schemas/Video'
808 requestBody:
809 content:
810 multipart/form-data:
811 schema:
812 type: object
813 properties:
814 thumbnailfile:
815 description: Video thumbnail file
816 type: string
817 previewfile:
818 description: Video preview file
819 type: string
820 category:
821 description: Video category
822 type: string
823 licence:
824 description: Video licence
825 type: string
826 language:
827 description: Video language
828 type: string
829 description:
830 description: Video description
831 type: string
832 waitTranscoding:
833 description: Whether or not we wait transcoding before publish the video
834 type: string
835 support:
836 description: Text describing how to support the video uploader
837 type: string
838 nsfw:
839 description: Whether or not this video contains sensitive content
840 type: string
841 name:
842 description: Video name
843 type: string
844 tags:
845 description: Video tags
846 type: array
847 items:
848 type: string
849 commentsEnabled:
850 description: Enable or disable comments for this video
851 type: string
852 scheduleUpdate: &ref_0
853 type: object
854 properties:
855 privacy:
856 type: string
857 enum:
858 - Public
859 - Unlisted
860 description: Video privacy target
861 updateAt:
862 type: string
863 format: date
864 description: When to update the video
865 required:
866 - updateAt
547 get: 867 get:
868 summary: Get a video by its id
548 tags: 869 tags:
549 - Video 870 - Video
550 consumes:
551 - application/json
552 produces:
553 - application/json
554 parameters: 871 parameters:
555 - $ref: "videos.yaml#/parameters/id" 872 - $ref: '#/components/parameters/id2'
556 responses: 873 responses:
557 '200': 874 '200':
558 description: successful operation 875 description: successful operation
559 schema: 876 content:
560 $ref: '#/definitions/Video' 877 application/json:
878 schema:
879 $ref: '#/components/schemas/Video'
561 delete: 880 delete:
881 summary: Delete a video by its id
562 security: 882 security:
563 - OAuth2: [ ] 883 - OAuth2: []
564 tags: 884 tags:
565 - Video 885 - Video
566 consumes:
567 - application/json
568 produces:
569 - application/json
570 parameters: 886 parameters:
571 - $ref: "videos.yaml#/parameters/id" 887 - $ref: '#/components/parameters/id2'
572 responses: 888 responses:
573 '204': 889 '204':
574 $ref: "commons.yaml#/responses/emptySuccess" 890 $ref: '#/paths/~1users~1me/put/responses/204'
575 "/videos/{id}/description": 891 '/videos/{id}/description':
576 get: 892 get:
893 summary: Get a video description by its id
577 tags: 894 tags:
578 - Video 895 - Video
579 consumes:
580 - application/json
581 produces:
582 - application/json
583 parameters: 896 parameters:
584 - $ref: "videos.yaml#/parameters/id" 897 - $ref: '#/components/parameters/id2'
585 responses: 898 responses:
586 '200': 899 '200':
587 description: successful operation 900 description: successful operation
588 schema: 901 content:
589 type: string 902 application/json:
590 "/videos/{id}/views": 903 schema:
904 type: string
905 '/videos/{id}/views':
591 post: 906 post:
907 summary: Add a view to the video by its id
592 tags: 908 tags:
593 - Video 909 - Video
594 consumes:
595 - application/json
596 produces:
597 - application/json
598 parameters: 910 parameters:
599 - $ref: "videos.yaml#/parameters/id" 911 - $ref: '#/components/parameters/id2'
600 responses: 912 responses:
601 '204': 913 '204':
602 $ref: "commons.yaml#/responses/emptySuccess" 914 $ref: '#/paths/~1users~1me/put/responses/204'
603 /videos/upload: 915 '/videos/{id}/watching':
916 put:
917 summary: Set watching progress of a video by its id for a user
918 tags:
919 - Video
920 security:
921 - OAuth2: []
922 parameters:
923 - $ref: '#/components/parameters/id2'
924 requestBody:
925 content:
926 application/json:
927 schema:
928 $ref: '#/components/schemas/UserWatchingVideo'
929 required: true
930 responses:
931 '204':
932 $ref: '#/paths/~1users~1me/put/responses/204'
933 /videos/ownership:
934 get:
935 summary: Get list of video ownership changes requests
936 tags:
937 - Video
938 security:
939 - OAuth2: []
940 parameters:
941 - $ref: '#/components/parameters/id2'
942 responses:
943 '200':
944 description: successful operation
945 '/videos/ownership/{id}/accept':
604 post: 946 post:
947 summary: Refuse ownership change request for video by its id
948 tags:
949 - Video
605 security: 950 security:
606 - OAuth2: [ ] 951 - OAuth2: []
952 parameters:
953 - $ref: '#/components/parameters/id2'
954 responses:
955 '204':
956 $ref: '#/paths/~1users~1me/put/responses/204'
957 '/videos/ownership/{id}/refuse':
958 post:
959 summary: Accept ownership change request for video by its id
607 tags: 960 tags:
608 - Video 961 - Video
609 consumes: 962 security:
610 - multipart/form-data 963 - OAuth2: []
611 produces:
612 - application/json
613 parameters: 964 parameters:
614 - name: videofile 965 - $ref: '#/components/parameters/id2'
615 in: formData 966 responses:
616 type: file 967 '204':
617 required: true 968 $ref: '#/paths/~1users~1me/put/responses/204'
618 description: 'Video file' 969 '/videos/{id}/give-ownership':
619 - name: channelId 970 post:
620 in: formData 971 summary: Request change of ownership for a video you own, by its id
621 required: true 972 tags:
622 type: number 973 - Video
623 description: 'Channel id that will contain this video' 974 security:
624 - $ref: "videos.yaml#/parameters/thumbnailfile" 975 - OAuth2: []
625 - $ref: "videos.yaml#/parameters/previewfile" 976 parameters:
626 - $ref: "videos.yaml#/parameters/category" 977 - $ref: '#/components/parameters/id2'
627 - $ref: "videos.yaml#/parameters/licence" 978 requestBody:
628 - $ref: "videos.yaml#/parameters/language" 979 required: true
629 - $ref: "videos.yaml#/parameters/description" 980 content:
630 - $ref: "videos.yaml#/parameters/waitTranscoding" 981 application/x-www-form-urlencoded:
631 - $ref: "videos.yaml#/parameters/support" 982 schema:
632 - $ref: "videos.yaml#/parameters/nsfw" 983 type: object
633 - $ref: "videos.yaml#/parameters/name" 984 properties:
634 - $ref: "videos.yaml#/parameters/tags" 985 username:
635 - $ref: "videos.yaml#/parameters/commentsEnabled" 986 type: string
636 - $ref: "videos.yaml#/parameters/downloadEnabled" 987 required:
637 - $ref: "videos.yaml#/parameters/privacy" 988 - username
638 - $ref: "videos.yaml#/parameters/scheduleUpdate" 989 responses:
990 '204':
991 $ref: '#/paths/~1users~1me/put/responses/204'
992 '400':
993 description: 'Changing video ownership to a remote account is not supported yet'
994 /videos/upload:
995 post:
996 summary: Upload a video file with its metadata
997 security:
998 - OAuth2: []
999 tags:
1000 - Video
639 responses: 1001 responses:
640 '200': 1002 '200':
641 description: successful operation 1003 description: successful operation
642 schema: 1004 content:
643 $ref: '#/definitions/VideoUploadResponse' 1005 application/json:
1006 schema:
1007 $ref: '#/components/schemas/VideoUploadResponse'
1008 requestBody:
1009 content:
1010 multipart/form-data:
1011 schema:
1012 type: object
1013 properties:
1014 videofile:
1015 description: Video file
1016 type: string
1017 format: binary
1018 channelId:
1019 description: Channel id that will contain this video
1020 type: number
1021 thumbnailfile:
1022 description: Video thumbnail file
1023 type: string
1024 previewfile:
1025 description: Video preview file
1026 type: string
1027 privacy:
1028 $ref: '#/components/schemas/VideoPrivacy'
1029 category:
1030 description: Video category
1031 type: string
1032 licence:
1033 description: Video licence
1034 type: string
1035 language:
1036 description: Video language
1037 type: string
1038 description:
1039 description: Video description
1040 type: string
1041 waitTranscoding:
1042 description: Whether or not we wait transcoding before publish the video
1043 type: string
1044 support:
1045 description: Text describing how to support the video uploader
1046 type: string
1047 nsfw:
1048 description: Whether or not this video contains sensitive content
1049 type: string
1050 name:
1051 description: Video name
1052 type: string
1053 tags:
1054 description: Video tags
1055 type: array
1056 items:
1057 type: string
1058 commentsEnabled:
1059 description: Enable or disable comments for this video
1060 type: string
1061 scheduleUpdate: *ref_0
1062 required:
1063 - videofile
1064 - channelId
1065 - name
1066 x-code-samples:
1067 - lang: Shell
1068 source: |
1069 ## DEPENDENCIES: httpie, jq
1070 # pip install httpie
1071 USERNAME="<your_username>"
1072 PASSWORD="<your_password>"
1073 FILE_PATH="<your_file_path>"
1074 CHANNEL_ID="<your_channel_id>"
1075 NAME="<video_name>"
1076
1077 API_PATH="https://peertube2.cpy.re/api/v1"
1078 ## AUTH
1079 client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1080 client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1081 token=$(http -b --form POST "$API_PATH/users/token" \
1082 client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
1083 username=$USERNAME \
1084 password=$PASSWORD \
1085 | jq -r ".access_token")
1086 ## VIDEO UPLOAD
1087 http -b --form POST "$API_PATH/videos/upload" \
1088 videofile@$FILE_PATH \
1089 channelId=$CHANNEL_ID \
1090 name=$NAME \
1091 "Authorization:Bearer $token"
644 /videos/abuse: 1092 /videos/abuse:
645 get: 1093 get:
1094 summary: Get list of reported video abuses
646 security: 1095 security:
647 - OAuth2: [ ] 1096 - OAuth2: []
648 tags: 1097 tags:
649 - VideoAbuse 1098 - Video Abuse
650 consumes:
651 - application/json
652 produces:
653 - application/json
654 parameters: 1099 parameters:
655 - $ref: "commons.yaml#/parameters/start" 1100 - $ref: '#/components/parameters/start'
656 - $ref: "commons.yaml#/parameters/count" 1101 - $ref: '#/components/parameters/count'
657 - $ref: "commons.yaml#/parameters/sort" 1102 - $ref: '#/components/parameters/abusesSort'
658 responses: 1103 responses:
659 '200': 1104 '200':
660 description: successful operation 1105 description: successful operation
661 schema: 1106 content:
662 type: array 1107 application/json:
663 items: 1108 schema:
664 $ref: '#/definitions/VideoAbuse' 1109 type: array
665 "/videos/{id}/abuse": 1110 items:
1111 $ref: '#/components/schemas/VideoAbuse'
1112 '/videos/{id}/abuse':
666 post: 1113 post:
1114 summary: 'Report an abuse, on a video by its id'
667 security: 1115 security:
668 - OAuth2: [ ] 1116 - OAuth2: []
669 tags: 1117 tags:
670 - VideoAbuse 1118 - Video Abuse
671 consumes:
672 - application/json
673 produces:
674 - application/json
675 parameters: 1119 parameters:
676 - $ref: "videos.yaml#/parameters/id" 1120 - $ref: '#/components/parameters/id2'
677 responses: 1121 responses:
678 '204': 1122 '204':
679 $ref: "commons.yaml#/responses/emptySuccess" 1123 $ref: '#/paths/~1users~1me/put/responses/204'
680 "/videos/{id}/blacklist": 1124 '/videos/{id}/blacklist':
681 post: 1125 post:
1126 summary: Put on blacklist a video by its id
682 security: 1127 security:
683 - OAuth2: [ ] 1128 - OAuth2:
1129 - admin
1130 - moderator
684 tags: 1131 tags:
685 - VideoBlacklist 1132 - Video Blacklist
686 consumes:
687 - application/json
688 produces:
689 - application/json
690 parameters: 1133 parameters:
691 - $ref: "videos.yaml#/parameters/id" 1134 - $ref: '#/components/parameters/id2'
692 responses: 1135 responses:
693 '204': 1136 '204':
694 $ref: "commons.yaml#/responses/emptySuccess" 1137 $ref: '#/paths/~1users~1me/put/responses/204'
695 delete: 1138 delete:
1139 summary: Delete an entry of the blacklist of a video by its id
696 security: 1140 security:
697 - OAuth2: [ ] 1141 - OAuth2:
1142 - admin
1143 - moderator
698 tags: 1144 tags:
699 - VideoBlacklist 1145 - Video Blacklist
700 consumes:
701 - application/json
702 produces:
703 - application/json
704 parameters: 1146 parameters:
705 - $ref: "videos.yaml#/parameters/id" 1147 - $ref: '#/components/parameters/id2'
706 responses: 1148 responses:
707 '204': 1149 '204':
708 $ref: "commons.yaml#/responses/emptySuccess" 1150 $ref: '#/paths/~1users~1me/put/responses/204'
709 /videos/blacklist: 1151 /videos/blacklist:
710 get: 1152 get:
1153 summary: Get list of videos on blacklist
711 security: 1154 security:
712 - OAuth2: [ ] 1155 - OAuth2:
1156 - admin
1157 - moderator
713 tags: 1158 tags:
714 - VideoBlacklist 1159 - Video Blacklist
715 consumes:
716 - application/json
717 produces:
718 - application/json
719 parameters: 1160 parameters:
720 - $ref: "commons.yaml#/parameters/start" 1161 - $ref: '#/components/parameters/start'
721 - $ref: "commons.yaml#/parameters/count" 1162 - $ref: '#/components/parameters/count'
722 - $ref: "commons.yaml#/parameters/sort" 1163 - $ref: '#/components/parameters/blacklistsSort'
723 responses: 1164 responses:
724 '200': 1165 '200':
725 description: successful operation 1166 description: successful operation
726 schema: 1167 content:
727 type: array 1168 application/json:
728 items: 1169 schema:
729 $ref: '#/definitions/VideoBlacklist' 1170 type: array
1171 items:
1172 $ref: '#/components/schemas/VideoBlacklist'
730 /video-channels: 1173 /video-channels:
731 get: 1174 get:
1175 summary: Get list of video channels
732 tags: 1176 tags:
733 - VideoChannel 1177 - Video Channel
734 consumes:
735 - application/json
736 produces:
737 - application/json
738 parameters: 1178 parameters:
739 - $ref: "commons.yaml#/parameters/start" 1179 - $ref: '#/components/parameters/start'
740 - $ref: "commons.yaml#/parameters/count" 1180 - $ref: '#/components/parameters/count'
741 - $ref: "commons.yaml#/parameters/sort" 1181 - $ref: '#/components/parameters/sort'
742 responses: 1182 responses:
743 '200': 1183 '200':
744 description: successful operation 1184 description: successful operation
745 schema: 1185 content:
746 type: array 1186 application/json:
747 items: 1187 schema:
748 $ref: '#/definitions/VideoChannel' 1188 type: array
1189 items:
1190 $ref: '#/components/schemas/VideoChannel'
749 post: 1191 post:
1192 summary: Creates a video channel for the current user
750 security: 1193 security:
751 - OAuth2: [ ] 1194 - OAuth2: []
752 tags: 1195 tags:
753 - VideoChannel 1196 - Video Channel
754 consumes:
755 - application/json
756 produces:
757 - application/json
758 parameters:
759 - in: body
760 name: body
761 schema:
762 $ref: '#/definitions/VideoChannelInput'
763 responses: 1197 responses:
764 '204': 1198 '204':
765 $ref: "commons.yaml#/responses/emptySuccess" 1199 $ref: '#/paths/~1users~1me/put/responses/204'
766 "/video-channels/{id}": 1200 requestBody:
1201 $ref: '#/components/requestBodies/VideoChannelInput'
1202 '/video-channels/{id}':
767 get: 1203 get:
1204 summary: Get a video channel by its id
768 tags: 1205 tags:
769 - VideoChannel 1206 - Video Channel
770 consumes:
771 - application/json
772 produces:
773 - application/json
774 parameters: 1207 parameters:
775 - $ref: "video-channels.yaml#/parameters/id" 1208 - $ref: '#/components/parameters/id3'
776 responses: 1209 responses:
777 '200': 1210 '200':
778 description: successful operation 1211 description: successful operation
779 schema: 1212 content:
780 $ref: '#/definitions/VideoChannel' 1213 application/json:
1214 schema:
1215 $ref: '#/components/schemas/VideoChannel'
781 put: 1216 put:
1217 summary: Update a video channel by its id
782 security: 1218 security:
783 - OAuth2: [ ] 1219 - OAuth2: []
784 tags: 1220 tags:
785 - VideoChannel 1221 - Video Channel
786 consumes:
787 - application/json
788 produces:
789 - application/json
790 parameters: 1222 parameters:
791 - $ref: "video-channels.yaml#/parameters/id" 1223 - $ref: '#/components/parameters/id3'
792 - in: body
793 name: body
794 schema:
795 $ref: '#/definitions/VideoChannelInput'
796 responses: 1224 responses:
797 '204': 1225 '204':
798 $ref: "commons.yaml#/responses/emptySuccess" 1226 $ref: '#/paths/~1users~1me/put/responses/204'
1227 requestBody:
1228 $ref: '#/components/requestBodies/VideoChannelInput'
799 delete: 1229 delete:
1230 summary: Delete a video channel by its id
800 security: 1231 security:
801 - OAuth2: [ ] 1232 - OAuth2: []
802 tags: 1233 tags:
803 - VideoChannel 1234 - Video Channel
804 consumes:
805 - application/json
806 produces:
807 - application/json
808 parameters: 1235 parameters:
809 - $ref: "video-channels.yaml#/parameters/id" 1236 - $ref: '#/components/parameters/id3'
810 responses: 1237 responses:
811 '204': 1238 '204':
812 $ref: "commons.yaml#/responses/emptySuccess" 1239 $ref: '#/paths/~1users~1me/put/responses/204'
813 "/video-channels/{id}/videos": 1240 '/video-channels/{id}/videos':
814 get: 1241 get:
1242 summary: Get videos of a video channel by its id
815 tags: 1243 tags:
816 - VideoChannel 1244 - Video Channel
817 consumes:
818 - application/json
819 produces:
820 - application/json
821 parameters: 1245 parameters:
822 - $ref: "video-channels.yaml#/parameters/id" 1246 - $ref: '#/components/parameters/id3'
823 responses: 1247 responses:
824 '200': 1248 '200':
825 description: successful operation 1249 description: successful operation
826 schema: 1250 content:
827 $ref: '#/definitions/Video' 1251 application/json:
828 /accounts/{name}/video-channels: 1252 schema:
1253 $ref: '#/components/schemas/Video'
1254 '/accounts/{name}/video-channels':
829 get: 1255 get:
1256 summary: Get video channels of an account by its name
830 tags: 1257 tags:
831 - VideoChannel 1258 - Video Channel
832 consumes:
833 - application/json
834 produces:
835 - application/json
836 parameters: 1259 parameters:
837 - $ref: "accounts.yaml#/parameters/name" 1260 - $ref: '#/components/parameters/name'
838 responses: 1261 responses:
839 '200': 1262 '200':
840 description: successful operation 1263 description: successful operation
841 schema: 1264 content:
842 type: array 1265 application/json:
843 items: 1266 schema:
844 $ref: '#/definitions/VideoChannel' 1267 type: array
845 "/videos/{id}/comment-threads": 1268 items:
1269 $ref: '#/components/schemas/VideoChannel'
1270 '/videos/{id}/comment-threads':
846 get: 1271 get:
1272 summary: Get the comment threads of a video by its id
847 tags: 1273 tags:
848 - VideoComment 1274 - Video Comment
849 consumes:
850 - application/json
851 produces:
852 - application/json
853 parameters: 1275 parameters:
854 - $ref: "videos.yaml#/parameters/id" 1276 - $ref: '#/components/parameters/id2'
855 - $ref: "commons.yaml#/parameters/start" 1277 - $ref: '#/components/parameters/start'
856 - $ref: "commons.yaml#/parameters/count" 1278 - $ref: '#/components/parameters/count'
857 - $ref: "commons.yaml#/parameters/sort" 1279 - $ref: '#/components/parameters/sort'
858 responses: 1280 responses:
859 '200': 1281 '200':
860 description: successful operation 1282 description: successful operation
861 schema: 1283 content:
862 $ref: '#/definitions/CommentThreadResponse' 1284 application/json:
1285 schema:
1286 $ref: '#/components/schemas/CommentThreadResponse'
863 post: 1287 post:
1288 summary: 'Creates a comment thread, on a video by its id'
864 security: 1289 security:
865 - OAuth2: [ ] 1290 - OAuth2: []
866 tags: 1291 tags:
867 - VideoComment 1292 - Video Comment
868 consumes:
869 - application/json
870 produces:
871 - application/json
872 parameters: 1293 parameters:
873 - $ref: "videos.yaml#/parameters/id" 1294 - $ref: '#/components/parameters/id2'
874 responses: 1295 responses:
875 '200': 1296 '200':
876 description: successful operation 1297 description: successful operation
877 schema: 1298 content:
878 $ref: '#/definitions/CommentThreadPostResponse' 1299 application/json:
879 "/videos/{id}/comment-threads/{threadId}": 1300 schema:
1301 $ref: '#/components/schemas/CommentThreadPostResponse'
1302 '/videos/{id}/comment-threads/{threadId}':
880 get: 1303 get:
1304 summary: 'Get the comment thread by its id, of a video by its id'
881 tags: 1305 tags:
882 - VideoComment 1306 - Video Comment
883 consumes:
884 - application/json
885 produces:
886 - application/json
887 parameters: 1307 parameters:
888 - $ref: "videos.yaml#/parameters/id" 1308 - $ref: '#/components/parameters/id2'
889 - $ref: "video-comments.yaml#/parameters/threadId" 1309 - name: threadId
1310 in: path
1311 required: true
1312 description: The thread id (root comment id)
1313 schema:
1314 type: number
890 responses: 1315 responses:
891 '200': 1316 '200':
892 description: successful operation 1317 description: successful operation
893 schema: 1318 content:
894 $ref: '#/definitions/VideoCommentThreadTree' 1319 application/json:
895 "/videos/{id}/comments/{commentId}": 1320 schema:
1321 $ref: '#/components/schemas/VideoCommentThreadTree'
1322 '/videos/{id}/comments/{commentId}':
896 post: 1323 post:
1324 summary: 'Creates a comment in a comment thread by its id, of a video by its id'
897 security: 1325 security:
898 - OAuth2: [ ] 1326 - OAuth2: []
899 tags: 1327 tags:
900 - VideoComment 1328 - Video Comment
901 consumes:
902 - application/json
903 produces:
904 - application/json
905 parameters: 1329 parameters:
906 - $ref: "videos.yaml#/parameters/id" 1330 - $ref: '#/components/parameters/id2'
907 - $ref: "video-comments.yaml#/parameters/commentId" 1331 - $ref: '#/components/parameters/commentId'
908 responses: 1332 responses:
909 '200': 1333 '200':
910 description: successful operation 1334 description: successful operation
911 schema: 1335 content:
912 $ref: '#/definitions/CommentThreadPostResponse' 1336 application/json:
1337 schema:
1338 $ref: '#/components/schemas/CommentThreadPostResponse'
913 delete: 1339 delete:
1340 summary: 'Delete a comment in a comment therad by its id, of a video by its id'
914 security: 1341 security:
915 - OAuth2: [ ] 1342 - OAuth2: []
916 tags: 1343 tags:
917 - VideoComment 1344 - Video Comment
918 consumes:
919 - application/json
920 produces:
921 - application/json
922 parameters: 1345 parameters:
923 - $ref: "videos.yaml#/parameters/id" 1346 - $ref: '#/components/parameters/id2'
924 - $ref: "video-comments.yaml#/parameters/commentId" 1347 - $ref: '#/components/parameters/commentId'
925 responses: 1348 responses:
926 '204': 1349 '204':
927 $ref: "commons.yaml#/responses/emptySuccess" 1350 $ref: '#/paths/~1users~1me/put/responses/204'
928 "/videos/{id}/rate": 1351 '/videos/{id}/rate':
929 put: 1352 put:
1353 summary: Vote for a video by its id
930 security: 1354 security:
931 - OAuth2: [ ] 1355 - OAuth2: []
932 tags: 1356 tags:
933 - VideoRate 1357 - Video Rate
934 consumes:
935 - application/json
936 produces:
937 - application/json
938 parameters: 1358 parameters:
939 - $ref: "videos.yaml#/parameters/id" 1359 - $ref: '#/components/parameters/id2'
940 responses: 1360 responses:
941 '204': 1361 '204':
942 $ref: "commons.yaml#/responses/emptySuccess" 1362 $ref: '#/paths/~1users~1me/put/responses/204'
943 /search/videos: 1363 /search/videos:
944 get: 1364 get:
945 tags: 1365 tags:
946 - Search 1366 - Search
947 consumes: 1367 summary: Get the videos corresponding to a given query
948 - application/json
949 produces:
950 - application/json
951 parameters: 1368 parameters:
952 - $ref: "commons.yaml#/parameters/start" 1369 - $ref: '#/components/parameters/start'
953 - $ref: "commons.yaml#/parameters/count" 1370 - $ref: '#/components/parameters/count'
954 - $ref: "commons.yaml#/parameters/sort" 1371 - $ref: '#/components/parameters/videosSearchSort'
955 - name: search 1372 - name: search
956 in: query 1373 in: query
957 required: true 1374 required: true
958 type: string 1375 description: String to search
959 description: 'String to search' 1376 schema:
1377 type: string
960 responses: 1378 responses:
961 '200': 1379 '200':
962 description: successful operation 1380 description: successful operation
963 schema: 1381 content:
964 type: array 1382 application/json:
965 items: 1383 schema:
966 $ref: '#/definitions/Video' 1384 type: array
967definitions: 1385 items:
968 VideoConstantNumber: 1386 $ref: '#/components/schemas/Video'
969 properties: 1387servers:
970 id: 1388 - url: 'https://peertube.cpy.re/api/v1'
971 type: number 1389 description: Live Test Server (live data - stable version)
972 label: 1390 - url: 'https://peertube2.cpy.re/api/v1'
973 type: string 1391 description: Live Test Server (live data - bleeding edge version)
974 VideoConstantString: 1392 - url: 'https://peertube3.cpy.re/api/v1'
975 properties: 1393 description: Live Test Server (live data - bleeding edge version)
976 id: 1394components:
977 type: string 1395 parameters:
978 label: 1396 start:
979 type: string 1397 name: start
980 VideoPrivacy: 1398 in: query
981 type: string 1399 required: false
982 enum: [Public, Unlisted, Private] 1400 description: Offset
983 Video: 1401 schema:
984 properties:
985 id:
986 type: number
987 uuid:
988 type: string
989 createdAt:
990 type: string
991 publishedAt:
992 type: string
993 updatedAt:
994 type: string
995 category:
996 $ref: "#/definitions/VideoConstantNumber"
997 licence:
998 $ref: "#/definitions/VideoConstantNumber"
999 language:
1000 $ref: "#/definitions/VideoConstantString"
1001 privacy:
1002 $ref: "#/definitions/VideoPrivacy"
1003 description:
1004 type: string
1005 duration:
1006 type: number
1007 isLocal:
1008 type: boolean
1009 name:
1010 type: string
1011 thumbnailPath:
1012 type: string
1013 previewPath:
1014 type: string
1015 embedPath:
1016 type: string
1017 views:
1018 type: number 1402 type: number
1019 likes: 1403 count:
1404 name: count
1405 in: query
1406 required: false
1407 description: Number of items
1408 schema:
1020 type: number 1409 type: number
1021 dislikes: 1410 sort:
1411 name: sort
1412 in: query
1413 required: false
1414 description: Sort column (-createdAt for example)
1415 schema:
1416 type: string
1417 videosSort:
1418 name: sort
1419 in: query
1420 required: false
1421 description: Sort videos by criteria
1422 schema:
1423 type: string
1424 enum:
1425 - -name
1426 - -duration
1427 - -createdAt
1428 - -publishedAt
1429 - -views
1430 - -likes
1431 - -trending
1432 videosSearchSort:
1433 name: sort
1434 in: query
1435 required: false
1436 description: Sort videos by criteria
1437 schema:
1438 type: string
1439 enum:
1440 - -name
1441 - -duration
1442 - -createdAt
1443 - -publishedAt
1444 - -views
1445 - -likes
1446 - -match
1447 blacklistsSort:
1448 name: sort
1449 in: query
1450 required: false
1451 description: Sort blacklists by criteria
1452 schema:
1453 type: string
1454 enum:
1455 - -id
1456 - -name
1457 - -duration
1458 - -views
1459 - -likes
1460 - -dislikes
1461 - -uuid
1462 - -createdAt
1463 usersSort:
1464 name: sort
1465 in: query
1466 required: false
1467 description: Sort users by criteria
1468 schema:
1469 type: string
1470 enum:
1471 - -id
1472 - -username
1473 - -createdAt
1474 abusesSort:
1475 name: sort
1476 in: query
1477 required: false
1478 description: Sort abuses by criteria
1479 schema:
1480 type: string
1481 enum:
1482 - -id
1483 - -createdAt
1484 - -state
1485 name:
1486 name: name
1487 in: path
1488 required: true
1489 description: >-
1490 The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
1491 example)
1492 schema:
1493 type: string
1494 id:
1495 name: id
1496 in: path
1497 required: true
1498 description: The user id
1499 schema:
1022 type: number 1500 type: number
1023 nsfw: 1501 id2:
1024 type: boolean 1502 name: id
1025 account: 1503 in: path
1026 type: object 1504 required: true
1027 properties: 1505 description: The video id or uuid
1028 name: 1506 schema:
1029 type: string 1507 type: string
1030 displayName: 1508 id3:
1031 type: string 1509 name: id
1032 url: 1510 in: path
1033 type: string 1511 required: true
1034 host: 1512 description: The video channel id or uuid
1035 type: string 1513 schema:
1036 avatar: 1514 type: string
1037 $ref: "#/definitions/Avatar" 1515 commentId:
1038 VideoAbuse: 1516 name: threadId
1039 properties: 1517 in: path
1040 id: 1518 required: true
1519 description: The comment id
1520 schema:
1041 type: number 1521 type: number
1042 reason: 1522 categoryOneOf:
1043 type: string 1523 name: categoryOneOf
1044 reporterAccount: 1524 in: query
1045 $ref: "#/definitions/Account" 1525 required: false
1046 video: 1526 description: category id of the video
1047 type: object 1527 schema:
1048 properties: 1528 oneOf:
1049 id: 1529 - type: number
1530 - type: array
1531 items:
1050 type: number 1532 type: number
1051 name: 1533 style: form
1534 explode: false
1535 tagsOneOf:
1536 name: tagsOneOf
1537 in: query
1538 required: false
1539 description: tag(s) of the video
1540 schema:
1541 oneOf:
1542 - type: string
1543 - type: array
1544 items:
1052 type: string 1545 type: string
1053 uuid: 1546 style: form
1547 explode: false
1548 tagsAllOf:
1549 name: tagsAllOf
1550 in: query
1551 required: false
1552 description: tag(s) of the video, where all should be present in the video
1553 schema:
1554 oneOf:
1555 - type: string
1556 - type: array
1557 items:
1054 type: string 1558 type: string
1055 url: 1559 style: form
1560 explode: false
1561 languageOneOf:
1562 name: languageOneOf
1563 in: query
1564 required: false
1565 description: language id of the video
1566 schema:
1567 oneOf:
1568 - type: string
1569 - type: array
1570 items:
1056 type: string 1571 type: string
1057 createdAt: 1572 style: form
1058 type: string 1573 explode: false
1059 VideoBlacklist: 1574 licenceOneOf:
1060 properties: 1575 name: licenceOneOf
1061 id: 1576 in: query
1062 type: number 1577 required: false
1063 videoId: 1578 description: licence id of the video
1064 type: number 1579 schema:
1065 createdAt: 1580 oneOf:
1066 type: string 1581 - type: number
1067 updatedAt: 1582 - type: array
1068 type: string 1583 items:
1069 name:
1070 type: string
1071 uuid:
1072 type: string
1073 description:
1074 type: string
1075 duration:
1076 type: number
1077 views:
1078 type: number
1079 likes:
1080 type: number
1081 dislikes:
1082 type: number
1083 nsfw:
1084 type: boolean
1085 VideoChannel:
1086 properties:
1087 displayName:
1088 type: string
1089 description:
1090 type: string
1091 isLocal:
1092 type: boolean
1093 ownerAccount:
1094 type: object
1095 properties:
1096 id:
1097 type: number 1584 type: number
1098 uuid: 1585 style: form
1099 type: string 1586 explode: false
1100 VideoComment: 1587 nsfw:
1101 properties: 1588 name: nsfw
1102 id: 1589 in: query
1103 type: number 1590 required: false
1104 url: 1591 description: whether to include nsfw videos, if any
1105 type: string 1592 schema:
1106 text: 1593 type: string
1107 type: string 1594 enum:
1108 threadId: 1595 - 'true'
1109 type: number 1596 - 'false'
1110 inReplyToCommentId: 1597 filter:
1111 type: number 1598 name: filter
1112 videoId: 1599 in: query
1113 type: number 1600 required: false
1114 createdAt: 1601 description: >
1115 type: string 1602 Special filters (local for instance) which might require special rights:
1116 updatedAt: 1603 * `local` - only videos local to the instance
1117 type: string 1604 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
1118 totalReplies: 1605 schema:
1119 type: number 1606 type: string
1120 account: 1607 enum:
1121 $ref: "#/definitions/Account" 1608 - local
1122 VideoCommentThreadTree: 1609 - all-local
1123 properties: 1610 subscriptionsUris:
1124 comment: 1611 name: uris
1125 $ref: "#/definitions/VideoComment" 1612 in: query
1126 children: 1613 required: true
1614 description: list of uris to check if each is part of the user subscriptions
1615 schema:
1127 type: array 1616 type: array
1128 items: 1617 items:
1129 $ref: "#/definitions/VideoCommentThreadTree" 1618 type: string
1130 Avatar: 1619 requestBodies:
1131 properties: 1620 VideoChannelInput:
1132 path: 1621 content:
1133 type: string 1622 application/json:
1134 createdAt: 1623 schema:
1135 type: string 1624 $ref: '#/components/schemas/VideoChannelInput'
1136 updatedAt: 1625 securitySchemes:
1137 type: string 1626 OAuth2:
1138 Actor: 1627 description: >
1139 properties: 1628 In the header: *Authorization: Bearer <token\>*
1140 id: 1629
1141 type: number 1630
1142 uuid: 1631 Authenticating via OAuth requires the following steps:
1143 type: string 1632
1144 url: 1633
1145 type: string 1634 - Have an account with sufficient authorization levels
1146 name: 1635
1147 type: string 1636 - [Generate](https://docs.joinpeertube.org/lang/en/devdocs/rest.html) a
1148 host: 1637 Bearer Token
1149 type: string 1638
1150 followingCount: 1639 - Make Authenticated Requests
1151 type: number 1640 type: oauth2
1152 followersCount: 1641 flows:
1153 type: number 1642 password:
1154 createdAt: 1643 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
1155 type: string 1644 scopes:
1156 updatedAt: 1645 admin: Admin scope
1157 type: string 1646 moderator: Moderator scope
1158 avatar: 1647 user: User scope
1159 $ref: "#/definitions/Avatar" 1648 schemas:
1160 Account: 1649 VideoConstantNumber:
1161 allOf: 1650 properties:
1162 - $ref: "#/definitions/Actor" 1651 id:
1163 - properties: 1652 type: number
1164 displayName: 1653 label:
1165 type: string 1654 type: string
1166 User: 1655 VideoConstantString:
1167 properties: 1656 properties:
1168 id: 1657 id:
1169 type: number 1658 type: string
1170 username: 1659 label:
1171 type: string 1660 type: string
1172 email: 1661 VideoPrivacy:
1173 type: string 1662 type: string
1174 displayNSFW: 1663 enum:
1175 type: boolean 1664 - Public
1176 autoPlayVideo: 1665 - Unlisted
1177 type: boolean 1666 - Private
1178 role: 1667 Video:
1179 type: string 1668 properties:
1180 enum: [User, Moderator, Administrator] 1669 id:
1181 videoQuota: 1670 type: number
1182 type: number 1671 uuid:
1183 createdAt: 1672 type: string
1184 type: string 1673 createdAt:
1185 account: 1674 type: string
1186 $ref: "#/definitions/Account" 1675 publishedAt:
1187 videoChannels: 1676 type: string
1188 type: array 1677 updatedAt:
1189 items: 1678 type: string
1190 $ref: "#/definitions/VideoChannel" 1679 category:
1191 ServerConfig: 1680 $ref: '#/components/schemas/VideoConstantNumber'
1192 properties: 1681 licence:
1193 signup: 1682 $ref: '#/components/schemas/VideoConstantNumber'
1194 type: object 1683 language:
1195 properties: 1684 $ref: '#/components/schemas/VideoConstantString'
1196 allowed: 1685 privacy:
1197 type: boolean 1686 $ref: '#/components/schemas/VideoPrivacy'
1198 transcoding: 1687 description:
1199 type: object 1688 type: string
1200 properties: 1689 duration:
1201 enabledResolutions: 1690 type: number
1202 type: array 1691 isLocal:
1203 items: 1692 type: boolean
1693 name:
1694 type: string
1695 thumbnailPath:
1696 type: string
1697 previewPath:
1698 type: string
1699 embedPath:
1700 type: string
1701 views:
1702 type: number
1703 likes:
1704 type: number
1705 dislikes:
1706 type: number
1707 nsfw:
1708 type: boolean
1709 account:
1710 type: object
1711 properties:
1712 name:
1713 type: string
1714 displayName:
1715 type: string
1716 url:
1717 type: string
1718 host:
1719 type: string
1720 avatar:
1721 $ref: '#/components/schemas/Avatar'
1722 VideoAbuse:
1723 properties:
1724 id:
1725 type: number
1726 reason:
1727 type: string
1728 reporterAccount:
1729 $ref: '#/components/schemas/Account'
1730 video:
1731 type: object
1732 properties:
1733 id:
1204 type: number 1734 type: number
1205 avatar: 1735 name:
1206 type: object
1207 properties:
1208 file:
1209 type: object
1210 properties:
1211 size:
1212 type: object
1213 properties:
1214 max:
1215 type: number
1216 extensions:
1217 type: array
1218 items:
1219 type: string 1736 type: string
1220 video: 1737 uuid:
1221 type: object 1738 type: string
1222 properties: 1739 url:
1223 file: 1740 type: string
1224 type: object 1741 createdAt:
1225 properties: 1742 type: string
1226 extensions: 1743 VideoBlacklist:
1227 type: array 1744 properties:
1228 items: 1745 id:
1229 type: string 1746 type: number
1230 Follow: 1747 videoId:
1231 properties: 1748 type: number
1232 id: 1749 createdAt:
1233 type: number 1750 type: string
1234 follower: 1751 updatedAt:
1235 $ref: "#/definitions/Actor" 1752 type: string
1236 following: 1753 name:
1237 $ref: "#/definitions/Actor" 1754 type: string
1238 score: 1755 uuid:
1239 type: number 1756 type: string
1240 state: 1757 description:
1241 type: string 1758 type: string
1242 enum: [pending, accepted] 1759 duration:
1243 createdAt: 1760 type: number
1244 type: string 1761 views:
1245 updatedAt: 1762 type: number
1246 type: string 1763 likes:
1247 Job: 1764 type: number
1248 properties: 1765 dislikes:
1249 id: 1766 type: number
1250 type: number 1767 nsfw:
1251 state: 1768 type: boolean
1252 type: string 1769 VideoChannel:
1253 enum: [pending, processing, error, success] 1770 properties:
1254 category: 1771 displayName:
1255 type: string 1772 type: string
1256 enum: [transcoding, activitypub-http] 1773 description:
1257 handlerName: 1774 type: string
1258 type: string 1775 isLocal:
1259 handlerInputData: 1776 type: boolean
1260 type: string 1777 ownerAccount:
1261 createdAt: 1778 type: object
1262 type: string 1779 properties:
1263 updatedAt: 1780 id:
1264 type: string 1781 type: number
1265 1782 uuid:
1266# Api responses 1783 type: string
1267 AddUserResponse: 1784 VideoComment:
1268 properties: 1785 properties:
1269 id: 1786 id:
1270 type: number 1787 type: number
1271 uuid: 1788 url:
1272 type: string 1789 type: string
1273 VideoUploadResponse: 1790 text:
1274 properties: 1791 type: string
1275 video: 1792 threadId:
1276 type: object 1793 type: number
1277 properties: 1794 inReplyToCommentId:
1278 id: 1795 type: number
1279 type: number 1796 videoId:
1280 uuid: 1797 type: number
1281 type: string 1798 createdAt:
1282 CommentThreadResponse: 1799 type: string
1283 properties: 1800 updatedAt:
1284 total: 1801 type: string
1285 type: number 1802 totalReplies:
1286 data: 1803 type: number
1287 type: array 1804 account:
1288 items: 1805 $ref: '#/components/schemas/Account'
1289 $ref: "#/definitions/VideoComment" 1806 VideoCommentThreadTree:
1290 CommentThreadPostResponse: 1807 properties:
1291 properties: 1808 comment:
1292 comment: 1809 $ref: '#/components/schemas/VideoComment'
1293 $ref: "#/definitions/VideoComment" 1810 children:
1811 type: array
1812 items:
1813 $ref: '#/components/schemas/VideoCommentThreadTree'
1814 Avatar:
1815 properties:
1816 path:
1817 type: string
1818 createdAt:
1819 type: string
1820 updatedAt:
1821 type: string
1822 Actor:
1823 properties:
1824 id:
1825 type: number
1826 uuid:
1827 type: string
1828 url:
1829 type: string
1830 name:
1831 type: string
1832 host:
1833 type: string
1834 followingCount:
1835 type: number
1836 followersCount:
1837 type: number
1838 createdAt:
1839 type: string
1840 updatedAt:
1841 type: string
1842 avatar:
1843 $ref: '#/components/schemas/Avatar'
1844 Account:
1845 allOf:
1846 - $ref: '#/components/schemas/Actor'
1847 - properties:
1848 displayName:
1849 type: string
1850 User:
1851 properties:
1852 id:
1853 type: number
1854 username:
1855 type: string
1856 email:
1857 type: string
1858 displayNSFW:
1859 type: boolean
1860 autoPlayVideo:
1861 type: boolean
1862 role:
1863 type: string
1864 enum:
1865 - User
1866 - Moderator
1867 - Administrator
1868 videoQuota:
1869 type: number
1870 createdAt:
1871 type: string
1872 account:
1873 $ref: '#/components/schemas/Account'
1874 videoChannels:
1875 type: array
1876 items:
1877 $ref: '#/components/schemas/VideoChannel'
1878 UserWatchingVideo:
1879 properties:
1880 currentTime:
1881 type: number
1882 ServerConfig:
1883 properties:
1884 signup:
1885 type: object
1886 properties:
1887 allowed:
1888 type: boolean
1889 transcoding:
1890 type: object
1891 properties:
1892 enabledResolutions:
1893 type: array
1894 items:
1895 type: number
1896 avatar:
1897 type: object
1898 properties:
1899 file:
1900 type: object
1901 properties:
1902 size:
1903 type: object
1904 properties:
1905 max:
1906 type: number
1907 extensions:
1908 type: array
1909 items:
1910 type: string
1911 video:
1912 type: object
1913 properties:
1914 file:
1915 type: object
1916 properties:
1917 extensions:
1918 type: array
1919 items:
1920 type: string
1921 Follow:
1922 properties:
1923 id:
1924 type: number
1925 follower:
1926 $ref: '#/components/schemas/Actor'
1927 following:
1928 $ref: '#/components/schemas/Actor'
1929 score:
1930 type: number
1931 state:
1932 type: string
1933 enum:
1934 - pending
1935 - accepted
1936 createdAt:
1937 type: string
1938 updatedAt:
1939 type: string
1940 Job:
1941 properties:
1942 id:
1943 type: number
1944 state:
1945 type: string
1946 enum:
1947 - pending
1948 - processing
1949 - error
1950 - success
1951 category:
1952 type: string
1953 enum:
1954 - transcoding
1955 - activitypub-http
1956 handlerName:
1957 type: string
1958 handlerInputData:
1959 type: string
1960 createdAt:
1961 type: string
1962 updatedAt:
1963 type: string
1964 AddUserResponse:
1965 properties:
1966 id:
1967 type: number
1968 uuid:
1969 type: string
1970 VideoUploadResponse:
1971 properties:
1972 video:
1973 type: object
1974 properties:
1975 id:
1976 type: number
1977 uuid:
1978 type: string
1979 CommentThreadResponse:
1980 properties:
1981 total:
1982 type: number
1983 data:
1984 type: array
1985 items:
1986 $ref: '#/components/schemas/VideoComment'
1987 CommentThreadPostResponse:
1988 properties:
1989 comment:
1990 $ref: '#/components/schemas/VideoComment'
1991 AddUser:
1992 properties:
1993 username:
1994 type: string
1995 description: 'The user username '
1996 password:
1997 type: string
1998 description: 'The user password '
1999 email:
2000 type: string
2001 description: 'The user email '
2002 videoQuota:
2003 type: string
2004 description: 'The user videoQuota '
2005 role:
2006 type: integer
2007 format: int32
2008 enum:
2009 - 0
2010 - 1
2011 - 2
2012 description: 'The user role '
2013 required:
2014 - username
2015 - password
2016 - email
2017 - videoQuota
2018 - role
2019 UpdateUser:
2020 properties:
2021 id:
2022 type: string
2023 description: 'The user id '
2024 email:
2025 type: string
2026 description: 'The updated email of the user '
2027 videoQuota:
2028 type: string
2029 description: 'The updated videoQuota of the user '
2030 role:
2031 type: string
2032 description: 'The updated role of the user '
2033 required:
2034 - id
2035 - email
2036 - videoQuota
2037 - role
2038 UpdateMe:
2039 properties:
2040 password:
2041 type: string
2042 description: 'Your new password '
2043 email:
2044 type: string
2045 description: 'Your new email '
2046 displayNSFW:
2047 type: string
2048 description: 'Your new displayNSFW '
2049 autoPlayVideo:
2050 type: string
2051 description: 'Your new autoPlayVideo '
2052 required:
2053 - password
2054 - email
2055 - displayNSFW
2056 - autoPlayVideo
2057 GetMeVideoRating:
2058 properties:
2059 id:
2060 type: string
2061 description: 'Id of the video '
2062 rating:
2063 type: number
2064 description: 'Rating of the video '
2065 required:
2066 - id
2067 - rating
2068 RegisterUser:
2069 properties:
2070 username:
2071 type: string
2072 description: 'The username of the user '
2073 password:
2074 type: string
2075 description: 'The password of the user '
2076 email:
2077 type: string
2078 description: 'The email of the user '
2079 required:
2080 - username
2081 - password
2082 - email
2083 VideoChannelInput:
2084 properties:
2085 name:
2086 type: string
2087 description:
2088 type: string
1294 2089
1295# Request bodies
1296 AddUser:
1297 properties:
1298 username:
1299 type: string
1300 description: 'The user username '
1301 password:
1302 type: string
1303 description: 'The user password '
1304 email:
1305 type: string
1306 description: 'The user email '
1307 videoQuota:
1308 type: string
1309 description: 'The user videoQuota '
1310 role:
1311 type: string
1312 description: 'The user role '
1313 required:
1314 - username
1315 - password
1316 - email
1317 - videoQuota
1318 - role
1319 UpdateUser:
1320 properties:
1321 id:
1322 type: string
1323 description: 'The user id '
1324 email:
1325 type: string
1326 description: 'The updated email of the user '
1327 videoQuota:
1328 type: string
1329 description: 'The updated videoQuota of the user '
1330 role:
1331 type: string
1332 description: 'The updated role of the user '
1333 required:
1334 - id
1335 - email
1336 - videoQuota
1337 - role
1338 UpdateMe:
1339 properties:
1340 password:
1341 type: string
1342 description: 'Your new password '
1343 email:
1344 type: string
1345 description: 'Your new email '
1346 displayNSFW:
1347 type: string
1348 description: 'Your new displayNSFW '
1349 autoPlayVideo:
1350 type: string
1351 description: 'Your new autoPlayVideo '
1352 required:
1353 - password
1354 - email
1355 - displayNSFW
1356 - autoPlayVideo
1357 GetMeVideoRating:
1358 properties:
1359 id:
1360 type: string
1361 description: 'Id of the video '
1362 rating:
1363 type: number
1364 description: 'Rating of the video '
1365 required:
1366 - id
1367 - rating
1368 RegisterUser:
1369 properties:
1370 username:
1371 type: string
1372 description: 'The username of the user '
1373 password:
1374 type: string
1375 description: 'The password of the user '
1376 email:
1377 type: string
1378 description: 'The email of the user '
1379 required:
1380 - username
1381 - password
1382 - email
1383 VideoChannelInput:
1384 properties:
1385 name:
1386 type: string
1387 description:
1388 type: string \ No newline at end of file