]>
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 | |
5dce26d2 C |
1065 | scheduleUpdate: |
1066 | $ref: '#/components/schemas/VideoScheduledUpdate' | |
3e9e6f2f RK |
1067 | required: |
1068 | - videofile | |
1069 | - channelId | |
8f9e8be1 | 1070 | - name |
8f9e8be1 RK |
1071 | x-code-samples: |
1072 | - lang: Shell | |
1073 | source: | | |
1074 | ## DEPENDENCIES: httpie, jq | |
1075 | # pip install httpie | |
1076 | USERNAME="<your_username>" | |
1077 | PASSWORD="<your_password>" | |
1078 | FILE_PATH="<your_file_path>" | |
1079 | CHANNEL_ID="<your_channel_id>" | |
8f9e8be1 RK |
1080 | NAME="<video_name>" |
1081 | ||
1082 | API_PATH="https://peertube2.cpy.re/api/v1" | |
1083 | ## AUTH | |
1084 | client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id") | |
1085 | client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret") | |
1086 | token=$(http -b --form POST "$API_PATH/users/token" \ | |
1087 | client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \ | |
1088 | username=$USERNAME \ | |
1089 | password=$PASSWORD \ | |
1090 | | jq -r ".access_token") | |
1091 | ## VIDEO UPLOAD | |
1092 | http -b --form POST "$API_PATH/videos/upload" \ | |
1093 | videofile@$FILE_PATH \ | |
1094 | channelId=$CHANNEL_ID \ | |
1095 | name=$NAME \ | |
8f9e8be1 | 1096 | "Authorization:Bearer $token" |
28c8e63e C |
1097 | /videos/imports: |
1098 | post: | |
1099 | summary: Import a torrent or magnetURI or HTTP ressource (if enabled by the instance administrator) | |
1100 | security: | |
1101 | - OAuth2: [] | |
1102 | tags: | |
1103 | - Video | |
1104 | responses: | |
1105 | '200': | |
1106 | description: successful operation | |
1107 | content: | |
1108 | application/json: | |
1109 | schema: | |
1110 | $ref: '#/components/schemas/VideoUploadResponse' | |
1111 | requestBody: | |
1112 | content: | |
1113 | multipart/form-data: | |
1114 | schema: | |
1115 | type: object | |
1116 | properties: | |
1117 | torrentfile: | |
1118 | description: Torrent File | |
1119 | type: string | |
1120 | format: binary | |
1121 | targetUrl: | |
1122 | description: HTTP target URL | |
1123 | type: string | |
1124 | magnetUri: | |
1125 | description: Magnet URI | |
1126 | type: string | |
1127 | channelId: | |
1128 | description: Channel id that will contain this video | |
1129 | type: number | |
1130 | thumbnailfile: | |
1131 | description: Video thumbnail file | |
1132 | type: string | |
1133 | previewfile: | |
1134 | description: Video preview file | |
1135 | type: string | |
1136 | privacy: | |
ee89e8fd | 1137 | $ref: '#/components/schemas/VideoPrivacySet' |
28c8e63e C |
1138 | category: |
1139 | description: Video category | |
1140 | type: string | |
1141 | licence: | |
1142 | description: Video licence | |
1143 | type: string | |
1144 | language: | |
1145 | description: Video language | |
1146 | type: string | |
1147 | description: | |
1148 | description: Video description | |
1149 | type: string | |
1150 | waitTranscoding: | |
1151 | description: Whether or not we wait transcoding before publish the video | |
1152 | type: string | |
1153 | support: | |
1154 | description: Text describing how to support the video uploader | |
1155 | type: string | |
1156 | nsfw: | |
1157 | description: Whether or not this video contains sensitive content | |
1158 | type: string | |
1159 | name: | |
1160 | description: Video name | |
1161 | type: string | |
1162 | tags: | |
1163 | description: Video tags | |
1164 | type: array | |
1165 | items: | |
1166 | type: string | |
1167 | commentsEnabled: | |
1168 | description: Enable or disable comments for this video | |
1169 | type: string | |
5dce26d2 C |
1170 | scheduleUpdate: |
1171 | $ref: '#/components/schemas/VideoScheduledUpdate' | |
28c8e63e C |
1172 | required: |
1173 | - channelId | |
1174 | - name | |
c360c494 | 1175 | /videos/abuse: |
1569a818 | 1176 | get: |
2963c343 | 1177 | summary: Get list of reported video abuses |
94ff4c23 | 1178 | security: |
3e9e6f2f | 1179 | - OAuth2: [] |
1569a818 | 1180 | tags: |
5776f78e | 1181 | - Video Abuse |
44cb3b85 | 1182 | parameters: |
3e9e6f2f RK |
1183 | - $ref: '#/components/parameters/start' |
1184 | - $ref: '#/components/parameters/count' | |
fd5af7a2 | 1185 | - $ref: '#/components/parameters/abusesSort' |
1569a818 DG |
1186 | responses: |
1187 | '200': | |
1188 | description: successful operation | |
3e9e6f2f RK |
1189 | content: |
1190 | application/json: | |
1191 | schema: | |
1192 | type: array | |
1193 | items: | |
1194 | $ref: '#/components/schemas/VideoAbuse' | |
1195 | '/videos/{id}/abuse': | |
1569a818 | 1196 | post: |
3e9e6f2f | 1197 | summary: 'Report an abuse, on a video by its id' |
94ff4c23 | 1198 | security: |
3e9e6f2f | 1199 | - OAuth2: [] |
1569a818 | 1200 | tags: |
5776f78e | 1201 | - Video Abuse |
1569a818 | 1202 | parameters: |
cb9d028a | 1203 | - $ref: '#/components/parameters/idOrUUID' |
1569a818 DG |
1204 | responses: |
1205 | '204': | |
3e9e6f2f RK |
1206 | $ref: '#/paths/~1users~1me/put/responses/204' |
1207 | '/videos/{id}/blacklist': | |
1569a818 | 1208 | post: |
2963c343 | 1209 | summary: Put on blacklist a video by its id |
94ff4c23 | 1210 | security: |
3e9e6f2f RK |
1211 | - OAuth2: |
1212 | - admin | |
1213 | - moderator | |
1569a818 | 1214 | tags: |
5776f78e | 1215 | - Video Blacklist |
1569a818 | 1216 | parameters: |
cb9d028a | 1217 | - $ref: '#/components/parameters/idOrUUID' |
1569a818 DG |
1218 | responses: |
1219 | '204': | |
3e9e6f2f | 1220 | $ref: '#/paths/~1users~1me/put/responses/204' |
1569a818 | 1221 | delete: |
2963c343 | 1222 | summary: Delete an entry of the blacklist of a video by its id |
94ff4c23 | 1223 | security: |
3e9e6f2f RK |
1224 | - OAuth2: |
1225 | - admin | |
1226 | - moderator | |
1569a818 | 1227 | tags: |
5776f78e | 1228 | - Video Blacklist |
1569a818 | 1229 | parameters: |
cb9d028a | 1230 | - $ref: '#/components/parameters/idOrUUID' |
1569a818 DG |
1231 | responses: |
1232 | '204': | |
3e9e6f2f | 1233 | $ref: '#/paths/~1users~1me/put/responses/204' |
c360c494 | 1234 | /videos/blacklist: |
1569a818 | 1235 | get: |
2963c343 | 1236 | summary: Get list of videos on blacklist |
94ff4c23 | 1237 | security: |
3e9e6f2f RK |
1238 | - OAuth2: |
1239 | - admin | |
1240 | - moderator | |
1569a818 | 1241 | tags: |
5776f78e | 1242 | - Video Blacklist |
44cb3b85 | 1243 | parameters: |
3e9e6f2f RK |
1244 | - $ref: '#/components/parameters/start' |
1245 | - $ref: '#/components/parameters/count' | |
fd5af7a2 | 1246 | - $ref: '#/components/parameters/blacklistsSort' |
1569a818 DG |
1247 | responses: |
1248 | '200': | |
1249 | description: successful operation | |
3e9e6f2f RK |
1250 | content: |
1251 | application/json: | |
1252 | schema: | |
1253 | type: array | |
1254 | items: | |
1255 | $ref: '#/components/schemas/VideoBlacklist' | |
67ae04a5 C |
1256 | /videos/{id}/captions: |
1257 | get: | |
1258 | summary: Get list of video's captions | |
1259 | tags: | |
1260 | - Video Caption | |
1261 | parameters: | |
cb9d028a | 1262 | - $ref: '#/components/parameters/idOrUUID' |
67ae04a5 C |
1263 | responses: |
1264 | '200': | |
1265 | description: successful operation | |
1266 | content: | |
1267 | application/json: | |
1268 | schema: | |
1269 | type: object | |
1270 | properties: | |
1271 | total: | |
1272 | type: integer | |
1273 | data: | |
1274 | type: array | |
1275 | items: | |
1276 | $ref: '#/components/schemas/VideoCaption' | |
1277 | /videos/{id}/captions/{captionLanguage}: | |
1278 | put: | |
1279 | summary: Add or replace a video caption | |
1280 | tags: | |
1281 | - Video Caption | |
1282 | parameters: | |
cb9d028a | 1283 | - $ref: '#/components/parameters/idOrUUID' |
67ae04a5 C |
1284 | - $ref: '#/components/parameters/captionLanguage' |
1285 | requestBody: | |
1286 | content: | |
1287 | multipart/form-data: | |
1288 | schema: | |
1289 | type: object | |
1290 | properties: | |
1291 | captionfile: | |
1292 | description: The file to upload. | |
1293 | type: string | |
1294 | format: binary | |
1295 | responses: | |
1296 | '204': | |
1297 | $ref: '#/paths/~1users~1me/put/responses/204' | |
1298 | delete: | |
1299 | summary: Delete a video caption | |
1300 | tags: | |
1301 | - Video Caption | |
1302 | parameters: | |
cb9d028a | 1303 | - $ref: '#/components/parameters/idOrUUID' |
67ae04a5 C |
1304 | - $ref: '#/components/parameters/captionLanguage' |
1305 | responses: | |
1306 | '204': | |
1307 | $ref: '#/paths/~1users~1me/put/responses/204' | |
48dce1c9 | 1308 | /video-channels: |
1569a818 | 1309 | get: |
2963c343 | 1310 | summary: Get list of video channels |
1569a818 | 1311 | tags: |
5776f78e | 1312 | - Video Channel |
44cb3b85 | 1313 | parameters: |
3e9e6f2f RK |
1314 | - $ref: '#/components/parameters/start' |
1315 | - $ref: '#/components/parameters/count' | |
1316 | - $ref: '#/components/parameters/sort' | |
1569a818 DG |
1317 | responses: |
1318 | '200': | |
1319 | description: successful operation | |
3e9e6f2f RK |
1320 | content: |
1321 | application/json: | |
1322 | schema: | |
1323 | type: array | |
1324 | items: | |
1325 | $ref: '#/components/schemas/VideoChannel' | |
1569a818 | 1326 | post: |
2963c343 | 1327 | summary: Creates a video channel for the current user |
94ff4c23 | 1328 | security: |
3e9e6f2f | 1329 | - OAuth2: [] |
1569a818 | 1330 | tags: |
5776f78e | 1331 | - Video Channel |
1569a818 DG |
1332 | responses: |
1333 | '204': | |
3e9e6f2f RK |
1334 | $ref: '#/paths/~1users~1me/put/responses/204' |
1335 | requestBody: | |
7d14d4d2 C |
1336 | content: |
1337 | application/json: | |
1338 | schema: | |
1339 | $ref: '#/components/schemas/VideoChannelCreate' | |
9ce3d302 | 1340 | '/video-channels/{channelHandle}': |
1569a818 | 1341 | get: |
2963c343 | 1342 | summary: Get a video channel by its id |
1569a818 | 1343 | tags: |
5776f78e | 1344 | - Video Channel |
1569a818 | 1345 | parameters: |
9ce3d302 | 1346 | - $ref: '#/components/parameters/channelHandle' |
1569a818 DG |
1347 | responses: |
1348 | '200': | |
1349 | description: successful operation | |
3e9e6f2f RK |
1350 | content: |
1351 | application/json: | |
1352 | schema: | |
1353 | $ref: '#/components/schemas/VideoChannel' | |
1569a818 | 1354 | put: |
2963c343 | 1355 | summary: Update a video channel by its id |
94ff4c23 | 1356 | security: |
3e9e6f2f | 1357 | - OAuth2: [] |
1569a818 | 1358 | tags: |
5776f78e | 1359 | - Video Channel |
1569a818 | 1360 | parameters: |
9ce3d302 | 1361 | - $ref: '#/components/parameters/channelHandle' |
1569a818 DG |
1362 | responses: |
1363 | '204': | |
3e9e6f2f RK |
1364 | $ref: '#/paths/~1users~1me/put/responses/204' |
1365 | requestBody: | |
7d14d4d2 C |
1366 | content: |
1367 | application/json: | |
1368 | schema: | |
1369 | $ref: '#/components/schemas/VideoChannelUpdate' | |
1569a818 | 1370 | delete: |
2963c343 | 1371 | summary: Delete a video channel by its id |
94ff4c23 | 1372 | security: |
3e9e6f2f | 1373 | - OAuth2: [] |
1569a818 | 1374 | tags: |
5776f78e | 1375 | - Video Channel |
1569a818 | 1376 | parameters: |
9ce3d302 | 1377 | - $ref: '#/components/parameters/channelHandle' |
cc918ac3 C |
1378 | responses: |
1379 | '204': | |
3e9e6f2f | 1380 | $ref: '#/paths/~1users~1me/put/responses/204' |
9ce3d302 | 1381 | '/video-channels/{channelHandle}/videos': |
cc918ac3 | 1382 | get: |
2963c343 | 1383 | summary: Get videos of a video channel by its id |
cc918ac3 | 1384 | tags: |
048b6946 | 1385 | - Video |
5776f78e | 1386 | - Video Channel |
cc918ac3 | 1387 | parameters: |
9ce3d302 | 1388 | - $ref: '#/components/parameters/channelHandle' |
1569a818 | 1389 | responses: |
cc918ac3 | 1390 | '200': |
1569a818 | 1391 | description: successful operation |
3e9e6f2f RK |
1392 | content: |
1393 | application/json: | |
1394 | schema: | |
048b6946 | 1395 | $ref: '#/components/schemas/VideoListResponse' |
3e9e6f2f | 1396 | '/accounts/{name}/video-channels': |
6b738c7a | 1397 | get: |
2963c343 | 1398 | summary: Get video channels of an account by its name |
6b738c7a | 1399 | tags: |
5776f78e | 1400 | - Video Channel |
6b738c7a | 1401 | parameters: |
3e9e6f2f | 1402 | - $ref: '#/components/parameters/name' |
6b738c7a C |
1403 | responses: |
1404 | '200': | |
1405 | description: successful operation | |
3e9e6f2f RK |
1406 | content: |
1407 | application/json: | |
1408 | schema: | |
1409 | type: array | |
1410 | items: | |
1411 | $ref: '#/components/schemas/VideoChannel' | |
c100a614 YB |
1412 | '/accounts/{name}/ratings': |
1413 | get: | |
1414 | summary: Get ratings of an account by its name | |
1415 | security: | |
1416 | - OAuth2: [] | |
1417 | tags: | |
1418 | - User | |
1419 | parameters: | |
cb9d028a | 1420 | - $ref: '#/components/parameters/name' |
c100a614 YB |
1421 | - $ref: '#/components/parameters/start' |
1422 | - $ref: '#/components/parameters/count' | |
1423 | - $ref: '#/components/parameters/sort' | |
1424 | - name: rating | |
1425 | in: query | |
1426 | required: false | |
1427 | description: Optionaly filter which ratings to retrieve | |
1428 | schema: | |
1429 | type: string | |
1430 | enum: | |
1431 | - like | |
1432 | - dislike | |
1433 | responses: | |
1434 | '200': | |
1435 | description: successful operation | |
1436 | content: | |
1437 | application/json: | |
1438 | schema: | |
1439 | type: array | |
1440 | items: | |
1441 | $ref: '#/components/schemas/VideoRating' | |
3e9e6f2f | 1442 | '/videos/{id}/comment-threads': |
1569a818 | 1443 | get: |
2963c343 | 1444 | summary: Get the comment threads of a video by its id |
1569a818 | 1445 | tags: |
5776f78e | 1446 | - Video Comment |
1569a818 | 1447 | parameters: |
cb9d028a | 1448 | - $ref: '#/components/parameters/idOrUUID' |
3e9e6f2f RK |
1449 | - $ref: '#/components/parameters/start' |
1450 | - $ref: '#/components/parameters/count' | |
1451 | - $ref: '#/components/parameters/sort' | |
1569a818 DG |
1452 | responses: |
1453 | '200': | |
1454 | description: successful operation | |
3e9e6f2f RK |
1455 | content: |
1456 | application/json: | |
1457 | schema: | |
1458 | $ref: '#/components/schemas/CommentThreadResponse' | |
1569a818 | 1459 | post: |
3e9e6f2f | 1460 | summary: 'Creates a comment thread, on a video by its id' |
94ff4c23 | 1461 | security: |
3e9e6f2f | 1462 | - OAuth2: [] |
1569a818 | 1463 | tags: |
5776f78e | 1464 | - Video Comment |
1569a818 | 1465 | parameters: |
cb9d028a | 1466 | - $ref: '#/components/parameters/idOrUUID' |
1569a818 DG |
1467 | responses: |
1468 | '200': | |
1469 | description: successful operation | |
3e9e6f2f RK |
1470 | content: |
1471 | application/json: | |
1472 | schema: | |
1473 | $ref: '#/components/schemas/CommentThreadPostResponse' | |
1474 | '/videos/{id}/comment-threads/{threadId}': | |
1569a818 | 1475 | get: |
3e9e6f2f | 1476 | summary: 'Get the comment thread by its id, of a video by its id' |
1569a818 | 1477 | tags: |
5776f78e | 1478 | - Video Comment |
1569a818 | 1479 | parameters: |
cb9d028a C |
1480 | - $ref: '#/components/parameters/idOrUUID' |
1481 | - $ref: '#/components/parameters/threadId' | |
1569a818 DG |
1482 | responses: |
1483 | '200': | |
1484 | description: successful operation | |
3e9e6f2f RK |
1485 | content: |
1486 | application/json: | |
1487 | schema: | |
1488 | $ref: '#/components/schemas/VideoCommentThreadTree' | |
1489 | '/videos/{id}/comments/{commentId}': | |
1569a818 | 1490 | post: |
3e9e6f2f | 1491 | summary: 'Creates a comment in a comment thread by its id, of a video by its id' |
94ff4c23 | 1492 | security: |
3e9e6f2f | 1493 | - OAuth2: [] |
1569a818 | 1494 | tags: |
5776f78e | 1495 | - Video Comment |
1569a818 | 1496 | parameters: |
cb9d028a | 1497 | - $ref: '#/components/parameters/idOrUUID' |
3e9e6f2f | 1498 | - $ref: '#/components/parameters/commentId' |
1569a818 DG |
1499 | responses: |
1500 | '200': | |
1501 | description: successful operation | |
3e9e6f2f RK |
1502 | content: |
1503 | application/json: | |
1504 | schema: | |
1505 | $ref: '#/components/schemas/CommentThreadPostResponse' | |
1569a818 | 1506 | delete: |
089caedc | 1507 | summary: 'Delete a comment in a comment thread by its id, of a video by its id' |
94ff4c23 | 1508 | security: |
3e9e6f2f | 1509 | - OAuth2: [] |
1569a818 | 1510 | tags: |
5776f78e | 1511 | - Video Comment |
1569a818 | 1512 | parameters: |
cb9d028a | 1513 | - $ref: '#/components/parameters/idOrUUID' |
3e9e6f2f | 1514 | - $ref: '#/components/parameters/commentId' |
1569a818 DG |
1515 | responses: |
1516 | '204': | |
3e9e6f2f RK |
1517 | $ref: '#/paths/~1users~1me/put/responses/204' |
1518 | '/videos/{id}/rate': | |
1569a818 | 1519 | put: |
2963c343 | 1520 | summary: Vote for a video by its id |
94ff4c23 | 1521 | security: |
3e9e6f2f | 1522 | - OAuth2: [] |
1569a818 | 1523 | tags: |
5776f78e | 1524 | - Video Rate |
1569a818 | 1525 | parameters: |
cb9d028a | 1526 | - $ref: '#/components/parameters/idOrUUID' |
1569a818 DG |
1527 | responses: |
1528 | '204': | |
3e9e6f2f | 1529 | $ref: '#/paths/~1users~1me/put/responses/204' |
fb72c193 DL |
1530 | /search/videos: |
1531 | get: | |
1532 | tags: | |
1533 | - Search | |
2963c343 | 1534 | summary: Get the videos corresponding to a given query |
fb72c193 | 1535 | parameters: |
3e9e6f2f RK |
1536 | - $ref: '#/components/parameters/start' |
1537 | - $ref: '#/components/parameters/count' | |
fd5af7a2 | 1538 | - $ref: '#/components/parameters/videosSearchSort' |
655b5490 | 1539 | - name: search |
fb72c193 DL |
1540 | in: query |
1541 | required: true | |
3e9e6f2f RK |
1542 | description: String to search |
1543 | schema: | |
1544 | type: string | |
fb72c193 DL |
1545 | responses: |
1546 | '200': | |
1547 | description: successful operation | |
3e9e6f2f RK |
1548 | content: |
1549 | application/json: | |
1550 | schema: | |
048b6946 | 1551 | $ref: '#/components/schemas/VideoListResponse' |
3e9e6f2f | 1552 | servers: |
6441981b RK |
1553 | - url: 'https://peertube.cpy.re/api/v1' |
1554 | description: Live Test Server (live data - stable version) | |
8f9e8be1 | 1555 | - url: 'https://peertube2.cpy.re/api/v1' |
6441981b RK |
1556 | description: Live Test Server (live data - bleeding edge version) |
1557 | - url: 'https://peertube3.cpy.re/api/v1' | |
1558 | description: Live Test Server (live data - bleeding edge version) | |
3e9e6f2f RK |
1559 | components: |
1560 | parameters: | |
1561 | start: | |
1562 | name: start | |
1563 | in: query | |
1564 | required: false | |
1565 | description: Offset | |
1566 | schema: | |
1569a818 | 1567 | type: number |
3e9e6f2f RK |
1568 | count: |
1569 | name: count | |
1570 | in: query | |
1571 | required: false | |
1572 | description: Number of items | |
1573 | schema: | |
1569a818 | 1574 | type: number |
3e9e6f2f RK |
1575 | sort: |
1576 | name: sort | |
1577 | in: query | |
1578 | required: false | |
1579 | description: Sort column (-createdAt for example) | |
1580 | schema: | |
1581 | type: string | |
fd5af7a2 RK |
1582 | videosSort: |
1583 | name: sort | |
1584 | in: query | |
1585 | required: false | |
1586 | description: Sort videos by criteria | |
1587 | schema: | |
1588 | type: string | |
1589 | enum: | |
1590 | - -name | |
1591 | - -duration | |
1592 | - -createdAt | |
1593 | - -publishedAt | |
1594 | - -views | |
1595 | - -likes | |
1596 | - -trending | |
1597 | videosSearchSort: | |
1598 | name: sort | |
1599 | in: query | |
1600 | required: false | |
1601 | description: Sort videos by criteria | |
1602 | schema: | |
1603 | type: string | |
1604 | enum: | |
1605 | - -name | |
1606 | - -duration | |
1607 | - -createdAt | |
1608 | - -publishedAt | |
1609 | - -views | |
1610 | - -likes | |
1611 | - -match | |
1612 | blacklistsSort: | |
1613 | name: sort | |
1614 | in: query | |
1615 | required: false | |
1616 | description: Sort blacklists by criteria | |
1617 | schema: | |
1618 | type: string | |
1619 | enum: | |
1620 | - -id | |
1621 | - -name | |
1622 | - -duration | |
1623 | - -views | |
1624 | - -likes | |
1625 | - -dislikes | |
1626 | - -uuid | |
1627 | - -createdAt | |
1628 | usersSort: | |
1629 | name: sort | |
1630 | in: query | |
1631 | required: false | |
1632 | description: Sort users by criteria | |
1633 | schema: | |
1634 | type: string | |
1635 | enum: | |
1636 | - -id | |
1637 | - -username | |
1638 | - -createdAt | |
1639 | abusesSort: | |
1640 | name: sort | |
1641 | in: query | |
1642 | required: false | |
1643 | description: Sort abuses by criteria | |
1644 | schema: | |
1645 | type: string | |
1646 | enum: | |
1647 | - -id | |
1648 | - -createdAt | |
1649 | - -state | |
3e9e6f2f RK |
1650 | name: |
1651 | name: name | |
1652 | in: path | |
1653 | required: true | |
1654 | description: >- | |
1655 | The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for | |
1656 | example) | |
1657 | schema: | |
1658 | type: string | |
1659 | id: | |
1660 | name: id | |
1661 | in: path | |
1662 | required: true | |
1663 | description: The user id | |
1664 | schema: | |
1569a818 | 1665 | type: number |
cb9d028a | 1666 | idOrUUID: |
3e9e6f2f RK |
1667 | name: id |
1668 | in: path | |
1669 | required: true | |
1670 | description: The video id or uuid | |
1671 | schema: | |
1672 | type: string | |
67ae04a5 C |
1673 | captionLanguage: |
1674 | name: captionLanguage | |
1675 | in: path | |
1676 | required: true | |
1677 | description: The caption language | |
1678 | schema: | |
1679 | type: string | |
9ce3d302 C |
1680 | channelHandle: |
1681 | name: channelHandle | |
3e9e6f2f RK |
1682 | in: path |
1683 | required: true | |
9ce3d302 | 1684 | description: "The video channel handle (example: 'my_username@example.com' or 'my_username')" |
3e9e6f2f RK |
1685 | schema: |
1686 | type: string | |
cb9d028a C |
1687 | subscriptionHandle: |
1688 | name: subscriptionHandle | |
1689 | in: path | |
1690 | required: true | |
1691 | description: "The subscription handle (example: 'my_username@example.com' or 'my_username')" | |
1692 | schema: | |
1693 | type: string | |
1694 | threadId: | |
3e9e6f2f RK |
1695 | name: threadId |
1696 | in: path | |
1697 | required: true | |
cb9d028a C |
1698 | description: The thread id (root comment id) |
1699 | schema: | |
1700 | type: number | |
1701 | commentId: | |
1702 | name: commentId | |
1703 | in: path | |
1704 | required: true | |
3e9e6f2f RK |
1705 | description: The comment id |
1706 | schema: | |
c360c494 | 1707 | type: number |
fd5af7a2 RK |
1708 | categoryOneOf: |
1709 | name: categoryOneOf | |
1710 | in: query | |
1711 | required: false | |
1712 | description: category id of the video | |
1713 | schema: | |
1714 | oneOf: | |
1715 | - type: number | |
1716 | - type: array | |
1717 | items: | |
1718 | type: number | |
2beb9895 RK |
1719 | style: form |
1720 | explode: false | |
fd5af7a2 RK |
1721 | tagsOneOf: |
1722 | name: tagsOneOf | |
1723 | in: query | |
1724 | required: false | |
1725 | description: tag(s) of the video | |
1726 | schema: | |
1727 | oneOf: | |
1728 | - type: string | |
1729 | - type: array | |
1730 | items: | |
1731 | type: string | |
2beb9895 RK |
1732 | style: form |
1733 | explode: false | |
fd5af7a2 RK |
1734 | tagsAllOf: |
1735 | name: tagsAllOf | |
1736 | in: query | |
1737 | required: false | |
1738 | description: tag(s) of the video, where all should be present in the video | |
1739 | schema: | |
1740 | oneOf: | |
1741 | - type: string | |
1742 | - type: array | |
1743 | items: | |
1744 | type: string | |
2beb9895 RK |
1745 | style: form |
1746 | explode: false | |
fd5af7a2 RK |
1747 | languageOneOf: |
1748 | name: languageOneOf | |
1749 | in: query | |
1750 | required: false | |
1751 | description: language id of the video | |
1752 | schema: | |
1753 | oneOf: | |
2beb9895 | 1754 | - type: string |
fd5af7a2 RK |
1755 | - type: array |
1756 | items: | |
2beb9895 RK |
1757 | type: string |
1758 | style: form | |
1759 | explode: false | |
fd5af7a2 RK |
1760 | licenceOneOf: |
1761 | name: licenceOneOf | |
1762 | in: query | |
1763 | required: false | |
1764 | description: licence id of the video | |
1765 | schema: | |
1766 | oneOf: | |
1767 | - type: number | |
1768 | - type: array | |
1769 | items: | |
1770 | type: number | |
2beb9895 RK |
1771 | style: form |
1772 | explode: false | |
fd5af7a2 RK |
1773 | nsfw: |
1774 | name: nsfw | |
1775 | in: query | |
1776 | required: false | |
1777 | description: whether to include nsfw videos, if any | |
1778 | schema: | |
1779 | type: string | |
1780 | enum: | |
1781 | - 'true' | |
1782 | - 'false' | |
1783 | filter: | |
1784 | name: filter | |
1785 | in: query | |
1786 | required: false | |
1787 | description: > | |
1788 | Special filters (local for instance) which might require special rights: | |
1789 | * `local` - only videos local to the instance | |
1790 | * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges) | |
1791 | schema: | |
1792 | type: string | |
1793 | enum: | |
1794 | - local | |
1795 | - all-local | |
e76d5784 RK |
1796 | subscriptionsUris: |
1797 | name: uris | |
1798 | in: query | |
1799 | required: true | |
1800 | description: list of uris to check if each is part of the user subscriptions | |
1801 | schema: | |
1802 | type: array | |
1803 | items: | |
1804 | type: string | |
3e9e6f2f RK |
1805 | securitySchemes: |
1806 | OAuth2: | |
1807 | description: > | |
1808 | In the header: *Authorization: Bearer <token\>* | |
1809 | ||
1810 | ||
1811 | Authenticating via OAuth requires the following steps: | |
1812 | ||
1813 | ||
1814 | - Have an account with sufficient authorization levels | |
1815 | ||
46e9407c | 1816 | - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a |
3e9e6f2f RK |
1817 | Bearer Token |
1818 | ||
1819 | - Make Authenticated Requests | |
1820 | type: oauth2 | |
1821 | flows: | |
1822 | password: | |
1823 | tokenUrl: 'https://peertube.example.com/api/v1/users/token' | |
1824 | scopes: | |
1825 | admin: Admin scope | |
1826 | moderator: Moderator scope | |
1827 | user: User scope | |
1828 | schemas: | |
1829 | VideoConstantNumber: | |
1830 | properties: | |
1831 | id: | |
1832 | type: number | |
1833 | label: | |
1834 | type: string | |
1835 | VideoConstantString: | |
1836 | properties: | |
1837 | id: | |
1838 | type: string | |
1839 | label: | |
1840 | type: string | |
ee89e8fd C |
1841 | VideoPrivacySet: |
1842 | type: integer | |
3e9e6f2f | 1843 | enum: |
ee89e8fd C |
1844 | - 1 |
1845 | - 2 | |
1846 | - 3 | |
1847 | description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3)' | |
1848 | VideoPrivacyConstant: | |
1849 | properties: | |
1850 | id: | |
1851 | type: integer | |
1852 | enum: | |
1853 | - 1 | |
1854 | - 2 | |
1855 | - 3 | |
1856 | label: | |
1857 | type: string | |
5dce26d2 C |
1858 | VideoStateConstant: |
1859 | properties: | |
1860 | id: | |
1861 | type: integer | |
1862 | enum: | |
1863 | - 1 | |
1864 | - 2 | |
1865 | - 3 | |
1866 | description: 'The video state (Published = 1, to transcode = 2, to import = 3)' | |
1867 | label: | |
1868 | type: string | |
1869 | VideoResolutionConstant: | |
1870 | properties: | |
1871 | id: | |
1872 | type: integer | |
1873 | description: 'Video resolution (240, 360, 720 ...)' | |
1874 | label: | |
1875 | type: string | |
1876 | VideoScheduledUpdate: | |
1877 | properties: | |
1878 | privacy: | |
1879 | $ref: '#/components/schemas/VideoPrivacySet' | |
1880 | description: Video privacy target | |
1881 | updateAt: | |
1882 | type: string | |
1883 | format: date | |
1884 | description: When to update the video | |
1885 | required: | |
1886 | - updateAt | |
1887 | VideoAccountSummary: | |
1888 | properties: | |
1889 | id: | |
1890 | type: number | |
1891 | name: | |
1892 | type: string | |
1893 | displayName: | |
1894 | type: string | |
1895 | url: | |
1896 | type: string | |
1897 | host: | |
1898 | type: string | |
1899 | avatar: | |
1900 | nullable: true | |
1901 | $ref: '#/components/schemas/Avatar' | |
1902 | VideoChannelSummary: | |
1903 | properties: | |
1904 | id: | |
1905 | type: number | |
1906 | name: | |
1907 | type: string | |
1908 | displayName: | |
1909 | type: string | |
1910 | url: | |
1911 | type: string | |
1912 | host: | |
1913 | type: string | |
1914 | avatar: | |
1915 | nullable: true | |
1916 | $ref: '#/components/schemas/Avatar' | |
1917 | PlaylistElement: | |
1918 | properties: | |
1919 | position: | |
1920 | type: number | |
1921 | startTimestamp: | |
1922 | type: number | |
1923 | stopTimestamp: | |
1924 | type: number | |
bfbd9128 C |
1925 | video: |
1926 | nullable: true | |
1927 | $ref: '#/components/schemas/Video' | |
5dce26d2 C |
1928 | VideoFile: |
1929 | properties: | |
1930 | magnetUri: | |
1931 | type: string | |
1932 | resolution: | |
1933 | $ref: '#/components/schemas/VideoResolutionConstant' | |
1934 | size: | |
1935 | type: number | |
1936 | description: 'Video file size in bytes' | |
1937 | torrentUrl: | |
1938 | type: string | |
1939 | torrentDownaloadUrl: | |
1940 | type: string | |
1941 | fileUrl: | |
1942 | type: string | |
1943 | fileDownloadUrl: | |
1944 | type: string | |
1945 | fps: | |
1946 | type: number | |
1947 | VideoStreamingPlaylists: | |
1948 | properties: | |
1949 | id: | |
1950 | type: number | |
1951 | type: | |
1952 | type: number | |
1953 | enum: | |
1954 | - 1 | |
1955 | description: 'Playlist type (HLS = 1)' | |
1956 | playlistUrl: | |
1957 | type: string | |
1958 | segmentsSha256Url: | |
1959 | type: string | |
1960 | redundancies: | |
1961 | type: array | |
1962 | items: | |
1963 | type: object | |
1964 | properties: | |
1965 | baseUrl: | |
1966 | type: string | |
3e9e6f2f RK |
1967 | Video: |
1968 | properties: | |
1969 | id: | |
1970 | type: number | |
1971 | uuid: | |
1972 | type: string | |
1973 | createdAt: | |
1974 | type: string | |
1975 | publishedAt: | |
1976 | type: string | |
1977 | updatedAt: | |
1978 | type: string | |
5dce26d2 C |
1979 | originallyPublishedAt: |
1980 | type: string | |
3e9e6f2f RK |
1981 | category: |
1982 | $ref: '#/components/schemas/VideoConstantNumber' | |
1983 | licence: | |
1984 | $ref: '#/components/schemas/VideoConstantNumber' | |
1985 | language: | |
1986 | $ref: '#/components/schemas/VideoConstantString' | |
1987 | privacy: | |
ee89e8fd | 1988 | $ref: '#/components/schemas/VideoPrivacyConstant' |
3e9e6f2f RK |
1989 | description: |
1990 | type: string | |
1991 | duration: | |
1992 | type: number | |
1993 | isLocal: | |
1994 | type: boolean | |
1995 | name: | |
1996 | type: string | |
1997 | thumbnailPath: | |
1998 | type: string | |
1999 | previewPath: | |
2000 | type: string | |
2001 | embedPath: | |
2002 | type: string | |
2003 | views: | |
2004 | type: number | |
2005 | likes: | |
2006 | type: number | |
2007 | dislikes: | |
2008 | type: number | |
2009 | nsfw: | |
2010 | type: boolean | |
5dce26d2 C |
2011 | waitTranscoding: |
2012 | type: boolean | |
2013 | nullable: true | |
2014 | state: | |
2015 | $ref: '#/components/schemas/VideoStateConstant' | |
2016 | scheduledUpdate: | |
2017 | nullable: true | |
2018 | $ref: '#/components/schemas/VideoScheduledUpdate' | |
2019 | blacklisted: | |
2020 | nullable: true | |
2021 | type: boolean | |
2022 | blacklistedReason: | |
2023 | nullable: true | |
2024 | type: string | |
3e9e6f2f | 2025 | account: |
5dce26d2 C |
2026 | $ref: '#/components/schemas/VideoAccountSummary' |
2027 | channel: | |
2028 | $ref: '#/components/schemas/VideoChannelSummary' | |
2029 | userHistory: | |
2030 | nullable: true | |
3e9e6f2f RK |
2031 | type: object |
2032 | properties: | |
5dce26d2 C |
2033 | currentTime: |
2034 | type: number | |
5dce26d2 C |
2035 | VideoDetails: |
2036 | allOf: | |
2037 | - $ref: '#/components/schemas/Video' | |
2038 | - type: object | |
2039 | properties: | |
2040 | descriptionPath: | |
3e9e6f2f | 2041 | type: string |
5dce26d2 | 2042 | support: |
3e9e6f2f | 2043 | type: string |
5dce26d2 C |
2044 | channel: |
2045 | $ref: '#/components/schemas/VideoChannel' | |
2046 | account: | |
2047 | $ref: '#/components/schemas/Account' | |
2048 | tags: | |
2049 | type: array | |
2050 | items: | |
2051 | type: string | |
2052 | files: | |
2053 | type: array | |
2054 | items: | |
2055 | $ref: '#/components/schemas/VideoFile' | |
2056 | commentsEnabled: | |
2057 | type: boolean | |
2058 | downloadEnabled: | |
2059 | type: boolean | |
2060 | trackerUrls: | |
2061 | type: array | |
2062 | items: | |
2063 | type: string | |
2064 | streamingPlaylists: | |
2065 | type: array | |
2066 | items: | |
2067 | $ref: '#/components/schemas/VideoStreamingPlaylists' | |
1f82e3e8 C |
2068 | VideoImportStateConstant: |
2069 | properties: | |
2070 | id: | |
2071 | type: integer | |
2072 | enum: | |
2073 | - 1 | |
2074 | - 2 | |
2075 | - 3 | |
2076 | description: 'The video import state (Pending = 1, Success = 2, Failed = 3)' | |
2077 | label: | |
2078 | type: string | |
2079 | VideoImport: | |
2080 | properties: | |
2081 | id: | |
2082 | type: number | |
2083 | targetUrl: | |
2084 | type: string | |
2085 | magnetUri: | |
2086 | type: string | |
2087 | torrentName: | |
2088 | type: string | |
2089 | state: | |
2090 | type: object | |
2091 | properties: | |
2092 | id: | |
2093 | $ref: '#/components/schemas/VideoImportStateConstant' | |
2094 | label: | |
2095 | type: string | |
2096 | error: | |
2097 | type: string | |
2098 | createdAt: | |
2099 | type: string | |
2100 | updatedAt: | |
2101 | type: string | |
2102 | video: | |
2103 | $ref: '#/components/schemas/Video' | |
3e9e6f2f RK |
2104 | VideoAbuse: |
2105 | properties: | |
2106 | id: | |
2107 | type: number | |
2108 | reason: | |
2109 | type: string | |
2110 | reporterAccount: | |
2111 | $ref: '#/components/schemas/Account' | |
2112 | video: | |
2113 | type: object | |
2114 | properties: | |
2115 | id: | |
2116 | type: number | |
2117 | name: | |
2118 | type: string | |
2119 | uuid: | |
2120 | type: string | |
2121 | url: | |
2122 | type: string | |
2123 | createdAt: | |
2124 | type: string | |
2125 | VideoBlacklist: | |
2126 | properties: | |
2127 | id: | |
2128 | type: number | |
2129 | videoId: | |
2130 | type: number | |
2131 | createdAt: | |
2132 | type: string | |
2133 | updatedAt: | |
2134 | type: string | |
2135 | name: | |
2136 | type: string | |
2137 | uuid: | |
2138 | type: string | |
2139 | description: | |
2140 | type: string | |
2141 | duration: | |
2142 | type: number | |
2143 | views: | |
2144 | type: number | |
2145 | likes: | |
2146 | type: number | |
2147 | dislikes: | |
2148 | type: number | |
2149 | nsfw: | |
2150 | type: boolean | |
2151 | VideoChannel: | |
2152 | properties: | |
2153 | displayName: | |
2154 | type: string | |
2155 | description: | |
2156 | type: string | |
2157 | isLocal: | |
2158 | type: boolean | |
2159 | ownerAccount: | |
2160 | type: object | |
2161 | properties: | |
2162 | id: | |
2163 | type: number | |
2164 | uuid: | |
2165 | type: string | |
2166 | VideoComment: | |
2167 | properties: | |
2168 | id: | |
2169 | type: number | |
2170 | url: | |
2171 | type: string | |
2172 | text: | |
2173 | type: string | |
2174 | threadId: | |
2175 | type: number | |
2176 | inReplyToCommentId: | |
2177 | type: number | |
2178 | videoId: | |
2179 | type: number | |
2180 | createdAt: | |
2181 | type: string | |
2182 | updatedAt: | |
2183 | type: string | |
2184 | totalReplies: | |
2185 | type: number | |
2186 | account: | |
2187 | $ref: '#/components/schemas/Account' | |
2188 | VideoCommentThreadTree: | |
2189 | properties: | |
2190 | comment: | |
2191 | $ref: '#/components/schemas/VideoComment' | |
2192 | children: | |
2193 | type: array | |
2194 | items: | |
2195 | $ref: '#/components/schemas/VideoCommentThreadTree' | |
67ae04a5 C |
2196 | VideoCaption: |
2197 | properties: | |
2198 | language: | |
2199 | $ref: '#/components/schemas/VideoConstantString' | |
2200 | captionPath: | |
2201 | type: string | |
3e9e6f2f RK |
2202 | Avatar: |
2203 | properties: | |
2204 | path: | |
2205 | type: string | |
2206 | createdAt: | |
2207 | type: string | |
2208 | updatedAt: | |
2209 | type: string | |
2210 | Actor: | |
2211 | properties: | |
2212 | id: | |
2213 | type: number | |
2214 | uuid: | |
2215 | type: string | |
2216 | url: | |
2217 | type: string | |
2218 | name: | |
2219 | type: string | |
2220 | host: | |
2221 | type: string | |
2222 | followingCount: | |
2223 | type: number | |
2224 | followersCount: | |
2225 | type: number | |
2226 | createdAt: | |
2227 | type: string | |
2228 | updatedAt: | |
2229 | type: string | |
2230 | avatar: | |
2231 | $ref: '#/components/schemas/Avatar' | |
2232 | Account: | |
2233 | allOf: | |
2234 | - $ref: '#/components/schemas/Actor' | |
2235 | - properties: | |
2236 | displayName: | |
2237 | type: string | |
2238 | User: | |
2239 | properties: | |
2240 | id: | |
2241 | type: number | |
2242 | username: | |
2243 | type: string | |
2244 | email: | |
2245 | type: string | |
2246 | displayNSFW: | |
2247 | type: boolean | |
2248 | autoPlayVideo: | |
2249 | type: boolean | |
2250 | role: | |
63d17405 C |
2251 | type: integer |
2252 | enum: | |
2253 | - 0 | |
2254 | - 1 | |
2255 | - 2 | |
2256 | description: 'The user role (Admin = 0, Moderator = 1, User = 2)' | |
2257 | roleLabel: | |
3e9e6f2f RK |
2258 | type: string |
2259 | enum: | |
2260 | - User | |
2261 | - Moderator | |
2262 | - Administrator | |
2263 | videoQuota: | |
2264 | type: number | |
ff40a4eb | 2265 | videoQuotaDaily: |
fbe1bc2a | 2266 | type: number |
3e9e6f2f RK |
2267 | createdAt: |
2268 | type: string | |
2269 | account: | |
2270 | $ref: '#/components/schemas/Account' | |
2271 | videoChannels: | |
2272 | type: array | |
2273 | items: | |
2274 | $ref: '#/components/schemas/VideoChannel' | |
6441981b RK |
2275 | UserWatchingVideo: |
2276 | properties: | |
2277 | currentTime: | |
2278 | type: number | |
3e9e6f2f RK |
2279 | ServerConfig: |
2280 | properties: | |
2281 | signup: | |
2282 | type: object | |
2283 | properties: | |
2284 | allowed: | |
2285 | type: boolean | |
2286 | transcoding: | |
2287 | type: object | |
2288 | properties: | |
2289 | enabledResolutions: | |
2290 | type: array | |
2291 | items: | |
2292 | type: number | |
2293 | avatar: | |
2294 | type: object | |
2295 | properties: | |
2296 | file: | |
2297 | type: object | |
2298 | properties: | |
2299 | size: | |
2300 | type: object | |
2301 | properties: | |
2302 | max: | |
2303 | type: number | |
2304 | extensions: | |
2305 | type: array | |
2306 | items: | |
2307 | type: string | |
2308 | video: | |
2309 | type: object | |
2310 | properties: | |
2311 | file: | |
2312 | type: object | |
2313 | properties: | |
2314 | extensions: | |
2315 | type: array | |
2316 | items: | |
2317 | type: string | |
2318 | Follow: | |
2319 | properties: | |
2320 | id: | |
2321 | type: number | |
2322 | follower: | |
2323 | $ref: '#/components/schemas/Actor' | |
2324 | following: | |
2325 | $ref: '#/components/schemas/Actor' | |
2326 | score: | |
2327 | type: number | |
2328 | state: | |
2329 | type: string | |
2330 | enum: | |
2331 | - pending | |
2332 | - accepted | |
2333 | createdAt: | |
2334 | type: string | |
2335 | updatedAt: | |
2336 | type: string | |
2337 | Job: | |
2338 | properties: | |
2339 | id: | |
2340 | type: number | |
2341 | state: | |
2342 | type: string | |
2343 | enum: | |
2344 | - pending | |
2345 | - processing | |
2346 | - error | |
2347 | - success | |
2348 | category: | |
2349 | type: string | |
2350 | enum: | |
2351 | - transcoding | |
2352 | - activitypub-http | |
2353 | handlerName: | |
2354 | type: string | |
2355 | handlerInputData: | |
2356 | type: string | |
2357 | createdAt: | |
2358 | type: string | |
2359 | updatedAt: | |
2360 | type: string | |
2361 | AddUserResponse: | |
2362 | properties: | |
2363 | id: | |
2364 | type: number | |
2365 | uuid: | |
2366 | type: string | |
2367 | VideoUploadResponse: | |
2368 | properties: | |
2369 | video: | |
2370 | type: object | |
2371 | properties: | |
2372 | id: | |
2373 | type: number | |
2374 | uuid: | |
2375 | type: string | |
2376 | CommentThreadResponse: | |
2377 | properties: | |
2378 | total: | |
2379 | type: number | |
2380 | data: | |
2381 | type: array | |
2382 | items: | |
2383 | $ref: '#/components/schemas/VideoComment' | |
2384 | CommentThreadPostResponse: | |
2385 | properties: | |
2386 | comment: | |
2387 | $ref: '#/components/schemas/VideoComment' | |
048b6946 C |
2388 | VideoListResponse: |
2389 | properties: | |
2390 | total: | |
2391 | type: number | |
2392 | data: | |
2393 | type: array | |
2394 | items: | |
2395 | $ref: '#/components/schemas/Video' | |
3e9e6f2f RK |
2396 | AddUser: |
2397 | properties: | |
2398 | username: | |
2399 | type: string | |
2400 | description: 'The user username ' | |
2401 | password: | |
2402 | type: string | |
2403 | description: 'The user password ' | |
2404 | email: | |
2405 | type: string | |
2406 | description: 'The user email ' | |
2407 | videoQuota: | |
2408 | type: string | |
2409 | description: 'The user videoQuota ' | |
fbe1bc2a C |
2410 | videoQuotaDaily: |
2411 | type: string | |
2412 | description: 'The user daily video quota ' | |
3e9e6f2f | 2413 | role: |
0f490230 | 2414 | type: integer |
0f490230 RK |
2415 | enum: |
2416 | - 0 | |
2417 | - 1 | |
2418 | - 2 | |
63d17405 | 2419 | description: 'The user role (Admin = 0, Moderator = 1, User = 2)' |
3e9e6f2f RK |
2420 | required: |
2421 | - username | |
2422 | - password | |
2423 | ||
2424 | - videoQuota | |
fbe1bc2a | 2425 | - videoQuotaDaily |
3e9e6f2f RK |
2426 | - role |
2427 | UpdateUser: | |
2428 | properties: | |
2429 | id: | |
2430 | type: string | |
2431 | description: 'The user id ' | |
2432 | email: | |
2433 | type: string | |
2434 | description: 'The updated email of the user ' | |
2435 | videoQuota: | |
2436 | type: string | |
2437 | description: 'The updated videoQuota of the user ' | |
fbe1bc2a C |
2438 | videoQuotaDaily: |
2439 | type: string | |
2440 | description: 'The updated daily video quota of the user ' | |
3e9e6f2f | 2441 | role: |
63d17405 C |
2442 | type: integer |
2443 | enum: | |
2444 | - 0 | |
2445 | - 1 | |
2446 | - 2 | |
2447 | description: 'The user role (Admin = 0, Moderator = 1, User = 2)' | |
3e9e6f2f RK |
2448 | required: |
2449 | - id | |
2450 | ||
2451 | - videoQuota | |
fbe1bc2a | 2452 | - videoQuotaDaily |
3e9e6f2f RK |
2453 | - role |
2454 | UpdateMe: | |
2455 | properties: | |
2456 | password: | |
2457 | type: string | |
2458 | description: 'Your new password ' | |
2459 | email: | |
2460 | type: string | |
2461 | description: 'Your new email ' | |
2462 | displayNSFW: | |
2463 | type: string | |
2464 | description: 'Your new displayNSFW ' | |
2465 | autoPlayVideo: | |
2466 | type: string | |
2467 | description: 'Your new autoPlayVideo ' | |
2468 | required: | |
2469 | - password | |
2470 | ||
2471 | - displayNSFW | |
2472 | - autoPlayVideo | |
2473 | GetMeVideoRating: | |
2474 | properties: | |
2475 | id: | |
2476 | type: string | |
2477 | description: 'Id of the video ' | |
2478 | rating: | |
2479 | type: number | |
2480 | description: 'Rating of the video ' | |
2481 | required: | |
2482 | - id | |
2483 | - rating | |
c100a614 YB |
2484 | VideoRating: |
2485 | properties: | |
2486 | video: | |
2487 | $ref: '#/components/schemas/Video' | |
2488 | rating: | |
2489 | type: number | |
2490 | description: 'Rating of the video' | |
2491 | required: | |
2492 | - video | |
2493 | - rating | |
3e9e6f2f RK |
2494 | RegisterUser: |
2495 | properties: | |
2496 | username: | |
2497 | type: string | |
2498 | description: 'The username of the user ' | |
2499 | password: | |
2500 | type: string | |
2501 | description: 'The password of the user ' | |
2502 | email: | |
2503 | type: string | |
2504 | description: 'The email of the user ' | |
1f20622f C |
2505 | displayName: |
2506 | type: string | |
2507 | description: 'The user display name' | |
2508 | channel: | |
2509 | type: object | |
2510 | properties: | |
2511 | name: | |
2512 | type: string | |
2513 | description: 'The default channel name' | |
2514 | displayName: | |
2515 | type: string | |
2516 | description: 'The default channel display name' | |
2517 | ||
3e9e6f2f RK |
2518 | required: |
2519 | - username | |
2520 | - password | |
2521 | ||
7d14d4d2 | 2522 | VideoChannelCreate: |
3e9e6f2f RK |
2523 | properties: |
2524 | name: | |
2525 | type: string | |
7d14d4d2 C |
2526 | displayName: |
2527 | type: string | |
3e9e6f2f RK |
2528 | description: |
2529 | type: string | |
7d14d4d2 C |
2530 | support: |
2531 | type: string | |
2532 | required: | |
2533 | - name | |
2534 | - displayName | |
2535 | VideoChannelUpdate: | |
2536 | properties: | |
2537 | displayName: | |
2538 | type: string | |
2539 | description: | |
2540 | type: string | |
2541 | support: | |
2542 | type: string | |
2543 | bulkVideosSupportUpdate: | |
2544 | type: boolean | |
2545 | description: 'Update all videos support field of this channel' | |
1569a818 | 2546 |