diff options
author | buoyantair <buoyantair@protonmail.com> | 2018-11-16 02:37:16 +0530 |
---|---|---|
committer | buoyantair <buoyantair@protonmail.com> | 2018-11-16 02:37:16 +0530 |
commit | ae28cdf327d782e629379eee1999096ca2a5d74b (patch) | |
tree | bfe0d4b3a232d75161fe5bba9196553a388fc02a /support/doc/api/openapi.yaml | |
parent | d4681c0074ba51c62a3aeb9fb3f2cd071dd21e32 (diff) | |
parent | 8cf998733496d44fa564e2e252356b871756c984 (diff) | |
download | PeerTube-ae28cdf327d782e629379eee1999096ca2a5d74b.tar.gz PeerTube-ae28cdf327d782e629379eee1999096ca2a5d74b.tar.zst PeerTube-ae28cdf327d782e629379eee1999096ca2a5d74b.zip |
Merge from upstream
Diffstat (limited to 'support/doc/api/openapi.yaml')
-rw-r--r-- | support/doc/api/openapi.yaml | 2156 |
1 files changed, 1196 insertions, 960 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 59ca8b29a..666e48a41 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml | |||
@@ -1,153 +1,237 @@ | |||
1 | swagger: '2.0' | 1 | openapi: 3.0.0 |
2 | info: | 2 | info: |
3 | title: PeerTube | 3 | title: PeerTube |
4 | version: 1.0.0-beta | 4 | version: 1.1.0-alpha.2 |
5 | description: Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular. | 5 | contact: |
6 | host: peertube.example.com | 6 | name: PeerTube Community |
7 | securityDefinitions: | 7 | url: 'https://joinpeertube.org' |
8 | OAuth2: | 8 | license: |
9 | description: 'In the header: *Authorization: Bearer mytoken*' | 9 | name: AGPLv3.0 |
10 | type: oauth2 | 10 | url: 'https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE' |
11 | flow: password | 11 | x-logo: |
12 | # Not implemented yet | 12 | url: 'https://joinpeertube.org/img/brand.png' |
13 | # authorizationUrl: https://example.com/oauth/authorize | 13 | description: | |
14 | tokenUrl: https://peertube.example.com/api/v1/users/token | 14 | # Introduction |
15 | basePath: '/api/v1' | 15 | The PeerTube API is built on HTTP(S). Our API is RESTful. It has predictable |
16 | schemes: | 16 | resource URLs. It returns HTTP response codes to indicate errors. It also |
17 | - https | 17 | accepts and returns JSON in the HTTP body. You can use your favorite |
18 | HTTP/REST library for your programming language to use PeerTube. No official | ||
19 | SDK is currently provided. | ||
20 | |||
21 | # Authentication | ||
22 | When you sign up for an account, you are given the possibility to generate | ||
23 | sessions, and authenticate using this session token. One session token can | ||
24 | currently be used at a time. | ||
25 | tags: | ||
26 | - name: Accounts | ||
27 | description: > | ||
28 | Using some features of PeerTube require authentication, for which Accounts | ||
29 | |||
30 | provide different levels of permission as well as associated user | ||
31 | information. | ||
32 | |||
33 | Accounts also encompass remote accounts discovered across the federation. | ||
34 | - name: Config | ||
35 | description: > | ||
36 | Each server exposes public information regarding supported videos and | ||
37 | options. | ||
38 | - name: Feeds | ||
39 | description: | | ||
40 | Feeds of videos and feeds of comments allow to see updates and get them in | ||
41 | an aggregator or script of your choice. | ||
42 | - name: Job | ||
43 | description: > | ||
44 | Jobs are long-running tasks enqueued and processed by the instance | ||
45 | itself. | ||
46 | |||
47 | No additional worker registration is currently available. | ||
48 | - name: ServerFollowing | ||
49 | description: > | ||
50 | Managing servers which the instance interacts with is crucial to the | ||
51 | concept | ||
52 | |||
53 | of federation in PeerTube and external video indexation. The PeerTube | ||
54 | server | ||
55 | |||
56 | then deals with inter-server ActivityPub operations and propagates | ||
57 | |||
58 | information across its social graph by posting activities to actors' inbox | ||
59 | |||
60 | endpoints. | ||
61 | - name: VideoAbuse | ||
62 | description: | | ||
63 | Video abuses deal with reports of local or remote videos alike. | ||
64 | - name: Video | ||
65 | description: | | ||
66 | Operations dealing with listing, uploading, fetching or modifying videos. | ||
67 | - name: Search | ||
68 | description: | | ||
69 | The search helps to find _videos_ from within the instance and beyond. | ||
70 | Videos from other instances federated by the instance (that is, instances | ||
71 | followed by the instance) can be found via keywords and other criteria of | ||
72 | the advanced search. | ||
73 | - name: VideoComment | ||
74 | description: > | ||
75 | Operations dealing with comments to a video. Comments are organized in | ||
76 | threads. | ||
77 | - name: VideoChannel | ||
78 | description: > | ||
79 | Operations dealing with creation, modification and video listing of a | ||
80 | user's | ||
81 | |||
82 | channels. | ||
18 | paths: | 83 | paths: |
19 | '/accounts/{name}': | 84 | '/accounts/{name}': |
20 | get: | 85 | get: |
21 | tags: | 86 | tags: |
22 | - Accounts | 87 | - Accounts |
23 | consumes: | 88 | summary: Get the account by name |
24 | - application/json | ||
25 | produces: | ||
26 | - application/json | ||
27 | parameters: | 89 | parameters: |
28 | - $ref: "accounts.yaml#/parameters/name" | 90 | - $ref: '#/components/parameters/name' |
29 | - $ref: "commons.yaml#/parameters/start" | 91 | - $ref: '#/components/parameters/start' |
30 | - $ref: "commons.yaml#/parameters/count" | 92 | - $ref: '#/components/parameters/count' |
31 | - $ref: "commons.yaml#/parameters/sort" | 93 | - $ref: '#/components/parameters/sort' |
32 | responses: | 94 | responses: |
33 | '200': | 95 | '200': |
34 | description: successful operation | 96 | description: successful operation |
35 | schema: | 97 | content: |
36 | $ref: '#/definitions/Account' | 98 | application/json: |
99 | schema: | ||
100 | $ref: '#/components/schemas/Account' | ||
37 | '/accounts/{name}/videos': | 101 | '/accounts/{name}/videos': |
38 | get: | 102 | get: |
39 | tags: | 103 | tags: |
40 | - Accounts | 104 | - Accounts |
41 | consumes: | 105 | - Video |
42 | - application/json | 106 | summary: 'Get videos for an account, provided the name of that account' |
43 | produces: | ||
44 | - application/json | ||
45 | parameters: | 107 | parameters: |
46 | - $ref: "accounts.yaml#/parameters/name" | 108 | - $ref: '#/components/parameters/name' |
47 | responses: | 109 | responses: |
48 | '200': | 110 | '200': |
49 | description: successful operation | 111 | description: successful operation |
50 | schema: | 112 | content: |
51 | $ref: '#/definitions/Video' | 113 | application/json: |
114 | schema: | ||
115 | $ref: '#/components/schemas/Video' | ||
116 | x-code-samples: | ||
117 | - lang: JavaScript | ||
118 | source: | | ||
119 | fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos') | ||
120 | .then(function(response) { | ||
121 | return response.json() | ||
122 | }).then(function(data) { | ||
123 | console.log(data) | ||
124 | }) | ||
125 | - lang: Shell | ||
126 | source: | | ||
127 | # pip install httpie | ||
128 | http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos | ||
52 | /accounts: | 129 | /accounts: |
53 | get: | 130 | get: |
54 | tags: | 131 | tags: |
55 | - Accounts | 132 | - Accounts |
56 | consumes: | 133 | summary: Get all accounts |
57 | - application/json | ||
58 | produces: | ||
59 | - application/json | ||
60 | responses: | 134 | responses: |
61 | '200': | 135 | '200': |
62 | description: successful operation | 136 | description: successful operation |
63 | schema: | 137 | content: |
64 | type: array | 138 | 'application/json': |
65 | items: | 139 | schema: |
66 | $ref: '#/definitions/Account' | 140 | type: array |
141 | items: | ||
142 | $ref: '#/components/schemas/Account' | ||
67 | /config: | 143 | /config: |
68 | get: | 144 | get: |
69 | tags: | 145 | tags: |
70 | - Config | 146 | - Config |
71 | consumes: | 147 | summary: Get the configuration of the server |
72 | - application/json | ||
73 | produces: | ||
74 | - application/json | ||
75 | responses: | 148 | responses: |
76 | '200': | 149 | '200': |
77 | description: successful operation | 150 | description: successful operation |
78 | schema: | 151 | content: |
79 | $ref: '#/definitions/ServerConfig' | 152 | application/json: |
80 | /feeds/videos.{format}: | 153 | schema: |
154 | $ref: '#/components/schemas/ServerConfig' | ||
155 | '/feeds/videos.{format}': | ||
81 | get: | 156 | get: |
157 | summary: >- | ||
158 | Get the feed of videos for the server, with optional filter by account | ||
159 | name or id | ||
82 | tags: | 160 | tags: |
83 | - Feeds | 161 | - Feeds |
84 | produces: | ||
85 | - application/atom+xml | ||
86 | - application/rss+xml | ||
87 | - application/json | ||
88 | parameters: | 162 | parameters: |
89 | - name: format | 163 | - name: format |
90 | in: path | 164 | in: path |
91 | required: true | 165 | required: true |
92 | type: string | 166 | description: >- |
93 | enum: [ 'xml', 'atom', 'json'] | 167 | The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and |
94 | default: 'xml' | 168 | json to JSON FEED 1.0 |
95 | description: 'The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and json to JSON FEED 1.0' | 169 | schema: |
170 | type: string | ||
171 | enum: | ||
172 | - xml | ||
173 | - atom | ||
174 | - json | ||
175 | default: xml | ||
96 | - name: accountId | 176 | - name: accountId |
97 | in: query | 177 | in: query |
98 | required: false | 178 | required: false |
99 | type: number | 179 | description: >- |
100 | description: 'The id of the local account to filter to (beware, users IDs and not actors IDs which will return empty feeds' | 180 | The id of the local account to filter to (beware, users IDs and not |
181 | actors IDs which will return empty feeds | ||
182 | schema: | ||
183 | type: number | ||
101 | - name: accountName | 184 | - name: accountName |
102 | in: query | 185 | in: query |
103 | required: false | 186 | required: false |
104 | type: string | 187 | description: The name of the local account to filter to |
105 | description: 'The name of the local account to filter to' | 188 | schema: |
189 | type: string | ||
106 | responses: | 190 | responses: |
107 | '200': | 191 | '200': |
108 | description: successful operation | 192 | description: successful operation |
109 | /jobs: | 193 | /jobs: |
110 | get: | 194 | get: |
195 | summary: Get list of jobs | ||
111 | security: | 196 | security: |
112 | - OAuth2: [ ] | 197 | - OAuth2: |
198 | - admin | ||
113 | tags: | 199 | tags: |
114 | - Job | 200 | - Job |
115 | consumes: | ||
116 | - application/json | ||
117 | produces: | ||
118 | - application/json | ||
119 | parameters: | 201 | parameters: |
120 | - name: state | 202 | - name: state |
121 | in: path | 203 | in: path |
122 | required: true | 204 | required: true |
123 | type: string | 205 | description: The state of the job |
124 | description: 'The state of the job' | 206 | schema: |
125 | - $ref: "commons.yaml#/parameters/start" | 207 | type: string |
126 | - $ref: "commons.yaml#/parameters/count" | 208 | - $ref: '#/components/parameters/start' |
127 | - $ref: "commons.yaml#/parameters/sort" | 209 | - $ref: '#/components/parameters/count' |
210 | - $ref: '#/components/parameters/sort' | ||
128 | responses: | 211 | responses: |
129 | '200': | 212 | '200': |
130 | description: successful operation | 213 | description: successful operation |
131 | schema: | 214 | content: |
132 | type: array | 215 | application/json: |
133 | items: | 216 | schema: |
134 | $ref: '#/definitions/Job' | 217 | type: array |
218 | items: | ||
219 | $ref: '#/components/schemas/Job' | ||
135 | '/server/following/{host}': | 220 | '/server/following/{host}': |
136 | delete: | 221 | delete: |
137 | security: | 222 | security: |
138 | - OAuth2: [ ] | 223 | - OAuth2: |
224 | - admin | ||
139 | tags: | 225 | tags: |
140 | - ServerFollowing | 226 | - ServerFollowing |
141 | consumes: | 227 | summary: Unfollow a server by hostname |
142 | - application/json | ||
143 | produces: | ||
144 | - application/json | ||
145 | parameters: | 228 | parameters: |
146 | - name: host | 229 | - name: host |
147 | in: path | 230 | in: path |
148 | required: true | 231 | required: true |
149 | type: string | ||
150 | description: 'The host to unfollow ' | 232 | description: 'The host to unfollow ' |
233 | schema: | ||
234 | type: string | ||
151 | responses: | 235 | responses: |
152 | '201': | 236 | '201': |
153 | description: successful operation | 237 | description: successful operation |
@@ -155,1232 +239,1384 @@ paths: | |||
155 | get: | 239 | get: |
156 | tags: | 240 | tags: |
157 | - ServerFollowing | 241 | - ServerFollowing |
158 | consumes: | 242 | summary: Get followers of the server |
159 | - application/json | ||
160 | produces: | ||
161 | - application/json | ||
162 | parameters: | 243 | parameters: |
163 | - $ref: "commons.yaml#/parameters/start" | 244 | - $ref: '#/components/parameters/start' |
164 | - $ref: "commons.yaml#/parameters/count" | 245 | - $ref: '#/components/parameters/count' |
165 | - $ref: "commons.yaml#/parameters/sort" | 246 | - $ref: '#/components/parameters/sort' |
166 | responses: | 247 | responses: |
167 | '200': | 248 | '200': |
168 | description: successful operation | 249 | description: successful operation |
169 | schema: | 250 | content: |
170 | type: array | 251 | application/json: |
171 | items: | 252 | schema: |
172 | $ref: '#/definitions/Follow' | 253 | type: array |
254 | items: | ||
255 | $ref: '#/components/schemas/Follow' | ||
173 | /server/following: | 256 | /server/following: |
174 | get: | 257 | get: |
175 | tags: | 258 | tags: |
176 | - ServerFollowing | 259 | - ServerFollowing |
177 | consumes: | 260 | summary: Get servers followed by the server |
178 | - application/json | ||
179 | produces: | ||
180 | - application/json | ||
181 | parameters: | 261 | parameters: |
182 | - $ref: "commons.yaml#/parameters/start" | 262 | - $ref: '#/components/parameters/start' |
183 | - $ref: "commons.yaml#/parameters/count" | 263 | - $ref: '#/components/parameters/count' |
184 | - $ref: "commons.yaml#/parameters/sort" | 264 | - $ref: '#/components/parameters/sort' |
185 | responses: | 265 | responses: |
186 | '200': | 266 | '200': |
187 | description: successful operation | 267 | description: successful operation |
188 | schema: | 268 | content: |
189 | type: array | 269 | application/json: |
190 | items: | 270 | schema: |
191 | $ref: '#/definitions/Follow' | 271 | type: array |
272 | items: | ||
273 | $ref: '#/components/schemas/Follow' | ||
192 | post: | 274 | post: |
193 | security: | 275 | security: |
194 | - OAuth2: [ ] | 276 | - OAuth2: |
277 | - admin | ||
195 | tags: | 278 | tags: |
196 | - ServerFollowing | 279 | - ServerFollowing |
197 | consumes: | 280 | summary: Follow a server |
198 | - application/json | ||
199 | produces: | ||
200 | - application/json | ||
201 | parameters: | ||
202 | - in: body | ||
203 | name: body | ||
204 | schema: | ||
205 | $ref: '#/definitions/Follow' | ||
206 | responses: | 281 | responses: |
207 | '204': | 282 | '204': |
208 | $ref: "commons.yaml#/responses/emptySuccess" | 283 | $ref: '#/paths/~1users~1me/put/responses/204' |
284 | requestBody: | ||
285 | content: | ||
286 | application/json: | ||
287 | schema: | ||
288 | $ref: '#/components/schemas/Follow' | ||
209 | /users: | 289 | /users: |
210 | post: | 290 | post: |
291 | summary: Creates user | ||
211 | security: | 292 | security: |
212 | - OAuth2: [ ] | 293 | - OAuth2: |
294 | - admin | ||
213 | tags: | 295 | tags: |
214 | - User | 296 | - User |
215 | consumes: | ||
216 | - application/json | ||
217 | produces: | ||
218 | - application/json | ||
219 | parameters: | ||
220 | - in: body | ||
221 | name: body | ||
222 | required: true | ||
223 | description: 'User to create' | ||
224 | schema: | ||
225 | $ref: '#/definitions/AddUser' | ||
226 | responses: | 297 | responses: |
227 | '200': | 298 | '200': |
228 | description: successful operation | 299 | description: successful operation |
229 | schema: | 300 | content: |
230 | $ref: '#/definitions/AddUserResponse' | 301 | application/json: |
302 | schema: | ||
303 | $ref: '#/components/schemas/AddUserResponse' | ||
304 | requestBody: | ||
305 | content: | ||
306 | application/json: | ||
307 | schema: | ||
308 | $ref: '#/components/schemas/AddUser' | ||
309 | description: User to create | ||
310 | required: true | ||
231 | get: | 311 | get: |
312 | summary: Get a list of users | ||
232 | security: | 313 | security: |
233 | - OAuth2: [ ] | 314 | - OAuth2: [] |
234 | tags: | 315 | tags: |
235 | - User | 316 | - User |
236 | consumes: | ||
237 | - application/json | ||
238 | produces: | ||
239 | - application/json | ||
240 | parameters: | 317 | parameters: |
241 | - $ref: "commons.yaml#/parameters/start" | 318 | - $ref: '#/components/parameters/start' |
242 | - $ref: "commons.yaml#/parameters/count" | 319 | - $ref: '#/components/parameters/count' |
243 | - $ref: "commons.yaml#/parameters/sort" | 320 | - $ref: '#/components/parameters/sort' |
244 | responses: | 321 | responses: |
245 | '200': | 322 | '200': |
246 | description: successful operation | 323 | description: successful operation |
247 | schema: | 324 | content: |
248 | type: array | 325 | application/json: |
249 | items: | 326 | schema: |
250 | $ref: '#/definitions/User' | 327 | type: array |
328 | items: | ||
329 | $ref: '#/components/schemas/User' | ||
251 | '/users/{id}': | 330 | '/users/{id}': |
252 | delete: | 331 | delete: |
332 | summary: Delete a user by its id | ||
253 | security: | 333 | security: |
254 | - OAuth2: [ ] | 334 | - OAuth2: |
335 | - admin | ||
255 | tags: | 336 | tags: |
256 | - User | 337 | - User |
257 | consumes: | ||
258 | - application/json | ||
259 | produces: | ||
260 | - application/json | ||
261 | parameters: | 338 | parameters: |
262 | - $ref: "users.yaml#/parameters/id" | 339 | - $ref: '#/components/parameters/id' |
263 | responses: | 340 | responses: |
264 | '204': | 341 | '204': |
265 | $ref: "commons.yaml#/responses/emptySuccess" | 342 | $ref: '#/paths/~1users~1me/put/responses/204' |
266 | get: | 343 | get: |
344 | summary: Get user by its id | ||
267 | security: | 345 | security: |
268 | - OAuth2: [ ] | 346 | - OAuth2: [] |
269 | tags: | 347 | tags: |
270 | - User | 348 | - User |
271 | consumes: | ||
272 | - application/json | ||
273 | produces: | ||
274 | - application/json | ||
275 | parameters: | 349 | parameters: |
276 | - $ref: "users.yaml#/parameters/id" | 350 | - $ref: '#/components/parameters/id' |
277 | responses: | 351 | responses: |
278 | '200': | 352 | '200': |
279 | description: successful operation | 353 | description: successful operation |
280 | schema: | 354 | content: |
281 | $ref: '#/definitions/User' | 355 | application/json: |
356 | schema: | ||
357 | $ref: '#/components/schemas/User' | ||
282 | put: | 358 | put: |
359 | summary: Update user profile by its id | ||
283 | security: | 360 | security: |
284 | - OAuth2: [ ] | 361 | - OAuth2: [] |
285 | tags: | 362 | tags: |
286 | - User | 363 | - User |
287 | consumes: | ||
288 | - application/json | ||
289 | produces: | ||
290 | - application/json | ||
291 | parameters: | 364 | parameters: |
292 | - $ref: "users.yaml#/parameters/id" | 365 | - $ref: '#/components/parameters/id' |
293 | - in: body | ||
294 | name: body | ||
295 | required: true | ||
296 | schema: | ||
297 | $ref: '#/definitions/UpdateUser' | ||
298 | responses: | 366 | responses: |
299 | '204': | 367 | '204': |
300 | $ref: "commons.yaml#/responses/emptySuccess" | 368 | $ref: '#/paths/~1users~1me/put/responses/204' |
369 | requestBody: | ||
370 | content: | ||
371 | application/json: | ||
372 | schema: | ||
373 | $ref: '#/components/schemas/UpdateUser' | ||
374 | required: true | ||
301 | /users/me: | 375 | /users/me: |
302 | get: | 376 | get: |
377 | summary: Get current user information | ||
303 | security: | 378 | security: |
304 | - OAuth2: [ ] | 379 | - OAuth2: [] |
305 | tags: | 380 | tags: |
306 | - User | 381 | - User |
307 | consumes: | ||
308 | - application/json | ||
309 | produces: | ||
310 | - application/json | ||
311 | responses: | 382 | responses: |
312 | '200': | 383 | '200': |
313 | description: successful operation | 384 | description: successful operation |
314 | schema: | 385 | content: |
315 | type: array | 386 | application/json: |
316 | items: | 387 | schema: |
317 | $ref: '#/definitions/User' | 388 | type: array |
389 | items: | ||
390 | $ref: '#/components/schemas/User' | ||
318 | put: | 391 | put: |
392 | summary: Update current user information | ||
319 | security: | 393 | security: |
320 | - OAuth2: [ ] | 394 | - OAuth2: [] |
321 | tags: | 395 | tags: |
322 | - User | 396 | - User |
323 | consumes: | ||
324 | - application/json | ||
325 | produces: | ||
326 | - application/json | ||
327 | parameters: | ||
328 | - in: body | ||
329 | name: body | ||
330 | required: true | ||
331 | schema: | ||
332 | $ref: '#/definitions/UpdateMe' | ||
333 | responses: | 397 | responses: |
334 | '204': | 398 | '204': |
335 | $ref: "commons.yaml#/responses/emptySuccess" | 399 | description: Successful operation |
400 | requestBody: | ||
401 | content: | ||
402 | application/json: | ||
403 | schema: | ||
404 | $ref: '#/components/schemas/UpdateMe' | ||
405 | required: true | ||
336 | /users/me/video-quota-used: | 406 | /users/me/video-quota-used: |
337 | get: | 407 | get: |
408 | summary: Get current user used quota | ||
338 | security: | 409 | security: |
339 | - OAuth2: [ ] | 410 | - OAuth2: [] |
340 | tags: | 411 | tags: |
341 | - User | 412 | - User |
342 | consumes: | ||
343 | - application/json | ||
344 | produces: | ||
345 | - application/json | ||
346 | parameters: [] | ||
347 | responses: | 413 | responses: |
348 | '200': | 414 | '200': |
349 | description: successful operation | 415 | description: successful operation |
350 | schema: | 416 | content: |
351 | type: number | 417 | application/json: |
418 | schema: | ||
419 | type: number | ||
352 | '/users/me/videos/{videoId}/rating': | 420 | '/users/me/videos/{videoId}/rating': |
353 | get: | 421 | get: |
422 | summary: 'Get rating of video by its id, among those of the current user' | ||
354 | security: | 423 | security: |
355 | - OAuth2: [ ] | 424 | - OAuth2: [] |
356 | tags: | 425 | tags: |
357 | - User | 426 | - User |
358 | consumes: | ||
359 | - application/json | ||
360 | produces: | ||
361 | - application/json | ||
362 | parameters: | 427 | parameters: |
363 | - name: videoId | 428 | - name: videoId |
364 | in: path | 429 | in: path |
365 | required: true | 430 | required: true |
366 | type: string | ||
367 | description: 'The video id ' | 431 | description: 'The video id ' |
432 | schema: | ||
433 | type: string | ||
368 | responses: | 434 | responses: |
369 | '200': | 435 | '200': |
370 | description: successful operation | 436 | description: successful operation |
371 | schema: | 437 | content: |
372 | $ref: '#/definitions/GetMeVideoRating' | 438 | application/json: |
439 | schema: | ||
440 | $ref: '#/components/schemas/GetMeVideoRating' | ||
373 | /users/me/videos: | 441 | /users/me/videos: |
374 | get: | 442 | get: |
443 | summary: Get videos of the current user | ||
375 | security: | 444 | security: |
376 | - OAuth2: [ ] | 445 | - OAuth2: [] |
377 | tags: | 446 | tags: |
378 | - User | 447 | - User |
379 | consumes: | ||
380 | - application/json | ||
381 | produces: | ||
382 | - application/json | ||
383 | parameters: | 448 | parameters: |
384 | - $ref: "commons.yaml#/parameters/start" | 449 | - $ref: '#/components/parameters/start' |
385 | - $ref: "commons.yaml#/parameters/count" | 450 | - $ref: '#/components/parameters/count' |
386 | - $ref: "commons.yaml#/parameters/sort" | 451 | - $ref: '#/components/parameters/sort' |
387 | responses: | 452 | responses: |
388 | '200': | 453 | '200': |
389 | description: successful operation | 454 | description: successful operation |
390 | schema: | 455 | content: |
391 | type: array | 456 | application/json: |
392 | items: | 457 | schema: |
393 | $ref: '#/definitions/Video' | 458 | type: array |
459 | items: | ||
460 | $ref: '#/components/schemas/Video' | ||
394 | /users/register: | 461 | /users/register: |
395 | post: | 462 | post: |
463 | summary: Register a user | ||
396 | tags: | 464 | tags: |
397 | - User | 465 | - User |
398 | consumes: | ||
399 | - application/json | ||
400 | produces: | ||
401 | - application/json | ||
402 | parameters: | ||
403 | - in: body | ||
404 | name: body | ||
405 | required: true | ||
406 | schema: | ||
407 | $ref: '#/definitions/RegisterUser' | ||
408 | responses: | 466 | responses: |
409 | '204': | 467 | '204': |
410 | $ref: "commons.yaml#/responses/emptySuccess" | 468 | $ref: '#/paths/~1users~1me/put/responses/204' |
469 | requestBody: | ||
470 | content: | ||
471 | application/json: | ||
472 | schema: | ||
473 | $ref: '#/components/schemas/RegisterUser' | ||
474 | required: true | ||
411 | /users/me/avatar/pick: | 475 | /users/me/avatar/pick: |
412 | post: | 476 | post: |
477 | summary: Update current user avatar | ||
413 | security: | 478 | security: |
414 | - OAuth2: [ ] | 479 | - OAuth2: [] |
415 | tags: | 480 | tags: |
416 | - User | 481 | - User |
417 | consumes: | ||
418 | - multipart/form-data | ||
419 | produces: | ||
420 | - application/json | ||
421 | parameters: | ||
422 | - in: formData | ||
423 | name: avatarfile | ||
424 | type: file | ||
425 | description: The file to upload. | ||
426 | responses: | 482 | responses: |
427 | '200': | 483 | '200': |
428 | description: successful operation | 484 | description: successful operation |
429 | schema: | 485 | content: |
430 | $ref: '#/definitions/Avatar' | 486 | application/json: |
487 | schema: | ||
488 | $ref: '#/components/schemas/Avatar' | ||
489 | requestBody: | ||
490 | content: | ||
491 | multipart/form-data: | ||
492 | schema: | ||
493 | type: object | ||
494 | properties: | ||
495 | avatarfile: | ||
496 | description: The file to upload. | ||
497 | type: string | ||
498 | format: binary | ||
499 | encoding: | ||
500 | profileImage: | ||
501 | # only accept png/jpeg | ||
502 | contentType: image/png, image/jpeg | ||
431 | /videos: | 503 | /videos: |
432 | get: | 504 | get: |
505 | summary: Get list of videos | ||
433 | tags: | 506 | tags: |
434 | - Video | 507 | - Video |
435 | consumes: | ||
436 | - application/json | ||
437 | produces: | ||
438 | - application/json | ||
439 | parameters: | 508 | parameters: |
440 | - name: category | 509 | - name: category |
441 | in: query | 510 | in: query |
442 | required: false | 511 | required: false |
443 | type: number | ||
444 | description: category id of the video | 512 | description: category id of the video |
445 | - $ref: "commons.yaml#/parameters/start" | 513 | schema: |
446 | - $ref: "commons.yaml#/parameters/count" | 514 | type: number |
447 | - $ref: "commons.yaml#/parameters/sort" | 515 | - $ref: '#/components/parameters/start' |
516 | - $ref: '#/components/parameters/count' | ||
517 | - $ref: '#/components/parameters/sort' | ||
448 | responses: | 518 | responses: |
449 | '200': | 519 | '200': |
450 | description: successful operation | 520 | description: successful operation |
451 | schema: | 521 | content: |
452 | type: array | 522 | application/json: |
453 | items: | 523 | schema: |
454 | $ref: '#/definitions/Video' | 524 | type: array |
525 | items: | ||
526 | $ref: '#/components/schemas/Video' | ||
455 | /videos/categories: | 527 | /videos/categories: |
456 | get: | 528 | get: |
529 | summary: Get list of video licences known by the server | ||
457 | tags: | 530 | tags: |
458 | - Video | 531 | - Video |
459 | consumes: | ||
460 | - application/json | ||
461 | produces: | ||
462 | - application/json | ||
463 | responses: | 532 | responses: |
464 | '200': | 533 | '200': |
465 | description: successful operation | 534 | description: successful operation |
466 | schema: | 535 | content: |
467 | type: array | 536 | application/json: |
468 | items: | 537 | schema: |
469 | type: string | 538 | type: array |
539 | items: | ||
540 | type: string | ||
470 | /videos/licences: | 541 | /videos/licences: |
471 | get: | 542 | get: |
543 | summary: Get list of video licences known by the server | ||
472 | tags: | 544 | tags: |
473 | - Video | 545 | - Video |
474 | consumes: | ||
475 | - application/json | ||
476 | produces: | ||
477 | - application/json | ||
478 | responses: | 546 | responses: |
479 | '200': | 547 | '200': |
480 | description: successful operation | 548 | description: successful operation |
481 | schema: | 549 | content: |
482 | type: array | 550 | application/json: |
483 | items: | 551 | schema: |
484 | type: string | 552 | type: array |
553 | items: | ||
554 | type: string | ||
485 | /videos/languages: | 555 | /videos/languages: |
486 | get: | 556 | get: |
557 | summary: Get list of languages known by the server | ||
487 | tags: | 558 | tags: |
488 | - Video | 559 | - Video |
489 | consumes: | ||
490 | - application/json | ||
491 | produces: | ||
492 | - application/json | ||
493 | responses: | 560 | responses: |
494 | '200': | 561 | '200': |
495 | description: successful operation | 562 | description: successful operation |
496 | schema: | 563 | content: |
497 | type: array | 564 | application/json: |
498 | items: | 565 | schema: |
499 | type: string | 566 | type: array |
567 | items: | ||
568 | type: string | ||
500 | /videos/privacies: | 569 | /videos/privacies: |
501 | get: | 570 | get: |
571 | summary: Get list of privacy policies supported by the server | ||
502 | tags: | 572 | tags: |
503 | - Video | 573 | - Video |
504 | consumes: | ||
505 | - application/json | ||
506 | produces: | ||
507 | - application/json | ||
508 | responses: | 574 | responses: |
509 | '200': | 575 | '200': |
510 | description: successful operation | 576 | description: successful operation |
511 | schema: | 577 | content: |
512 | type: array | 578 | application/json: |
513 | items: | 579 | schema: |
514 | type: string | 580 | type: array |
515 | "/videos/{id}": | 581 | items: |
582 | type: string | ||
583 | '/videos/{id}': | ||
516 | put: | 584 | put: |
585 | summary: Update metadata for a video by its id | ||
517 | security: | 586 | security: |
518 | - OAuth2: [ ] | 587 | - OAuth2: [] |
519 | tags: | 588 | tags: |
520 | - Video | 589 | - Video |
521 | consumes: | ||
522 | - multipart/form-data | ||
523 | produces: | ||
524 | - application/json | ||
525 | parameters: | 590 | parameters: |
526 | - $ref: "videos.yaml#/parameters/id" | 591 | - $ref: '#/components/parameters/id2' |
527 | - $ref: "videos.yaml#/parameters/thumbnailfile" | ||
528 | - $ref: "videos.yaml#/parameters/previewfile" | ||
529 | - $ref: "videos.yaml#/parameters/category" | ||
530 | - $ref: "videos.yaml#/parameters/licence" | ||
531 | - $ref: "videos.yaml#/parameters/language" | ||
532 | - $ref: "videos.yaml#/parameters/description" | ||
533 | - $ref: "videos.yaml#/parameters/waitTranscoding" | ||
534 | - $ref: "videos.yaml#/parameters/support" | ||
535 | - $ref: "videos.yaml#/parameters/nsfw" | ||
536 | - $ref: "videos.yaml#/parameters/name" | ||
537 | - $ref: "videos.yaml#/parameters/tags" | ||
538 | - $ref: "videos.yaml#/parameters/commentsEnabled" | ||
539 | - $ref: "videos.yaml#/parameters/privacy" | ||
540 | - $ref: "videos.yaml#/parameters/scheduleUpdate" | ||
541 | responses: | 592 | responses: |
542 | '200': | 593 | '200': |
543 | description: successful operation | 594 | description: successful operation |
544 | schema: | 595 | content: |
545 | $ref: '#/definitions/Video' | 596 | application/json: |
597 | schema: | ||
598 | $ref: '#/components/schemas/Video' | ||
599 | requestBody: | ||
600 | content: | ||
601 | multipart/form-data: | ||
602 | schema: | ||
603 | type: object | ||
604 | properties: | ||
605 | thumbnailfile: | ||
606 | description: Video thumbnail file | ||
607 | type: string | ||
608 | previewfile: | ||
609 | description: Video preview file | ||
610 | type: string | ||
611 | category: | ||
612 | description: Video category | ||
613 | type: string | ||
614 | licence: | ||
615 | description: Video licence | ||
616 | type: string | ||
617 | language: | ||
618 | description: Video language | ||
619 | type: string | ||
620 | description: | ||
621 | description: Video description | ||
622 | type: string | ||
623 | waitTranscoding: | ||
624 | description: Whether or not we wait transcoding before publish the video | ||
625 | type: string | ||
626 | support: | ||
627 | description: Text describing how to support the video uploader | ||
628 | type: string | ||
629 | nsfw: | ||
630 | description: Whether or not this video contains sensitive content | ||
631 | type: string | ||
632 | name: | ||
633 | description: Video name | ||
634 | type: string | ||
635 | tags: | ||
636 | description: Video tags | ||
637 | type: string | ||
638 | commentsEnabled: | ||
639 | description: Enable or disable comments for this video | ||
640 | type: string | ||
641 | scheduleUpdate: &ref_0 | ||
642 | type: object | ||
643 | properties: | ||
644 | privacy: | ||
645 | type: string | ||
646 | enum: | ||
647 | - Public | ||
648 | - Unlisted | ||
649 | description: Video privacy target | ||
650 | updateAt: | ||
651 | type: string | ||
652 | format: date | ||
653 | description: When to update the video | ||
654 | required: | ||
655 | - updateAt | ||
546 | get: | 656 | get: |
657 | summary: Get a video by its id | ||
547 | tags: | 658 | tags: |
548 | - Video | 659 | - Video |
549 | consumes: | ||
550 | - application/json | ||
551 | produces: | ||
552 | - application/json | ||
553 | parameters: | 660 | parameters: |
554 | - $ref: "videos.yaml#/parameters/id" | 661 | - $ref: '#/components/parameters/id2' |
555 | responses: | 662 | responses: |
556 | '200': | 663 | '200': |
557 | description: successful operation | 664 | description: successful operation |
558 | schema: | 665 | content: |
559 | $ref: '#/definitions/Video' | 666 | application/json: |
667 | schema: | ||
668 | $ref: '#/components/schemas/Video' | ||
560 | delete: | 669 | delete: |
670 | summary: Delete a video by its id | ||
561 | security: | 671 | security: |
562 | - OAuth2: [ ] | 672 | - OAuth2: [] |
563 | tags: | 673 | tags: |
564 | - Video | 674 | - Video |
565 | consumes: | ||
566 | - application/json | ||
567 | produces: | ||
568 | - application/json | ||
569 | parameters: | 675 | parameters: |
570 | - $ref: "videos.yaml#/parameters/id" | 676 | - $ref: '#/components/parameters/id2' |
571 | responses: | 677 | responses: |
572 | '204': | 678 | '204': |
573 | $ref: "commons.yaml#/responses/emptySuccess" | 679 | $ref: '#/paths/~1users~1me/put/responses/204' |
574 | "/videos/{id}/description": | 680 | '/videos/{id}/description': |
575 | get: | 681 | get: |
682 | summary: Get a video description by its id | ||
576 | tags: | 683 | tags: |
577 | - Video | 684 | - Video |
578 | consumes: | ||
579 | - application/json | ||
580 | produces: | ||
581 | - application/json | ||
582 | parameters: | 685 | parameters: |
583 | - $ref: "videos.yaml#/parameters/id" | 686 | - $ref: '#/components/parameters/id2' |
584 | responses: | 687 | responses: |
585 | '200': | 688 | '200': |
586 | description: successful operation | 689 | description: successful operation |
587 | schema: | 690 | content: |
588 | type: string | 691 | application/json: |
589 | "/videos/{id}/views": | 692 | schema: |
693 | type: string | ||
694 | '/videos/{id}/views': | ||
590 | post: | 695 | post: |
696 | summary: Add a view to the video by its id | ||
591 | tags: | 697 | tags: |
592 | - Video | 698 | - Video |
593 | consumes: | ||
594 | - application/json | ||
595 | produces: | ||
596 | - application/json | ||
597 | parameters: | 699 | parameters: |
598 | - $ref: "videos.yaml#/parameters/id" | 700 | - $ref: '#/components/parameters/id2' |
599 | responses: | 701 | responses: |
600 | '204': | 702 | '204': |
601 | $ref: "commons.yaml#/responses/emptySuccess" | 703 | $ref: '#/paths/~1users~1me/put/responses/204' |
602 | /videos/upload: | 704 | /videos/upload: |
603 | post: | 705 | post: |
706 | summary: Upload a video file with its metadata | ||
604 | security: | 707 | security: |
605 | - OAuth2: [ ] | 708 | - OAuth2: [] |
606 | tags: | 709 | tags: |
607 | - Video | 710 | - Video |
608 | consumes: | ||
609 | - multipart/form-data | ||
610 | produces: | ||
611 | - application/json | ||
612 | parameters: | ||
613 | - name: videofile | ||
614 | in: formData | ||
615 | type: file | ||
616 | required: true | ||
617 | description: 'Video file' | ||
618 | - name: channelId | ||
619 | in: formData | ||
620 | required: true | ||
621 | type: number | ||
622 | description: 'Channel id that will contain this video' | ||
623 | - $ref: "videos.yaml#/parameters/thumbnailfile" | ||
624 | - $ref: "videos.yaml#/parameters/previewfile" | ||
625 | - $ref: "videos.yaml#/parameters/category" | ||
626 | - $ref: "videos.yaml#/parameters/licence" | ||
627 | - $ref: "videos.yaml#/parameters/language" | ||
628 | - $ref: "videos.yaml#/parameters/description" | ||
629 | - $ref: "videos.yaml#/parameters/waitTranscoding" | ||
630 | - $ref: "videos.yaml#/parameters/support" | ||
631 | - $ref: "videos.yaml#/parameters/nsfw" | ||
632 | - $ref: "videos.yaml#/parameters/name" | ||
633 | - $ref: "videos.yaml#/parameters/tags" | ||
634 | - $ref: "videos.yaml#/parameters/commentsEnabled" | ||
635 | - $ref: "videos.yaml#/parameters/privacy" | ||
636 | - $ref: "videos.yaml#/parameters/scheduleUpdate" | ||
637 | responses: | 711 | responses: |
638 | '200': | 712 | '200': |
639 | description: successful operation | 713 | description: successful operation |
640 | schema: | 714 | content: |
641 | $ref: '#/definitions/VideoUploadResponse' | 715 | application/json: |
716 | schema: | ||
717 | $ref: '#/components/schemas/VideoUploadResponse' | ||
718 | requestBody: | ||
719 | content: | ||
720 | multipart/form-data: | ||
721 | schema: | ||
722 | type: object | ||
723 | properties: | ||
724 | videofile: | ||
725 | description: Video file | ||
726 | type: string | ||
727 | format: binary | ||
728 | channelId: | ||
729 | description: Channel id that will contain this video | ||
730 | type: number | ||
731 | thumbnailfile: | ||
732 | description: Video thumbnail file | ||
733 | type: string | ||
734 | previewfile: | ||
735 | description: Video preview file | ||
736 | type: string | ||
737 | privacy: | ||
738 | $ref: '#/components/schemas/VideoPrivacy' | ||
739 | category: | ||
740 | description: Video category | ||
741 | type: string | ||
742 | licence: | ||
743 | description: Video licence | ||
744 | type: string | ||
745 | language: | ||
746 | description: Video language | ||
747 | type: string | ||
748 | description: | ||
749 | description: Video description | ||
750 | type: string | ||
751 | waitTranscoding: | ||
752 | description: Whether or not we wait transcoding before publish the video | ||
753 | type: string | ||
754 | support: | ||
755 | description: Text describing how to support the video uploader | ||
756 | type: string | ||
757 | nsfw: | ||
758 | description: Whether or not this video contains sensitive content | ||
759 | type: string | ||
760 | name: | ||
761 | description: Video name | ||
762 | type: string | ||
763 | tags: | ||
764 | description: Video tags | ||
765 | type: string | ||
766 | commentsEnabled: | ||
767 | description: Enable or disable comments for this video | ||
768 | type: string | ||
769 | scheduleUpdate: *ref_0 | ||
770 | required: | ||
771 | - videofile | ||
772 | - channelId | ||
773 | - name | ||
774 | - privacy | ||
775 | x-code-samples: | ||
776 | - lang: Shell | ||
777 | source: | | ||
778 | ## DEPENDENCIES: httpie, jq | ||
779 | # pip install httpie | ||
780 | USERNAME="<your_username>" | ||
781 | PASSWORD="<your_password>" | ||
782 | FILE_PATH="<your_file_path>" | ||
783 | CHANNEL_ID="<your_channel_id>" | ||
784 | PRIVACY="1" # public: 1, unlisted: 2, private: 3 | ||
785 | NAME="<video_name>" | ||
786 | |||
787 | API_PATH="https://peertube2.cpy.re/api/v1" | ||
788 | ## AUTH | ||
789 | client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id") | ||
790 | client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret") | ||
791 | token=$(http -b --form POST "$API_PATH/users/token" \ | ||
792 | client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \ | ||
793 | username=$USERNAME \ | ||
794 | password=$PASSWORD \ | ||
795 | | jq -r ".access_token") | ||
796 | ## VIDEO UPLOAD | ||
797 | http -b --form POST "$API_PATH/videos/upload" \ | ||
798 | videofile@$FILE_PATH \ | ||
799 | channelId=$CHANNEL_ID \ | ||
800 | name=$NAME \ | ||
801 | privacy=$PRIVACY \ | ||
802 | "Authorization:Bearer $token" | ||
642 | /videos/abuse: | 803 | /videos/abuse: |
643 | get: | 804 | get: |
805 | summary: Get list of reported video abuses | ||
644 | security: | 806 | security: |
645 | - OAuth2: [ ] | 807 | - OAuth2: [] |
646 | tags: | 808 | tags: |
647 | - VideoAbuse | 809 | - VideoAbuse |
648 | consumes: | ||
649 | - application/json | ||
650 | produces: | ||
651 | - application/json | ||
652 | parameters: | 810 | parameters: |
653 | - $ref: "commons.yaml#/parameters/start" | 811 | - $ref: '#/components/parameters/start' |
654 | - $ref: "commons.yaml#/parameters/count" | 812 | - $ref: '#/components/parameters/count' |
655 | - $ref: "commons.yaml#/parameters/sort" | 813 | - $ref: '#/components/parameters/sort' |
656 | responses: | 814 | responses: |
657 | '200': | 815 | '200': |
658 | description: successful operation | 816 | description: successful operation |
659 | schema: | 817 | content: |
660 | type: array | 818 | application/json: |
661 | items: | 819 | schema: |
662 | $ref: '#/definitions/VideoAbuse' | 820 | type: array |
663 | "/videos/{id}/abuse": | 821 | items: |
822 | $ref: '#/components/schemas/VideoAbuse' | ||
823 | '/videos/{id}/abuse': | ||
664 | post: | 824 | post: |
825 | summary: 'Report an abuse, on a video by its id' | ||
665 | security: | 826 | security: |
666 | - OAuth2: [ ] | 827 | - OAuth2: [] |
667 | tags: | 828 | tags: |
668 | - VideoAbuse | 829 | - VideoAbuse |
669 | consumes: | ||
670 | - application/json | ||
671 | produces: | ||
672 | - application/json | ||
673 | parameters: | 830 | parameters: |
674 | - $ref: "videos.yaml#/parameters/id" | 831 | - $ref: '#/components/parameters/id2' |
675 | responses: | 832 | responses: |
676 | '204': | 833 | '204': |
677 | $ref: "commons.yaml#/responses/emptySuccess" | 834 | $ref: '#/paths/~1users~1me/put/responses/204' |
678 | "/videos/{id}/blacklist": | 835 | '/videos/{id}/blacklist': |
679 | post: | 836 | post: |
837 | summary: Put on blacklist a video by its id | ||
680 | security: | 838 | security: |
681 | - OAuth2: [ ] | 839 | - OAuth2: |
840 | - admin | ||
841 | - moderator | ||
682 | tags: | 842 | tags: |
683 | - VideoBlacklist | 843 | - VideoBlacklist |
684 | consumes: | ||
685 | - application/json | ||
686 | produces: | ||
687 | - application/json | ||
688 | parameters: | 844 | parameters: |
689 | - $ref: "videos.yaml#/parameters/id" | 845 | - $ref: '#/components/parameters/id2' |
690 | responses: | 846 | responses: |
691 | '204': | 847 | '204': |
692 | $ref: "commons.yaml#/responses/emptySuccess" | 848 | $ref: '#/paths/~1users~1me/put/responses/204' |
693 | delete: | 849 | delete: |
850 | summary: Delete an entry of the blacklist of a video by its id | ||
694 | security: | 851 | security: |
695 | - OAuth2: [ ] | 852 | - OAuth2: |
853 | - admin | ||
854 | - moderator | ||
696 | tags: | 855 | tags: |
697 | - VideoBlacklist | 856 | - VideoBlacklist |
698 | consumes: | ||
699 | - application/json | ||
700 | produces: | ||
701 | - application/json | ||
702 | parameters: | 857 | parameters: |
703 | - $ref: "videos.yaml#/parameters/id" | 858 | - $ref: '#/components/parameters/id2' |
704 | responses: | 859 | responses: |
705 | '204': | 860 | '204': |
706 | $ref: "commons.yaml#/responses/emptySuccess" | 861 | $ref: '#/paths/~1users~1me/put/responses/204' |
707 | /videos/blacklist: | 862 | /videos/blacklist: |
708 | get: | 863 | get: |
864 | summary: Get list of videos on blacklist | ||
709 | security: | 865 | security: |
710 | - OAuth2: [ ] | 866 | - OAuth2: |
867 | - admin | ||
868 | - moderator | ||
711 | tags: | 869 | tags: |
712 | - VideoBlacklist | 870 | - VideoBlacklist |
713 | consumes: | ||
714 | - application/json | ||
715 | produces: | ||
716 | - application/json | ||
717 | parameters: | 871 | parameters: |
718 | - $ref: "commons.yaml#/parameters/start" | 872 | - $ref: '#/components/parameters/start' |
719 | - $ref: "commons.yaml#/parameters/count" | 873 | - $ref: '#/components/parameters/count' |
720 | - $ref: "commons.yaml#/parameters/sort" | 874 | - $ref: '#/components/parameters/sort' |
721 | responses: | 875 | responses: |
722 | '200': | 876 | '200': |
723 | description: successful operation | 877 | description: successful operation |
724 | schema: | 878 | content: |
725 | type: array | 879 | application/json: |
726 | items: | 880 | schema: |
727 | $ref: '#/definitions/VideoBlacklist' | 881 | type: array |
882 | items: | ||
883 | $ref: '#/components/schemas/VideoBlacklist' | ||
728 | /video-channels: | 884 | /video-channels: |
729 | get: | 885 | get: |
886 | summary: Get list of video channels | ||
730 | tags: | 887 | tags: |
731 | - VideoChannel | 888 | - VideoChannel |
732 | consumes: | ||
733 | - application/json | ||
734 | produces: | ||
735 | - application/json | ||
736 | parameters: | 889 | parameters: |
737 | - $ref: "commons.yaml#/parameters/start" | 890 | - $ref: '#/components/parameters/start' |
738 | - $ref: "commons.yaml#/parameters/count" | 891 | - $ref: '#/components/parameters/count' |
739 | - $ref: "commons.yaml#/parameters/sort" | 892 | - $ref: '#/components/parameters/sort' |
740 | responses: | 893 | responses: |
741 | '200': | 894 | '200': |
742 | description: successful operation | 895 | description: successful operation |
743 | schema: | 896 | content: |
744 | type: array | 897 | application/json: |
745 | items: | 898 | schema: |
746 | $ref: '#/definitions/VideoChannel' | 899 | type: array |
900 | items: | ||
901 | $ref: '#/components/schemas/VideoChannel' | ||
747 | post: | 902 | post: |
903 | summary: Creates a video channel for the current user | ||
748 | security: | 904 | security: |
749 | - OAuth2: [ ] | 905 | - OAuth2: [] |
750 | tags: | 906 | tags: |
751 | - VideoChannel | 907 | - VideoChannel |
752 | consumes: | ||
753 | - application/json | ||
754 | produces: | ||
755 | - application/json | ||
756 | parameters: | ||
757 | - in: body | ||
758 | name: body | ||
759 | schema: | ||
760 | $ref: '#/definitions/VideoChannelInput' | ||
761 | responses: | 908 | responses: |
762 | '204': | 909 | '204': |
763 | $ref: "commons.yaml#/responses/emptySuccess" | 910 | $ref: '#/paths/~1users~1me/put/responses/204' |
764 | "/video-channels/{id}": | 911 | requestBody: |
912 | $ref: '#/components/requestBodies/VideoChannelInput' | ||
913 | '/video-channels/{id}': | ||
765 | get: | 914 | get: |
915 | summary: Get a video channel by its id | ||
766 | tags: | 916 | tags: |
767 | - VideoChannel | 917 | - VideoChannel |
768 | consumes: | ||
769 | - application/json | ||
770 | produces: | ||
771 | - application/json | ||
772 | parameters: | 918 | parameters: |
773 | - $ref: "video-channels.yaml#/parameters/id" | 919 | - $ref: '#/components/parameters/id3' |
774 | responses: | 920 | responses: |
775 | '200': | 921 | '200': |
776 | description: successful operation | 922 | description: successful operation |
777 | schema: | 923 | content: |
778 | $ref: '#/definitions/VideoChannel' | 924 | application/json: |
925 | schema: | ||
926 | $ref: '#/components/schemas/VideoChannel' | ||
779 | put: | 927 | put: |
928 | summary: Update a video channel by its id | ||
780 | security: | 929 | security: |
781 | - OAuth2: [ ] | 930 | - OAuth2: [] |
782 | tags: | 931 | tags: |
783 | - VideoChannel | 932 | - VideoChannel |
784 | consumes: | ||
785 | - application/json | ||
786 | produces: | ||
787 | - application/json | ||
788 | parameters: | 933 | parameters: |
789 | - $ref: "video-channels.yaml#/parameters/id" | 934 | - $ref: '#/components/parameters/id3' |
790 | - in: body | ||
791 | name: body | ||
792 | schema: | ||
793 | $ref: '#/definitions/VideoChannelInput' | ||
794 | responses: | 935 | responses: |
795 | '204': | 936 | '204': |
796 | $ref: "commons.yaml#/responses/emptySuccess" | 937 | $ref: '#/paths/~1users~1me/put/responses/204' |
938 | requestBody: | ||
939 | $ref: '#/components/requestBodies/VideoChannelInput' | ||
797 | delete: | 940 | delete: |
941 | summary: Delete a video channel by its id | ||
798 | security: | 942 | security: |
799 | - OAuth2: [ ] | 943 | - OAuth2: [] |
800 | tags: | 944 | tags: |
801 | - VideoChannel | 945 | - VideoChannel |
802 | consumes: | ||
803 | - application/json | ||
804 | produces: | ||
805 | - application/json | ||
806 | parameters: | 946 | parameters: |
807 | - $ref: "video-channels.yaml#/parameters/id" | 947 | - $ref: '#/components/parameters/id3' |
808 | responses: | 948 | responses: |
809 | '204': | 949 | '204': |
810 | $ref: "commons.yaml#/responses/emptySuccess" | 950 | $ref: '#/paths/~1users~1me/put/responses/204' |
811 | "/video-channels/{id}/videos": | 951 | '/video-channels/{id}/videos': |
812 | get: | 952 | get: |
953 | summary: Get videos of a video channel by its id | ||
813 | tags: | 954 | tags: |
814 | - VideoChannel | 955 | - VideoChannel |
815 | consumes: | ||
816 | - application/json | ||
817 | produces: | ||
818 | - application/json | ||
819 | parameters: | 956 | parameters: |
820 | - $ref: "video-channels.yaml#/parameters/id" | 957 | - $ref: '#/components/parameters/id3' |
821 | responses: | 958 | responses: |
822 | '200': | 959 | '200': |
823 | description: successful operation | 960 | description: successful operation |
824 | schema: | 961 | content: |
825 | $ref: '#/definitions/Video' | 962 | application/json: |
826 | /accounts/{name}/video-channels: | 963 | schema: |
964 | $ref: '#/components/schemas/Video' | ||
965 | '/accounts/{name}/video-channels': | ||
827 | get: | 966 | get: |
967 | summary: Get video channels of an account by its name | ||
828 | tags: | 968 | tags: |
829 | - VideoChannel | 969 | - VideoChannel |
830 | consumes: | ||
831 | - application/json | ||
832 | produces: | ||
833 | - application/json | ||
834 | parameters: | 970 | parameters: |
835 | - $ref: "accounts.yaml#/parameters/name" | 971 | - $ref: '#/components/parameters/name' |
836 | responses: | 972 | responses: |
837 | '200': | 973 | '200': |
838 | description: successful operation | 974 | description: successful operation |
839 | schema: | 975 | content: |
840 | type: array | 976 | application/json: |
841 | items: | 977 | schema: |
842 | $ref: '#/definitions/VideoChannel' | 978 | type: array |
843 | "/videos/{id}/comment-threads": | 979 | items: |
980 | $ref: '#/components/schemas/VideoChannel' | ||
981 | '/videos/{id}/comment-threads': | ||
844 | get: | 982 | get: |
983 | summary: Get the comment threads of a video by its id | ||
845 | tags: | 984 | tags: |
846 | - VideoComment | 985 | - VideoComment |
847 | consumes: | ||
848 | - application/json | ||
849 | produces: | ||
850 | - application/json | ||
851 | parameters: | 986 | parameters: |
852 | - $ref: "videos.yaml#/parameters/id" | 987 | - $ref: '#/components/parameters/id2' |
853 | - $ref: "commons.yaml#/parameters/start" | 988 | - $ref: '#/components/parameters/start' |
854 | - $ref: "commons.yaml#/parameters/count" | 989 | - $ref: '#/components/parameters/count' |
855 | - $ref: "commons.yaml#/parameters/sort" | 990 | - $ref: '#/components/parameters/sort' |
856 | responses: | 991 | responses: |
857 | '200': | 992 | '200': |
858 | description: successful operation | 993 | description: successful operation |
859 | schema: | 994 | content: |
860 | $ref: '#/definitions/CommentThreadResponse' | 995 | application/json: |
996 | schema: | ||
997 | $ref: '#/components/schemas/CommentThreadResponse' | ||
861 | post: | 998 | post: |
999 | summary: 'Creates a comment thread, on a video by its id' | ||
862 | security: | 1000 | security: |
863 | - OAuth2: [ ] | 1001 | - OAuth2: [] |
864 | tags: | 1002 | tags: |
865 | - VideoComment | 1003 | - VideoComment |
866 | consumes: | ||
867 | - application/json | ||
868 | produces: | ||
869 | - application/json | ||
870 | parameters: | 1004 | parameters: |
871 | - $ref: "videos.yaml#/parameters/id" | 1005 | - $ref: '#/components/parameters/id2' |
872 | responses: | 1006 | responses: |
873 | '200': | 1007 | '200': |
874 | description: successful operation | 1008 | description: successful operation |
875 | schema: | 1009 | content: |
876 | $ref: '#/definitions/CommentThreadPostResponse' | 1010 | application/json: |
877 | "/videos/{id}/comment-threads/{threadId}": | 1011 | schema: |
1012 | $ref: '#/components/schemas/CommentThreadPostResponse' | ||
1013 | '/videos/{id}/comment-threads/{threadId}': | ||
878 | get: | 1014 | get: |
1015 | summary: 'Get the comment thread by its id, of a video by its id' | ||
879 | tags: | 1016 | tags: |
880 | - VideoComment | 1017 | - VideoComment |
881 | consumes: | ||
882 | - application/json | ||
883 | produces: | ||
884 | - application/json | ||
885 | parameters: | 1018 | parameters: |
886 | - $ref: "videos.yaml#/parameters/id" | 1019 | - $ref: '#/components/parameters/id2' |
887 | - $ref: "video-comments.yaml#/parameters/threadId" | 1020 | - name: threadId |
1021 | in: path | ||
1022 | required: true | ||
1023 | description: The thread id (root comment id) | ||
1024 | schema: | ||
1025 | type: number | ||
888 | responses: | 1026 | responses: |
889 | '200': | 1027 | '200': |
890 | description: successful operation | 1028 | description: successful operation |
891 | schema: | 1029 | content: |
892 | $ref: '#/definitions/VideoCommentThreadTree' | 1030 | application/json: |
893 | "/videos/{id}/comments/{commentId}": | 1031 | schema: |
1032 | $ref: '#/components/schemas/VideoCommentThreadTree' | ||
1033 | '/videos/{id}/comments/{commentId}': | ||
894 | post: | 1034 | post: |
1035 | summary: 'Creates a comment in a comment thread by its id, of a video by its id' | ||
895 | security: | 1036 | security: |
896 | - OAuth2: [ ] | 1037 | - OAuth2: [] |
897 | tags: | 1038 | tags: |
898 | - VideoComment | 1039 | - VideoComment |
899 | consumes: | ||
900 | - application/json | ||
901 | produces: | ||
902 | - application/json | ||
903 | parameters: | 1040 | parameters: |
904 | - $ref: "videos.yaml#/parameters/id" | 1041 | - $ref: '#/components/parameters/id2' |
905 | - $ref: "video-comments.yaml#/parameters/commentId" | 1042 | - $ref: '#/components/parameters/commentId' |
906 | responses: | 1043 | responses: |
907 | '200': | 1044 | '200': |
908 | description: successful operation | 1045 | description: successful operation |
909 | schema: | 1046 | content: |
910 | $ref: '#/definitions/CommentThreadPostResponse' | 1047 | application/json: |
1048 | schema: | ||
1049 | $ref: '#/components/schemas/CommentThreadPostResponse' | ||
911 | delete: | 1050 | delete: |
1051 | summary: 'Delete a comment in a comment therad by its id, of a video by its id' | ||
912 | security: | 1052 | security: |
913 | - OAuth2: [ ] | 1053 | - OAuth2: [] |
914 | tags: | 1054 | tags: |
915 | - VideoComment | 1055 | - VideoComment |
916 | consumes: | ||
917 | - application/json | ||
918 | produces: | ||
919 | - application/json | ||
920 | parameters: | 1056 | parameters: |
921 | - $ref: "videos.yaml#/parameters/id" | 1057 | - $ref: '#/components/parameters/id2' |
922 | - $ref: "video-comments.yaml#/parameters/commentId" | 1058 | - $ref: '#/components/parameters/commentId' |
923 | responses: | 1059 | responses: |
924 | '204': | 1060 | '204': |
925 | $ref: "commons.yaml#/responses/emptySuccess" | 1061 | $ref: '#/paths/~1users~1me/put/responses/204' |
926 | "/videos/{id}/rate": | 1062 | '/videos/{id}/rate': |
927 | put: | 1063 | put: |
1064 | summary: Vote for a video by its id | ||
928 | security: | 1065 | security: |
929 | - OAuth2: [ ] | 1066 | - OAuth2: [] |
930 | tags: | 1067 | tags: |
931 | - VideoRate | 1068 | - VideoRate |
932 | consumes: | ||
933 | - application/json | ||
934 | produces: | ||
935 | - application/json | ||
936 | parameters: | 1069 | parameters: |
937 | - $ref: "videos.yaml#/parameters/id" | 1070 | - $ref: '#/components/parameters/id2' |
938 | responses: | 1071 | responses: |
939 | '204': | 1072 | '204': |
940 | $ref: "commons.yaml#/responses/emptySuccess" | 1073 | $ref: '#/paths/~1users~1me/put/responses/204' |
941 | /search/videos: | 1074 | /search/videos: |
942 | get: | 1075 | get: |
943 | tags: | 1076 | tags: |
944 | - Search | 1077 | - Search |
945 | consumes: | 1078 | summary: Get the videos corresponding to a given query |
946 | - application/json | ||
947 | produces: | ||
948 | - application/json | ||
949 | parameters: | 1079 | parameters: |
950 | - $ref: "commons.yaml#/parameters/start" | 1080 | - $ref: '#/components/parameters/start' |
951 | - $ref: "commons.yaml#/parameters/count" | 1081 | - $ref: '#/components/parameters/count' |
952 | - $ref: "commons.yaml#/parameters/sort" | 1082 | - $ref: '#/components/parameters/sort' |
953 | - name: search | 1083 | - name: search |
954 | in: query | 1084 | in: query |
955 | required: true | 1085 | required: true |
956 | type: string | 1086 | description: String to search |
957 | description: 'String to search' | 1087 | schema: |
1088 | type: string | ||
958 | responses: | 1089 | responses: |
959 | '200': | 1090 | '200': |
960 | description: successful operation | 1091 | description: successful operation |
961 | schema: | 1092 | content: |
962 | type: array | 1093 | application/json: |
963 | items: | 1094 | schema: |
964 | $ref: '#/definitions/Video' | ||
965 | definitions: | ||
966 | VideoConstantNumber: | ||
967 | properties: | ||
968 | id: | ||
969 | type: number | ||
970 | label: | ||
971 | type: string | ||
972 | VideoConstantString: | ||
973 | properties: | ||
974 | id: | ||
975 | type: string | ||
976 | label: | ||
977 | type: string | ||
978 | VideoPrivacy: | ||
979 | type: string | ||
980 | enum: [Public, Unlisted, Private] | ||
981 | Video: | ||
982 | properties: | ||
983 | id: | ||
984 | type: number | ||
985 | uuid: | ||
986 | type: string | ||
987 | createdAt: | ||
988 | type: string | ||
989 | publishedAt: | ||
990 | type: string | ||
991 | updatedAt: | ||
992 | type: string | ||
993 | category: | ||
994 | $ref: "#/definitions/VideoConstantNumber" | ||
995 | licence: | ||
996 | $ref: "#/definitions/VideoConstantNumber" | ||
997 | language: | ||
998 | $ref: "#/definitions/VideoConstantString" | ||
999 | privacy: | ||
1000 | $ref: "#/definitions/VideoPrivacy" | ||
1001 | description: | ||
1002 | type: string | ||
1003 | duration: | ||
1004 | type: number | ||
1005 | isLocal: | ||
1006 | type: boolean | ||
1007 | name: | ||
1008 | type: string | ||
1009 | thumbnailPath: | ||
1010 | type: string | ||
1011 | previewPath: | ||
1012 | type: string | ||
1013 | embedPath: | ||
1014 | type: string | ||
1015 | views: | ||
1016 | type: number | ||
1017 | likes: | ||
1018 | type: number | ||
1019 | dislikes: | ||
1020 | type: number | ||
1021 | nsfw: | ||
1022 | type: boolean | ||
1023 | account: | ||
1024 | type: object | ||
1025 | properties: | ||
1026 | name: | ||
1027 | type: string | ||
1028 | displayName: | ||
1029 | type: string | ||
1030 | url: | ||
1031 | type: string | ||
1032 | host: | ||
1033 | type: string | ||
1034 | avatar: | ||
1035 | $ref: "#/definitions/Avatar" | ||
1036 | VideoAbuse: | ||
1037 | properties: | ||
1038 | id: | ||
1039 | type: number | ||
1040 | reason: | ||
1041 | type: string | ||
1042 | reporterAccount: | ||
1043 | $ref: "#/definitions/Account" | ||
1044 | video: | ||
1045 | type: object | ||
1046 | properties: | ||
1047 | id: | ||
1048 | type: number | ||
1049 | name: | ||
1050 | type: string | ||
1051 | uuid: | ||
1052 | type: string | ||
1053 | url: | ||
1054 | type: string | ||
1055 | createdAt: | ||
1056 | type: string | ||
1057 | VideoBlacklist: | ||
1058 | properties: | ||
1059 | id: | ||
1060 | type: number | ||
1061 | videoId: | ||
1062 | type: number | ||
1063 | createdAt: | ||
1064 | type: string | ||
1065 | updatedAt: | ||
1066 | type: string | ||
1067 | name: | ||
1068 | type: string | ||
1069 | uuid: | ||
1070 | type: string | ||
1071 | description: | ||
1072 | type: string | ||
1073 | duration: | ||
1074 | type: number | ||
1075 | views: | ||
1076 | type: number | ||
1077 | likes: | ||
1078 | type: number | ||
1079 | dislikes: | ||
1080 | type: number | ||
1081 | nsfw: | ||
1082 | type: boolean | ||
1083 | VideoChannel: | ||
1084 | properties: | ||
1085 | displayName: | ||
1086 | type: string | ||
1087 | description: | ||
1088 | type: string | ||
1089 | isLocal: | ||
1090 | type: boolean | ||
1091 | ownerAccount: | ||
1092 | type: object | ||
1093 | properties: | ||
1094 | id: | ||
1095 | type: number | ||
1096 | uuid: | ||
1097 | type: string | ||
1098 | VideoComment: | ||
1099 | properties: | ||
1100 | id: | ||
1101 | type: number | ||
1102 | url: | ||
1103 | type: string | ||
1104 | text: | ||
1105 | type: string | ||
1106 | threadId: | ||
1107 | type: number | ||
1108 | inReplyToCommentId: | ||
1109 | type: number | ||
1110 | videoId: | ||
1111 | type: number | ||
1112 | createdAt: | ||
1113 | type: string | ||
1114 | updatedAt: | ||
1115 | type: string | ||
1116 | totalReplies: | ||
1117 | type: number | ||
1118 | account: | ||
1119 | $ref: "#/definitions/Account" | ||
1120 | VideoCommentThreadTree: | ||
1121 | properties: | ||
1122 | comment: | ||
1123 | $ref: "#/definitions/VideoComment" | ||
1124 | children: | ||
1125 | type: array | ||
1126 | items: | ||
1127 | $ref: "#/definitions/VideoCommentThreadTree" | ||
1128 | Avatar: | ||
1129 | properties: | ||
1130 | path: | ||
1131 | type: string | ||
1132 | createdAt: | ||
1133 | type: string | ||
1134 | updatedAt: | ||
1135 | type: string | ||
1136 | Actor: | ||
1137 | properties: | ||
1138 | id: | ||
1139 | type: number | ||
1140 | uuid: | ||
1141 | type: string | ||
1142 | url: | ||
1143 | type: string | ||
1144 | name: | ||
1145 | type: string | ||
1146 | host: | ||
1147 | type: string | ||
1148 | followingCount: | ||
1149 | type: number | ||
1150 | followersCount: | ||
1151 | type: number | ||
1152 | createdAt: | ||
1153 | type: string | ||
1154 | updatedAt: | ||
1155 | type: string | ||
1156 | avatar: | ||
1157 | $ref: "#/definitions/Avatar" | ||
1158 | Account: | ||
1159 | allOf: | ||
1160 | - $ref: "#/definitions/Actor" | ||
1161 | - properties: | ||
1162 | displayName: | ||
1163 | type: string | ||
1164 | User: | ||
1165 | properties: | ||
1166 | id: | ||
1167 | type: number | ||
1168 | username: | ||
1169 | type: string | ||
1170 | email: | ||
1171 | type: string | ||
1172 | displayNSFW: | ||
1173 | type: boolean | ||
1174 | autoPlayVideo: | ||
1175 | type: boolean | ||
1176 | role: | ||
1177 | type: string | ||
1178 | enum: [User, Moderator, Administrator] | ||
1179 | videoQuota: | ||
1180 | type: number | ||
1181 | createdAt: | ||
1182 | type: string | ||
1183 | account: | ||
1184 | $ref: "#/definitions/Account" | ||
1185 | videoChannels: | ||
1186 | type: array | ||
1187 | items: | ||
1188 | $ref: "#/definitions/VideoChannel" | ||
1189 | ServerConfig: | ||
1190 | properties: | ||
1191 | signup: | ||
1192 | type: object | ||
1193 | properties: | ||
1194 | allowed: | ||
1195 | type: boolean | ||
1196 | transcoding: | ||
1197 | type: object | ||
1198 | properties: | ||
1199 | enabledResolutions: | ||
1200 | type: array | ||
1201 | items: | ||
1202 | type: number | ||
1203 | avatar: | ||
1204 | type: object | ||
1205 | properties: | ||
1206 | file: | ||
1207 | type: object | ||
1208 | properties: | ||
1209 | size: | ||
1210 | type: object | ||
1211 | properties: | ||
1212 | max: | ||
1213 | type: number | ||
1214 | extensions: | ||
1215 | type: array | ||
1216 | items: | ||
1217 | type: string | ||
1218 | video: | ||
1219 | type: object | ||
1220 | properties: | ||
1221 | file: | ||
1222 | type: object | ||
1223 | properties: | ||
1224 | extensions: | ||
1225 | type: array | 1095 | type: array |
1226 | items: | 1096 | items: |
1227 | type: string | 1097 | $ref: '#/components/schemas/Video' |
1228 | Follow: | 1098 | servers: |
1229 | properties: | 1099 | - url: 'https://peertube2.cpy.re/api/v1' |
1230 | id: | 1100 | description: Live Server |
1101 | components: | ||
1102 | parameters: | ||
1103 | start: | ||
1104 | name: start | ||
1105 | in: query | ||
1106 | required: false | ||
1107 | description: Offset | ||
1108 | schema: | ||
1231 | type: number | 1109 | type: number |
1232 | follower: | 1110 | count: |
1233 | $ref: "#/definitions/Actor" | 1111 | name: count |
1234 | following: | 1112 | in: query |
1235 | $ref: "#/definitions/Actor" | 1113 | required: false |
1236 | score: | 1114 | description: Number of items |
1115 | schema: | ||
1237 | type: number | 1116 | type: number |
1238 | state: | 1117 | sort: |
1239 | type: string | 1118 | name: sort |
1240 | enum: [pending, accepted] | 1119 | in: query |
1241 | createdAt: | 1120 | required: false |
1242 | type: string | 1121 | description: Sort column (-createdAt for example) |
1243 | updatedAt: | 1122 | schema: |
1244 | type: string | 1123 | type: string |
1245 | Job: | 1124 | name: |
1246 | properties: | 1125 | name: name |
1247 | id: | 1126 | in: path |
1127 | required: true | ||
1128 | description: >- | ||
1129 | The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for | ||
1130 | example) | ||
1131 | schema: | ||
1132 | type: string | ||
1133 | id: | ||
1134 | name: id | ||
1135 | in: path | ||
1136 | required: true | ||
1137 | description: The user id | ||
1138 | schema: | ||
1248 | type: number | 1139 | type: number |
1249 | state: | 1140 | id2: |
1250 | type: string | 1141 | name: id |
1251 | enum: [pending, processing, error, success] | 1142 | in: path |
1252 | category: | 1143 | required: true |
1253 | type: string | 1144 | description: The video id or uuid |
1254 | enum: [transcoding, activitypub-http] | 1145 | schema: |
1255 | handlerName: | 1146 | type: string |
1256 | type: string | 1147 | id3: |
1257 | handlerInputData: | 1148 | name: id |
1258 | type: string | 1149 | in: path |
1259 | createdAt: | 1150 | required: true |
1260 | type: string | 1151 | description: The video channel id or uuid |
1261 | updatedAt: | 1152 | schema: |
1262 | type: string | 1153 | type: string |
1263 | 1154 | commentId: | |
1264 | # Api responses | 1155 | name: threadId |
1265 | AddUserResponse: | 1156 | in: path |
1266 | properties: | 1157 | required: true |
1267 | id: | 1158 | description: The comment id |
1268 | type: number | 1159 | schema: |
1269 | uuid: | ||
1270 | type: string | ||
1271 | VideoUploadResponse: | ||
1272 | properties: | ||
1273 | video: | ||
1274 | type: object | ||
1275 | properties: | ||
1276 | id: | ||
1277 | type: number | ||
1278 | uuid: | ||
1279 | type: string | ||
1280 | CommentThreadResponse: | ||
1281 | properties: | ||
1282 | total: | ||
1283 | type: number | 1160 | type: number |
1284 | data: | 1161 | requestBodies: |
1285 | type: array | 1162 | VideoChannelInput: |
1286 | items: | 1163 | content: |
1287 | $ref: "#/definitions/VideoComment" | 1164 | application/json: |
1288 | CommentThreadPostResponse: | 1165 | schema: |
1289 | properties: | 1166 | $ref: '#/components/schemas/VideoChannelInput' |
1290 | comment: | 1167 | securitySchemes: |
1291 | $ref: "#/definitions/VideoComment" | 1168 | OAuth2: |
1169 | description: > | ||
1170 | In the header: *Authorization: Bearer <token\>* | ||
1171 | |||
1172 | |||
1173 | Authenticating via OAuth requires the following steps: | ||
1174 | |||
1175 | |||
1176 | - Have an account with sufficient authorization levels | ||
1177 | |||
1178 | - [Generate](https://docs.joinpeertube.org/lang/en/devdocs/rest.html) a | ||
1179 | Bearer Token | ||
1180 | |||
1181 | - Make Authenticated Requests | ||
1182 | type: oauth2 | ||
1183 | flows: | ||
1184 | password: | ||
1185 | tokenUrl: 'https://peertube.example.com/api/v1/users/token' | ||
1186 | scopes: | ||
1187 | admin: Admin scope | ||
1188 | moderator: Moderator scope | ||
1189 | user: User scope | ||
1190 | schemas: | ||
1191 | VideoConstantNumber: | ||
1192 | properties: | ||
1193 | id: | ||
1194 | type: number | ||
1195 | label: | ||
1196 | type: string | ||
1197 | VideoConstantString: | ||
1198 | properties: | ||
1199 | id: | ||
1200 | type: string | ||
1201 | label: | ||
1202 | type: string | ||
1203 | VideoPrivacy: | ||
1204 | type: string | ||
1205 | enum: | ||
1206 | - Public | ||
1207 | - Unlisted | ||
1208 | - Private | ||
1209 | Video: | ||
1210 | properties: | ||
1211 | id: | ||
1212 | type: number | ||
1213 | uuid: | ||
1214 | type: string | ||
1215 | createdAt: | ||
1216 | type: string | ||
1217 | publishedAt: | ||
1218 | type: string | ||
1219 | updatedAt: | ||
1220 | type: string | ||
1221 | category: | ||
1222 | $ref: '#/components/schemas/VideoConstantNumber' | ||
1223 | licence: | ||
1224 | $ref: '#/components/schemas/VideoConstantNumber' | ||
1225 | language: | ||
1226 | $ref: '#/components/schemas/VideoConstantString' | ||
1227 | privacy: | ||
1228 | $ref: '#/components/schemas/VideoPrivacy' | ||
1229 | description: | ||
1230 | type: string | ||
1231 | duration: | ||
1232 | type: number | ||
1233 | isLocal: | ||
1234 | type: boolean | ||
1235 | name: | ||
1236 | type: string | ||
1237 | thumbnailPath: | ||
1238 | type: string | ||
1239 | previewPath: | ||
1240 | type: string | ||
1241 | embedPath: | ||
1242 | type: string | ||
1243 | views: | ||
1244 | type: number | ||
1245 | likes: | ||
1246 | type: number | ||
1247 | dislikes: | ||
1248 | type: number | ||
1249 | nsfw: | ||
1250 | type: boolean | ||
1251 | account: | ||
1252 | type: object | ||
1253 | properties: | ||
1254 | name: | ||
1255 | type: string | ||
1256 | displayName: | ||
1257 | type: string | ||
1258 | url: | ||
1259 | type: string | ||
1260 | host: | ||
1261 | type: string | ||
1262 | avatar: | ||
1263 | $ref: '#/components/schemas/Avatar' | ||
1264 | VideoAbuse: | ||
1265 | properties: | ||
1266 | id: | ||
1267 | type: number | ||
1268 | reason: | ||
1269 | type: string | ||
1270 | reporterAccount: | ||
1271 | $ref: '#/components/schemas/Account' | ||
1272 | video: | ||
1273 | type: object | ||
1274 | properties: | ||
1275 | id: | ||
1276 | type: number | ||
1277 | name: | ||
1278 | type: string | ||
1279 | uuid: | ||
1280 | type: string | ||
1281 | url: | ||
1282 | type: string | ||
1283 | createdAt: | ||
1284 | type: string | ||
1285 | VideoBlacklist: | ||
1286 | properties: | ||
1287 | id: | ||
1288 | type: number | ||
1289 | videoId: | ||
1290 | type: number | ||
1291 | createdAt: | ||
1292 | type: string | ||
1293 | updatedAt: | ||
1294 | type: string | ||
1295 | name: | ||
1296 | type: string | ||
1297 | uuid: | ||
1298 | type: string | ||
1299 | description: | ||
1300 | type: string | ||
1301 | duration: | ||
1302 | type: number | ||
1303 | views: | ||
1304 | type: number | ||
1305 | likes: | ||
1306 | type: number | ||
1307 | dislikes: | ||
1308 | type: number | ||
1309 | nsfw: | ||
1310 | type: boolean | ||
1311 | VideoChannel: | ||
1312 | properties: | ||
1313 | displayName: | ||
1314 | type: string | ||
1315 | description: | ||
1316 | type: string | ||
1317 | isLocal: | ||
1318 | type: boolean | ||
1319 | ownerAccount: | ||
1320 | type: object | ||
1321 | properties: | ||
1322 | id: | ||
1323 | type: number | ||
1324 | uuid: | ||
1325 | type: string | ||
1326 | VideoComment: | ||
1327 | properties: | ||
1328 | id: | ||
1329 | type: number | ||
1330 | url: | ||
1331 | type: string | ||
1332 | text: | ||
1333 | type: string | ||
1334 | threadId: | ||
1335 | type: number | ||
1336 | inReplyToCommentId: | ||
1337 | type: number | ||
1338 | videoId: | ||
1339 | type: number | ||
1340 | createdAt: | ||
1341 | type: string | ||
1342 | updatedAt: | ||
1343 | type: string | ||
1344 | totalReplies: | ||
1345 | type: number | ||
1346 | account: | ||
1347 | $ref: '#/components/schemas/Account' | ||
1348 | VideoCommentThreadTree: | ||
1349 | properties: | ||
1350 | comment: | ||
1351 | $ref: '#/components/schemas/VideoComment' | ||
1352 | children: | ||
1353 | type: array | ||
1354 | items: | ||
1355 | $ref: '#/components/schemas/VideoCommentThreadTree' | ||
1356 | Avatar: | ||
1357 | properties: | ||
1358 | path: | ||
1359 | type: string | ||
1360 | createdAt: | ||
1361 | type: string | ||
1362 | updatedAt: | ||
1363 | type: string | ||
1364 | Actor: | ||
1365 | properties: | ||
1366 | id: | ||
1367 | type: number | ||
1368 | uuid: | ||
1369 | type: string | ||
1370 | url: | ||
1371 | type: string | ||
1372 | name: | ||
1373 | type: string | ||
1374 | host: | ||
1375 | type: string | ||
1376 | followingCount: | ||
1377 | type: number | ||
1378 | followersCount: | ||
1379 | type: number | ||
1380 | createdAt: | ||
1381 | type: string | ||
1382 | updatedAt: | ||
1383 | type: string | ||
1384 | avatar: | ||
1385 | $ref: '#/components/schemas/Avatar' | ||
1386 | Account: | ||
1387 | allOf: | ||
1388 | - $ref: '#/components/schemas/Actor' | ||
1389 | - properties: | ||
1390 | displayName: | ||
1391 | type: string | ||
1392 | User: | ||
1393 | properties: | ||
1394 | id: | ||
1395 | type: number | ||
1396 | username: | ||
1397 | type: string | ||
1398 | email: | ||
1399 | type: string | ||
1400 | displayNSFW: | ||
1401 | type: boolean | ||
1402 | autoPlayVideo: | ||
1403 | type: boolean | ||
1404 | role: | ||
1405 | type: string | ||
1406 | enum: | ||
1407 | - User | ||
1408 | - Moderator | ||
1409 | - Administrator | ||
1410 | videoQuota: | ||
1411 | type: number | ||
1412 | createdAt: | ||
1413 | type: string | ||
1414 | account: | ||
1415 | $ref: '#/components/schemas/Account' | ||
1416 | videoChannels: | ||
1417 | type: array | ||
1418 | items: | ||
1419 | $ref: '#/components/schemas/VideoChannel' | ||
1420 | ServerConfig: | ||
1421 | properties: | ||
1422 | signup: | ||
1423 | type: object | ||
1424 | properties: | ||
1425 | allowed: | ||
1426 | type: boolean | ||
1427 | transcoding: | ||
1428 | type: object | ||
1429 | properties: | ||
1430 | enabledResolutions: | ||
1431 | type: array | ||
1432 | items: | ||
1433 | type: number | ||
1434 | avatar: | ||
1435 | type: object | ||
1436 | properties: | ||
1437 | file: | ||
1438 | type: object | ||
1439 | properties: | ||
1440 | size: | ||
1441 | type: object | ||
1442 | properties: | ||
1443 | max: | ||
1444 | type: number | ||
1445 | extensions: | ||
1446 | type: array | ||
1447 | items: | ||
1448 | type: string | ||
1449 | video: | ||
1450 | type: object | ||
1451 | properties: | ||
1452 | file: | ||
1453 | type: object | ||
1454 | properties: | ||
1455 | extensions: | ||
1456 | type: array | ||
1457 | items: | ||
1458 | type: string | ||
1459 | Follow: | ||
1460 | properties: | ||
1461 | id: | ||
1462 | type: number | ||
1463 | follower: | ||
1464 | $ref: '#/components/schemas/Actor' | ||
1465 | following: | ||
1466 | $ref: '#/components/schemas/Actor' | ||
1467 | score: | ||
1468 | type: number | ||
1469 | state: | ||
1470 | type: string | ||
1471 | enum: | ||
1472 | - pending | ||
1473 | - accepted | ||
1474 | createdAt: | ||
1475 | type: string | ||
1476 | updatedAt: | ||
1477 | type: string | ||
1478 | Job: | ||
1479 | properties: | ||
1480 | id: | ||
1481 | type: number | ||
1482 | state: | ||
1483 | type: string | ||
1484 | enum: | ||
1485 | - pending | ||
1486 | - processing | ||
1487 | - error | ||
1488 | - success | ||
1489 | category: | ||
1490 | type: string | ||
1491 | enum: | ||
1492 | - transcoding | ||
1493 | - activitypub-http | ||
1494 | handlerName: | ||
1495 | type: string | ||
1496 | handlerInputData: | ||
1497 | type: string | ||
1498 | createdAt: | ||
1499 | type: string | ||
1500 | updatedAt: | ||
1501 | type: string | ||
1502 | AddUserResponse: | ||
1503 | properties: | ||
1504 | id: | ||
1505 | type: number | ||
1506 | uuid: | ||
1507 | type: string | ||
1508 | VideoUploadResponse: | ||
1509 | properties: | ||
1510 | video: | ||
1511 | type: object | ||
1512 | properties: | ||
1513 | id: | ||
1514 | type: number | ||
1515 | uuid: | ||
1516 | type: string | ||
1517 | CommentThreadResponse: | ||
1518 | properties: | ||
1519 | total: | ||
1520 | type: number | ||
1521 | data: | ||
1522 | type: array | ||
1523 | items: | ||
1524 | $ref: '#/components/schemas/VideoComment' | ||
1525 | CommentThreadPostResponse: | ||
1526 | properties: | ||
1527 | comment: | ||
1528 | $ref: '#/components/schemas/VideoComment' | ||
1529 | AddUser: | ||
1530 | properties: | ||
1531 | username: | ||
1532 | type: string | ||
1533 | description: 'The user username ' | ||
1534 | password: | ||
1535 | type: string | ||
1536 | description: 'The user password ' | ||
1537 | email: | ||
1538 | type: string | ||
1539 | description: 'The user email ' | ||
1540 | videoQuota: | ||
1541 | type: string | ||
1542 | description: 'The user videoQuota ' | ||
1543 | role: | ||
1544 | type: string | ||
1545 | description: 'The user role ' | ||
1546 | required: | ||
1547 | - username | ||
1548 | - password | ||
1549 | |||
1550 | - videoQuota | ||
1551 | - role | ||
1552 | UpdateUser: | ||
1553 | properties: | ||
1554 | id: | ||
1555 | type: string | ||
1556 | description: 'The user id ' | ||
1557 | email: | ||
1558 | type: string | ||
1559 | description: 'The updated email of the user ' | ||
1560 | videoQuota: | ||
1561 | type: string | ||
1562 | description: 'The updated videoQuota of the user ' | ||
1563 | role: | ||
1564 | type: string | ||
1565 | description: 'The updated role of the user ' | ||
1566 | required: | ||
1567 | - id | ||
1568 | |||
1569 | - videoQuota | ||
1570 | - role | ||
1571 | UpdateMe: | ||
1572 | properties: | ||
1573 | password: | ||
1574 | type: string | ||
1575 | description: 'Your new password ' | ||
1576 | email: | ||
1577 | type: string | ||
1578 | description: 'Your new email ' | ||
1579 | displayNSFW: | ||
1580 | type: string | ||
1581 | description: 'Your new displayNSFW ' | ||
1582 | autoPlayVideo: | ||
1583 | type: string | ||
1584 | description: 'Your new autoPlayVideo ' | ||
1585 | required: | ||
1586 | - password | ||
1587 | |||
1588 | - displayNSFW | ||
1589 | - autoPlayVideo | ||
1590 | GetMeVideoRating: | ||
1591 | properties: | ||
1592 | id: | ||
1593 | type: string | ||
1594 | description: 'Id of the video ' | ||
1595 | rating: | ||
1596 | type: number | ||
1597 | description: 'Rating of the video ' | ||
1598 | required: | ||
1599 | - id | ||
1600 | - rating | ||
1601 | RegisterUser: | ||
1602 | properties: | ||
1603 | username: | ||
1604 | type: string | ||
1605 | description: 'The username of the user ' | ||
1606 | password: | ||
1607 | type: string | ||
1608 | description: 'The password of the user ' | ||
1609 | email: | ||
1610 | type: string | ||
1611 | description: 'The email of the user ' | ||
1612 | required: | ||
1613 | - username | ||
1614 | - password | ||
1615 | |||
1616 | VideoChannelInput: | ||
1617 | properties: | ||
1618 | name: | ||
1619 | type: string | ||
1620 | description: | ||
1621 | type: string | ||
1292 | 1622 | ||
1293 | # Request bodies | ||
1294 | AddUser: | ||
1295 | properties: | ||
1296 | username: | ||
1297 | type: string | ||
1298 | description: 'The user username ' | ||
1299 | password: | ||
1300 | type: string | ||
1301 | description: 'The user password ' | ||
1302 | email: | ||
1303 | type: string | ||
1304 | description: 'The user email ' | ||
1305 | videoQuota: | ||
1306 | type: string | ||
1307 | description: 'The user videoQuota ' | ||
1308 | role: | ||
1309 | type: string | ||
1310 | description: 'The user role ' | ||
1311 | required: | ||
1312 | - username | ||
1313 | - password | ||
1314 | |||
1315 | - videoQuota | ||
1316 | - role | ||
1317 | UpdateUser: | ||
1318 | properties: | ||
1319 | id: | ||
1320 | type: string | ||
1321 | description: 'The user id ' | ||
1322 | email: | ||
1323 | type: string | ||
1324 | description: 'The updated email of the user ' | ||
1325 | videoQuota: | ||
1326 | type: string | ||
1327 | description: 'The updated videoQuota of the user ' | ||
1328 | role: | ||
1329 | type: string | ||
1330 | description: 'The updated role of the user ' | ||
1331 | required: | ||
1332 | - id | ||
1333 | |||
1334 | - videoQuota | ||
1335 | - role | ||
1336 | UpdateMe: | ||
1337 | properties: | ||
1338 | password: | ||
1339 | type: string | ||
1340 | description: 'Your new password ' | ||
1341 | email: | ||
1342 | type: string | ||
1343 | description: 'Your new email ' | ||
1344 | displayNSFW: | ||
1345 | type: string | ||
1346 | description: 'Your new displayNSFW ' | ||
1347 | autoPlayVideo: | ||
1348 | type: string | ||
1349 | description: 'Your new autoPlayVideo ' | ||
1350 | required: | ||
1351 | - password | ||
1352 | |||
1353 | - displayNSFW | ||
1354 | - autoPlayVideo | ||
1355 | GetMeVideoRating: | ||
1356 | properties: | ||
1357 | id: | ||
1358 | type: string | ||
1359 | description: 'Id of the video ' | ||
1360 | rating: | ||
1361 | type: number | ||
1362 | description: 'Rating of the video ' | ||
1363 | required: | ||
1364 | - id | ||
1365 | - rating | ||
1366 | RegisterUser: | ||
1367 | properties: | ||
1368 | username: | ||
1369 | type: string | ||
1370 | description: 'The username of the user ' | ||
1371 | password: | ||
1372 | type: string | ||
1373 | description: 'The password of the user ' | ||
1374 | email: | ||
1375 | type: string | ||
1376 | description: 'The email of the user ' | ||
1377 | required: | ||
1378 | - username | ||
1379 | - password | ||
1380 | |||
1381 | VideoChannelInput: | ||
1382 | properties: | ||
1383 | name: | ||
1384 | type: string | ||
1385 | description: | ||
1386 | type: string \ No newline at end of file | ||