openapi.yaml 77 KB

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