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