aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc/api
diff options
context:
space:
mode:
Diffstat (limited to 'support/doc/api')
-rw-r--r--support/doc/api/openapi.yaml182
-rw-r--r--support/doc/api/quickstart.md2
2 files changed, 145 insertions, 39 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index de610893c..5a4f6fcb2 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -38,7 +38,7 @@ info:
38 } 38 }
39 ``` 39 ```
40externalDocs: 40externalDocs:
41 url: https://docs.joinpeertube.org/api.html 41 url: https://docs.joinpeertube.org/#/api-rest-reference.html
42tags: 42tags:
43 - name: Accounts 43 - name: Accounts
44 description: > 44 description: >
@@ -99,6 +99,7 @@ x-tagGroups:
99 - name: Videos 99 - name: Videos
100 tags: 100 tags:
101 - Video 101 - Video
102 - Video Caption
102 - Video Channel 103 - Video Channel
103 - Video Comment 104 - Video Comment
104 - Video Following 105 - Video Following
@@ -152,7 +153,7 @@ paths:
152 content: 153 content:
153 application/json: 154 application/json:
154 schema: 155 schema:
155 $ref: '#/components/schemas/Video' 156 $ref: '#/components/schemas/VideoListResponse'
156 x-code-samples: 157 x-code-samples:
157 - lang: JavaScript 158 - lang: JavaScript
158 source: | 159 source: |
@@ -575,9 +576,7 @@ paths:
575 content: 576 content:
576 application/json: 577 application/json:
577 schema: 578 schema:
578 type: array 579 $ref: '#/components/schemas/VideoListResponse'
579 items:
580 $ref: '#/components/schemas/Video'
581 /users/me/subscriptions: 580 /users/me/subscriptions:
582 get: 581 get:
583 summary: Get subscriptions of the current user 582 summary: Get subscriptions of the current user
@@ -638,9 +637,7 @@ paths:
638 content: 637 content:
639 application/json: 638 application/json:
640 schema: 639 schema:
641 type: array 640 $ref: '#/components/schemas/VideoListResponse'
642 items:
643 $ref: '#/components/schemas/Video'
644 '/users/me/subscriptions/{uri}': 641 '/users/me/subscriptions/{uri}':
645 get: 642 get:
646 summary: Get subscription of the current user for a given uri 643 summary: Get subscription of the current user for a given uri
@@ -730,9 +727,7 @@ paths:
730 content: 727 content:
731 application/json: 728 application/json:
732 schema: 729 schema:
733 type: array 730 $ref: '#/components/schemas/VideoListResponse'
734 items:
735 $ref: '#/components/schemas/Video'
736 /videos/categories: 731 /videos/categories:
737 get: 732 get:
738 summary: Get list of video licences known by the server 733 summary: Get list of video licences known by the server
@@ -1025,7 +1020,7 @@ paths:
1025 description: Video preview file 1020 description: Video preview file
1026 type: string 1021 type: string
1027 privacy: 1022 privacy:
1028 $ref: '#/components/schemas/VideoPrivacy' 1023 $ref: '#/components/schemas/VideoPrivacySet'
1029 category: 1024 category:
1030 description: Video category 1025 description: Video category
1031 type: string 1026 type: string
@@ -1129,7 +1124,7 @@ paths:
1129 description: Video preview file 1124 description: Video preview file
1130 type: string 1125 type: string
1131 privacy: 1126 privacy:
1132 $ref: '#/components/schemas/VideoPrivacy' 1127 $ref: '#/components/schemas/VideoPrivacySet'
1133 category: 1128 category:
1134 description: Video category 1129 description: Video category
1135 type: string 1130 type: string
@@ -1247,6 +1242,58 @@ paths:
1247 type: array 1242 type: array
1248 items: 1243 items:
1249 $ref: '#/components/schemas/VideoBlacklist' 1244 $ref: '#/components/schemas/VideoBlacklist'
1245 /videos/{id}/captions:
1246 get:
1247 summary: Get list of video's captions
1248 tags:
1249 - Video Caption
1250 parameters:
1251 - $ref: '#/components/parameters/id2'
1252 responses:
1253 '200':
1254 description: successful operation
1255 content:
1256 application/json:
1257 schema:
1258 type: object
1259 properties:
1260 total:
1261 type: integer
1262 data:
1263 type: array
1264 items:
1265 $ref: '#/components/schemas/VideoCaption'
1266 /videos/{id}/captions/{captionLanguage}:
1267 put:
1268 summary: Add or replace a video caption
1269 tags:
1270 - Video Caption
1271 parameters:
1272 - $ref: '#/components/parameters/id2'
1273 - $ref: '#/components/parameters/captionLanguage'
1274 requestBody:
1275 content:
1276 multipart/form-data:
1277 schema:
1278 type: object
1279 properties:
1280 captionfile:
1281 description: The file to upload.
1282 type: string
1283 format: binary
1284 responses:
1285 '204':
1286 $ref: '#/paths/~1users~1me/put/responses/204'
1287 delete:
1288 summary: Delete a video caption
1289 tags:
1290 - Video Caption
1291 parameters:
1292 - $ref: '#/components/parameters/id2'
1293 - $ref: '#/components/parameters/captionLanguage'
1294 responses:
1295 '204':
1296 $ref: '#/paths/~1users~1me/put/responses/204'
1250 /video-channels: 1297 /video-channels:
1251 get: 1298 get:
1252 summary: Get list of video channels 1299 summary: Get list of video channels
@@ -1275,7 +1322,10 @@ paths:
1275 '204': 1322 '204':
1276 $ref: '#/paths/~1users~1me/put/responses/204' 1323 $ref: '#/paths/~1users~1me/put/responses/204'
1277 requestBody: 1324 requestBody:
1278 $ref: '#/components/requestBodies/VideoChannelInput' 1325 content:
1326 application/json:
1327 schema:
1328 $ref: '#/components/schemas/VideoChannelCreate'
1279 '/video-channels/{channelHandle}': 1329 '/video-channels/{channelHandle}':
1280 get: 1330 get:
1281 summary: Get a video channel by its id 1331 summary: Get a video channel by its id
@@ -1302,7 +1352,10 @@ paths:
1302 '204': 1352 '204':
1303 $ref: '#/paths/~1users~1me/put/responses/204' 1353 $ref: '#/paths/~1users~1me/put/responses/204'
1304 requestBody: 1354 requestBody:
1305 $ref: '#/components/requestBodies/VideoChannelInput' 1355 content:
1356 application/json:
1357 schema:
1358 $ref: '#/components/schemas/VideoChannelUpdate'
1306 delete: 1359 delete:
1307 summary: Delete a video channel by its id 1360 summary: Delete a video channel by its id
1308 security: 1361 security:
@@ -1318,6 +1371,7 @@ paths:
1318 get: 1371 get:
1319 summary: Get videos of a video channel by its id 1372 summary: Get videos of a video channel by its id
1320 tags: 1373 tags:
1374 - Video
1321 - Video Channel 1375 - Video Channel
1322 parameters: 1376 parameters:
1323 - $ref: '#/components/parameters/channelHandle' 1377 - $ref: '#/components/parameters/channelHandle'
@@ -1327,7 +1381,7 @@ paths:
1327 content: 1381 content:
1328 application/json: 1382 application/json:
1329 schema: 1383 schema:
1330 $ref: '#/components/schemas/Video' 1384 $ref: '#/components/schemas/VideoListResponse'
1331 '/accounts/{name}/video-channels': 1385 '/accounts/{name}/video-channels':
1332 get: 1386 get:
1333 summary: Get video channels of an account by its name 1387 summary: Get video channels of an account by its name
@@ -1443,7 +1497,7 @@ paths:
1443 schema: 1497 schema:
1444 $ref: '#/components/schemas/CommentThreadPostResponse' 1498 $ref: '#/components/schemas/CommentThreadPostResponse'
1445 delete: 1499 delete:
1446 summary: 'Delete a comment in a comment therad by its id, of a video by its id' 1500 summary: 'Delete a comment in a comment thread by its id, of a video by its id'
1447 security: 1501 security:
1448 - OAuth2: [] 1502 - OAuth2: []
1449 tags: 1503 tags:
@@ -1487,9 +1541,7 @@ paths:
1487 content: 1541 content:
1488 application/json: 1542 application/json:
1489 schema: 1543 schema:
1490 type: array 1544 $ref: '#/components/schemas/VideoListResponse'
1491 items:
1492 $ref: '#/components/schemas/Video'
1493servers: 1545servers:
1494 - url: 'https://peertube.cpy.re/api/v1' 1546 - url: 'https://peertube.cpy.re/api/v1'
1495 description: Live Test Server (live data - stable version) 1547 description: Live Test Server (live data - stable version)
@@ -1611,6 +1663,13 @@ components:
1611 description: The video id or uuid 1663 description: The video id or uuid
1612 schema: 1664 schema:
1613 type: string 1665 type: string
1666 captionLanguage:
1667 name: captionLanguage
1668 in: path
1669 required: true
1670 description: The caption language
1671 schema:
1672 type: string
1614 channelHandle: 1673 channelHandle:
1615 name: channelHandle 1674 name: channelHandle
1616 in: path 1675 in: path
@@ -1722,12 +1781,6 @@ components:
1722 type: array 1781 type: array
1723 items: 1782 items:
1724 type: string 1783 type: string
1725 requestBodies:
1726 VideoChannelInput:
1727 content:
1728 application/json:
1729 schema:
1730 $ref: '#/components/schemas/VideoChannelInput'
1731 securitySchemes: 1784 securitySchemes:
1732 OAuth2: 1785 OAuth2:
1733 description: > 1786 description: >
@@ -1739,7 +1792,7 @@ components:
1739 1792
1740 - Have an account with sufficient authorization levels 1793 - Have an account with sufficient authorization levels
1741 1794
1742 - [Generate](https://docs.joinpeertube.org/lang/en/devdocs/rest.html) a 1795 - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
1743 Bearer Token 1796 Bearer Token
1744 1797
1745 - Make Authenticated Requests 1798 - Make Authenticated Requests
@@ -1764,12 +1817,23 @@ components:
1764 type: string 1817 type: string
1765 label: 1818 label:
1766 type: string 1819 type: string
1767 VideoPrivacy: 1820 VideoPrivacySet:
1768 type: string 1821 type: integer
1769 enum: 1822 enum:
1770 - Public 1823 - 1
1771 - Unlisted 1824 - 2
1772 - Private 1825 - 3
1826 description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3)'
1827 VideoPrivacyConstant:
1828 properties:
1829 id:
1830 type: integer
1831 enum:
1832 - 1
1833 - 2
1834 - 3
1835 label:
1836 type: string
1773 Video: 1837 Video:
1774 properties: 1838 properties:
1775 id: 1839 id:
@@ -1789,7 +1853,7 @@ components:
1789 language: 1853 language:
1790 $ref: '#/components/schemas/VideoConstantString' 1854 $ref: '#/components/schemas/VideoConstantString'
1791 privacy: 1855 privacy:
1792 $ref: '#/components/schemas/VideoPrivacy' 1856 $ref: '#/components/schemas/VideoPrivacyConstant'
1793 description: 1857 description:
1794 type: string 1858 type: string
1795 duration: 1859 duration:
@@ -1917,6 +1981,12 @@ components:
1917 type: array 1981 type: array
1918 items: 1982 items:
1919 $ref: '#/components/schemas/VideoCommentThreadTree' 1983 $ref: '#/components/schemas/VideoCommentThreadTree'
1984 VideoCaption:
1985 properties:
1986 language:
1987 $ref: '#/components/schemas/VideoConstantString'
1988 captionPath:
1989 type: string
1920 Avatar: 1990 Avatar:
1921 properties: 1991 properties:
1922 path: 1992 path:
@@ -1966,6 +2036,13 @@ components:
1966 autoPlayVideo: 2036 autoPlayVideo:
1967 type: boolean 2037 type: boolean
1968 role: 2038 role:
2039 type: integer
2040 enum:
2041 - 0
2042 - 1
2043 - 2
2044 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2045 roleLabel:
1969 type: string 2046 type: string
1970 enum: 2047 enum:
1971 - User 2048 - User
@@ -2096,6 +2173,14 @@ components:
2096 properties: 2173 properties:
2097 comment: 2174 comment:
2098 $ref: '#/components/schemas/VideoComment' 2175 $ref: '#/components/schemas/VideoComment'
2176 VideoListResponse:
2177 properties:
2178 total:
2179 type: number
2180 data:
2181 type: array
2182 items:
2183 $ref: '#/components/schemas/Video'
2099 AddUser: 2184 AddUser:
2100 properties: 2185 properties:
2101 username: 2186 username:
@@ -2115,12 +2200,11 @@ components:
2115 description: 'The user daily video quota ' 2200 description: 'The user daily video quota '
2116 role: 2201 role:
2117 type: integer 2202 type: integer
2118 format: int32
2119 enum: 2203 enum:
2120 - 0 2204 - 0
2121 - 1 2205 - 1
2122 - 2 2206 - 2
2123 description: 'The user role ' 2207 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2124 required: 2208 required:
2125 - username 2209 - username
2126 - password 2210 - password
@@ -2143,8 +2227,12 @@ components:
2143 type: string 2227 type: string
2144 description: 'The updated daily video quota of the user ' 2228 description: 'The updated daily video quota of the user '
2145 role: 2229 role:
2146 type: string 2230 type: integer
2147 description: 'The updated role of the user ' 2231 enum:
2232 - 0
2233 - 1
2234 - 2
2235 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2148 required: 2236 required:
2149 - id 2237 - id
2150 - email 2238 - email
@@ -2206,10 +2294,28 @@ components:
2206 - username 2294 - username
2207 - password 2295 - password
2208 - email 2296 - email
2209 VideoChannelInput: 2297 VideoChannelCreate:
2210 properties: 2298 properties:
2211 name: 2299 name:
2212 type: string 2300 type: string
2301 displayName:
2302 type: string
2303 description:
2304 type: string
2305 support:
2306 type: string
2307 required:
2308 - name
2309 - displayName
2310 VideoChannelUpdate:
2311 properties:
2312 displayName:
2313 type: string
2213 description: 2314 description:
2214 type: string 2315 type: string
2316 support:
2317 type: string
2318 bulkVideosSupportUpdate:
2319 type: boolean
2320 description: 'Update all videos support field of this channel'
2215 2321
diff --git a/support/doc/api/quickstart.md b/support/doc/api/quickstart.md
index 00874a1c9..2222be741 100644
--- a/support/doc/api/quickstart.md
+++ b/support/doc/api/quickstart.md
@@ -47,7 +47,7 @@ $ curl -H 'Authorization: Bearer 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0' https
47``` 47```
48 48
49 49
50### List videos 50## List videos
51 51
52```bash 52```bash
53$ curl https://peertube.example.com/api/v1/videos 53$ curl https://peertube.example.com/api/v1/videos