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