]>
Commit | Line | Data |
---|---|---|
3e9e6f2f | 1 | openapi: 3.0.0 |
1569a818 | 2 | info: |
5e1c08eb | 3 | title: PeerTube |
88ebb433 | 4 | version: 1.3.0 |
2963c343 RK |
5 | contact: |
6 | name: PeerTube Community | |
7 | url: 'https://joinpeertube.org' | |
8 | license: | |
9 | name: AGPLv3.0 | |
10 | url: 'https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE' | |
11 | x-logo: | |
12 | url: 'https://joinpeertube.org/img/brand.png' | |
5776f78e | 13 | altText: PeerTube Project Homepage |
2963c343 RK |
14 | description: | |
15 | # Introduction | |
16 | The PeerTube API is built on HTTP(S). Our API is RESTful. It has predictable | |
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 | |
5776f78e RK |
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. | |
3e9e6f2f | 23 | |
2963c343 RK |
24 | # Authentication |
25 | When you sign up for an account, you are given the possibility to generate | |
1fd12c7c | 26 | sessions, and authenticate using this session token. One session token can |
2963c343 | 27 | currently be used at a time. |
5776f78e RK |
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 | ``` | |
6441981b RK |
40 | externalDocs: |
41 | url: https://docs.joinpeertube.org/api.html | |
2963c343 RK |
42 | tags: |
43 | - name: Accounts | |
3e9e6f2f | 44 | description: > |
2963c343 | 45 | Using some features of PeerTube require authentication, for which Accounts |
3e9e6f2f | 46 | provide different levels of permission as well as associated user |
5776f78e | 47 | information. Accounts also encompass remote accounts discovered across the federation. |
2963c343 | 48 | - name: Config |
3e9e6f2f RK |
49 | description: > |
50 | Each server exposes public information regarding supported videos and | |
51 | options. | |
2963c343 RK |
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 | |
3e9e6f2f RK |
57 | description: > |
58 | Jobs are long-running tasks enqueued and processed by the instance | |
5776f78e RK |
59 | itself. No additional worker registration is currently available. |
60 | - name: Server Following | |
3e9e6f2f RK |
61 | description: > |
62 | Managing servers which the instance interacts with is crucial to the | |
5776f78e | 63 | concept of federation in PeerTube and external video indexation. The PeerTube |
1fd12c7c | 64 | server then deals with inter-server ActivityPub operations and propagates |
2963c343 RK |
65 | information across its social graph by posting activities to actors' inbox |
66 | endpoints. | |
5776f78e | 67 | - name: Video Abuse |
2963c343 RK |
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. | |
5776f78e | 79 | - name: Video Comment |
3e9e6f2f RK |
80 | description: > |
81 | Operations dealing with comments to a video. Comments are organized in | |
82 | threads. | |
5776f78e | 83 | - name: Video Channel |
3e9e6f2f RK |
84 | description: > |
85 | Operations dealing with creation, modification and video listing of a | |
5776f78e RK |
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. | |
94 | x-tagGroups: | |
95 | - name: Accounts | |
96 | tags: | |
97 | - Accounts | |
98 | - User | |
99 | - name: Videos | |
100 | tags: | |
101 | - Video | |
102 | - Video Channel | |
103 | - Video Comment | |
5776f78e RK |
104 | - Video Following |
105 | - Video Rate | |
106 | - name: Moderation | |
107 | tags: | |
9d0b856e | 108 | - Video Abuse |
5776f78e | 109 | - Video Blacklist |
65f02679 | 110 | - name: Instance Configuration |
5776f78e RK |
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 | |
1569a818 | 123 | paths: |
ad9e39fb | 124 | '/accounts/{name}': |
1569a818 DG |
125 | get: |
126 | tags: | |
127 | - Accounts | |
2963c343 | 128 | summary: Get the account by name |
1569a818 | 129 | parameters: |
3e9e6f2f RK |
130 | - $ref: '#/components/parameters/name' |
131 | - $ref: '#/components/parameters/start' | |
132 | - $ref: '#/components/parameters/count' | |
133 | - $ref: '#/components/parameters/sort' | |
1569a818 DG |
134 | responses: |
135 | '200': | |
136 | description: successful operation | |
3e9e6f2f RK |
137 | content: |
138 | application/json: | |
139 | schema: | |
140 | $ref: '#/components/schemas/Account' | |
ad9e39fb | 141 | '/accounts/{name}/videos': |
6b738c7a C |
142 | get: |
143 | tags: | |
144 | - Accounts | |
2963c343 | 145 | - Video |
3e9e6f2f | 146 | summary: 'Get videos for an account, provided the name of that account' |
6b738c7a | 147 | parameters: |
3e9e6f2f | 148 | - $ref: '#/components/parameters/name' |
6b738c7a C |
149 | responses: |
150 | '200': | |
151 | description: successful operation | |
3e9e6f2f RK |
152 | content: |
153 | application/json: | |
154 | schema: | |
155 | $ref: '#/components/schemas/Video' | |
2963c343 RK |
156 | x-code-samples: |
157 | - lang: JavaScript | |
158 | source: | | |
8f9e8be1 | 159 | fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos') |
2963c343 RK |
160 | .then(function(response) { |
161 | return response.json() | |
162 | }).then(function(data) { | |
163 | console.log(data) | |
164 | }) | |
8f9e8be1 RK |
165 | - lang: Shell |
166 | source: | | |
167 | # pip install httpie | |
168 | http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos | |
5776f78e RK |
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")) | |
1569a818 DG |
200 | /accounts: |
201 | get: | |
202 | tags: | |
203 | - Accounts | |
2963c343 | 204 | summary: Get all accounts |
1569a818 DG |
205 | responses: |
206 | '200': | |
207 | description: successful operation | |
3e9e6f2f | 208 | content: |
8f9e8be1 | 209 | 'application/json': |
3e9e6f2f RK |
210 | schema: |
211 | type: array | |
212 | items: | |
213 | $ref: '#/components/schemas/Account' | |
1569a818 DG |
214 | /config: |
215 | get: | |
216 | tags: | |
217 | - Config | |
6441981b | 218 | summary: Get the public configuration of the server |
1569a818 DG |
219 | responses: |
220 | '200': | |
221 | description: successful operation | |
3e9e6f2f RK |
222 | content: |
223 | application/json: | |
224 | schema: | |
225 | $ref: '#/components/schemas/ServerConfig' | |
6441981b RK |
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: | |
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 | |
3e9e6f2f | 265 | '/feeds/videos.{format}': |
244e76a5 | 266 | get: |
3e9e6f2f RK |
267 | summary: >- |
268 | Get the feed of videos for the server, with optional filter by account | |
269 | name or id | |
244e76a5 RK |
270 | tags: |
271 | - Feeds | |
244e76a5 RK |
272 | parameters: |
273 | - name: format | |
274 | in: path | |
275 | required: true | |
3e9e6f2f RK |
276 | description: >- |
277 | The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and | |
278 | json to JSON FEED 1.0 | |
279 | schema: | |
280 | type: string | |
281 | enum: | |
282 | - xml | |
283 | - atom | |
284 | - json | |
285 | default: xml | |
244e76a5 RK |
286 | - name: accountId |
287 | in: query | |
288 | required: false | |
3e9e6f2f RK |
289 | description: >- |
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 | |
244e76a5 RK |
294 | - name: accountName |
295 | in: query | |
296 | required: false | |
3e9e6f2f RK |
297 | description: The name of the local account to filter to |
298 | schema: | |
299 | type: string | |
244e76a5 RK |
300 | responses: |
301 | '200': | |
302 | description: successful operation | |
d216b538 | 303 | /jobs/{state}: |
1569a818 | 304 | get: |
2963c343 | 305 | summary: Get list of jobs |
94ff4c23 | 306 | security: |
3e9e6f2f RK |
307 | - OAuth2: |
308 | - admin | |
1569a818 DG |
309 | tags: |
310 | - Job | |
44cb3b85 DG |
311 | parameters: |
312 | - name: state | |
313 | in: path | |
314 | required: true | |
3e9e6f2f RK |
315 | description: The state of the job |
316 | schema: | |
317 | type: string | |
65f02679 RK |
318 | enum: |
319 | - active | |
320 | - completed | |
321 | - failed | |
322 | - waiting | |
323 | - delayed | |
3e9e6f2f RK |
324 | - $ref: '#/components/parameters/start' |
325 | - $ref: '#/components/parameters/count' | |
326 | - $ref: '#/components/parameters/sort' | |
1569a818 DG |
327 | responses: |
328 | '200': | |
329 | description: successful operation | |
3e9e6f2f RK |
330 | content: |
331 | application/json: | |
332 | schema: | |
333 | type: array | |
334 | items: | |
335 | $ref: '#/components/schemas/Job' | |
1569a818 DG |
336 | '/server/following/{host}': |
337 | delete: | |
94ff4c23 | 338 | security: |
3e9e6f2f RK |
339 | - OAuth2: |
340 | - admin | |
1569a818 | 341 | tags: |
5776f78e | 342 | - Server Following |
2963c343 | 343 | summary: Unfollow a server by hostname |
1569a818 DG |
344 | parameters: |
345 | - name: host | |
346 | in: path | |
347 | required: true | |
1569a818 | 348 | description: 'The host to unfollow ' |
3e9e6f2f RK |
349 | schema: |
350 | type: string | |
1569a818 DG |
351 | responses: |
352 | '201': | |
353 | description: successful operation | |
354 | /server/followers: | |
355 | get: | |
356 | tags: | |
5776f78e | 357 | - Server Following |
2963c343 | 358 | summary: Get followers of the server |
44cb3b85 | 359 | parameters: |
3e9e6f2f RK |
360 | - $ref: '#/components/parameters/start' |
361 | - $ref: '#/components/parameters/count' | |
362 | - $ref: '#/components/parameters/sort' | |
1569a818 DG |
363 | responses: |
364 | '200': | |
365 | description: successful operation | |
3e9e6f2f RK |
366 | content: |
367 | application/json: | |
368 | schema: | |
369 | type: array | |
370 | items: | |
371 | $ref: '#/components/schemas/Follow' | |
1569a818 DG |
372 | /server/following: |
373 | get: | |
374 | tags: | |
5776f78e | 375 | - Server Following |
2963c343 | 376 | summary: Get servers followed by the server |
44cb3b85 | 377 | parameters: |
3e9e6f2f RK |
378 | - $ref: '#/components/parameters/start' |
379 | - $ref: '#/components/parameters/count' | |
380 | - $ref: '#/components/parameters/sort' | |
1569a818 DG |
381 | responses: |
382 | '200': | |
383 | description: successful operation | |
3e9e6f2f RK |
384 | content: |
385 | application/json: | |
386 | schema: | |
387 | type: array | |
388 | items: | |
389 | $ref: '#/components/schemas/Follow' | |
1569a818 | 390 | post: |
94ff4c23 | 391 | security: |
3e9e6f2f RK |
392 | - OAuth2: |
393 | - admin | |
1569a818 | 394 | tags: |
5776f78e | 395 | - Server Following |
2963c343 | 396 | summary: Follow a server |
1569a818 DG |
397 | responses: |
398 | '204': | |
3e9e6f2f RK |
399 | $ref: '#/paths/~1users~1me/put/responses/204' |
400 | requestBody: | |
401 | content: | |
402 | application/json: | |
403 | schema: | |
404 | $ref: '#/components/schemas/Follow' | |
1569a818 DG |
405 | /users: |
406 | post: | |
2963c343 | 407 | summary: Creates user |
94ff4c23 | 408 | security: |
3e9e6f2f RK |
409 | - OAuth2: |
410 | - admin | |
1569a818 DG |
411 | tags: |
412 | - User | |
1569a818 DG |
413 | responses: |
414 | '200': | |
415 | description: successful operation | |
3e9e6f2f RK |
416 | content: |
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 | |
1569a818 | 427 | get: |
2963c343 | 428 | summary: Get a list of users |
94ff4c23 | 429 | security: |
3e9e6f2f | 430 | - OAuth2: [] |
1569a818 DG |
431 | tags: |
432 | - User | |
44cb3b85 | 433 | parameters: |
3e9e6f2f RK |
434 | - $ref: '#/components/parameters/start' |
435 | - $ref: '#/components/parameters/count' | |
fd5af7a2 | 436 | - $ref: '#/components/parameters/usersSort' |
1569a818 DG |
437 | responses: |
438 | '200': | |
439 | description: successful operation | |
3e9e6f2f RK |
440 | content: |
441 | application/json: | |
442 | schema: | |
443 | type: array | |
444 | items: | |
445 | $ref: '#/components/schemas/User' | |
1569a818 DG |
446 | '/users/{id}': |
447 | delete: | |
2963c343 | 448 | summary: Delete a user by its id |
94ff4c23 | 449 | security: |
3e9e6f2f RK |
450 | - OAuth2: |
451 | - admin | |
1569a818 DG |
452 | tags: |
453 | - User | |
1569a818 | 454 | parameters: |
3e9e6f2f | 455 | - $ref: '#/components/parameters/id' |
1569a818 DG |
456 | responses: |
457 | '204': | |
3e9e6f2f | 458 | $ref: '#/paths/~1users~1me/put/responses/204' |
1569a818 | 459 | get: |
2963c343 | 460 | summary: Get user by its id |
94ff4c23 | 461 | security: |
3e9e6f2f | 462 | - OAuth2: [] |
1569a818 DG |
463 | tags: |
464 | - User | |
1569a818 | 465 | parameters: |
3e9e6f2f | 466 | - $ref: '#/components/parameters/id' |
1569a818 DG |
467 | responses: |
468 | '200': | |
469 | description: successful operation | |
3e9e6f2f RK |
470 | content: |
471 | application/json: | |
472 | schema: | |
473 | $ref: '#/components/schemas/User' | |
1569a818 | 474 | put: |
2963c343 | 475 | summary: Update user profile by its id |
94ff4c23 | 476 | security: |
3e9e6f2f | 477 | - OAuth2: [] |
1569a818 DG |
478 | tags: |
479 | - User | |
1569a818 | 480 | parameters: |
3e9e6f2f | 481 | - $ref: '#/components/parameters/id' |
1569a818 DG |
482 | responses: |
483 | '204': | |
3e9e6f2f RK |
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 | |
1569a818 DG |
491 | /users/me: |
492 | get: | |
2963c343 | 493 | summary: Get current user information |
94ff4c23 | 494 | security: |
e76d5784 RK |
495 | - OAuth2: |
496 | - user | |
1569a818 DG |
497 | tags: |
498 | - User | |
1569a818 DG |
499 | responses: |
500 | '200': | |
501 | description: successful operation | |
3e9e6f2f RK |
502 | content: |
503 | application/json: | |
504 | schema: | |
505 | type: array | |
506 | items: | |
507 | $ref: '#/components/schemas/User' | |
1569a818 | 508 | put: |
2963c343 | 509 | summary: Update current user information |
94ff4c23 | 510 | security: |
e76d5784 RK |
511 | - OAuth2: |
512 | - user | |
1569a818 DG |
513 | tags: |
514 | - User | |
1569a818 DG |
515 | responses: |
516 | '204': | |
3e9e6f2f RK |
517 | description: Successful operation |
518 | requestBody: | |
519 | content: | |
520 | application/json: | |
521 | schema: | |
522 | $ref: '#/components/schemas/UpdateMe' | |
523 | required: true | |
1569a818 DG |
524 | /users/me/video-quota-used: |
525 | get: | |
2963c343 | 526 | summary: Get current user used quota |
94ff4c23 | 527 | security: |
e76d5784 RK |
528 | - OAuth2: |
529 | - user | |
1569a818 DG |
530 | tags: |
531 | - User | |
1569a818 DG |
532 | responses: |
533 | '200': | |
534 | description: successful operation | |
3e9e6f2f RK |
535 | content: |
536 | application/json: | |
537 | schema: | |
538 | type: number | |
1569a818 DG |
539 | '/users/me/videos/{videoId}/rating': |
540 | get: | |
3e9e6f2f | 541 | summary: 'Get rating of video by its id, among those of the current user' |
94ff4c23 | 542 | security: |
3e9e6f2f | 543 | - OAuth2: [] |
1569a818 DG |
544 | tags: |
545 | - User | |
1569a818 DG |
546 | parameters: |
547 | - name: videoId | |
548 | in: path | |
549 | required: true | |
1569a818 | 550 | description: 'The video id ' |
3e9e6f2f RK |
551 | schema: |
552 | type: string | |
1569a818 DG |
553 | responses: |
554 | '200': | |
555 | description: successful operation | |
3e9e6f2f RK |
556 | content: |
557 | application/json: | |
558 | schema: | |
559 | $ref: '#/components/schemas/GetMeVideoRating' | |
1569a818 DG |
560 | /users/me/videos: |
561 | get: | |
2963c343 | 562 | summary: Get videos of the current user |
94ff4c23 | 563 | security: |
e76d5784 RK |
564 | - OAuth2: |
565 | - user | |
1569a818 DG |
566 | tags: |
567 | - User | |
44cb3b85 | 568 | parameters: |
3e9e6f2f RK |
569 | - $ref: '#/components/parameters/start' |
570 | - $ref: '#/components/parameters/count' | |
571 | - $ref: '#/components/parameters/sort' | |
1569a818 DG |
572 | responses: |
573 | '200': | |
574 | description: successful operation | |
3e9e6f2f RK |
575 | content: |
576 | application/json: | |
577 | schema: | |
578 | type: array | |
579 | items: | |
580 | $ref: '#/components/schemas/Video' | |
e76d5784 RK |
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' | |
593 | responses: | |
594 | '200': | |
595 | description: successful operation | |
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 | |
612 | tags: | |
613 | - User | |
614 | parameters: | |
615 | - $ref: '#/components/parameters/subscriptionsUris' | |
616 | responses: | |
617 | '200': | |
618 | description: successful operation | |
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 | |
1569a818 DG |
669 | /users/register: |
670 | post: | |
2963c343 | 671 | summary: Register a user |
1569a818 DG |
672 | tags: |
673 | - User | |
1569a818 DG |
674 | responses: |
675 | '204': | |
3e9e6f2f RK |
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 | |
1569a818 DG |
683 | /users/me/avatar/pick: |
684 | post: | |
2963c343 | 685 | summary: Update current user avatar |
94ff4c23 | 686 | security: |
3e9e6f2f | 687 | - OAuth2: [] |
1569a818 DG |
688 | tags: |
689 | - User | |
1569a818 DG |
690 | responses: |
691 | '200': | |
692 | description: successful operation | |
3e9e6f2f RK |
693 | content: |
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 | |
c360c494 | 711 | /videos: |
1569a818 | 712 | get: |
2963c343 | 713 | summary: Get list of videos |
1569a818 DG |
714 | tags: |
715 | - Video | |
44cb3b85 | 716 | parameters: |
fd5af7a2 RK |
717 | - $ref: '#/components/parameters/categoryOneOf' |
718 | - $ref: '#/components/parameters/tagsOneOf' | |
719 | - $ref: '#/components/parameters/tagsAllOf' | |
720 | - $ref: '#/components/parameters/licenceOneOf' | |
721 | - $ref: '#/components/parameters/languageOneOf' | |
722 | - $ref: '#/components/parameters/nsfw' | |
723 | - $ref: '#/components/parameters/filter' | |
3e9e6f2f RK |
724 | - $ref: '#/components/parameters/start' |
725 | - $ref: '#/components/parameters/count' | |
fd5af7a2 | 726 | - $ref: '#/components/parameters/videosSort' |
1569a818 DG |
727 | responses: |
728 | '200': | |
729 | description: successful operation | |
3e9e6f2f RK |
730 | content: |
731 | application/json: | |
732 | schema: | |
733 | type: array | |
734 | items: | |
735 | $ref: '#/components/schemas/Video' | |
c360c494 | 736 | /videos/categories: |
1569a818 | 737 | get: |
2963c343 | 738 | summary: Get list of video licences known by the server |
1569a818 DG |
739 | tags: |
740 | - Video | |
1569a818 DG |
741 | responses: |
742 | '200': | |
743 | description: successful operation | |
3e9e6f2f RK |
744 | content: |
745 | application/json: | |
746 | schema: | |
747 | type: array | |
748 | items: | |
749 | type: string | |
c360c494 | 750 | /videos/licences: |
1569a818 | 751 | get: |
2963c343 | 752 | summary: Get list of video licences known by the server |
1569a818 DG |
753 | tags: |
754 | - Video | |
1569a818 DG |
755 | responses: |
756 | '200': | |
757 | description: successful operation | |
3e9e6f2f RK |
758 | content: |
759 | application/json: | |
760 | schema: | |
761 | type: array | |
762 | items: | |
763 | type: string | |
c360c494 | 764 | /videos/languages: |
1569a818 | 765 | get: |
2963c343 | 766 | summary: Get list of languages known by the server |
1569a818 DG |
767 | tags: |
768 | - Video | |
1569a818 DG |
769 | responses: |
770 | '200': | |
771 | description: successful operation | |
3e9e6f2f RK |
772 | content: |
773 | application/json: | |
774 | schema: | |
775 | type: array | |
776 | items: | |
777 | type: string | |
c360c494 | 778 | /videos/privacies: |
1569a818 | 779 | get: |
2963c343 | 780 | summary: Get list of privacy policies supported by the server |
1569a818 DG |
781 | tags: |
782 | - Video | |
1569a818 DG |
783 | responses: |
784 | '200': | |
785 | description: successful operation | |
3e9e6f2f RK |
786 | content: |
787 | application/json: | |
788 | schema: | |
789 | type: array | |
790 | items: | |
791 | type: string | |
792 | '/videos/{id}': | |
1569a818 | 793 | put: |
2963c343 | 794 | summary: Update metadata for a video by its id |
94ff4c23 | 795 | security: |
3e9e6f2f | 796 | - OAuth2: [] |
1569a818 DG |
797 | tags: |
798 | - Video | |
1569a818 | 799 | parameters: |
3e9e6f2f | 800 | - $ref: '#/components/parameters/id2' |
1569a818 DG |
801 | responses: |
802 | '200': | |
803 | description: successful operation | |
3e9e6f2f RK |
804 | content: |
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: | |
12fed49e | 845 | description: Video tags (maximum 5 tags each between 2 and 30 characters) |
1fd12c7c C |
846 | type: array |
847 | items: | |
848 | type: string | |
3e9e6f2f RK |
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 | |
1569a818 | 867 | get: |
2963c343 | 868 | summary: Get a video by its id |
1569a818 DG |
869 | tags: |
870 | - Video | |
1569a818 | 871 | parameters: |
3e9e6f2f | 872 | - $ref: '#/components/parameters/id2' |
1569a818 DG |
873 | responses: |
874 | '200': | |
875 | description: successful operation | |
3e9e6f2f RK |
876 | content: |
877 | application/json: | |
878 | schema: | |
879 | $ref: '#/components/schemas/Video' | |
1569a818 | 880 | delete: |
2963c343 | 881 | summary: Delete a video by its id |
94ff4c23 | 882 | security: |
3e9e6f2f | 883 | - OAuth2: [] |
1569a818 DG |
884 | tags: |
885 | - Video | |
1569a818 | 886 | parameters: |
3e9e6f2f | 887 | - $ref: '#/components/parameters/id2' |
1569a818 DG |
888 | responses: |
889 | '204': | |
3e9e6f2f RK |
890 | $ref: '#/paths/~1users~1me/put/responses/204' |
891 | '/videos/{id}/description': | |
1569a818 | 892 | get: |
2963c343 | 893 | summary: Get a video description by its id |
1569a818 DG |
894 | tags: |
895 | - Video | |
1569a818 | 896 | parameters: |
3e9e6f2f | 897 | - $ref: '#/components/parameters/id2' |
1569a818 DG |
898 | responses: |
899 | '200': | |
900 | description: successful operation | |
3e9e6f2f RK |
901 | content: |
902 | application/json: | |
903 | schema: | |
904 | type: string | |
905 | '/videos/{id}/views': | |
1569a818 | 906 | post: |
2963c343 | 907 | summary: Add a view to the video by its id |
1569a818 DG |
908 | tags: |
909 | - Video | |
1569a818 | 910 | parameters: |
3e9e6f2f | 911 | - $ref: '#/components/parameters/id2' |
1569a818 DG |
912 | responses: |
913 | '204': | |
3e9e6f2f | 914 | $ref: '#/paths/~1users~1me/put/responses/204' |
6441981b RK |
915 | '/videos/{id}/watching': |
916 | put: | |
f50ab1c2 | 917 | summary: Set watching progress of a video by its id for a user |
6441981b RK |
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': | |
946 | post: | |
947 | summary: Refuse ownership change request for video by its id | |
948 | tags: | |
949 | - Video | |
950 | security: | |
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 | |
960 | tags: | |
961 | - Video | |
962 | security: | |
963 | - OAuth2: [] | |
964 | parameters: | |
965 | - $ref: '#/components/parameters/id2' | |
966 | responses: | |
967 | '204': | |
968 | $ref: '#/paths/~1users~1me/put/responses/204' | |
969 | '/videos/{id}/give-ownership': | |
970 | post: | |
971 | summary: Request change of ownership for a video you own, by its id | |
972 | tags: | |
973 | - Video | |
974 | security: | |
975 | - OAuth2: [] | |
976 | parameters: | |
977 | - $ref: '#/components/parameters/id2' | |
978 | requestBody: | |
979 | required: true | |
980 | content: | |
981 | application/x-www-form-urlencoded: | |
982 | schema: | |
983 | type: object | |
984 | properties: | |
985 | username: | |
986 | type: string | |
987 | required: | |
988 | - username | |
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' | |
c360c494 | 994 | /videos/upload: |
1569a818 | 995 | post: |
2963c343 | 996 | summary: Upload a video file with its metadata |
94ff4c23 | 997 | security: |
3e9e6f2f | 998 | - OAuth2: [] |
1569a818 DG |
999 | tags: |
1000 | - Video | |
1569a818 DG |
1001 | responses: |
1002 | '200': | |
1003 | description: successful operation | |
3e9e6f2f RK |
1004 | content: |
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 | |
8f9e8be1 RK |
1027 | privacy: |
1028 | $ref: '#/components/schemas/VideoPrivacy' | |
3e9e6f2f RK |
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 | |
1fd12c7c C |
1055 | type: array |
1056 | items: | |
1057 | type: string | |
3e9e6f2f RK |
1058 | commentsEnabled: |
1059 | description: Enable or disable comments for this video | |
1060 | type: string | |
1061 | scheduleUpdate: *ref_0 | |
1062 | required: | |
1063 | - videofile | |
1064 | - channelId | |
8f9e8be1 | 1065 | - name |
8f9e8be1 RK |
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>" | |
8f9e8be1 RK |
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 \ | |
8f9e8be1 | 1091 | "Authorization:Bearer $token" |
28c8e63e C |
1092 | /videos/imports: |
1093 | post: | |
1094 | summary: Import a torrent or magnetURI or HTTP ressource (if enabled by the instance administrator) | |
1095 | security: | |
1096 | - OAuth2: [] | |
1097 | tags: | |
1098 | - Video | |
1099 | responses: | |
1100 | '200': | |
1101 | description: successful operation | |
1102 | content: | |
1103 | application/json: | |
1104 | schema: | |
1105 | $ref: '#/components/schemas/VideoUploadResponse' | |
1106 | requestBody: | |
1107 | content: | |
1108 | multipart/form-data: | |
1109 | schema: | |
1110 | type: object | |
1111 | properties: | |
1112 | torrentfile: | |
1113 | description: Torrent File | |
1114 | type: string | |
1115 | format: binary | |
1116 | targetUrl: | |
1117 | description: HTTP target URL | |
1118 | type: string | |
1119 | magnetUri: | |
1120 | description: Magnet URI | |
1121 | type: string | |
1122 | channelId: | |
1123 | description: Channel id that will contain this video | |
1124 | type: number | |
1125 | thumbnailfile: | |
1126 | description: Video thumbnail file | |
1127 | type: string | |
1128 | previewfile: | |
1129 | description: Video preview file | |
1130 | type: string | |
1131 | privacy: | |
1132 | $ref: '#/components/schemas/VideoPrivacy' | |
1133 | category: | |
1134 | description: Video category | |
1135 | type: string | |
1136 | licence: | |
1137 | description: Video licence | |
1138 | type: string | |
1139 | language: | |
1140 | description: Video language | |
1141 | type: string | |
1142 | description: | |
1143 | description: Video description | |
1144 | type: string | |
1145 | waitTranscoding: | |
1146 | description: Whether or not we wait transcoding before publish the video | |
1147 | type: string | |
1148 | support: | |
1149 | description: Text describing how to support the video uploader | |
1150 | type: string | |
1151 | nsfw: | |
1152 | description: Whether or not this video contains sensitive content | |
1153 | type: string | |
1154 | name: | |
1155 | description: Video name | |
1156 | type: string | |
1157 | tags: | |
1158 | description: Video tags | |
1159 | type: array | |
1160 | items: | |
1161 | type: string | |
1162 | commentsEnabled: | |
1163 | description: Enable or disable comments for this video | |
1164 | type: string | |
1165 | scheduleUpdate: *ref_0 | |
1166 | required: | |
1167 | - channelId | |
1168 | - name | |
c360c494 | 1169 | /videos/abuse: |
1569a818 | 1170 | get: |
2963c343 | 1171 | summary: Get list of reported video abuses |
94ff4c23 | 1172 | security: |
3e9e6f2f | 1173 | - OAuth2: [] |
1569a818 | 1174 | tags: |
5776f78e | 1175 | - Video Abuse |
44cb3b85 | 1176 | parameters: |
3e9e6f2f RK |
1177 | - $ref: '#/components/parameters/start' |
1178 | - $ref: '#/components/parameters/count' | |
fd5af7a2 | 1179 | - $ref: '#/components/parameters/abusesSort' |
1569a818 DG |
1180 | responses: |
1181 | '200': | |
1182 | description: successful operation | |
3e9e6f2f RK |
1183 | content: |
1184 | application/json: | |
1185 | schema: | |
1186 | type: array | |
1187 | items: | |
1188 | $ref: '#/components/schemas/VideoAbuse' | |
1189 | '/videos/{id}/abuse': | |
1569a818 | 1190 | post: |
3e9e6f2f | 1191 | summary: 'Report an abuse, on a video by its id' |
94ff4c23 | 1192 | security: |
3e9e6f2f | 1193 | - OAuth2: [] |
1569a818 | 1194 | tags: |
5776f78e | 1195 | - Video Abuse |
1569a818 | 1196 | parameters: |
3e9e6f2f | 1197 | - $ref: '#/components/parameters/id2' |
1569a818 DG |
1198 | responses: |
1199 | '204': | |
3e9e6f2f RK |
1200 | $ref: '#/paths/~1users~1me/put/responses/204' |
1201 | '/videos/{id}/blacklist': | |
1569a818 | 1202 | post: |
2963c343 | 1203 | summary: Put on blacklist a video by its id |
94ff4c23 | 1204 | security: |
3e9e6f2f RK |
1205 | - OAuth2: |
1206 | - admin | |
1207 | - moderator | |
1569a818 | 1208 | tags: |
5776f78e | 1209 | - Video Blacklist |
1569a818 | 1210 | parameters: |
3e9e6f2f | 1211 | - $ref: '#/components/parameters/id2' |
1569a818 DG |
1212 | responses: |
1213 | '204': | |
3e9e6f2f | 1214 | $ref: '#/paths/~1users~1me/put/responses/204' |
1569a818 | 1215 | delete: |
2963c343 | 1216 | summary: Delete an entry of the blacklist of a video by its id |
94ff4c23 | 1217 | security: |
3e9e6f2f RK |
1218 | - OAuth2: |
1219 | - admin | |
1220 | - moderator | |
1569a818 | 1221 | tags: |
5776f78e | 1222 | - Video Blacklist |
1569a818 | 1223 | parameters: |
3e9e6f2f | 1224 | - $ref: '#/components/parameters/id2' |
1569a818 DG |
1225 | responses: |
1226 | '204': | |
3e9e6f2f | 1227 | $ref: '#/paths/~1users~1me/put/responses/204' |
c360c494 | 1228 | /videos/blacklist: |
1569a818 | 1229 | get: |
2963c343 | 1230 | summary: Get list of videos on blacklist |
94ff4c23 | 1231 | security: |
3e9e6f2f RK |
1232 | - OAuth2: |
1233 | - admin | |
1234 | - moderator | |
1569a818 | 1235 | tags: |
5776f78e | 1236 | - Video Blacklist |
44cb3b85 | 1237 | parameters: |
3e9e6f2f RK |
1238 | - $ref: '#/components/parameters/start' |
1239 | - $ref: '#/components/parameters/count' | |
fd5af7a2 | 1240 | - $ref: '#/components/parameters/blacklistsSort' |
1569a818 DG |
1241 | responses: |
1242 | '200': | |
1243 | description: successful operation | |
3e9e6f2f RK |
1244 | content: |
1245 | application/json: | |
1246 | schema: | |
1247 | type: array | |
1248 | items: | |
1249 | $ref: '#/components/schemas/VideoBlacklist' | |
48dce1c9 | 1250 | /video-channels: |
1569a818 | 1251 | get: |
2963c343 | 1252 | summary: Get list of video channels |
1569a818 | 1253 | tags: |
5776f78e | 1254 | - Video Channel |
44cb3b85 | 1255 | parameters: |
3e9e6f2f RK |
1256 | - $ref: '#/components/parameters/start' |
1257 | - $ref: '#/components/parameters/count' | |
1258 | - $ref: '#/components/parameters/sort' | |
1569a818 DG |
1259 | responses: |
1260 | '200': | |
1261 | description: successful operation | |
3e9e6f2f RK |
1262 | content: |
1263 | application/json: | |
1264 | schema: | |
1265 | type: array | |
1266 | items: | |
1267 | $ref: '#/components/schemas/VideoChannel' | |
1569a818 | 1268 | post: |
2963c343 | 1269 | summary: Creates a video channel for the current user |
94ff4c23 | 1270 | security: |
3e9e6f2f | 1271 | - OAuth2: [] |
1569a818 | 1272 | tags: |
5776f78e | 1273 | - Video Channel |
1569a818 DG |
1274 | responses: |
1275 | '204': | |
3e9e6f2f RK |
1276 | $ref: '#/paths/~1users~1me/put/responses/204' |
1277 | requestBody: | |
1278 | $ref: '#/components/requestBodies/VideoChannelInput' | |
9ce3d302 | 1279 | '/video-channels/{channelHandle}': |
1569a818 | 1280 | get: |
2963c343 | 1281 | summary: Get a video channel by its id |
1569a818 | 1282 | tags: |
5776f78e | 1283 | - Video Channel |
1569a818 | 1284 | parameters: |
9ce3d302 | 1285 | - $ref: '#/components/parameters/channelHandle' |
1569a818 DG |
1286 | responses: |
1287 | '200': | |
1288 | description: successful operation | |
3e9e6f2f RK |
1289 | content: |
1290 | application/json: | |
1291 | schema: | |
1292 | $ref: '#/components/schemas/VideoChannel' | |
1569a818 | 1293 | put: |
2963c343 | 1294 | summary: Update a video channel by its id |
94ff4c23 | 1295 | security: |
3e9e6f2f | 1296 | - OAuth2: [] |
1569a818 | 1297 | tags: |
5776f78e | 1298 | - Video Channel |
1569a818 | 1299 | parameters: |
9ce3d302 | 1300 | - $ref: '#/components/parameters/channelHandle' |
1569a818 DG |
1301 | responses: |
1302 | '204': | |
3e9e6f2f RK |
1303 | $ref: '#/paths/~1users~1me/put/responses/204' |
1304 | requestBody: | |
1305 | $ref: '#/components/requestBodies/VideoChannelInput' | |
1569a818 | 1306 | delete: |
2963c343 | 1307 | summary: Delete a video channel by its id |
94ff4c23 | 1308 | security: |
3e9e6f2f | 1309 | - OAuth2: [] |
1569a818 | 1310 | tags: |
5776f78e | 1311 | - Video Channel |
1569a818 | 1312 | parameters: |
9ce3d302 | 1313 | - $ref: '#/components/parameters/channelHandle' |
cc918ac3 C |
1314 | responses: |
1315 | '204': | |
3e9e6f2f | 1316 | $ref: '#/paths/~1users~1me/put/responses/204' |
9ce3d302 | 1317 | '/video-channels/{channelHandle}/videos': |
cc918ac3 | 1318 | get: |
2963c343 | 1319 | summary: Get videos of a video channel by its id |
cc918ac3 | 1320 | tags: |
5776f78e | 1321 | - Video Channel |
cc918ac3 | 1322 | parameters: |
9ce3d302 | 1323 | - $ref: '#/components/parameters/channelHandle' |
1569a818 | 1324 | responses: |
cc918ac3 | 1325 | '200': |
1569a818 | 1326 | description: successful operation |
3e9e6f2f RK |
1327 | content: |
1328 | application/json: | |
1329 | schema: | |
1330 | $ref: '#/components/schemas/Video' | |
1331 | '/accounts/{name}/video-channels': | |
6b738c7a | 1332 | get: |
2963c343 | 1333 | summary: Get video channels of an account by its name |
6b738c7a | 1334 | tags: |
5776f78e | 1335 | - Video Channel |
6b738c7a | 1336 | parameters: |
3e9e6f2f | 1337 | - $ref: '#/components/parameters/name' |
6b738c7a C |
1338 | responses: |
1339 | '200': | |
1340 | description: successful operation | |
3e9e6f2f RK |
1341 | content: |
1342 | application/json: | |
1343 | schema: | |
1344 | type: array | |
1345 | items: | |
1346 | $ref: '#/components/schemas/VideoChannel' | |
c100a614 YB |
1347 | '/accounts/{name}/ratings': |
1348 | get: | |
1349 | summary: Get ratings of an account by its name | |
1350 | security: | |
1351 | - OAuth2: [] | |
1352 | tags: | |
1353 | - User | |
1354 | parameters: | |
1355 | - $ref: '#/components/parameters/start' | |
1356 | - $ref: '#/components/parameters/count' | |
1357 | - $ref: '#/components/parameters/sort' | |
1358 | - name: rating | |
1359 | in: query | |
1360 | required: false | |
1361 | description: Optionaly filter which ratings to retrieve | |
1362 | schema: | |
1363 | type: string | |
1364 | enum: | |
1365 | - like | |
1366 | - dislike | |
1367 | responses: | |
1368 | '200': | |
1369 | description: successful operation | |
1370 | content: | |
1371 | application/json: | |
1372 | schema: | |
1373 | type: array | |
1374 | items: | |
1375 | $ref: '#/components/schemas/VideoRating' | |
3e9e6f2f | 1376 | '/videos/{id}/comment-threads': |
1569a818 | 1377 | get: |
2963c343 | 1378 | summary: Get the comment threads of a video by its id |
1569a818 | 1379 | tags: |
5776f78e | 1380 | - Video Comment |
1569a818 | 1381 | parameters: |
3e9e6f2f RK |
1382 | - $ref: '#/components/parameters/id2' |
1383 | - $ref: '#/components/parameters/start' | |
1384 | - $ref: '#/components/parameters/count' | |
1385 | - $ref: '#/components/parameters/sort' | |
1569a818 DG |
1386 | responses: |
1387 | '200': | |
1388 | description: successful operation | |
3e9e6f2f RK |
1389 | content: |
1390 | application/json: | |
1391 | schema: | |
1392 | $ref: '#/components/schemas/CommentThreadResponse' | |
1569a818 | 1393 | post: |
3e9e6f2f | 1394 | summary: 'Creates a comment thread, on a video by its id' |
94ff4c23 | 1395 | security: |
3e9e6f2f | 1396 | - OAuth2: [] |
1569a818 | 1397 | tags: |
5776f78e | 1398 | - Video Comment |
1569a818 | 1399 | parameters: |
3e9e6f2f | 1400 | - $ref: '#/components/parameters/id2' |
1569a818 DG |
1401 | responses: |
1402 | '200': | |
1403 | description: successful operation | |
3e9e6f2f RK |
1404 | content: |
1405 | application/json: | |
1406 | schema: | |
1407 | $ref: '#/components/schemas/CommentThreadPostResponse' | |
1408 | '/videos/{id}/comment-threads/{threadId}': | |
1569a818 | 1409 | get: |
3e9e6f2f | 1410 | summary: 'Get the comment thread by its id, of a video by its id' |
1569a818 | 1411 | tags: |
5776f78e | 1412 | - Video Comment |
1569a818 | 1413 | parameters: |
3e9e6f2f RK |
1414 | - $ref: '#/components/parameters/id2' |
1415 | - name: threadId | |
1416 | in: path | |
1417 | required: true | |
1418 | description: The thread id (root comment id) | |
1419 | schema: | |
1420 | type: number | |
1569a818 DG |
1421 | responses: |
1422 | '200': | |
1423 | description: successful operation | |
3e9e6f2f RK |
1424 | content: |
1425 | application/json: | |
1426 | schema: | |
1427 | $ref: '#/components/schemas/VideoCommentThreadTree' | |
1428 | '/videos/{id}/comments/{commentId}': | |
1569a818 | 1429 | post: |
3e9e6f2f | 1430 | summary: 'Creates a comment in a comment thread by its id, of a video by its id' |
94ff4c23 | 1431 | security: |
3e9e6f2f | 1432 | - OAuth2: [] |
1569a818 | 1433 | tags: |
5776f78e | 1434 | - Video Comment |
1569a818 | 1435 | parameters: |
3e9e6f2f RK |
1436 | - $ref: '#/components/parameters/id2' |
1437 | - $ref: '#/components/parameters/commentId' | |
1569a818 DG |
1438 | responses: |
1439 | '200': | |
1440 | description: successful operation | |
3e9e6f2f RK |
1441 | content: |
1442 | application/json: | |
1443 | schema: | |
1444 | $ref: '#/components/schemas/CommentThreadPostResponse' | |
1569a818 | 1445 | delete: |
3e9e6f2f | 1446 | summary: 'Delete a comment in a comment therad by its id, of a video by its id' |
94ff4c23 | 1447 | security: |
3e9e6f2f | 1448 | - OAuth2: [] |
1569a818 | 1449 | tags: |
5776f78e | 1450 | - Video Comment |
1569a818 | 1451 | parameters: |
3e9e6f2f RK |
1452 | - $ref: '#/components/parameters/id2' |
1453 | - $ref: '#/components/parameters/commentId' | |
1569a818 DG |
1454 | responses: |
1455 | '204': | |
3e9e6f2f RK |
1456 | $ref: '#/paths/~1users~1me/put/responses/204' |
1457 | '/videos/{id}/rate': | |
1569a818 | 1458 | put: |
2963c343 | 1459 | summary: Vote for a video by its id |
94ff4c23 | 1460 | security: |
3e9e6f2f | 1461 | - OAuth2: [] |
1569a818 | 1462 | tags: |
5776f78e | 1463 | - Video Rate |
1569a818 | 1464 | parameters: |
3e9e6f2f | 1465 | - $ref: '#/components/parameters/id2' |
1569a818 DG |
1466 | responses: |
1467 | '204': | |
3e9e6f2f | 1468 | $ref: '#/paths/~1users~1me/put/responses/204' |
fb72c193 DL |
1469 | /search/videos: |
1470 | get: | |
1471 | tags: | |
1472 | - Search | |
2963c343 | 1473 | summary: Get the videos corresponding to a given query |
fb72c193 | 1474 | parameters: |
3e9e6f2f RK |
1475 | - $ref: '#/components/parameters/start' |
1476 | - $ref: '#/components/parameters/count' | |
fd5af7a2 | 1477 | - $ref: '#/components/parameters/videosSearchSort' |
655b5490 | 1478 | - name: search |
fb72c193 DL |
1479 | in: query |
1480 | required: true | |
3e9e6f2f RK |
1481 | description: String to search |
1482 | schema: | |
1483 | type: string | |
fb72c193 DL |
1484 | responses: |
1485 | '200': | |
1486 | description: successful operation | |
3e9e6f2f RK |
1487 | content: |
1488 | application/json: | |
1489 | schema: | |
1569a818 DG |
1490 | type: array |
1491 | items: | |
3e9e6f2f RK |
1492 | $ref: '#/components/schemas/Video' |
1493 | servers: | |
6441981b RK |
1494 | - url: 'https://peertube.cpy.re/api/v1' |
1495 | description: Live Test Server (live data - stable version) | |
8f9e8be1 | 1496 | - url: 'https://peertube2.cpy.re/api/v1' |
6441981b RK |
1497 | description: Live Test Server (live data - bleeding edge version) |
1498 | - url: 'https://peertube3.cpy.re/api/v1' | |
1499 | description: Live Test Server (live data - bleeding edge version) | |
3e9e6f2f RK |
1500 | components: |
1501 | parameters: | |
1502 | start: | |
1503 | name: start | |
1504 | in: query | |
1505 | required: false | |
1506 | description: Offset | |
1507 | schema: | |
1569a818 | 1508 | type: number |
3e9e6f2f RK |
1509 | count: |
1510 | name: count | |
1511 | in: query | |
1512 | required: false | |
1513 | description: Number of items | |
1514 | schema: | |
1569a818 | 1515 | type: number |
3e9e6f2f RK |
1516 | sort: |
1517 | name: sort | |
1518 | in: query | |
1519 | required: false | |
1520 | description: Sort column (-createdAt for example) | |
1521 | schema: | |
1522 | type: string | |
fd5af7a2 RK |
1523 | videosSort: |
1524 | name: sort | |
1525 | in: query | |
1526 | required: false | |
1527 | description: Sort videos by criteria | |
1528 | schema: | |
1529 | type: string | |
1530 | enum: | |
1531 | - -name | |
1532 | - -duration | |
1533 | - -createdAt | |
1534 | - -publishedAt | |
1535 | - -views | |
1536 | - -likes | |
1537 | - -trending | |
1538 | videosSearchSort: | |
1539 | name: sort | |
1540 | in: query | |
1541 | required: false | |
1542 | description: Sort videos by criteria | |
1543 | schema: | |
1544 | type: string | |
1545 | enum: | |
1546 | - -name | |
1547 | - -duration | |
1548 | - -createdAt | |
1549 | - -publishedAt | |
1550 | - -views | |
1551 | - -likes | |
1552 | - -match | |
1553 | blacklistsSort: | |
1554 | name: sort | |
1555 | in: query | |
1556 | required: false | |
1557 | description: Sort blacklists by criteria | |
1558 | schema: | |
1559 | type: string | |
1560 | enum: | |
1561 | - -id | |
1562 | - -name | |
1563 | - -duration | |
1564 | - -views | |
1565 | - -likes | |
1566 | - -dislikes | |
1567 | - -uuid | |
1568 | - -createdAt | |
1569 | usersSort: | |
1570 | name: sort | |
1571 | in: query | |
1572 | required: false | |
1573 | description: Sort users by criteria | |
1574 | schema: | |
1575 | type: string | |
1576 | enum: | |
1577 | - -id | |
1578 | - -username | |
1579 | - -createdAt | |
1580 | abusesSort: | |
1581 | name: sort | |
1582 | in: query | |
1583 | required: false | |
1584 | description: Sort abuses by criteria | |
1585 | schema: | |
1586 | type: string | |
1587 | enum: | |
1588 | - -id | |
1589 | - -createdAt | |
1590 | - -state | |
3e9e6f2f RK |
1591 | name: |
1592 | name: name | |
1593 | in: path | |
1594 | required: true | |
1595 | description: >- | |
1596 | The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for | |
1597 | example) | |
1598 | schema: | |
1599 | type: string | |
1600 | id: | |
1601 | name: id | |
1602 | in: path | |
1603 | required: true | |
1604 | description: The user id | |
1605 | schema: | |
1569a818 | 1606 | type: number |
3e9e6f2f RK |
1607 | id2: |
1608 | name: id | |
1609 | in: path | |
1610 | required: true | |
1611 | description: The video id or uuid | |
1612 | schema: | |
1613 | type: string | |
9ce3d302 C |
1614 | channelHandle: |
1615 | name: channelHandle | |
3e9e6f2f RK |
1616 | in: path |
1617 | required: true | |
9ce3d302 | 1618 | description: "The video channel handle (example: 'my_username@example.com' or 'my_username')" |
3e9e6f2f RK |
1619 | schema: |
1620 | type: string | |
1621 | commentId: | |
1622 | name: threadId | |
1623 | in: path | |
1624 | required: true | |
1625 | description: The comment id | |
1626 | schema: | |
c360c494 | 1627 | type: number |
fd5af7a2 RK |
1628 | categoryOneOf: |
1629 | name: categoryOneOf | |
1630 | in: query | |
1631 | required: false | |
1632 | description: category id of the video | |
1633 | schema: | |
1634 | oneOf: | |
1635 | - type: number | |
1636 | - type: array | |
1637 | items: | |
1638 | type: number | |
2beb9895 RK |
1639 | style: form |
1640 | explode: false | |
fd5af7a2 RK |
1641 | tagsOneOf: |
1642 | name: tagsOneOf | |
1643 | in: query | |
1644 | required: false | |
1645 | description: tag(s) of the video | |
1646 | schema: | |
1647 | oneOf: | |
1648 | - type: string | |
1649 | - type: array | |
1650 | items: | |
1651 | type: string | |
2beb9895 RK |
1652 | style: form |
1653 | explode: false | |
fd5af7a2 RK |
1654 | tagsAllOf: |
1655 | name: tagsAllOf | |
1656 | in: query | |
1657 | required: false | |
1658 | description: tag(s) of the video, where all should be present in the video | |
1659 | schema: | |
1660 | oneOf: | |
1661 | - type: string | |
1662 | - type: array | |
1663 | items: | |
1664 | type: string | |
2beb9895 RK |
1665 | style: form |
1666 | explode: false | |
fd5af7a2 RK |
1667 | languageOneOf: |
1668 | name: languageOneOf | |
1669 | in: query | |
1670 | required: false | |
1671 | description: language id of the video | |
1672 | schema: | |
1673 | oneOf: | |
2beb9895 | 1674 | - type: string |
fd5af7a2 RK |
1675 | - type: array |
1676 | items: | |
2beb9895 RK |
1677 | type: string |
1678 | style: form | |
1679 | explode: false | |
fd5af7a2 RK |
1680 | licenceOneOf: |
1681 | name: licenceOneOf | |
1682 | in: query | |
1683 | required: false | |
1684 | description: licence id of the video | |
1685 | schema: | |
1686 | oneOf: | |
1687 | - type: number | |
1688 | - type: array | |
1689 | items: | |
1690 | type: number | |
2beb9895 RK |
1691 | style: form |
1692 | explode: false | |
fd5af7a2 RK |
1693 | nsfw: |
1694 | name: nsfw | |
1695 | in: query | |
1696 | required: false | |
1697 | description: whether to include nsfw videos, if any | |
1698 | schema: | |
1699 | type: string | |
1700 | enum: | |
1701 | - 'true' | |
1702 | - 'false' | |
1703 | filter: | |
1704 | name: filter | |
1705 | in: query | |
1706 | required: false | |
1707 | description: > | |
1708 | Special filters (local for instance) which might require special rights: | |
1709 | * `local` - only videos local to the instance | |
1710 | * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges) | |
1711 | schema: | |
1712 | type: string | |
1713 | enum: | |
1714 | - local | |
1715 | - all-local | |
e76d5784 RK |
1716 | subscriptionsUris: |
1717 | name: uris | |
1718 | in: query | |
1719 | required: true | |
1720 | description: list of uris to check if each is part of the user subscriptions | |
1721 | schema: | |
1722 | type: array | |
1723 | items: | |
1724 | type: string | |
3e9e6f2f RK |
1725 | requestBodies: |
1726 | VideoChannelInput: | |
1727 | content: | |
1728 | application/json: | |
1729 | schema: | |
1730 | $ref: '#/components/schemas/VideoChannelInput' | |
1731 | securitySchemes: | |
1732 | OAuth2: | |
1733 | description: > | |
1734 | In the header: *Authorization: Bearer <token\>* | |
1735 | ||
1736 | ||
1737 | Authenticating via OAuth requires the following steps: | |
1738 | ||
1739 | ||
1740 | - Have an account with sufficient authorization levels | |
1741 | ||
1742 | - [Generate](https://docs.joinpeertube.org/lang/en/devdocs/rest.html) a | |
1743 | Bearer Token | |
1744 | ||
1745 | - Make Authenticated Requests | |
1746 | type: oauth2 | |
1747 | flows: | |
1748 | password: | |
1749 | tokenUrl: 'https://peertube.example.com/api/v1/users/token' | |
1750 | scopes: | |
1751 | admin: Admin scope | |
1752 | moderator: Moderator scope | |
1753 | user: User scope | |
1754 | schemas: | |
1755 | VideoConstantNumber: | |
1756 | properties: | |
1757 | id: | |
1758 | type: number | |
1759 | label: | |
1760 | type: string | |
1761 | VideoConstantString: | |
1762 | properties: | |
1763 | id: | |
1764 | type: string | |
1765 | label: | |
1766 | type: string | |
1767 | VideoPrivacy: | |
1768 | type: string | |
1769 | enum: | |
1770 | - Public | |
1771 | - Unlisted | |
1772 | - Private | |
1773 | Video: | |
1774 | properties: | |
1775 | id: | |
1776 | type: number | |
1777 | uuid: | |
1778 | type: string | |
1779 | createdAt: | |
1780 | type: string | |
1781 | publishedAt: | |
1782 | type: string | |
1783 | updatedAt: | |
1784 | type: string | |
1785 | category: | |
1786 | $ref: '#/components/schemas/VideoConstantNumber' | |
1787 | licence: | |
1788 | $ref: '#/components/schemas/VideoConstantNumber' | |
1789 | language: | |
1790 | $ref: '#/components/schemas/VideoConstantString' | |
1791 | privacy: | |
1792 | $ref: '#/components/schemas/VideoPrivacy' | |
1793 | description: | |
1794 | type: string | |
1795 | duration: | |
1796 | type: number | |
1797 | isLocal: | |
1798 | type: boolean | |
1799 | name: | |
1800 | type: string | |
1801 | thumbnailPath: | |
1802 | type: string | |
1803 | previewPath: | |
1804 | type: string | |
1805 | embedPath: | |
1806 | type: string | |
1807 | views: | |
1808 | type: number | |
1809 | likes: | |
1810 | type: number | |
1811 | dislikes: | |
1812 | type: number | |
1813 | nsfw: | |
1814 | type: boolean | |
1815 | account: | |
1816 | type: object | |
1817 | properties: | |
1818 | name: | |
1819 | type: string | |
1820 | displayName: | |
1821 | type: string | |
1822 | url: | |
1823 | type: string | |
1824 | host: | |
1825 | type: string | |
1826 | avatar: | |
1827 | $ref: '#/components/schemas/Avatar' | |
1828 | VideoAbuse: | |
1829 | properties: | |
1830 | id: | |
1831 | type: number | |
1832 | reason: | |
1833 | type: string | |
1834 | reporterAccount: | |
1835 | $ref: '#/components/schemas/Account' | |
1836 | video: | |
1837 | type: object | |
1838 | properties: | |
1839 | id: | |
1840 | type: number | |
1841 | name: | |
1842 | type: string | |
1843 | uuid: | |
1844 | type: string | |
1845 | url: | |
1846 | type: string | |
1847 | createdAt: | |
1848 | type: string | |
1849 | VideoBlacklist: | |
1850 | properties: | |
1851 | id: | |
1852 | type: number | |
1853 | videoId: | |
1854 | type: number | |
1855 | createdAt: | |
1856 | type: string | |
1857 | updatedAt: | |
1858 | type: string | |
1859 | name: | |
1860 | type: string | |
1861 | uuid: | |
1862 | type: string | |
1863 | description: | |
1864 | type: string | |
1865 | duration: | |
1866 | type: number | |
1867 | views: | |
1868 | type: number | |
1869 | likes: | |
1870 | type: number | |
1871 | dislikes: | |
1872 | type: number | |
1873 | nsfw: | |
1874 | type: boolean | |
1875 | VideoChannel: | |
1876 | properties: | |
1877 | displayName: | |
1878 | type: string | |
1879 | description: | |
1880 | type: string | |
1881 | isLocal: | |
1882 | type: boolean | |
1883 | ownerAccount: | |
1884 | type: object | |
1885 | properties: | |
1886 | id: | |
1887 | type: number | |
1888 | uuid: | |
1889 | type: string | |
1890 | VideoComment: | |
1891 | properties: | |
1892 | id: | |
1893 | type: number | |
1894 | url: | |
1895 | type: string | |
1896 | text: | |
1897 | type: string | |
1898 | threadId: | |
1899 | type: number | |
1900 | inReplyToCommentId: | |
1901 | type: number | |
1902 | videoId: | |
1903 | type: number | |
1904 | createdAt: | |
1905 | type: string | |
1906 | updatedAt: | |
1907 | type: string | |
1908 | totalReplies: | |
1909 | type: number | |
1910 | account: | |
1911 | $ref: '#/components/schemas/Account' | |
1912 | VideoCommentThreadTree: | |
1913 | properties: | |
1914 | comment: | |
1915 | $ref: '#/components/schemas/VideoComment' | |
1916 | children: | |
1917 | type: array | |
1918 | items: | |
1919 | $ref: '#/components/schemas/VideoCommentThreadTree' | |
1920 | Avatar: | |
1921 | properties: | |
1922 | path: | |
1923 | type: string | |
1924 | createdAt: | |
1925 | type: string | |
1926 | updatedAt: | |
1927 | type: string | |
1928 | Actor: | |
1929 | properties: | |
1930 | id: | |
1931 | type: number | |
1932 | uuid: | |
1933 | type: string | |
1934 | url: | |
1935 | type: string | |
1936 | name: | |
1937 | type: string | |
1938 | host: | |
1939 | type: string | |
1940 | followingCount: | |
1941 | type: number | |
1942 | followersCount: | |
1943 | type: number | |
1944 | createdAt: | |
1945 | type: string | |
1946 | updatedAt: | |
1947 | type: string | |
1948 | avatar: | |
1949 | $ref: '#/components/schemas/Avatar' | |
1950 | Account: | |
1951 | allOf: | |
1952 | - $ref: '#/components/schemas/Actor' | |
1953 | - properties: | |
1954 | displayName: | |
1955 | type: string | |
1956 | User: | |
1957 | properties: | |
1958 | id: | |
1959 | type: number | |
1960 | username: | |
1961 | type: string | |
1962 | email: | |
1963 | type: string | |
1964 | displayNSFW: | |
1965 | type: boolean | |
1966 | autoPlayVideo: | |
1967 | type: boolean | |
1968 | role: | |
1969 | type: string | |
1970 | enum: | |
1971 | - User | |
1972 | - Moderator | |
1973 | - Administrator | |
1974 | videoQuota: | |
1975 | type: number | |
ff40a4eb | 1976 | videoQuotaDaily: |
fbe1bc2a | 1977 | type: number |
3e9e6f2f RK |
1978 | createdAt: |
1979 | type: string | |
1980 | account: | |
1981 | $ref: '#/components/schemas/Account' | |
1982 | videoChannels: | |
1983 | type: array | |
1984 | items: | |
1985 | $ref: '#/components/schemas/VideoChannel' | |
6441981b RK |
1986 | UserWatchingVideo: |
1987 | properties: | |
1988 | currentTime: | |
1989 | type: number | |
3e9e6f2f RK |
1990 | ServerConfig: |
1991 | properties: | |
1992 | signup: | |
1993 | type: object | |
1994 | properties: | |
1995 | allowed: | |
1996 | type: boolean | |
1997 | transcoding: | |
1998 | type: object | |
1999 | properties: | |
2000 | enabledResolutions: | |
2001 | type: array | |
2002 | items: | |
2003 | type: number | |
2004 | avatar: | |
2005 | type: object | |
2006 | properties: | |
2007 | file: | |
2008 | type: object | |
2009 | properties: | |
2010 | size: | |
2011 | type: object | |
2012 | properties: | |
2013 | max: | |
2014 | type: number | |
2015 | extensions: | |
2016 | type: array | |
2017 | items: | |
2018 | type: string | |
2019 | video: | |
2020 | type: object | |
2021 | properties: | |
2022 | file: | |
2023 | type: object | |
2024 | properties: | |
2025 | extensions: | |
2026 | type: array | |
2027 | items: | |
2028 | type: string | |
2029 | Follow: | |
2030 | properties: | |
2031 | id: | |
2032 | type: number | |
2033 | follower: | |
2034 | $ref: '#/components/schemas/Actor' | |
2035 | following: | |
2036 | $ref: '#/components/schemas/Actor' | |
2037 | score: | |
2038 | type: number | |
2039 | state: | |
2040 | type: string | |
2041 | enum: | |
2042 | - pending | |
2043 | - accepted | |
2044 | createdAt: | |
2045 | type: string | |
2046 | updatedAt: | |
2047 | type: string | |
2048 | Job: | |
2049 | properties: | |
2050 | id: | |
2051 | type: number | |
2052 | state: | |
2053 | type: string | |
2054 | enum: | |
2055 | - pending | |
2056 | - processing | |
2057 | - error | |
2058 | - success | |
2059 | category: | |
2060 | type: string | |
2061 | enum: | |
2062 | - transcoding | |
2063 | - activitypub-http | |
2064 | handlerName: | |
2065 | type: string | |
2066 | handlerInputData: | |
2067 | type: string | |
2068 | createdAt: | |
2069 | type: string | |
2070 | updatedAt: | |
2071 | type: string | |
2072 | AddUserResponse: | |
2073 | properties: | |
2074 | id: | |
2075 | type: number | |
2076 | uuid: | |
2077 | type: string | |
2078 | VideoUploadResponse: | |
2079 | properties: | |
2080 | video: | |
2081 | type: object | |
2082 | properties: | |
2083 | id: | |
2084 | type: number | |
2085 | uuid: | |
2086 | type: string | |
2087 | CommentThreadResponse: | |
2088 | properties: | |
2089 | total: | |
2090 | type: number | |
2091 | data: | |
2092 | type: array | |
2093 | items: | |
2094 | $ref: '#/components/schemas/VideoComment' | |
2095 | CommentThreadPostResponse: | |
2096 | properties: | |
2097 | comment: | |
2098 | $ref: '#/components/schemas/VideoComment' | |
2099 | AddUser: | |
2100 | properties: | |
2101 | username: | |
2102 | type: string | |
2103 | description: 'The user username ' | |
2104 | password: | |
2105 | type: string | |
2106 | description: 'The user password ' | |
2107 | email: | |
2108 | type: string | |
2109 | description: 'The user email ' | |
2110 | videoQuota: | |
2111 | type: string | |
2112 | description: 'The user videoQuota ' | |
fbe1bc2a C |
2113 | videoQuotaDaily: |
2114 | type: string | |
2115 | description: 'The user daily video quota ' | |
3e9e6f2f | 2116 | role: |
0f490230 RK |
2117 | type: integer |
2118 | format: int32 | |
2119 | enum: | |
2120 | - 0 | |
2121 | - 1 | |
2122 | - 2 | |
3e9e6f2f RK |
2123 | description: 'The user role ' |
2124 | required: | |
2125 | - username | |
2126 | - password | |
2127 | ||
2128 | - videoQuota | |
fbe1bc2a | 2129 | - videoQuotaDaily |
3e9e6f2f RK |
2130 | - role |
2131 | UpdateUser: | |
2132 | properties: | |
2133 | id: | |
2134 | type: string | |
2135 | description: 'The user id ' | |
2136 | email: | |
2137 | type: string | |
2138 | description: 'The updated email of the user ' | |
2139 | videoQuota: | |
2140 | type: string | |
2141 | description: 'The updated videoQuota of the user ' | |
fbe1bc2a C |
2142 | videoQuotaDaily: |
2143 | type: string | |
2144 | description: 'The updated daily video quota of the user ' | |
3e9e6f2f RK |
2145 | role: |
2146 | type: string | |
2147 | description: 'The updated role of the user ' | |
2148 | required: | |
2149 | - id | |
2150 | ||
2151 | - videoQuota | |
fbe1bc2a | 2152 | - videoQuotaDaily |
3e9e6f2f RK |
2153 | - role |
2154 | UpdateMe: | |
2155 | properties: | |
2156 | password: | |
2157 | type: string | |
2158 | description: 'Your new password ' | |
2159 | email: | |
2160 | type: string | |
2161 | description: 'Your new email ' | |
2162 | displayNSFW: | |
2163 | type: string | |
2164 | description: 'Your new displayNSFW ' | |
2165 | autoPlayVideo: | |
2166 | type: string | |
2167 | description: 'Your new autoPlayVideo ' | |
2168 | required: | |
2169 | - password | |
2170 | ||
2171 | - displayNSFW | |
2172 | - autoPlayVideo | |
2173 | GetMeVideoRating: | |
2174 | properties: | |
2175 | id: | |
2176 | type: string | |
2177 | description: 'Id of the video ' | |
2178 | rating: | |
2179 | type: number | |
2180 | description: 'Rating of the video ' | |
2181 | required: | |
2182 | - id | |
2183 | - rating | |
c100a614 YB |
2184 | VideoRating: |
2185 | properties: | |
2186 | video: | |
2187 | $ref: '#/components/schemas/Video' | |
2188 | rating: | |
2189 | type: number | |
2190 | description: 'Rating of the video' | |
2191 | required: | |
2192 | - video | |
2193 | - rating | |
3e9e6f2f RK |
2194 | RegisterUser: |
2195 | properties: | |
2196 | username: | |
2197 | type: string | |
2198 | description: 'The username of the user ' | |
2199 | password: | |
2200 | type: string | |
2201 | description: 'The password of the user ' | |
2202 | email: | |
2203 | type: string | |
2204 | description: 'The email of the user ' | |
2205 | required: | |
2206 | - username | |
2207 | - password | |
2208 | ||
2209 | VideoChannelInput: | |
2210 | properties: | |
2211 | name: | |
2212 | type: string | |
2213 | description: | |
2214 | type: string | |
1569a818 | 2215 |