aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc/api/openapi.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'support/doc/api/openapi.yaml')
-rw-r--r--support/doc/api/openapi.yaml391
1 files changed, 327 insertions, 64 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index 0ab0c71c4..0dc50e403 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
@@ -849,21 +844,8 @@ paths:
849 commentsEnabled: 844 commentsEnabled:
850 description: Enable or disable comments for this video 845 description: Enable or disable comments for this video
851 type: string 846 type: string
852 scheduleUpdate: &ref_0 847 scheduleUpdate:
853 type: object 848 $ref: '#/components/schemas/VideoScheduledUpdate'
854 properties:
855 privacy:
856 type: string
857 enum:
858 - Public
859 - Unlisted
860 description: Video privacy target
861 updateAt:
862 type: string
863 format: date
864 description: When to update the video
865 required:
866 - updateAt
867 get: 849 get:
868 summary: Get a video by its id 850 summary: Get a video by its id
869 tags: 851 tags:
@@ -876,7 +858,7 @@ paths:
876 content: 858 content:
877 application/json: 859 application/json:
878 schema: 860 schema:
879 $ref: '#/components/schemas/Video' 861 $ref: '#/components/schemas/VideoDetails'
880 delete: 862 delete:
881 summary: Delete a video by its id 863 summary: Delete a video by its id
882 security: 864 security:
@@ -1025,7 +1007,7 @@ paths:
1025 description: Video preview file 1007 description: Video preview file
1026 type: string 1008 type: string
1027 privacy: 1009 privacy:
1028 $ref: '#/components/schemas/VideoPrivacy' 1010 $ref: '#/components/schemas/VideoPrivacySet'
1029 category: 1011 category:
1030 description: Video category 1012 description: Video category
1031 type: string 1013 type: string
@@ -1058,7 +1040,8 @@ paths:
1058 commentsEnabled: 1040 commentsEnabled:
1059 description: Enable or disable comments for this video 1041 description: Enable or disable comments for this video
1060 type: string 1042 type: string
1061 scheduleUpdate: *ref_0 1043 scheduleUpdate:
1044 $ref: '#/components/schemas/VideoScheduledUpdate'
1062 required: 1045 required:
1063 - videofile 1046 - videofile
1064 - channelId 1047 - channelId
@@ -1129,7 +1112,7 @@ paths:
1129 description: Video preview file 1112 description: Video preview file
1130 type: string 1113 type: string
1131 privacy: 1114 privacy:
1132 $ref: '#/components/schemas/VideoPrivacy' 1115 $ref: '#/components/schemas/VideoPrivacySet'
1133 category: 1116 category:
1134 description: Video category 1117 description: Video category
1135 type: string 1118 type: string
@@ -1162,7 +1145,8 @@ paths:
1162 commentsEnabled: 1145 commentsEnabled:
1163 description: Enable or disable comments for this video 1146 description: Enable or disable comments for this video
1164 type: string 1147 type: string
1165 scheduleUpdate: *ref_0 1148 scheduleUpdate:
1149 $ref: '#/components/schemas/VideoScheduledUpdate'
1166 required: 1150 required:
1167 - channelId 1151 - channelId
1168 - name 1152 - name
@@ -1247,6 +1231,58 @@ paths:
1247 type: array 1231 type: array
1248 items: 1232 items:
1249 $ref: '#/components/schemas/VideoBlacklist' 1233 $ref: '#/components/schemas/VideoBlacklist'
1234 /videos/{id}/captions:
1235 get:
1236 summary: Get list of video's captions
1237 tags:
1238 - Video Caption
1239 parameters:
1240 - $ref: '#/components/parameters/id2'
1241 responses:
1242 '200':
1243 description: successful operation
1244 content:
1245 application/json:
1246 schema:
1247 type: object
1248 properties:
1249 total:
1250 type: integer
1251 data:
1252 type: array
1253 items:
1254 $ref: '#/components/schemas/VideoCaption'
1255 /videos/{id}/captions/{captionLanguage}:
1256 put:
1257 summary: Add or replace a video caption
1258 tags:
1259 - Video Caption
1260 parameters:
1261 - $ref: '#/components/parameters/id2'
1262 - $ref: '#/components/parameters/captionLanguage'
1263 requestBody:
1264 content:
1265 multipart/form-data:
1266 schema:
1267 type: object
1268 properties:
1269 captionfile:
1270 description: The file to upload.
1271 type: string
1272 format: binary
1273 responses:
1274 '204':
1275 $ref: '#/paths/~1users~1me/put/responses/204'
1276 delete:
1277 summary: Delete a video caption
1278 tags:
1279 - Video Caption
1280 parameters:
1281 - $ref: '#/components/parameters/id2'
1282 - $ref: '#/components/parameters/captionLanguage'
1283 responses:
1284 '204':
1285 $ref: '#/paths/~1users~1me/put/responses/204'
1250 /video-channels: 1286 /video-channels:
1251 get: 1287 get:
1252 summary: Get list of video channels 1288 summary: Get list of video channels
@@ -1275,7 +1311,10 @@ paths:
1275 '204': 1311 '204':
1276 $ref: '#/paths/~1users~1me/put/responses/204' 1312 $ref: '#/paths/~1users~1me/put/responses/204'
1277 requestBody: 1313 requestBody:
1278 $ref: '#/components/requestBodies/VideoChannelInput' 1314 content:
1315 application/json:
1316 schema:
1317 $ref: '#/components/schemas/VideoChannelCreate'
1279 '/video-channels/{channelHandle}': 1318 '/video-channels/{channelHandle}':
1280 get: 1319 get:
1281 summary: Get a video channel by its id 1320 summary: Get a video channel by its id
@@ -1302,7 +1341,10 @@ paths:
1302 '204': 1341 '204':
1303 $ref: '#/paths/~1users~1me/put/responses/204' 1342 $ref: '#/paths/~1users~1me/put/responses/204'
1304 requestBody: 1343 requestBody:
1305 $ref: '#/components/requestBodies/VideoChannelInput' 1344 content:
1345 application/json:
1346 schema:
1347 $ref: '#/components/schemas/VideoChannelUpdate'
1306 delete: 1348 delete:
1307 summary: Delete a video channel by its id 1349 summary: Delete a video channel by its id
1308 security: 1350 security:
@@ -1318,6 +1360,7 @@ paths:
1318 get: 1360 get:
1319 summary: Get videos of a video channel by its id 1361 summary: Get videos of a video channel by its id
1320 tags: 1362 tags:
1363 - Video
1321 - Video Channel 1364 - Video Channel
1322 parameters: 1365 parameters:
1323 - $ref: '#/components/parameters/channelHandle' 1366 - $ref: '#/components/parameters/channelHandle'
@@ -1327,7 +1370,7 @@ paths:
1327 content: 1370 content:
1328 application/json: 1371 application/json:
1329 schema: 1372 schema:
1330 $ref: '#/components/schemas/Video' 1373 $ref: '#/components/schemas/VideoListResponse'
1331 '/accounts/{name}/video-channels': 1374 '/accounts/{name}/video-channels':
1332 get: 1375 get:
1333 summary: Get video channels of an account by its name 1376 summary: Get video channels of an account by its name
@@ -1443,7 +1486,7 @@ paths:
1443 schema: 1486 schema:
1444 $ref: '#/components/schemas/CommentThreadPostResponse' 1487 $ref: '#/components/schemas/CommentThreadPostResponse'
1445 delete: 1488 delete:
1446 summary: 'Delete a comment in a comment therad by its id, of a video by its id' 1489 summary: 'Delete a comment in a comment thread by its id, of a video by its id'
1447 security: 1490 security:
1448 - OAuth2: [] 1491 - OAuth2: []
1449 tags: 1492 tags:
@@ -1487,9 +1530,7 @@ paths:
1487 content: 1530 content:
1488 application/json: 1531 application/json:
1489 schema: 1532 schema:
1490 type: array 1533 $ref: '#/components/schemas/VideoListResponse'
1491 items:
1492 $ref: '#/components/schemas/Video'
1493servers: 1534servers:
1494 - url: 'https://peertube.cpy.re/api/v1' 1535 - url: 'https://peertube.cpy.re/api/v1'
1495 description: Live Test Server (live data - stable version) 1536 description: Live Test Server (live data - stable version)
@@ -1611,6 +1652,13 @@ components:
1611 description: The video id or uuid 1652 description: The video id or uuid
1612 schema: 1653 schema:
1613 type: string 1654 type: string
1655 captionLanguage:
1656 name: captionLanguage
1657 in: path
1658 required: true
1659 description: The caption language
1660 schema:
1661 type: string
1614 channelHandle: 1662 channelHandle:
1615 name: channelHandle 1663 name: channelHandle
1616 in: path 1664 in: path
@@ -1722,12 +1770,6 @@ components:
1722 type: array 1770 type: array
1723 items: 1771 items:
1724 type: string 1772 type: string
1725 requestBodies:
1726 VideoChannelInput:
1727 content:
1728 application/json:
1729 schema:
1730 $ref: '#/components/schemas/VideoChannelInput'
1731 securitySchemes: 1773 securitySchemes:
1732 OAuth2: 1774 OAuth2:
1733 description: > 1775 description: >
@@ -1739,7 +1781,7 @@ components:
1739 1781
1740 - Have an account with sufficient authorization levels 1782 - Have an account with sufficient authorization levels
1741 1783
1742 - [Generate](https://docs.joinpeertube.org/lang/en/devdocs/rest.html) a 1784 - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
1743 Bearer Token 1785 Bearer Token
1744 1786
1745 - Make Authenticated Requests 1787 - Make Authenticated Requests
@@ -1764,12 +1806,129 @@ components:
1764 type: string 1806 type: string
1765 label: 1807 label:
1766 type: string 1808 type: string
1767 VideoPrivacy: 1809 VideoPrivacySet:
1768 type: string 1810 type: integer
1769 enum: 1811 enum:
1770 - Public 1812 - 1
1771 - Unlisted 1813 - 2
1772 - Private 1814 - 3
1815 description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3)'
1816 VideoPrivacyConstant:
1817 properties:
1818 id:
1819 type: integer
1820 enum:
1821 - 1
1822 - 2
1823 - 3
1824 label:
1825 type: string
1826 VideoStateConstant:
1827 properties:
1828 id:
1829 type: integer
1830 enum:
1831 - 1
1832 - 2
1833 - 3
1834 description: 'The video state (Published = 1, to transcode = 2, to import = 3)'
1835 label:
1836 type: string
1837 VideoResolutionConstant:
1838 properties:
1839 id:
1840 type: integer
1841 description: 'Video resolution (240, 360, 720 ...)'
1842 label:
1843 type: string
1844 VideoScheduledUpdate:
1845 properties:
1846 privacy:
1847 $ref: '#/components/schemas/VideoPrivacySet'
1848 description: Video privacy target
1849 updateAt:
1850 type: string
1851 format: date
1852 description: When to update the video
1853 required:
1854 - updateAt
1855 VideoAccountSummary:
1856 properties:
1857 id:
1858 type: number
1859 name:
1860 type: string
1861 displayName:
1862 type: string
1863 url:
1864 type: string
1865 host:
1866 type: string
1867 avatar:
1868 nullable: true
1869 $ref: '#/components/schemas/Avatar'
1870 VideoChannelSummary:
1871 properties:
1872 id:
1873 type: number
1874 name:
1875 type: string
1876 displayName:
1877 type: string
1878 url:
1879 type: string
1880 host:
1881 type: string
1882 avatar:
1883 nullable: true
1884 $ref: '#/components/schemas/Avatar'
1885 PlaylistElement:
1886 properties:
1887 position:
1888 type: number
1889 startTimestamp:
1890 type: number
1891 stopTimestamp:
1892 type: number
1893 VideoFile:
1894 properties:
1895 magnetUri:
1896 type: string
1897 resolution:
1898 $ref: '#/components/schemas/VideoResolutionConstant'
1899 size:
1900 type: number
1901 description: 'Video file size in bytes'
1902 torrentUrl:
1903 type: string
1904 torrentDownaloadUrl:
1905 type: string
1906 fileUrl:
1907 type: string
1908 fileDownloadUrl:
1909 type: string
1910 fps:
1911 type: number
1912 VideoStreamingPlaylists:
1913 properties:
1914 id:
1915 type: number
1916 type:
1917 type: number
1918 enum:
1919 - 1
1920 description: 'Playlist type (HLS = 1)'
1921 playlistUrl:
1922 type: string
1923 segmentsSha256Url:
1924 type: string
1925 redundancies:
1926 type: array
1927 items:
1928 type: object
1929 properties:
1930 baseUrl:
1931 type: string
1773 Video: 1932 Video:
1774 properties: 1933 properties:
1775 id: 1934 id:
@@ -1782,6 +1941,8 @@ components:
1782 type: string 1941 type: string
1783 updatedAt: 1942 updatedAt:
1784 type: string 1943 type: string
1944 originallyPublishedAt:
1945 type: string
1785 category: 1946 category:
1786 $ref: '#/components/schemas/VideoConstantNumber' 1947 $ref: '#/components/schemas/VideoConstantNumber'
1787 licence: 1948 licence:
@@ -1789,7 +1950,7 @@ components:
1789 language: 1950 language:
1790 $ref: '#/components/schemas/VideoConstantString' 1951 $ref: '#/components/schemas/VideoConstantString'
1791 privacy: 1952 privacy:
1792 $ref: '#/components/schemas/VideoPrivacy' 1953 $ref: '#/components/schemas/VideoPrivacyConstant'
1793 description: 1954 description:
1794 type: string 1955 type: string
1795 duration: 1956 duration:
@@ -1812,19 +1973,66 @@ components:
1812 type: number 1973 type: number
1813 nsfw: 1974 nsfw:
1814 type: boolean 1975 type: boolean
1976 waitTranscoding:
1977 type: boolean
1978 nullable: true
1979 state:
1980 $ref: '#/components/schemas/VideoStateConstant'
1981 scheduledUpdate:
1982 nullable: true
1983 $ref: '#/components/schemas/VideoScheduledUpdate'
1984 blacklisted:
1985 nullable: true
1986 type: boolean
1987 blacklistedReason:
1988 nullable: true
1989 type: string
1815 account: 1990 account:
1991 $ref: '#/components/schemas/VideoAccountSummary'
1992 channel:
1993 $ref: '#/components/schemas/VideoChannelSummary'
1994 userHistory:
1995 nullable: true
1816 type: object 1996 type: object
1817 properties: 1997 properties:
1818 name: 1998 currentTime:
1819 type: string 1999 type: number
1820 displayName: 2000 playlistElement:
1821 type: string 2001 nullable: true
1822 url: 2002 $ref: '#/components/schemas/PlaylistElement'
2003 VideoDetails:
2004 allOf:
2005 - $ref: '#/components/schemas/Video'
2006 - type: object
2007 properties:
2008 descriptionPath:
1823 type: string 2009 type: string
1824 host: 2010 support:
1825 type: string 2011 type: string
1826 avatar: 2012 channel:
1827 $ref: '#/components/schemas/Avatar' 2013 $ref: '#/components/schemas/VideoChannel'
2014 account:
2015 $ref: '#/components/schemas/Account'
2016 tags:
2017 type: array
2018 items:
2019 type: string
2020 files:
2021 type: array
2022 items:
2023 $ref: '#/components/schemas/VideoFile'
2024 commentsEnabled:
2025 type: boolean
2026 downloadEnabled:
2027 type: boolean
2028 trackerUrls:
2029 type: array
2030 items:
2031 type: string
2032 streamingPlaylists:
2033 type: array
2034 items:
2035 $ref: '#/components/schemas/VideoStreamingPlaylists'
1828 VideoAbuse: 2036 VideoAbuse:
1829 properties: 2037 properties:
1830 id: 2038 id:
@@ -1917,6 +2125,12 @@ components:
1917 type: array 2125 type: array
1918 items: 2126 items:
1919 $ref: '#/components/schemas/VideoCommentThreadTree' 2127 $ref: '#/components/schemas/VideoCommentThreadTree'
2128 VideoCaption:
2129 properties:
2130 language:
2131 $ref: '#/components/schemas/VideoConstantString'
2132 captionPath:
2133 type: string
1920 Avatar: 2134 Avatar:
1921 properties: 2135 properties:
1922 path: 2136 path:
@@ -1966,6 +2180,13 @@ components:
1966 autoPlayVideo: 2180 autoPlayVideo:
1967 type: boolean 2181 type: boolean
1968 role: 2182 role:
2183 type: integer
2184 enum:
2185 - 0
2186 - 1
2187 - 2
2188 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2189 roleLabel:
1969 type: string 2190 type: string
1970 enum: 2191 enum:
1971 - User 2192 - User
@@ -2096,6 +2317,14 @@ components:
2096 properties: 2317 properties:
2097 comment: 2318 comment:
2098 $ref: '#/components/schemas/VideoComment' 2319 $ref: '#/components/schemas/VideoComment'
2320 VideoListResponse:
2321 properties:
2322 total:
2323 type: number
2324 data:
2325 type: array
2326 items:
2327 $ref: '#/components/schemas/Video'
2099 AddUser: 2328 AddUser:
2100 properties: 2329 properties:
2101 username: 2330 username:
@@ -2115,12 +2344,11 @@ components:
2115 description: 'The user daily video quota ' 2344 description: 'The user daily video quota '
2116 role: 2345 role:
2117 type: integer 2346 type: integer
2118 format: int32
2119 enum: 2347 enum:
2120 - 0 2348 - 0
2121 - 1 2349 - 1
2122 - 2 2350 - 2
2123 description: 'The user role ' 2351 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2124 required: 2352 required:
2125 - username 2353 - username
2126 - password 2354 - password
@@ -2143,8 +2371,12 @@ components:
2143 type: string 2371 type: string
2144 description: 'The updated daily video quota of the user ' 2372 description: 'The updated daily video quota of the user '
2145 role: 2373 role:
2146 type: string 2374 type: integer
2147 description: 'The updated role of the user ' 2375 enum:
2376 - 0
2377 - 1
2378 - 2
2379 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2148 required: 2380 required:
2149 - id 2381 - id
2150 - email 2382 - email
@@ -2202,14 +2434,45 @@ components:
2202 email: 2434 email:
2203 type: string 2435 type: string
2204 description: 'The email of the user ' 2436 description: 'The email of the user '
2437 displayName:
2438 type: string
2439 description: 'The user display name'
2440 channel:
2441 type: object
2442 properties:
2443 name:
2444 type: string
2445 description: 'The default channel name'
2446 displayName:
2447 type: string
2448 description: 'The default channel display name'
2449
2205 required: 2450 required:
2206 - username 2451 - username
2207 - password 2452 - password
2208 - email 2453 - email
2209 VideoChannelInput: 2454 VideoChannelCreate:
2210 properties: 2455 properties:
2211 name: 2456 name:
2212 type: string 2457 type: string
2458 displayName:
2459 type: string
2460 description:
2461 type: string
2462 support:
2463 type: string
2464 required:
2465 - name
2466 - displayName
2467 VideoChannelUpdate:
2468 properties:
2469 displayName:
2470 type: string
2213 description: 2471 description:
2214 type: string 2472 type: string
2473 support:
2474 type: string
2475 bulkVideosSupportUpdate:
2476 type: boolean
2477 description: 'Update all videos support field of this channel'
2215 2478