openapi.yaml 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984
  1. openapi: 3.0.0
  2. info:
  3. title: PeerTube
  4. version: 1.1.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.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: Feeds
  50. description: |
  51. Feeds of videos and feeds of comments allow to see updates and get them in
  52. an aggregator or script of your choice.
  53. - name: Job
  54. description: >
  55. Jobs are long-running tasks enqueued and processed by the instance
  56. itself. No additional worker registration is currently available.
  57. - name: Server Following
  58. description: >
  59. Managing servers which the instance interacts with is crucial to the
  60. concept of federation in PeerTube and external video indexation. The PeerTube
  61. server then deals with inter-server ActivityPub operations and propagates
  62. information across its social graph by posting activities to actors' inbox
  63. endpoints.
  64. - name: Video Abuse
  65. description: |
  66. Video abuses deal with reports of local or remote videos alike.
  67. - name: Video
  68. description: |
  69. Operations dealing with listing, uploading, fetching or modifying videos.
  70. - name: Search
  71. description: |
  72. The search helps to find _videos_ from within the instance and beyond.
  73. Videos from other instances federated by the instance (that is, instances
  74. followed by the instance) can be found via keywords and other criteria of
  75. the advanced search.
  76. - name: Video Comment
  77. description: >
  78. Operations dealing with comments to a video. Comments are organized in
  79. threads.
  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. - name: Videos
  97. tags:
  98. - Video
  99. - Video Channel
  100. - Video Comment
  101. - Video Following
  102. - Video Rate
  103. - name: Moderation
  104. tags:
  105. - Video Abuse
  106. - Video Blacklist
  107. - name: Instance Configuration
  108. tags:
  109. - Config
  110. - Server Following
  111. - name: Notifications
  112. tags:
  113. - Feeds
  114. - name: Jobs
  115. tags:
  116. - Job
  117. - name: Search
  118. tags:
  119. - Search
  120. paths:
  121. '/accounts/{name}':
  122. get:
  123. tags:
  124. - Accounts
  125. summary: Get the account by name
  126. parameters:
  127. - $ref: '#/components/parameters/name'
  128. - $ref: '#/components/parameters/start'
  129. - $ref: '#/components/parameters/count'
  130. - $ref: '#/components/parameters/sort'
  131. responses:
  132. '200':
  133. description: successful operation
  134. content:
  135. application/json:
  136. schema:
  137. $ref: '#/components/schemas/Account'
  138. '/accounts/{name}/videos':
  139. get:
  140. tags:
  141. - Accounts
  142. - Video
  143. summary: 'Get videos for an account, provided the name of that account'
  144. parameters:
  145. - $ref: '#/components/parameters/name'
  146. responses:
  147. '200':
  148. description: successful operation
  149. content:
  150. application/json:
  151. schema:
  152. $ref: '#/components/schemas/Video'
  153. x-code-samples:
  154. - lang: JavaScript
  155. source: |
  156. fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
  157. .then(function(response) {
  158. return response.json()
  159. }).then(function(data) {
  160. console.log(data)
  161. })
  162. - lang: Shell
  163. source: |
  164. # pip install httpie
  165. http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
  166. - lang: Ruby
  167. source: |
  168. require 'uri'
  169. require 'net/http'
  170. url = URI("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
  171. http = Net::HTTP.new(url.host, url.port)
  172. http.use_ssl = true
  173. http.verify_mode = OpenSSL::SSL::VERIFY_NONE
  174. request = Net::HTTP::Post.new(url)
  175. request["content-type"] = 'application/json'
  176. response = http.request(request)
  177. puts response.read_body
  178. - lang: Python
  179. source: |
  180. import http.client
  181. conn = http.client.HTTPSConnection("https://peertube2.cpy.re/api/v1")
  182. headers = {
  183. 'content-type': "application/json"
  184. }
  185. conn.request("POST", "/accounts/{name}/videos", None, headers)
  186. res = conn.getresponse()
  187. data = res.read()
  188. print(data.decode("utf-8"))
  189. /accounts:
  190. get:
  191. tags:
  192. - Accounts
  193. summary: Get all accounts
  194. responses:
  195. '200':
  196. description: successful operation
  197. content:
  198. 'application/json':
  199. schema:
  200. type: array
  201. items:
  202. $ref: '#/components/schemas/Account'
  203. /config:
  204. get:
  205. tags:
  206. - Config
  207. summary: Get the public configuration of the server
  208. responses:
  209. '200':
  210. description: successful operation
  211. content:
  212. application/json:
  213. schema:
  214. $ref: '#/components/schemas/ServerConfig'
  215. /config/about:
  216. get:
  217. summary: Get the instance about page content
  218. tags:
  219. - Config
  220. responses:
  221. '200':
  222. description: successful operation
  223. /config/custom:
  224. get:
  225. summary: Get the runtime configuration of the server
  226. tags:
  227. - Config
  228. security:
  229. - OAuth2:
  230. - admin
  231. responses:
  232. '200':
  233. description: successful operation
  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. '/feeds/videos.{format}':
  255. get:
  256. summary: >-
  257. Get the feed of videos for the server, with optional filter by account
  258. name or id
  259. tags:
  260. - Feeds
  261. parameters:
  262. - name: format
  263. in: path
  264. required: true
  265. description: >-
  266. The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and
  267. json to JSON FEED 1.0
  268. schema:
  269. type: string
  270. enum:
  271. - xml
  272. - atom
  273. - json
  274. default: xml
  275. - name: accountId
  276. in: query
  277. required: false
  278. description: >-
  279. The id of the local account to filter to (beware, users IDs and not
  280. actors IDs which will return empty feeds
  281. schema:
  282. type: number
  283. - name: accountName
  284. in: query
  285. required: false
  286. description: The name of the local account to filter to
  287. schema:
  288. type: string
  289. responses:
  290. '200':
  291. description: successful operation
  292. /jobs/{state}:
  293. get:
  294. summary: Get list of jobs
  295. security:
  296. - OAuth2:
  297. - admin
  298. tags:
  299. - Job
  300. parameters:
  301. - name: state
  302. in: path
  303. required: true
  304. description: The state of the job
  305. schema:
  306. type: string
  307. enum:
  308. - active
  309. - completed
  310. - failed
  311. - waiting
  312. - delayed
  313. - $ref: '#/components/parameters/start'
  314. - $ref: '#/components/parameters/count'
  315. - $ref: '#/components/parameters/sort'
  316. responses:
  317. '200':
  318. description: successful operation
  319. content:
  320. application/json:
  321. schema:
  322. type: array
  323. items:
  324. $ref: '#/components/schemas/Job'
  325. '/server/following/{host}':
  326. delete:
  327. security:
  328. - OAuth2:
  329. - admin
  330. tags:
  331. - Server Following
  332. summary: Unfollow a server by hostname
  333. parameters:
  334. - name: host
  335. in: path
  336. required: true
  337. description: 'The host to unfollow '
  338. schema:
  339. type: string
  340. responses:
  341. '201':
  342. description: successful operation
  343. /server/followers:
  344. get:
  345. tags:
  346. - Server Following
  347. summary: Get followers of the server
  348. parameters:
  349. - $ref: '#/components/parameters/start'
  350. - $ref: '#/components/parameters/count'
  351. - $ref: '#/components/parameters/sort'
  352. responses:
  353. '200':
  354. description: successful operation
  355. content:
  356. application/json:
  357. schema:
  358. type: array
  359. items:
  360. $ref: '#/components/schemas/Follow'
  361. /server/following:
  362. get:
  363. tags:
  364. - Server Following
  365. summary: Get servers followed by the server
  366. parameters:
  367. - $ref: '#/components/parameters/start'
  368. - $ref: '#/components/parameters/count'
  369. - $ref: '#/components/parameters/sort'
  370. responses:
  371. '200':
  372. description: successful operation
  373. content:
  374. application/json:
  375. schema:
  376. type: array
  377. items:
  378. $ref: '#/components/schemas/Follow'
  379. post:
  380. security:
  381. - OAuth2:
  382. - admin
  383. tags:
  384. - Server Following
  385. summary: Follow a server
  386. responses:
  387. '204':
  388. $ref: '#/paths/~1users~1me/put/responses/204'
  389. requestBody:
  390. content:
  391. application/json:
  392. schema:
  393. $ref: '#/components/schemas/Follow'
  394. /users:
  395. post:
  396. summary: Creates user
  397. security:
  398. - OAuth2:
  399. - admin
  400. tags:
  401. - User
  402. responses:
  403. '200':
  404. description: successful operation
  405. content:
  406. application/json:
  407. schema:
  408. $ref: '#/components/schemas/AddUserResponse'
  409. requestBody:
  410. content:
  411. application/json:
  412. schema:
  413. $ref: '#/components/schemas/AddUser'
  414. description: User to create
  415. required: true
  416. get:
  417. summary: Get a list of users
  418. security:
  419. - OAuth2: []
  420. tags:
  421. - User
  422. parameters:
  423. - $ref: '#/components/parameters/start'
  424. - $ref: '#/components/parameters/count'
  425. - $ref: '#/components/parameters/usersSort'
  426. responses:
  427. '200':
  428. description: successful operation
  429. content:
  430. application/json:
  431. schema:
  432. type: array
  433. items:
  434. $ref: '#/components/schemas/User'
  435. '/users/{id}':
  436. delete:
  437. summary: Delete a user by its id
  438. security:
  439. - OAuth2:
  440. - admin
  441. tags:
  442. - User
  443. parameters:
  444. - $ref: '#/components/parameters/id'
  445. responses:
  446. '204':
  447. $ref: '#/paths/~1users~1me/put/responses/204'
  448. get:
  449. summary: Get user by its id
  450. security:
  451. - OAuth2: []
  452. tags:
  453. - User
  454. parameters:
  455. - $ref: '#/components/parameters/id'
  456. responses:
  457. '200':
  458. description: successful operation
  459. content:
  460. application/json:
  461. schema:
  462. $ref: '#/components/schemas/User'
  463. put:
  464. summary: Update user profile by its id
  465. security:
  466. - OAuth2: []
  467. tags:
  468. - User
  469. parameters:
  470. - $ref: '#/components/parameters/id'
  471. responses:
  472. '204':
  473. $ref: '#/paths/~1users~1me/put/responses/204'
  474. requestBody:
  475. content:
  476. application/json:
  477. schema:
  478. $ref: '#/components/schemas/UpdateUser'
  479. required: true
  480. /users/me:
  481. get:
  482. summary: Get current user information
  483. security:
  484. - OAuth2: []
  485. tags:
  486. - User
  487. responses:
  488. '200':
  489. description: successful operation
  490. content:
  491. application/json:
  492. schema:
  493. type: array
  494. items:
  495. $ref: '#/components/schemas/User'
  496. put:
  497. summary: Update current user information
  498. security:
  499. - OAuth2: []
  500. tags:
  501. - User
  502. responses:
  503. '204':
  504. description: Successful operation
  505. requestBody:
  506. content:
  507. application/json:
  508. schema:
  509. $ref: '#/components/schemas/UpdateMe'
  510. required: true
  511. /users/me/video-quota-used:
  512. get:
  513. summary: Get current user used quota
  514. security:
  515. - OAuth2: []
  516. tags:
  517. - User
  518. responses:
  519. '200':
  520. description: successful operation
  521. content:
  522. application/json:
  523. schema:
  524. type: number
  525. '/users/me/videos/{videoId}/rating':
  526. get:
  527. summary: 'Get rating of video by its id, among those of the current user'
  528. security:
  529. - OAuth2: []
  530. tags:
  531. - User
  532. parameters:
  533. - name: videoId
  534. in: path
  535. required: true
  536. description: 'The video id '
  537. schema:
  538. type: string
  539. responses:
  540. '200':
  541. description: successful operation
  542. content:
  543. application/json:
  544. schema:
  545. $ref: '#/components/schemas/GetMeVideoRating'
  546. /users/me/videos:
  547. get:
  548. summary: Get videos of the current user
  549. security:
  550. - OAuth2: []
  551. tags:
  552. - User
  553. parameters:
  554. - $ref: '#/components/parameters/start'
  555. - $ref: '#/components/parameters/count'
  556. - $ref: '#/components/parameters/sort'
  557. responses:
  558. '200':
  559. description: successful operation
  560. content:
  561. application/json:
  562. schema:
  563. type: array
  564. items:
  565. $ref: '#/components/schemas/Video'
  566. /users/register:
  567. post:
  568. summary: Register a user
  569. tags:
  570. - User
  571. responses:
  572. '204':
  573. $ref: '#/paths/~1users~1me/put/responses/204'
  574. requestBody:
  575. content:
  576. application/json:
  577. schema:
  578. $ref: '#/components/schemas/RegisterUser'
  579. required: true
  580. /users/me/avatar/pick:
  581. post:
  582. summary: Update current user avatar
  583. security:
  584. - OAuth2: []
  585. tags:
  586. - User
  587. responses:
  588. '200':
  589. description: successful operation
  590. content:
  591. application/json:
  592. schema:
  593. $ref: '#/components/schemas/Avatar'
  594. requestBody:
  595. content:
  596. multipart/form-data:
  597. schema:
  598. type: object
  599. properties:
  600. avatarfile:
  601. description: The file to upload.
  602. type: string
  603. format: binary
  604. encoding:
  605. profileImage:
  606. # only accept png/jpeg
  607. contentType: image/png, image/jpeg
  608. /videos:
  609. get:
  610. summary: Get list of videos
  611. tags:
  612. - Video
  613. parameters:
  614. - $ref: '#/components/parameters/categoryOneOf'
  615. - $ref: '#/components/parameters/tagsOneOf'
  616. - $ref: '#/components/parameters/tagsAllOf'
  617. - $ref: '#/components/parameters/licenceOneOf'
  618. - $ref: '#/components/parameters/languageOneOf'
  619. - $ref: '#/components/parameters/nsfw'
  620. - $ref: '#/components/parameters/filter'
  621. - $ref: '#/components/parameters/start'
  622. - $ref: '#/components/parameters/count'
  623. - $ref: '#/components/parameters/videosSort'
  624. responses:
  625. '200':
  626. description: successful operation
  627. content:
  628. application/json:
  629. schema:
  630. type: array
  631. items:
  632. $ref: '#/components/schemas/Video'
  633. /videos/categories:
  634. get:
  635. summary: Get list of video licences known by the server
  636. tags:
  637. - Video
  638. responses:
  639. '200':
  640. description: successful operation
  641. content:
  642. application/json:
  643. schema:
  644. type: array
  645. items:
  646. type: string
  647. /videos/licences:
  648. get:
  649. summary: Get list of video licences known by the server
  650. tags:
  651. - Video
  652. responses:
  653. '200':
  654. description: successful operation
  655. content:
  656. application/json:
  657. schema:
  658. type: array
  659. items:
  660. type: string
  661. /videos/languages:
  662. get:
  663. summary: Get list of languages known by the server
  664. tags:
  665. - Video
  666. responses:
  667. '200':
  668. description: successful operation
  669. content:
  670. application/json:
  671. schema:
  672. type: array
  673. items:
  674. type: string
  675. /videos/privacies:
  676. get:
  677. summary: Get list of privacy policies supported by the server
  678. tags:
  679. - Video
  680. responses:
  681. '200':
  682. description: successful operation
  683. content:
  684. application/json:
  685. schema:
  686. type: array
  687. items:
  688. type: string
  689. '/videos/{id}':
  690. put:
  691. summary: Update metadata for a video by its id
  692. security:
  693. - OAuth2: []
  694. tags:
  695. - Video
  696. parameters:
  697. - $ref: '#/components/parameters/id2'
  698. responses:
  699. '200':
  700. description: successful operation
  701. content:
  702. application/json:
  703. schema:
  704. $ref: '#/components/schemas/Video'
  705. requestBody:
  706. content:
  707. multipart/form-data:
  708. schema:
  709. type: object
  710. properties:
  711. thumbnailfile:
  712. description: Video thumbnail file
  713. type: string
  714. previewfile:
  715. description: Video preview file
  716. type: string
  717. category:
  718. description: Video category
  719. type: string
  720. licence:
  721. description: Video licence
  722. type: string
  723. language:
  724. description: Video language
  725. type: string
  726. description:
  727. description: Video description
  728. type: string
  729. waitTranscoding:
  730. description: Whether or not we wait transcoding before publish the video
  731. type: string
  732. support:
  733. description: Text describing how to support the video uploader
  734. type: string
  735. nsfw:
  736. description: Whether or not this video contains sensitive content
  737. type: string
  738. name:
  739. description: Video name
  740. type: string
  741. tags:
  742. description: Video tags
  743. type: string
  744. commentsEnabled:
  745. description: Enable or disable comments for this video
  746. type: string
  747. scheduleUpdate: &ref_0
  748. type: object
  749. properties:
  750. privacy:
  751. type: string
  752. enum:
  753. - Public
  754. - Unlisted
  755. description: Video privacy target
  756. updateAt:
  757. type: string
  758. format: date
  759. description: When to update the video
  760. required:
  761. - updateAt
  762. get:
  763. summary: Get a video by its id
  764. tags:
  765. - Video
  766. parameters:
  767. - $ref: '#/components/parameters/id2'
  768. responses:
  769. '200':
  770. description: successful operation
  771. content:
  772. application/json:
  773. schema:
  774. $ref: '#/components/schemas/Video'
  775. delete:
  776. summary: Delete a video by its id
  777. security:
  778. - OAuth2: []
  779. tags:
  780. - Video
  781. parameters:
  782. - $ref: '#/components/parameters/id2'
  783. responses:
  784. '204':
  785. $ref: '#/paths/~1users~1me/put/responses/204'
  786. '/videos/{id}/description':
  787. get:
  788. summary: Get a video description by its id
  789. tags:
  790. - Video
  791. parameters:
  792. - $ref: '#/components/parameters/id2'
  793. responses:
  794. '200':
  795. description: successful operation
  796. content:
  797. application/json:
  798. schema:
  799. type: string
  800. '/videos/{id}/views':
  801. post:
  802. summary: Add a view to the video by its id
  803. tags:
  804. - Video
  805. parameters:
  806. - $ref: '#/components/parameters/id2'
  807. responses:
  808. '204':
  809. $ref: '#/paths/~1users~1me/put/responses/204'
  810. '/videos/{id}/watching':
  811. put:
  812. summary: Set watching progress of a video by its id for a user
  813. tags:
  814. - Video
  815. security:
  816. - OAuth2: []
  817. parameters:
  818. - $ref: '#/components/parameters/id2'
  819. requestBody:
  820. content:
  821. application/json:
  822. schema:
  823. $ref: '#/components/schemas/UserWatchingVideo'
  824. required: true
  825. responses:
  826. '204':
  827. $ref: '#/paths/~1users~1me/put/responses/204'
  828. /videos/ownership:
  829. get:
  830. summary: Get list of video ownership changes requests
  831. tags:
  832. - Video
  833. security:
  834. - OAuth2: []
  835. parameters:
  836. - $ref: '#/components/parameters/id2'
  837. responses:
  838. '200':
  839. description: successful operation
  840. '/videos/ownership/{id}/accept':
  841. post:
  842. summary: Refuse ownership change request for video by its id
  843. tags:
  844. - Video
  845. security:
  846. - OAuth2: []
  847. parameters:
  848. - $ref: '#/components/parameters/id2'
  849. responses:
  850. '204':
  851. $ref: '#/paths/~1users~1me/put/responses/204'
  852. '/videos/ownership/{id}/refuse':
  853. post:
  854. summary: Accept ownership change request for video by its id
  855. tags:
  856. - Video
  857. security:
  858. - OAuth2: []
  859. parameters:
  860. - $ref: '#/components/parameters/id2'
  861. responses:
  862. '204':
  863. $ref: '#/paths/~1users~1me/put/responses/204'
  864. '/videos/{id}/give-ownership':
  865. post:
  866. summary: Request change of ownership for a video you own, by its id
  867. tags:
  868. - Video
  869. security:
  870. - OAuth2: []
  871. parameters:
  872. - $ref: '#/components/parameters/id2'
  873. requestBody:
  874. required: true
  875. content:
  876. application/x-www-form-urlencoded:
  877. schema:
  878. type: object
  879. properties:
  880. username:
  881. type: string
  882. required:
  883. - username
  884. responses:
  885. '204':
  886. $ref: '#/paths/~1users~1me/put/responses/204'
  887. '400':
  888. description: 'Changing video ownership to a remote account is not supported yet'
  889. /videos/upload:
  890. post:
  891. summary: Upload a video file with its metadata
  892. security:
  893. - OAuth2: []
  894. tags:
  895. - Video
  896. responses:
  897. '200':
  898. description: successful operation
  899. content:
  900. application/json:
  901. schema:
  902. $ref: '#/components/schemas/VideoUploadResponse'
  903. requestBody:
  904. content:
  905. multipart/form-data:
  906. schema:
  907. type: object
  908. properties:
  909. videofile:
  910. description: Video file
  911. type: string
  912. format: binary
  913. channelId:
  914. description: Channel id that will contain this video
  915. type: number
  916. thumbnailfile:
  917. description: Video thumbnail file
  918. type: string
  919. previewfile:
  920. description: Video preview file
  921. type: string
  922. privacy:
  923. $ref: '#/components/schemas/VideoPrivacy'
  924. category:
  925. description: Video category
  926. type: string
  927. licence:
  928. description: Video licence
  929. type: string
  930. language:
  931. description: Video language
  932. type: string
  933. description:
  934. description: Video description
  935. type: string
  936. waitTranscoding:
  937. description: Whether or not we wait transcoding before publish the video
  938. type: string
  939. support:
  940. description: Text describing how to support the video uploader
  941. type: string
  942. nsfw:
  943. description: Whether or not this video contains sensitive content
  944. type: string
  945. name:
  946. description: Video name
  947. type: string
  948. tags:
  949. description: Video tags
  950. type: string
  951. commentsEnabled:
  952. description: Enable or disable comments for this video
  953. type: string
  954. scheduleUpdate: *ref_0
  955. required:
  956. - videofile
  957. - channelId
  958. - name
  959. x-code-samples:
  960. - lang: Shell
  961. source: |
  962. ## DEPENDENCIES: httpie, jq
  963. # pip install httpie
  964. USERNAME="<your_username>"
  965. PASSWORD="<your_password>"
  966. FILE_PATH="<your_file_path>"
  967. CHANNEL_ID="<your_channel_id>"
  968. NAME="<video_name>"
  969. API_PATH="https://peertube2.cpy.re/api/v1"
  970. ## AUTH
  971. client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
  972. client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
  973. token=$(http -b --form POST "$API_PATH/users/token" \
  974. client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
  975. username=$USERNAME \
  976. password=$PASSWORD \
  977. | jq -r ".access_token")
  978. ## VIDEO UPLOAD
  979. http -b --form POST "$API_PATH/videos/upload" \
  980. videofile@$FILE_PATH \
  981. channelId=$CHANNEL_ID \
  982. name=$NAME \
  983. "Authorization:Bearer $token"
  984. /videos/abuse:
  985. get:
  986. summary: Get list of reported video abuses
  987. security:
  988. - OAuth2: []
  989. tags:
  990. - Video Abuse
  991. parameters:
  992. - $ref: '#/components/parameters/start'
  993. - $ref: '#/components/parameters/count'
  994. - $ref: '#/components/parameters/abusesSort'
  995. responses:
  996. '200':
  997. description: successful operation
  998. content:
  999. application/json:
  1000. schema:
  1001. type: array
  1002. items:
  1003. $ref: '#/components/schemas/VideoAbuse'
  1004. '/videos/{id}/abuse':
  1005. post:
  1006. summary: 'Report an abuse, on a video by its id'
  1007. security:
  1008. - OAuth2: []
  1009. tags:
  1010. - Video Abuse
  1011. parameters:
  1012. - $ref: '#/components/parameters/id2'
  1013. responses:
  1014. '204':
  1015. $ref: '#/paths/~1users~1me/put/responses/204'
  1016. '/videos/{id}/blacklist':
  1017. post:
  1018. summary: Put on blacklist a video by its id
  1019. security:
  1020. - OAuth2:
  1021. - admin
  1022. - moderator
  1023. tags:
  1024. - Video Blacklist
  1025. parameters:
  1026. - $ref: '#/components/parameters/id2'
  1027. responses:
  1028. '204':
  1029. $ref: '#/paths/~1users~1me/put/responses/204'
  1030. delete:
  1031. summary: Delete an entry of the blacklist of a video by its id
  1032. security:
  1033. - OAuth2:
  1034. - admin
  1035. - moderator
  1036. tags:
  1037. - Video Blacklist
  1038. parameters:
  1039. - $ref: '#/components/parameters/id2'
  1040. responses:
  1041. '204':
  1042. $ref: '#/paths/~1users~1me/put/responses/204'
  1043. /videos/blacklist:
  1044. get:
  1045. summary: Get list of videos on blacklist
  1046. security:
  1047. - OAuth2:
  1048. - admin
  1049. - moderator
  1050. tags:
  1051. - Video Blacklist
  1052. parameters:
  1053. - $ref: '#/components/parameters/start'
  1054. - $ref: '#/components/parameters/count'
  1055. - $ref: '#/components/parameters/blacklistsSort'
  1056. responses:
  1057. '200':
  1058. description: successful operation
  1059. content:
  1060. application/json:
  1061. schema:
  1062. type: array
  1063. items:
  1064. $ref: '#/components/schemas/VideoBlacklist'
  1065. /video-channels:
  1066. get:
  1067. summary: Get list of video channels
  1068. tags:
  1069. - Video Channel
  1070. parameters:
  1071. - $ref: '#/components/parameters/start'
  1072. - $ref: '#/components/parameters/count'
  1073. - $ref: '#/components/parameters/sort'
  1074. responses:
  1075. '200':
  1076. description: successful operation
  1077. content:
  1078. application/json:
  1079. schema:
  1080. type: array
  1081. items:
  1082. $ref: '#/components/schemas/VideoChannel'
  1083. post:
  1084. summary: Creates a video channel for the current user
  1085. security:
  1086. - OAuth2: []
  1087. tags:
  1088. - Video Channel
  1089. responses:
  1090. '204':
  1091. $ref: '#/paths/~1users~1me/put/responses/204'
  1092. requestBody:
  1093. $ref: '#/components/requestBodies/VideoChannelInput'
  1094. '/video-channels/{id}':
  1095. get:
  1096. summary: Get a video channel by its id
  1097. tags:
  1098. - Video Channel
  1099. parameters:
  1100. - $ref: '#/components/parameters/id3'
  1101. responses:
  1102. '200':
  1103. description: successful operation
  1104. content:
  1105. application/json:
  1106. schema:
  1107. $ref: '#/components/schemas/VideoChannel'
  1108. put:
  1109. summary: Update a video channel by its id
  1110. security:
  1111. - OAuth2: []
  1112. tags:
  1113. - Video Channel
  1114. parameters:
  1115. - $ref: '#/components/parameters/id3'
  1116. responses:
  1117. '204':
  1118. $ref: '#/paths/~1users~1me/put/responses/204'
  1119. requestBody:
  1120. $ref: '#/components/requestBodies/VideoChannelInput'
  1121. delete:
  1122. summary: Delete a video channel by its id
  1123. security:
  1124. - OAuth2: []
  1125. tags:
  1126. - Video Channel
  1127. parameters:
  1128. - $ref: '#/components/parameters/id3'
  1129. responses:
  1130. '204':
  1131. $ref: '#/paths/~1users~1me/put/responses/204'
  1132. '/video-channels/{id}/videos':
  1133. get:
  1134. summary: Get videos of a video channel by its id
  1135. tags:
  1136. - Video Channel
  1137. parameters:
  1138. - $ref: '#/components/parameters/id3'
  1139. responses:
  1140. '200':
  1141. description: successful operation
  1142. content:
  1143. application/json:
  1144. schema:
  1145. $ref: '#/components/schemas/Video'
  1146. '/accounts/{name}/video-channels':
  1147. get:
  1148. summary: Get video channels of an account by its name
  1149. tags:
  1150. - Video Channel
  1151. parameters:
  1152. - $ref: '#/components/parameters/name'
  1153. responses:
  1154. '200':
  1155. description: successful operation
  1156. content:
  1157. application/json:
  1158. schema:
  1159. type: array
  1160. items:
  1161. $ref: '#/components/schemas/VideoChannel'
  1162. '/videos/{id}/comment-threads':
  1163. get:
  1164. summary: Get the comment threads of a video by its id
  1165. tags:
  1166. - Video Comment
  1167. parameters:
  1168. - $ref: '#/components/parameters/id2'
  1169. - $ref: '#/components/parameters/start'
  1170. - $ref: '#/components/parameters/count'
  1171. - $ref: '#/components/parameters/sort'
  1172. responses:
  1173. '200':
  1174. description: successful operation
  1175. content:
  1176. application/json:
  1177. schema:
  1178. $ref: '#/components/schemas/CommentThreadResponse'
  1179. post:
  1180. summary: 'Creates a comment thread, on a video by its id'
  1181. security:
  1182. - OAuth2: []
  1183. tags:
  1184. - Video Comment
  1185. parameters:
  1186. - $ref: '#/components/parameters/id2'
  1187. responses:
  1188. '200':
  1189. description: successful operation
  1190. content:
  1191. application/json:
  1192. schema:
  1193. $ref: '#/components/schemas/CommentThreadPostResponse'
  1194. '/videos/{id}/comment-threads/{threadId}':
  1195. get:
  1196. summary: 'Get the comment thread by its id, of a video by its id'
  1197. tags:
  1198. - Video Comment
  1199. parameters:
  1200. - $ref: '#/components/parameters/id2'
  1201. - name: threadId
  1202. in: path
  1203. required: true
  1204. description: The thread id (root comment id)
  1205. schema:
  1206. type: number
  1207. responses:
  1208. '200':
  1209. description: successful operation
  1210. content:
  1211. application/json:
  1212. schema:
  1213. $ref: '#/components/schemas/VideoCommentThreadTree'
  1214. '/videos/{id}/comments/{commentId}':
  1215. post:
  1216. summary: 'Creates a comment in a comment thread by its id, of a video by its id'
  1217. security:
  1218. - OAuth2: []
  1219. tags:
  1220. - Video Comment
  1221. parameters:
  1222. - $ref: '#/components/parameters/id2'
  1223. - $ref: '#/components/parameters/commentId'
  1224. responses:
  1225. '200':
  1226. description: successful operation
  1227. content:
  1228. application/json:
  1229. schema:
  1230. $ref: '#/components/schemas/CommentThreadPostResponse'
  1231. delete:
  1232. summary: 'Delete a comment in a comment therad by its id, of a video by its id'
  1233. security:
  1234. - OAuth2: []
  1235. tags:
  1236. - Video Comment
  1237. parameters:
  1238. - $ref: '#/components/parameters/id2'
  1239. - $ref: '#/components/parameters/commentId'
  1240. responses:
  1241. '204':
  1242. $ref: '#/paths/~1users~1me/put/responses/204'
  1243. '/videos/{id}/rate':
  1244. put:
  1245. summary: Vote for a video by its id
  1246. security:
  1247. - OAuth2: []
  1248. tags:
  1249. - Video Rate
  1250. parameters:
  1251. - $ref: '#/components/parameters/id2'
  1252. responses:
  1253. '204':
  1254. $ref: '#/paths/~1users~1me/put/responses/204'
  1255. /search/videos:
  1256. get:
  1257. tags:
  1258. - Search
  1259. summary: Get the videos corresponding to a given query
  1260. parameters:
  1261. - $ref: '#/components/parameters/start'
  1262. - $ref: '#/components/parameters/count'
  1263. - $ref: '#/components/parameters/videosSearchSort'
  1264. - name: search
  1265. in: query
  1266. required: true
  1267. description: String to search
  1268. schema:
  1269. type: string
  1270. responses:
  1271. '200':
  1272. description: successful operation
  1273. content:
  1274. application/json:
  1275. schema:
  1276. type: array
  1277. items:
  1278. $ref: '#/components/schemas/Video'
  1279. servers:
  1280. - url: 'https://peertube.cpy.re/api/v1'
  1281. description: Live Test Server (live data - stable version)
  1282. - url: 'https://peertube2.cpy.re/api/v1'
  1283. description: Live Test Server (live data - bleeding edge version)
  1284. - url: 'https://peertube3.cpy.re/api/v1'
  1285. description: Live Test Server (live data - bleeding edge version)
  1286. components:
  1287. parameters:
  1288. start:
  1289. name: start
  1290. in: query
  1291. required: false
  1292. description: Offset
  1293. schema:
  1294. type: number
  1295. count:
  1296. name: count
  1297. in: query
  1298. required: false
  1299. description: Number of items
  1300. schema:
  1301. type: number
  1302. sort:
  1303. name: sort
  1304. in: query
  1305. required: false
  1306. description: Sort column (-createdAt for example)
  1307. schema:
  1308. type: string
  1309. videosSort:
  1310. name: sort
  1311. in: query
  1312. required: false
  1313. description: Sort videos by criteria
  1314. schema:
  1315. type: string
  1316. enum:
  1317. - -name
  1318. - -duration
  1319. - -createdAt
  1320. - -publishedAt
  1321. - -views
  1322. - -likes
  1323. - -trending
  1324. videosSearchSort:
  1325. name: sort
  1326. in: query
  1327. required: false
  1328. description: Sort videos by criteria
  1329. schema:
  1330. type: string
  1331. enum:
  1332. - -name
  1333. - -duration
  1334. - -createdAt
  1335. - -publishedAt
  1336. - -views
  1337. - -likes
  1338. - -match
  1339. blacklistsSort:
  1340. name: sort
  1341. in: query
  1342. required: false
  1343. description: Sort blacklists by criteria
  1344. schema:
  1345. type: string
  1346. enum:
  1347. - -id
  1348. - -name
  1349. - -duration
  1350. - -views
  1351. - -likes
  1352. - -dislikes
  1353. - -uuid
  1354. - -createdAt
  1355. usersSort:
  1356. name: sort
  1357. in: query
  1358. required: false
  1359. description: Sort users by criteria
  1360. schema:
  1361. type: string
  1362. enum:
  1363. - -id
  1364. - -username
  1365. - -createdAt
  1366. abusesSort:
  1367. name: sort
  1368. in: query
  1369. required: false
  1370. description: Sort abuses by criteria
  1371. schema:
  1372. type: string
  1373. enum:
  1374. - -id
  1375. - -createdAt
  1376. - -state
  1377. name:
  1378. name: name
  1379. in: path
  1380. required: true
  1381. description: >-
  1382. The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
  1383. example)
  1384. schema:
  1385. type: string
  1386. id:
  1387. name: id
  1388. in: path
  1389. required: true
  1390. description: The user id
  1391. schema:
  1392. type: number
  1393. id2:
  1394. name: id
  1395. in: path
  1396. required: true
  1397. description: The video id or uuid
  1398. schema:
  1399. type: string
  1400. id3:
  1401. name: id
  1402. in: path
  1403. required: true
  1404. description: The video channel id or uuid
  1405. schema:
  1406. type: string
  1407. commentId:
  1408. name: threadId
  1409. in: path
  1410. required: true
  1411. description: The comment id
  1412. schema:
  1413. type: number
  1414. categoryOneOf:
  1415. name: categoryOneOf
  1416. in: query
  1417. required: false
  1418. description: category id of the video
  1419. schema:
  1420. oneOf:
  1421. - type: number
  1422. - type: array
  1423. items:
  1424. type: number
  1425. style: form
  1426. explode: false
  1427. tagsOneOf:
  1428. name: tagsOneOf
  1429. in: query
  1430. required: false
  1431. description: tag(s) of the video
  1432. schema:
  1433. oneOf:
  1434. - type: string
  1435. - type: array
  1436. items:
  1437. type: string
  1438. style: form
  1439. explode: false
  1440. tagsAllOf:
  1441. name: tagsAllOf
  1442. in: query
  1443. required: false
  1444. description: tag(s) of the video, where all should be present in the video
  1445. schema:
  1446. oneOf:
  1447. - type: string
  1448. - type: array
  1449. items:
  1450. type: string
  1451. style: form
  1452. explode: false
  1453. languageOneOf:
  1454. name: languageOneOf
  1455. in: query
  1456. required: false
  1457. description: language id of the video
  1458. schema:
  1459. oneOf:
  1460. - type: string
  1461. - type: array
  1462. items:
  1463. type: string
  1464. style: form
  1465. explode: false
  1466. licenceOneOf:
  1467. name: licenceOneOf
  1468. in: query
  1469. required: false
  1470. description: licence id of the video
  1471. schema:
  1472. oneOf:
  1473. - type: number
  1474. - type: array
  1475. items:
  1476. type: number
  1477. style: form
  1478. explode: false
  1479. nsfw:
  1480. name: nsfw
  1481. in: query
  1482. required: false
  1483. description: whether to include nsfw videos, if any
  1484. schema:
  1485. type: string
  1486. enum:
  1487. - 'true'
  1488. - 'false'
  1489. filter:
  1490. name: filter
  1491. in: query
  1492. required: false
  1493. description: >
  1494. Special filters (local for instance) which might require special rights:
  1495. * `local` - only videos local to the instance
  1496. * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
  1497. schema:
  1498. type: string
  1499. enum:
  1500. - local
  1501. - all-local
  1502. requestBodies:
  1503. VideoChannelInput:
  1504. content:
  1505. application/json:
  1506. schema:
  1507. $ref: '#/components/schemas/VideoChannelInput'
  1508. securitySchemes:
  1509. OAuth2:
  1510. description: >
  1511. In the header: *Authorization: Bearer <token\>*
  1512. Authenticating via OAuth requires the following steps:
  1513. - Have an account with sufficient authorization levels
  1514. - [Generate](https://docs.joinpeertube.org/lang/en/devdocs/rest.html) a
  1515. Bearer Token
  1516. - Make Authenticated Requests
  1517. type: oauth2
  1518. flows:
  1519. password:
  1520. tokenUrl: 'https://peertube.example.com/api/v1/users/token'
  1521. scopes:
  1522. admin: Admin scope
  1523. moderator: Moderator scope
  1524. user: User scope
  1525. schemas:
  1526. VideoConstantNumber:
  1527. properties:
  1528. id:
  1529. type: number
  1530. label:
  1531. type: string
  1532. VideoConstantString:
  1533. properties:
  1534. id:
  1535. type: string
  1536. label:
  1537. type: string
  1538. VideoPrivacy:
  1539. type: string
  1540. enum:
  1541. - Public
  1542. - Unlisted
  1543. - Private
  1544. Video:
  1545. properties:
  1546. id:
  1547. type: number
  1548. uuid:
  1549. type: string
  1550. createdAt:
  1551. type: string
  1552. publishedAt:
  1553. type: string
  1554. updatedAt:
  1555. type: string
  1556. category:
  1557. $ref: '#/components/schemas/VideoConstantNumber'
  1558. licence:
  1559. $ref: '#/components/schemas/VideoConstantNumber'
  1560. language:
  1561. $ref: '#/components/schemas/VideoConstantString'
  1562. privacy:
  1563. $ref: '#/components/schemas/VideoPrivacy'
  1564. description:
  1565. type: string
  1566. duration:
  1567. type: number
  1568. isLocal:
  1569. type: boolean
  1570. name:
  1571. type: string
  1572. thumbnailPath:
  1573. type: string
  1574. previewPath:
  1575. type: string
  1576. embedPath:
  1577. type: string
  1578. views:
  1579. type: number
  1580. likes:
  1581. type: number
  1582. dislikes:
  1583. type: number
  1584. nsfw:
  1585. type: boolean
  1586. account:
  1587. type: object
  1588. properties:
  1589. name:
  1590. type: string
  1591. displayName:
  1592. type: string
  1593. url:
  1594. type: string
  1595. host:
  1596. type: string
  1597. avatar:
  1598. $ref: '#/components/schemas/Avatar'
  1599. VideoAbuse:
  1600. properties:
  1601. id:
  1602. type: number
  1603. reason:
  1604. type: string
  1605. reporterAccount:
  1606. $ref: '#/components/schemas/Account'
  1607. video:
  1608. type: object
  1609. properties:
  1610. id:
  1611. type: number
  1612. name:
  1613. type: string
  1614. uuid:
  1615. type: string
  1616. url:
  1617. type: string
  1618. createdAt:
  1619. type: string
  1620. VideoBlacklist:
  1621. properties:
  1622. id:
  1623. type: number
  1624. videoId:
  1625. type: number
  1626. createdAt:
  1627. type: string
  1628. updatedAt:
  1629. type: string
  1630. name:
  1631. type: string
  1632. uuid:
  1633. type: string
  1634. description:
  1635. type: string
  1636. duration:
  1637. type: number
  1638. views:
  1639. type: number
  1640. likes:
  1641. type: number
  1642. dislikes:
  1643. type: number
  1644. nsfw:
  1645. type: boolean
  1646. VideoChannel:
  1647. properties:
  1648. displayName:
  1649. type: string
  1650. description:
  1651. type: string
  1652. isLocal:
  1653. type: boolean
  1654. ownerAccount:
  1655. type: object
  1656. properties:
  1657. id:
  1658. type: number
  1659. uuid:
  1660. type: string
  1661. VideoComment:
  1662. properties:
  1663. id:
  1664. type: number
  1665. url:
  1666. type: string
  1667. text:
  1668. type: string
  1669. threadId:
  1670. type: number
  1671. inReplyToCommentId:
  1672. type: number
  1673. videoId:
  1674. type: number
  1675. createdAt:
  1676. type: string
  1677. updatedAt:
  1678. type: string
  1679. totalReplies:
  1680. type: number
  1681. account:
  1682. $ref: '#/components/schemas/Account'
  1683. VideoCommentThreadTree:
  1684. properties:
  1685. comment:
  1686. $ref: '#/components/schemas/VideoComment'
  1687. children:
  1688. type: array
  1689. items:
  1690. $ref: '#/components/schemas/VideoCommentThreadTree'
  1691. Avatar:
  1692. properties:
  1693. path:
  1694. type: string
  1695. createdAt:
  1696. type: string
  1697. updatedAt:
  1698. type: string
  1699. Actor:
  1700. properties:
  1701. id:
  1702. type: number
  1703. uuid:
  1704. type: string
  1705. url:
  1706. type: string
  1707. name:
  1708. type: string
  1709. host:
  1710. type: string
  1711. followingCount:
  1712. type: number
  1713. followersCount:
  1714. type: number
  1715. createdAt:
  1716. type: string
  1717. updatedAt:
  1718. type: string
  1719. avatar:
  1720. $ref: '#/components/schemas/Avatar'
  1721. Account:
  1722. allOf:
  1723. - $ref: '#/components/schemas/Actor'
  1724. - properties:
  1725. displayName:
  1726. type: string
  1727. User:
  1728. properties:
  1729. id:
  1730. type: number
  1731. username:
  1732. type: string
  1733. email:
  1734. type: string
  1735. displayNSFW:
  1736. type: boolean
  1737. autoPlayVideo:
  1738. type: boolean
  1739. role:
  1740. type: string
  1741. enum:
  1742. - User
  1743. - Moderator
  1744. - Administrator
  1745. videoQuota:
  1746. type: number
  1747. createdAt:
  1748. type: string
  1749. account:
  1750. $ref: '#/components/schemas/Account'
  1751. videoChannels:
  1752. type: array
  1753. items:
  1754. $ref: '#/components/schemas/VideoChannel'
  1755. UserWatchingVideo:
  1756. properties:
  1757. currentTime:
  1758. type: number
  1759. ServerConfig:
  1760. properties:
  1761. signup:
  1762. type: object
  1763. properties:
  1764. allowed:
  1765. type: boolean
  1766. transcoding:
  1767. type: object
  1768. properties:
  1769. enabledResolutions:
  1770. type: array
  1771. items:
  1772. type: number
  1773. avatar:
  1774. type: object
  1775. properties:
  1776. file:
  1777. type: object
  1778. properties:
  1779. size:
  1780. type: object
  1781. properties:
  1782. max:
  1783. type: number
  1784. extensions:
  1785. type: array
  1786. items:
  1787. type: string
  1788. video:
  1789. type: object
  1790. properties:
  1791. file:
  1792. type: object
  1793. properties:
  1794. extensions:
  1795. type: array
  1796. items:
  1797. type: string
  1798. Follow:
  1799. properties:
  1800. id:
  1801. type: number
  1802. follower:
  1803. $ref: '#/components/schemas/Actor'
  1804. following:
  1805. $ref: '#/components/schemas/Actor'
  1806. score:
  1807. type: number
  1808. state:
  1809. type: string
  1810. enum:
  1811. - pending
  1812. - accepted
  1813. createdAt:
  1814. type: string
  1815. updatedAt:
  1816. type: string
  1817. Job:
  1818. properties:
  1819. id:
  1820. type: number
  1821. state:
  1822. type: string
  1823. enum:
  1824. - pending
  1825. - processing
  1826. - error
  1827. - success
  1828. category:
  1829. type: string
  1830. enum:
  1831. - transcoding
  1832. - activitypub-http
  1833. handlerName:
  1834. type: string
  1835. handlerInputData:
  1836. type: string
  1837. createdAt:
  1838. type: string
  1839. updatedAt:
  1840. type: string
  1841. AddUserResponse:
  1842. properties:
  1843. id:
  1844. type: number
  1845. uuid:
  1846. type: string
  1847. VideoUploadResponse:
  1848. properties:
  1849. video:
  1850. type: object
  1851. properties:
  1852. id:
  1853. type: number
  1854. uuid:
  1855. type: string
  1856. CommentThreadResponse:
  1857. properties:
  1858. total:
  1859. type: number
  1860. data:
  1861. type: array
  1862. items:
  1863. $ref: '#/components/schemas/VideoComment'
  1864. CommentThreadPostResponse:
  1865. properties:
  1866. comment:
  1867. $ref: '#/components/schemas/VideoComment'
  1868. AddUser:
  1869. properties:
  1870. username:
  1871. type: string
  1872. description: 'The user username '
  1873. password:
  1874. type: string
  1875. description: 'The user password '
  1876. email:
  1877. type: string
  1878. description: 'The user email '
  1879. videoQuota:
  1880. type: string
  1881. description: 'The user videoQuota '
  1882. role:
  1883. type: integer
  1884. format: int32
  1885. enum:
  1886. - 0
  1887. - 1
  1888. - 2
  1889. description: 'The user role '
  1890. required:
  1891. - username
  1892. - password
  1893. - email
  1894. - videoQuota
  1895. - role
  1896. UpdateUser:
  1897. properties:
  1898. id:
  1899. type: string
  1900. description: 'The user id '
  1901. email:
  1902. type: string
  1903. description: 'The updated email of the user '
  1904. videoQuota:
  1905. type: string
  1906. description: 'The updated videoQuota of the user '
  1907. role:
  1908. type: string
  1909. description: 'The updated role of the user '
  1910. required:
  1911. - id
  1912. - email
  1913. - videoQuota
  1914. - role
  1915. UpdateMe:
  1916. properties:
  1917. password:
  1918. type: string
  1919. description: 'Your new password '
  1920. email:
  1921. type: string
  1922. description: 'Your new email '
  1923. displayNSFW:
  1924. type: string
  1925. description: 'Your new displayNSFW '
  1926. autoPlayVideo:
  1927. type: string
  1928. description: 'Your new autoPlayVideo '
  1929. required:
  1930. - password
  1931. - email
  1932. - displayNSFW
  1933. - autoPlayVideo
  1934. GetMeVideoRating:
  1935. properties:
  1936. id:
  1937. type: string
  1938. description: 'Id of the video '
  1939. rating:
  1940. type: number
  1941. description: 'Rating of the video '
  1942. required:
  1943. - id
  1944. - rating
  1945. RegisterUser:
  1946. properties:
  1947. username:
  1948. type: string
  1949. description: 'The username of the user '
  1950. password:
  1951. type: string
  1952. description: 'The password of the user '
  1953. email:
  1954. type: string
  1955. description: 'The email of the user '
  1956. required:
  1957. - username
  1958. - password
  1959. - email
  1960. VideoChannelInput:
  1961. properties:
  1962. name:
  1963. type: string
  1964. description:
  1965. type: string