Mirror of PeerTube
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openapi.yaml 58KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215
  1. openapi: 3.0.0
  2. info:
  3. title: PeerTube
  4. version: 1.3.0-rc.2
  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. - user
  486. tags:
  487. - User
  488. responses:
  489. '200':
  490. description: successful operation
  491. content:
  492. application/json:
  493. schema:
  494. type: array
  495. items:
  496. $ref: '#/components/schemas/User'
  497. put:
  498. summary: Update current user information
  499. security:
  500. - OAuth2:
  501. - user
  502. tags:
  503. - User
  504. responses:
  505. '204':
  506. description: Successful operation
  507. requestBody:
  508. content:
  509. application/json:
  510. schema:
  511. $ref: '#/components/schemas/UpdateMe'
  512. required: true
  513. /users/me/video-quota-used:
  514. get:
  515. summary: Get current user used quota
  516. security:
  517. - OAuth2:
  518. - user
  519. tags:
  520. - User
  521. responses:
  522. '200':
  523. description: successful operation
  524. content:
  525. application/json:
  526. schema:
  527. type: number
  528. '/users/me/videos/{videoId}/rating':
  529. get:
  530. summary: 'Get rating of video by its id, among those of the current user'
  531. security:
  532. - OAuth2: []
  533. tags:
  534. - User
  535. parameters:
  536. - name: videoId
  537. in: path
  538. required: true
  539. description: 'The video id '
  540. schema:
  541. type: string
  542. responses:
  543. '200':
  544. description: successful operation
  545. content:
  546. application/json:
  547. schema:
  548. $ref: '#/components/schemas/GetMeVideoRating'
  549. /users/me/videos:
  550. get:
  551. summary: Get videos of the current user
  552. security:
  553. - OAuth2:
  554. - user
  555. tags:
  556. - User
  557. parameters:
  558. - $ref: '#/components/parameters/start'
  559. - $ref: '#/components/parameters/count'
  560. - $ref: '#/components/parameters/sort'
  561. responses:
  562. '200':
  563. description: successful operation
  564. content:
  565. application/json:
  566. schema:
  567. type: array
  568. items:
  569. $ref: '#/components/schemas/Video'
  570. /users/me/subscriptions:
  571. get:
  572. summary: Get subscriptions of the current user
  573. security:
  574. - OAuth2:
  575. - user
  576. tags:
  577. - User
  578. parameters:
  579. - $ref: '#/components/parameters/start'
  580. - $ref: '#/components/parameters/count'
  581. - $ref: '#/components/parameters/sort'
  582. responses:
  583. '200':
  584. description: successful operation
  585. post:
  586. summary: Add subscription to the current user
  587. security:
  588. - OAuth2:
  589. - user
  590. tags:
  591. - User
  592. responses:
  593. '200':
  594. description: successful operation
  595. /users/me/subscriptions/exist:
  596. get:
  597. summary: Get if subscriptions exist for the current user
  598. security:
  599. - OAuth2:
  600. - user
  601. tags:
  602. - User
  603. parameters:
  604. - $ref: '#/components/parameters/subscriptionsUris'
  605. responses:
  606. '200':
  607. description: successful operation
  608. content:
  609. application/json:
  610. schema:
  611. type: object
  612. /users/me/subscriptions/videos:
  613. get:
  614. summary: Get videos of subscriptions of the current user
  615. security:
  616. - OAuth2:
  617. - user
  618. tags:
  619. - User
  620. parameters:
  621. - $ref: '#/components/parameters/start'
  622. - $ref: '#/components/parameters/count'
  623. - $ref: '#/components/parameters/sort'
  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. '/users/me/subscriptions/{uri}':
  634. get:
  635. summary: Get subscription of the current user for a given uri
  636. security:
  637. - OAuth2:
  638. - user
  639. tags:
  640. - User
  641. responses:
  642. '200':
  643. description: successful operation
  644. content:
  645. application/json:
  646. schema:
  647. $ref: '#/components/schemas/VideoChannel'
  648. delete:
  649. summary: Delete subscription of the current user for a given uri
  650. security:
  651. - OAuth2:
  652. - user
  653. tags:
  654. - User
  655. responses:
  656. '200':
  657. description: successful operation
  658. /users/register:
  659. post:
  660. summary: Register a user
  661. tags:
  662. - User
  663. responses:
  664. '204':
  665. $ref: '#/paths/~1users~1me/put/responses/204'
  666. requestBody:
  667. content:
  668. application/json:
  669. schema:
  670. $ref: '#/components/schemas/RegisterUser'
  671. required: true
  672. /users/me/avatar/pick:
  673. post:
  674. summary: Update current user avatar
  675. security:
  676. - OAuth2: []
  677. tags:
  678. - User
  679. responses:
  680. '200':
  681. description: successful operation
  682. content:
  683. application/json:
  684. schema:
  685. $ref: '#/components/schemas/Avatar'
  686. requestBody:
  687. content:
  688. multipart/form-data:
  689. schema:
  690. type: object
  691. properties:
  692. avatarfile:
  693. description: The file to upload.
  694. type: string
  695. format: binary
  696. encoding:
  697. profileImage:
  698. # only accept png/jpeg
  699. contentType: image/png, image/jpeg
  700. /videos:
  701. get:
  702. summary: Get list of videos
  703. tags:
  704. - Video
  705. parameters:
  706. - $ref: '#/components/parameters/categoryOneOf'
  707. - $ref: '#/components/parameters/tagsOneOf'
  708. - $ref: '#/components/parameters/tagsAllOf'
  709. - $ref: '#/components/parameters/licenceOneOf'
  710. - $ref: '#/components/parameters/languageOneOf'
  711. - $ref: '#/components/parameters/nsfw'
  712. - $ref: '#/components/parameters/filter'
  713. - $ref: '#/components/parameters/start'
  714. - $ref: '#/components/parameters/count'
  715. - $ref: '#/components/parameters/videosSort'
  716. responses:
  717. '200':
  718. description: successful operation
  719. content:
  720. application/json:
  721. schema:
  722. type: array
  723. items:
  724. $ref: '#/components/schemas/Video'
  725. /videos/categories:
  726. get:
  727. summary: Get list of video licences known by the server
  728. tags:
  729. - Video
  730. responses:
  731. '200':
  732. description: successful operation
  733. content:
  734. application/json:
  735. schema:
  736. type: array
  737. items:
  738. type: string
  739. /videos/licences:
  740. get:
  741. summary: Get list of video licences known by the server
  742. tags:
  743. - Video
  744. responses:
  745. '200':
  746. description: successful operation
  747. content:
  748. application/json:
  749. schema:
  750. type: array
  751. items:
  752. type: string
  753. /videos/languages:
  754. get:
  755. summary: Get list of languages known by the server
  756. tags:
  757. - Video
  758. responses:
  759. '200':
  760. description: successful operation
  761. content:
  762. application/json:
  763. schema:
  764. type: array
  765. items:
  766. type: string
  767. /videos/privacies:
  768. get:
  769. summary: Get list of privacy policies supported by the server
  770. tags:
  771. - Video
  772. responses:
  773. '200':
  774. description: successful operation
  775. content:
  776. application/json:
  777. schema:
  778. type: array
  779. items:
  780. type: string
  781. '/videos/{id}':
  782. put:
  783. summary: Update metadata for a video by its id
  784. security:
  785. - OAuth2: []
  786. tags:
  787. - Video
  788. parameters:
  789. - $ref: '#/components/parameters/id2'
  790. responses:
  791. '200':
  792. description: successful operation
  793. content:
  794. application/json:
  795. schema:
  796. $ref: '#/components/schemas/Video'
  797. requestBody:
  798. content:
  799. multipart/form-data:
  800. schema:
  801. type: object
  802. properties:
  803. thumbnailfile:
  804. description: Video thumbnail file
  805. type: string
  806. previewfile:
  807. description: Video preview file
  808. type: string
  809. category:
  810. description: Video category
  811. type: string
  812. licence:
  813. description: Video licence
  814. type: string
  815. language:
  816. description: Video language
  817. type: string
  818. description:
  819. description: Video description
  820. type: string
  821. waitTranscoding:
  822. description: Whether or not we wait transcoding before publish the video
  823. type: string
  824. support:
  825. description: Text describing how to support the video uploader
  826. type: string
  827. nsfw:
  828. description: Whether or not this video contains sensitive content
  829. type: string
  830. name:
  831. description: Video name
  832. type: string
  833. tags:
  834. description: Video tags (maximum 5 tags each between 2 and 30 characters)
  835. type: array
  836. items:
  837. type: string
  838. commentsEnabled:
  839. description: Enable or disable comments for this video
  840. type: string
  841. scheduleUpdate: &ref_0
  842. type: object
  843. properties:
  844. privacy:
  845. type: string
  846. enum:
  847. - Public
  848. - Unlisted
  849. description: Video privacy target
  850. updateAt:
  851. type: string
  852. format: date
  853. description: When to update the video
  854. required:
  855. - updateAt
  856. get:
  857. summary: Get a video by its id
  858. tags:
  859. - Video
  860. parameters:
  861. - $ref: '#/components/parameters/id2'
  862. responses:
  863. '200':
  864. description: successful operation
  865. content:
  866. application/json:
  867. schema:
  868. $ref: '#/components/schemas/Video'
  869. delete:
  870. summary: Delete a video by its id
  871. security:
  872. - OAuth2: []
  873. tags:
  874. - Video
  875. parameters:
  876. - $ref: '#/components/parameters/id2'
  877. responses:
  878. '204':
  879. $ref: '#/paths/~1users~1me/put/responses/204'
  880. '/videos/{id}/description':
  881. get:
  882. summary: Get a video description by its id
  883. tags:
  884. - Video
  885. parameters:
  886. - $ref: '#/components/parameters/id2'
  887. responses:
  888. '200':
  889. description: successful operation
  890. content:
  891. application/json:
  892. schema:
  893. type: string
  894. '/videos/{id}/views':
  895. post:
  896. summary: Add a view to the video by its id
  897. tags:
  898. - Video
  899. parameters:
  900. - $ref: '#/components/parameters/id2'
  901. responses:
  902. '204':
  903. $ref: '#/paths/~1users~1me/put/responses/204'
  904. '/videos/{id}/watching':
  905. put:
  906. summary: Set watching progress of a video by its id for a user
  907. tags:
  908. - Video
  909. security:
  910. - OAuth2: []
  911. parameters:
  912. - $ref: '#/components/parameters/id2'
  913. requestBody:
  914. content:
  915. application/json:
  916. schema:
  917. $ref: '#/components/schemas/UserWatchingVideo'
  918. required: true
  919. responses:
  920. '204':
  921. $ref: '#/paths/~1users~1me/put/responses/204'
  922. /videos/ownership:
  923. get:
  924. summary: Get list of video ownership changes requests
  925. tags:
  926. - Video
  927. security:
  928. - OAuth2: []
  929. parameters:
  930. - $ref: '#/components/parameters/id2'
  931. responses:
  932. '200':
  933. description: successful operation
  934. '/videos/ownership/{id}/accept':
  935. post:
  936. summary: Refuse ownership change request for video by its id
  937. tags:
  938. - Video
  939. security:
  940. - OAuth2: []
  941. parameters:
  942. - $ref: '#/components/parameters/id2'
  943. responses:
  944. '204':
  945. $ref: '#/paths/~1users~1me/put/responses/204'
  946. '/videos/ownership/{id}/refuse':
  947. post:
  948. summary: Accept ownership change request for video by its id
  949. tags:
  950. - Video
  951. security:
  952. - OAuth2: []
  953. parameters:
  954. - $ref: '#/components/parameters/id2'
  955. responses:
  956. '204':
  957. $ref: '#/paths/~1users~1me/put/responses/204'
  958. '/videos/{id}/give-ownership':
  959. post:
  960. summary: Request change of ownership for a video you own, by its id
  961. tags:
  962. - Video
  963. security:
  964. - OAuth2: []
  965. parameters:
  966. - $ref: '#/components/parameters/id2'
  967. requestBody:
  968. required: true
  969. content:
  970. application/x-www-form-urlencoded:
  971. schema:
  972. type: object
  973. properties:
  974. username:
  975. type: string
  976. required:
  977. - username
  978. responses:
  979. '204':
  980. $ref: '#/paths/~1users~1me/put/responses/204'
  981. '400':
  982. description: 'Changing video ownership to a remote account is not supported yet'
  983. /videos/upload:
  984. post:
  985. summary: Upload a video file with its metadata
  986. security:
  987. - OAuth2: []
  988. tags:
  989. - Video
  990. responses:
  991. '200':
  992. description: successful operation
  993. content:
  994. application/json:
  995. schema:
  996. $ref: '#/components/schemas/VideoUploadResponse'
  997. requestBody:
  998. content:
  999. multipart/form-data:
  1000. schema:
  1001. type: object
  1002. properties:
  1003. videofile:
  1004. description: Video file
  1005. type: string
  1006. format: binary
  1007. channelId:
  1008. description: Channel id that will contain this video
  1009. type: number
  1010. thumbnailfile:
  1011. description: Video thumbnail file
  1012. type: string
  1013. previewfile:
  1014. description: Video preview file
  1015. type: string
  1016. privacy:
  1017. $ref: '#/components/schemas/VideoPrivacy'
  1018. category:
  1019. description: Video category
  1020. type: string
  1021. licence:
  1022. description: Video licence
  1023. type: string
  1024. language:
  1025. description: Video language
  1026. type: string
  1027. description:
  1028. description: Video description
  1029. type: string
  1030. waitTranscoding:
  1031. description: Whether or not we wait transcoding before publish the video
  1032. type: string
  1033. support:
  1034. description: Text describing how to support the video uploader
  1035. type: string
  1036. nsfw:
  1037. description: Whether or not this video contains sensitive content
  1038. type: string
  1039. name:
  1040. description: Video name
  1041. type: string
  1042. tags:
  1043. description: Video tags
  1044. type: array
  1045. items:
  1046. type: string
  1047. commentsEnabled:
  1048. description: Enable or disable comments for this video
  1049. type: string
  1050. scheduleUpdate: *ref_0
  1051. required:
  1052. - videofile
  1053. - channelId
  1054. - name
  1055. x-code-samples:
  1056. - lang: Shell
  1057. source: |
  1058. ## DEPENDENCIES: httpie, jq
  1059. # pip install httpie
  1060. USERNAME="<your_username>"
  1061. PASSWORD="<your_password>"
  1062. FILE_PATH="<your_file_path>"
  1063. CHANNEL_ID="<your_channel_id>"
  1064. NAME="<video_name>"
  1065. API_PATH="https://peertube2.cpy.re/api/v1"
  1066. ## AUTH
  1067. client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
  1068. client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
  1069. token=$(http -b --form POST "$API_PATH/users/token" \
  1070. client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
  1071. username=$USERNAME \
  1072. password=$PASSWORD \
  1073. | jq -r ".access_token")
  1074. ## VIDEO UPLOAD
  1075. http -b --form POST "$API_PATH/videos/upload" \
  1076. videofile@$FILE_PATH \
  1077. channelId=$CHANNEL_ID \
  1078. name=$NAME \
  1079. "Authorization:Bearer $token"
  1080. /videos/imports:
  1081. post:
  1082. summary: Import a torrent or magnetURI or HTTP ressource (if enabled by the instance administrator)
  1083. security:
  1084. - OAuth2: []
  1085. tags:
  1086. - Video
  1087. responses:
  1088. '200':
  1089. description: successful operation
  1090. content:
  1091. application/json:
  1092. schema:
  1093. $ref: '#/components/schemas/VideoUploadResponse'
  1094. requestBody:
  1095. content:
  1096. multipart/form-data:
  1097. schema:
  1098. type: object
  1099. properties:
  1100. torrentfile:
  1101. description: Torrent File
  1102. type: string
  1103. format: binary
  1104. targetUrl:
  1105. description: HTTP target URL
  1106. type: string
  1107. magnetUri:
  1108. description: Magnet URI
  1109. type: string
  1110. channelId:
  1111. description: Channel id that will contain this video
  1112. type: number
  1113. thumbnailfile:
  1114. description: Video thumbnail file
  1115. type: string
  1116. previewfile:
  1117. description: Video preview file
  1118. type: string
  1119. privacy:
  1120. $ref: '#/components/schemas/VideoPrivacy'
  1121. category:
  1122. description: Video category
  1123. type: string
  1124. licence:
  1125. description: Video licence
  1126. type: string
  1127. language:
  1128. description: Video language
  1129. type: string
  1130. description:
  1131. description: Video description
  1132. type: string
  1133. waitTranscoding:
  1134. description: Whether or not we wait transcoding before publish the video
  1135. type: string
  1136. support:
  1137. description: Text describing how to support the video uploader
  1138. type: string
  1139. nsfw:
  1140. description: Whether or not this video contains sensitive content
  1141. type: string
  1142. name:
  1143. description: Video name
  1144. type: string
  1145. tags:
  1146. description: Video tags
  1147. type: array
  1148. items:
  1149. type: string
  1150. commentsEnabled:
  1151. description: Enable or disable comments for this video
  1152. type: string
  1153. scheduleUpdate: *ref_0
  1154. required:
  1155. - channelId
  1156. - name
  1157. /videos/abuse:
  1158. get:
  1159. summary: Get list of reported video abuses
  1160. security:
  1161. - OAuth2: []
  1162. tags:
  1163. - Video Abuse
  1164. parameters:
  1165. - $ref: '#/components/parameters/start'
  1166. - $ref: '#/components/parameters/count'
  1167. - $ref: '#/components/parameters/abusesSort'
  1168. responses:
  1169. '200':
  1170. description: successful operation
  1171. content:
  1172. application/json:
  1173. schema:
  1174. type: array
  1175. items:
  1176. $ref: '#/components/schemas/VideoAbuse'
  1177. '/videos/{id}/abuse':
  1178. post:
  1179. summary: 'Report an abuse, on a video by its id'
  1180. security:
  1181. - OAuth2: []
  1182. tags:
  1183. - Video Abuse
  1184. parameters:
  1185. - $ref: '#/components/parameters/id2'
  1186. responses:
  1187. '204':
  1188. $ref: '#/paths/~1users~1me/put/responses/204'
  1189. '/videos/{id}/blacklist':
  1190. post:
  1191. summary: Put on blacklist a video by its id
  1192. security:
  1193. - OAuth2:
  1194. - admin
  1195. - moderator
  1196. tags:
  1197. - Video Blacklist
  1198. parameters:
  1199. - $ref: '#/components/parameters/id2'
  1200. responses:
  1201. '204':
  1202. $ref: '#/paths/~1users~1me/put/responses/204'
  1203. delete:
  1204. summary: Delete an entry of the blacklist of a video by its id
  1205. security:
  1206. - OAuth2:
  1207. - admin
  1208. - moderator
  1209. tags:
  1210. - Video Blacklist
  1211. parameters:
  1212. - $ref: '#/components/parameters/id2'
  1213. responses:
  1214. '204':
  1215. $ref: '#/paths/~1users~1me/put/responses/204'
  1216. /videos/blacklist:
  1217. get:
  1218. summary: Get list of videos on blacklist
  1219. security:
  1220. - OAuth2:
  1221. - admin
  1222. - moderator
  1223. tags:
  1224. - Video Blacklist
  1225. parameters:
  1226. - $ref: '#/components/parameters/start'
  1227. - $ref: '#/components/parameters/count'
  1228. - $ref: '#/components/parameters/blacklistsSort'
  1229. responses:
  1230. '200':
  1231. description: successful operation
  1232. content:
  1233. application/json:
  1234. schema:
  1235. type: array
  1236. items:
  1237. $ref: '#/components/schemas/VideoBlacklist'
  1238. /video-channels:
  1239. get:
  1240. summary: Get list of video channels
  1241. tags:
  1242. - Video Channel
  1243. parameters:
  1244. - $ref: '#/components/parameters/start'
  1245. - $ref: '#/components/parameters/count'
  1246. - $ref: '#/components/parameters/sort'
  1247. responses:
  1248. '200':
  1249. description: successful operation
  1250. content:
  1251. application/json:
  1252. schema:
  1253. type: array
  1254. items:
  1255. $ref: '#/components/schemas/VideoChannel'
  1256. post:
  1257. summary: Creates a video channel for the current user
  1258. security:
  1259. - OAuth2: []
  1260. tags:
  1261. - Video Channel
  1262. responses:
  1263. '204':
  1264. $ref: '#/paths/~1users~1me/put/responses/204'
  1265. requestBody:
  1266. $ref: '#/components/requestBodies/VideoChannelInput'
  1267. '/video-channels/{channelHandle}':
  1268. get:
  1269. summary: Get a video channel by its id
  1270. tags:
  1271. - Video Channel
  1272. parameters:
  1273. - $ref: '#/components/parameters/channelHandle'
  1274. responses:
  1275. '200':
  1276. description: successful operation
  1277. content:
  1278. application/json:
  1279. schema:
  1280. $ref: '#/components/schemas/VideoChannel'
  1281. put:
  1282. summary: Update a video channel by its id
  1283. security:
  1284. - OAuth2: []
  1285. tags:
  1286. - Video Channel
  1287. parameters:
  1288. - $ref: '#/components/parameters/channelHandle'
  1289. responses:
  1290. '204':
  1291. $ref: '#/paths/~1users~1me/put/responses/204'
  1292. requestBody:
  1293. $ref: '#/components/requestBodies/VideoChannelInput'
  1294. delete:
  1295. summary: Delete a video channel by its id
  1296. security:
  1297. - OAuth2: []
  1298. tags:
  1299. - Video Channel
  1300. parameters:
  1301. - $ref: '#/components/parameters/channelHandle'
  1302. responses:
  1303. '204':
  1304. $ref: '#/paths/~1users~1me/put/responses/204'
  1305. '/video-channels/{channelHandle}/videos':
  1306. get:
  1307. summary: Get videos of a video channel by its id
  1308. tags:
  1309. - Video Channel
  1310. parameters:
  1311. - $ref: '#/components/parameters/channelHandle'
  1312. responses:
  1313. '200':
  1314. description: successful operation
  1315. content:
  1316. application/json:
  1317. schema:
  1318. $ref: '#/components/schemas/Video'
  1319. '/accounts/{name}/video-channels':
  1320. get:
  1321. summary: Get video channels of an account by its name
  1322. tags:
  1323. - Video Channel
  1324. parameters:
  1325. - $ref: '#/components/parameters/name'
  1326. responses:
  1327. '200':
  1328. description: successful operation
  1329. content:
  1330. application/json:
  1331. schema:
  1332. type: array
  1333. items:
  1334. $ref: '#/components/schemas/VideoChannel'
  1335. '/accounts/{name}/ratings':
  1336. get:
  1337. summary: Get ratings of an account by its name
  1338. security:
  1339. - OAuth2: []
  1340. tags:
  1341. - User
  1342. parameters:
  1343. - $ref: '#/components/parameters/start'
  1344. - $ref: '#/components/parameters/count'
  1345. - $ref: '#/components/parameters/sort'
  1346. - name: rating
  1347. in: query
  1348. required: false
  1349. description: Optionaly filter which ratings to retrieve
  1350. schema:
  1351. type: string
  1352. enum:
  1353. - like
  1354. - dislike
  1355. responses:
  1356. '200':
  1357. description: successful operation
  1358. content:
  1359. application/json:
  1360. schema:
  1361. type: array
  1362. items:
  1363. $ref: '#/components/schemas/VideoRating'
  1364. '/videos/{id}/comment-threads':
  1365. get:
  1366. summary: Get the comment threads of a video by its id
  1367. tags:
  1368. - Video Comment
  1369. parameters:
  1370. - $ref: '#/components/parameters/id2'
  1371. - $ref: '#/components/parameters/start'
  1372. - $ref: '#/components/parameters/count'
  1373. - $ref: '#/components/parameters/sort'
  1374. responses:
  1375. '200':
  1376. description: successful operation
  1377. content:
  1378. application/json:
  1379. schema:
  1380. $ref: '#/components/schemas/CommentThreadResponse'
  1381. post:
  1382. summary: 'Creates a comment thread, on a video by its id'
  1383. security:
  1384. - OAuth2: []
  1385. tags:
  1386. - Video Comment
  1387. parameters:
  1388. - $ref: '#/components/parameters/id2'
  1389. responses:
  1390. '200':
  1391. description: successful operation
  1392. content:
  1393. application/json:
  1394. schema:
  1395. $ref: '#/components/schemas/CommentThreadPostResponse'
  1396. '/videos/{id}/comment-threads/{threadId}':
  1397. get:
  1398. summary: 'Get the comment thread by its id, of a video by its id'
  1399. tags:
  1400. - Video Comment
  1401. parameters:
  1402. - $ref: '#/components/parameters/id2'
  1403. - name: threadId
  1404. in: path
  1405. required: true
  1406. description: The thread id (root comment id)
  1407. schema:
  1408. type: number
  1409. responses:
  1410. '200':
  1411. description: successful operation
  1412. content:
  1413. application/json:
  1414. schema:
  1415. $ref: '#/components/schemas/VideoCommentThreadTree'
  1416. '/videos/{id}/comments/{commentId}':
  1417. post:
  1418. summary: 'Creates a comment in a comment thread by its id, of a video by its id'
  1419. security:
  1420. - OAuth2: []
  1421. tags:
  1422. - Video Comment
  1423. parameters:
  1424. - $ref: '#/components/parameters/id2'
  1425. - $ref: '#/components/parameters/commentId'
  1426. responses:
  1427. '200':
  1428. description: successful operation
  1429. content:
  1430. application/json:
  1431. schema:
  1432. $ref: '#/components/schemas/CommentThreadPostResponse'
  1433. delete:
  1434. summary: 'Delete a comment in a comment therad by its id, of a video by its id'
  1435. security:
  1436. - OAuth2: []
  1437. tags:
  1438. - Video Comment
  1439. parameters:
  1440. - $ref: '#/components/parameters/id2'
  1441. - $ref: '#/components/parameters/commentId'
  1442. responses:
  1443. '204':
  1444. $ref: '#/paths/~1users~1me/put/responses/204'
  1445. '/videos/{id}/rate':
  1446. put:
  1447. summary: Vote for a video by its id
  1448. security:
  1449. - OAuth2: []
  1450. tags:
  1451. - Video Rate
  1452. parameters:
  1453. - $ref: '#/components/parameters/id2'
  1454. responses:
  1455. '204':
  1456. $ref: '#/paths/~1users~1me/put/responses/204'
  1457. /search/videos:
  1458. get:
  1459. tags:
  1460. - Search
  1461. summary: Get the videos corresponding to a given query
  1462. parameters:
  1463. - $ref: '#/components/parameters/start'
  1464. - $ref: '#/components/parameters/count'
  1465. - $ref: '#/components/parameters/videosSearchSort'
  1466. - name: search
  1467. in: query
  1468. required: true
  1469. description: String to search
  1470. schema:
  1471. type: string
  1472. responses:
  1473. '200':
  1474. description: successful operation
  1475. content:
  1476. application/json:
  1477. schema:
  1478. type: array
  1479. items:
  1480. $ref: '#/components/schemas/Video'
  1481. servers:
  1482. - url: 'https://peertube.cpy.re/api/v1'
  1483. description: Live Test Server (live data - stable version)
  1484. - url: 'https://peertube2.cpy.re/api/v1'
  1485. description: Live Test Server (live data - bleeding edge version)
  1486. - url: 'https://peertube3.cpy.re/api/v1'
  1487. description: Live Test Server (live data - bleeding edge version)
  1488. components:
  1489. parameters:
  1490. start:
  1491. name: start
  1492. in: query
  1493. required: false
  1494. description: Offset
  1495. schema:
  1496. type: number
  1497. count:
  1498. name: count
  1499. in: query
  1500. required: false
  1501. description: Number of items
  1502. schema:
  1503. type: number
  1504. sort:
  1505. name: sort
  1506. in: query
  1507. required: false
  1508. description: Sort column (-createdAt for example)
  1509. schema:
  1510. type: string
  1511. videosSort:
  1512. name: sort
  1513. in: query
  1514. required: false
  1515. description: Sort videos by criteria
  1516. schema:
  1517. type: string
  1518. enum:
  1519. - -name
  1520. - -duration
  1521. - -createdAt
  1522. - -publishedAt
  1523. - -views
  1524. - -likes
  1525. - -trending
  1526. videosSearchSort:
  1527. name: sort
  1528. in: query
  1529. required: false
  1530. description: Sort videos by criteria
  1531. schema:
  1532. type: string
  1533. enum:
  1534. - -name
  1535. - -duration
  1536. - -createdAt
  1537. - -publishedAt
  1538. - -views
  1539. - -likes
  1540. - -match
  1541. blacklistsSort:
  1542. name: sort
  1543. in: query
  1544. required: false
  1545. description: Sort blacklists by criteria
  1546. schema:
  1547. type: string
  1548. enum:
  1549. - -id
  1550. - -name
  1551. - -duration
  1552. - -views
  1553. - -likes
  1554. - -dislikes
  1555. - -uuid
  1556. - -createdAt
  1557. usersSort:
  1558. name: sort
  1559. in: query
  1560. required: false
  1561. description: Sort users by criteria
  1562. schema:
  1563. type: string
  1564. enum:
  1565. - -id
  1566. - -username
  1567. - -createdAt
  1568. abusesSort:
  1569. name: sort
  1570. in: query
  1571. required: false
  1572. description: Sort abuses by criteria
  1573. schema:
  1574. type: string
  1575. enum:
  1576. - -id
  1577. - -createdAt
  1578. - -state
  1579. name:
  1580. name: name
  1581. in: path
  1582. required: true
  1583. description: >-
  1584. The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
  1585. example)
  1586. schema:
  1587. type: string
  1588. id:
  1589. name: id
  1590. in: path
  1591. required: true
  1592. description: The user id
  1593. schema:
  1594. type: number
  1595. id2:
  1596. name: id
  1597. in: path
  1598. required: true
  1599. description: The video id or uuid
  1600. schema:
  1601. type: string
  1602. channelHandle:
  1603. name: channelHandle
  1604. in: path
  1605. required: true
  1606. description: "The video channel handle (example: 'my_username@example.com' or 'my_username')"
  1607. schema:
  1608. type: string
  1609. commentId:
  1610. name: threadId
  1611. in: path
  1612. required: true
  1613. description: The comment id
  1614. schema:
  1615. type: number
  1616. categoryOneOf:
  1617. name: categoryOneOf
  1618. in: query
  1619. required: false
  1620. description: category id of the video
  1621. schema:
  1622. oneOf:
  1623. - type: number
  1624. - type: array
  1625. items:
  1626. type: number
  1627. style: form
  1628. explode: false
  1629. tagsOneOf:
  1630. name: tagsOneOf
  1631. in: query
  1632. required: false
  1633. description: tag(s) of the video
  1634. schema:
  1635. oneOf:
  1636. - type: string
  1637. - type: array
  1638. items:
  1639. type: string
  1640. style: form
  1641. explode: false
  1642. tagsAllOf:
  1643. name: tagsAllOf
  1644. in: query
  1645. required: false
  1646. description: tag(s) of the video, where all should be present in the video
  1647. schema:
  1648. oneOf:
  1649. - type: string
  1650. - type: array
  1651. items:
  1652. type: string
  1653. style: form
  1654. explode: false
  1655. languageOneOf:
  1656. name: languageOneOf
  1657. in: query
  1658. required: false
  1659. description: language id of the video
  1660. schema:
  1661. oneOf:
  1662. - type: string
  1663. - type: array
  1664. items:
  1665. type: string
  1666. style: form
  1667. explode: false
  1668. licenceOneOf:
  1669. name: licenceOneOf
  1670. in: query
  1671. required: false
  1672. description: licence id of the video
  1673. schema:
  1674. oneOf:
  1675. - type: number
  1676. - type: array
  1677. items:
  1678. type: number
  1679. style: form
  1680. explode: false
  1681. nsfw:
  1682. name: nsfw
  1683. in: query
  1684. required: false
  1685. description: whether to include nsfw videos, if any
  1686. schema:
  1687. type: string
  1688. enum:
  1689. - 'true'
  1690. - 'false'
  1691. filter:
  1692. name: filter
  1693. in: query
  1694. required: false
  1695. description: >
  1696. Special filters (local for instance) which might require special rights:
  1697. * `local` - only videos local to the instance
  1698. * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
  1699. schema:
  1700. type: string
  1701. enum:
  1702. - local
  1703. - all-local
  1704. subscriptionsUris:
  1705. name: uris
  1706. in: query
  1707. required: true
  1708. description: list of uris to check if each is part of the user subscriptions
  1709. schema:
  1710. type: array
  1711. items:
  1712. type: string
  1713. requestBodies:
  1714. VideoChannelInput:
  1715. content:
  1716. application/json:
  1717. schema:
  1718. $ref: '#/components/schemas/VideoChannelInput'
  1719. securitySchemes:
  1720. OAuth2:
  1721. description: >
  1722. In the header: *Authorization: Bearer <token\>*
  1723. Authenticating via OAuth requires the following steps:
  1724. - Have an account with sufficient authorization levels
  1725. - [Generate](https://docs.joinpeertube.org/lang/en/devdocs/rest.html) a
  1726. Bearer Token
  1727. - Make Authenticated Requests
  1728. type: oauth2
  1729. flows:
  1730. password:
  1731. tokenUrl: 'https://peertube.example.com/api/v1/users/token'
  1732. scopes:
  1733. admin: Admin scope
  1734. moderator: Moderator scope
  1735. user: User scope
  1736. schemas:
  1737. VideoConstantNumber:
  1738. properties:
  1739. id:
  1740. type: number
  1741. label:
  1742. type: string
  1743. VideoConstantString:
  1744. properties:
  1745. id:
  1746. type: string
  1747. label:
  1748. type: string
  1749. VideoPrivacy:
  1750. type: string
  1751. enum:
  1752. - Public
  1753. - Unlisted
  1754. - Private
  1755. Video:
  1756. properties:
  1757. id:
  1758. type: number
  1759. uuid:
  1760. type: string
  1761. createdAt:
  1762. type: string
  1763. publishedAt:
  1764. type: string
  1765. updatedAt:
  1766. type: string
  1767. category:
  1768. $ref: '#/components/schemas/VideoConstantNumber'
  1769. licence:
  1770. $ref: '#/components/schemas/VideoConstantNumber'
  1771. language:
  1772. $ref: '#/components/schemas/VideoConstantString'
  1773. privacy:
  1774. $ref: '#/components/schemas/VideoPrivacy'
  1775. description:
  1776. type: string
  1777. duration:
  1778. type: number
  1779. isLocal:
  1780. type: boolean
  1781. name:
  1782. type: string
  1783. thumbnailPath:
  1784. type: string
  1785. previewPath:
  1786. type: string
  1787. embedPath:
  1788. type: string
  1789. views:
  1790. type: number
  1791. likes:
  1792. type: number
  1793. dislikes:
  1794. type: number
  1795. nsfw:
  1796. type: boolean
  1797. account:
  1798. type: object
  1799. properties:
  1800. name:
  1801. type: string
  1802. displayName:
  1803. type: string
  1804. url:
  1805. type: string
  1806. host:
  1807. type: string
  1808. avatar:
  1809. $ref: '#/components/schemas/Avatar'
  1810. VideoAbuse:
  1811. properties:
  1812. id:
  1813. type: number
  1814. reason:
  1815. type: string
  1816. reporterAccount:
  1817. $ref: '#/components/schemas/Account'
  1818. video:
  1819. type: object
  1820. properties:
  1821. id:
  1822. type: number
  1823. name:
  1824. type: string
  1825. uuid:
  1826. type: string
  1827. url:
  1828. type: string
  1829. createdAt:
  1830. type: string
  1831. VideoBlacklist:
  1832. properties:
  1833. id:
  1834. type: number
  1835. videoId:
  1836. type: number
  1837. createdAt:
  1838. type: string
  1839. updatedAt:
  1840. type: string
  1841. name:
  1842. type: string
  1843. uuid:
  1844. type: string
  1845. description:
  1846. type: string
  1847. duration:
  1848. type: number
  1849. views:
  1850. type: number
  1851. likes:
  1852. type: number
  1853. dislikes:
  1854. type: number
  1855. nsfw:
  1856. type: boolean
  1857. VideoChannel:
  1858. properties:
  1859. displayName:
  1860. type: string
  1861. description:
  1862. type: string
  1863. isLocal:
  1864. type: boolean
  1865. ownerAccount:
  1866. type: object
  1867. properties:
  1868. id:
  1869. type: number
  1870. uuid:
  1871. type: string
  1872. VideoComment:
  1873. properties:
  1874. id:
  1875. type: number
  1876. url:
  1877. type: string
  1878. text:
  1879. type: string
  1880. threadId:
  1881. type: number
  1882. inReplyToCommentId:
  1883. type: number
  1884. videoId:
  1885. type: number
  1886. createdAt:
  1887. type: string
  1888. updatedAt:
  1889. type: string
  1890. totalReplies:
  1891. type: number
  1892. account:
  1893. $ref: '#/components/schemas/Account'
  1894. VideoCommentThreadTree:
  1895. properties:
  1896. comment:
  1897. $ref: '#/components/schemas/VideoComment'
  1898. children:
  1899. type: array
  1900. items:
  1901. $ref: '#/components/schemas/VideoCommentThreadTree'
  1902. Avatar:
  1903. properties:
  1904. path:
  1905. type: string
  1906. createdAt:
  1907. type: string
  1908. updatedAt:
  1909. type: string
  1910. Actor:
  1911. properties:
  1912. id:
  1913. type: number
  1914. uuid:
  1915. type: string
  1916. url:
  1917. type: string
  1918. name:
  1919. type: string
  1920. host:
  1921. type: string
  1922. followingCount:
  1923. type: number
  1924. followersCount:
  1925. type: number
  1926. createdAt:
  1927. type: string
  1928. updatedAt:
  1929. type: string
  1930. avatar:
  1931. $ref: '#/components/schemas/Avatar'
  1932. Account:
  1933. allOf:
  1934. - $ref: '#/components/schemas/Actor'
  1935. - properties:
  1936. displayName:
  1937. type: string
  1938. User:
  1939. properties:
  1940. id:
  1941. type: number
  1942. username:
  1943. type: string
  1944. email:
  1945. type: string
  1946. displayNSFW:
  1947. type: boolean
  1948. autoPlayVideo:
  1949. type: boolean
  1950. role:
  1951. type: string
  1952. enum:
  1953. - User
  1954. - Moderator
  1955. - Administrator
  1956. videoQuota:
  1957. type: number
  1958. videoQuotaDaily:
  1959. type: number
  1960. createdAt:
  1961. type: string
  1962. account:
  1963. $ref: '#/components/schemas/Account'
  1964. videoChannels:
  1965. type: array
  1966. items:
  1967. $ref: '#/components/schemas/VideoChannel'
  1968. UserWatchingVideo:
  1969. properties:
  1970. currentTime:
  1971. type: number
  1972. ServerConfig:
  1973. properties:
  1974. signup:
  1975. type: object
  1976. properties:
  1977. allowed:
  1978. type: boolean
  1979. transcoding:
  1980. type: object
  1981. properties:
  1982. enabledResolutions:
  1983. type: array
  1984. items:
  1985. type: number
  1986. avatar:
  1987. type: object
  1988. properties:
  1989. file:
  1990. type: object
  1991. properties:
  1992. size:
  1993. type: object
  1994. properties:
  1995. max:
  1996. type: number
  1997. extensions:
  1998. type: array
  1999. items:
  2000. type: string
  2001. video:
  2002. type: object
  2003. properties:
  2004. file:
  2005. type: object
  2006. properties:
  2007. extensions:
  2008. type: array
  2009. items:
  2010. type: string
  2011. Follow:
  2012. properties:
  2013. id:
  2014. type: number
  2015. follower:
  2016. $ref: '#/components/schemas/Actor'
  2017. following:
  2018. $ref: '#/components/schemas/Actor'
  2019. score:
  2020. type: number
  2021. state:
  2022. type: string
  2023. enum:
  2024. - pending
  2025. - accepted
  2026. createdAt:
  2027. type: string
  2028. updatedAt:
  2029. type: string
  2030. Job:
  2031. properties:
  2032. id:
  2033. type: number
  2034. state:
  2035. type: string
  2036. enum:
  2037. - pending
  2038. - processing
  2039. - error
  2040. - success
  2041. category:
  2042. type: string
  2043. enum:
  2044. - transcoding
  2045. - activitypub-http
  2046. handlerName:
  2047. type: string
  2048. handlerInputData:
  2049. type: string
  2050. createdAt:
  2051. type: string
  2052. updatedAt:
  2053. type: string
  2054. AddUserResponse:
  2055. properties:
  2056. id:
  2057. type: number
  2058. uuid:
  2059. type: string
  2060. VideoUploadResponse:
  2061. properties:
  2062. video:
  2063. type: object
  2064. properties:
  2065. id:
  2066. type: number
  2067. uuid:
  2068. type: string
  2069. CommentThreadResponse:
  2070. properties:
  2071. total:
  2072. type: number
  2073. data:
  2074. type: array
  2075. items:
  2076. $ref: '#/components/schemas/VideoComment'
  2077. CommentThreadPostResponse:
  2078. properties:
  2079. comment:
  2080. $ref: '#/components/schemas/VideoComment'
  2081. AddUser:
  2082. properties:
  2083. username:
  2084. type: string
  2085. description: 'The user username '
  2086. password:
  2087. type: string
  2088. description: 'The user password '
  2089. email:
  2090. type: string
  2091. description: 'The user email '
  2092. videoQuota:
  2093. type: string
  2094. description: 'The user videoQuota '
  2095. videoQuotaDaily:
  2096. type: string
  2097. description: 'The user daily video quota '
  2098. role:
  2099. type: integer
  2100. format: int32
  2101. enum:
  2102. - 0
  2103. - 1
  2104. - 2
  2105. description: 'The user role '
  2106. required:
  2107. - username
  2108. - password
  2109. - email
  2110. - videoQuota
  2111. - videoQuotaDaily
  2112. - role
  2113. UpdateUser:
  2114. properties:
  2115. id:
  2116. type: string
  2117. description: 'The user id '
  2118. email:
  2119. type: string
  2120. description: 'The updated email of the user '
  2121. videoQuota:
  2122. type: string
  2123. description: 'The updated videoQuota of the user '
  2124. videoQuotaDaily:
  2125. type: string
  2126. description: 'The updated daily video quota of the user '
  2127. role:
  2128. type: string
  2129. description: 'The updated role of the user '
  2130. required:
  2131. - id
  2132. - email
  2133. - videoQuota
  2134. - videoQuotaDaily
  2135. - role
  2136. UpdateMe:
  2137. properties:
  2138. password:
  2139. type: string
  2140. description: 'Your new password '
  2141. email:
  2142. type: string
  2143. description: 'Your new email '
  2144. displayNSFW:
  2145. type: string
  2146. description: 'Your new displayNSFW '
  2147. autoPlayVideo:
  2148. type: string
  2149. description: 'Your new autoPlayVideo '
  2150. required:
  2151. - password
  2152. - email
  2153. - displayNSFW
  2154. - autoPlayVideo
  2155. GetMeVideoRating:
  2156. properties:
  2157. id:
  2158. type: string
  2159. description: 'Id of the video '
  2160. rating:
  2161. type: number
  2162. description: 'Rating of the video '
  2163. required:
  2164. - id
  2165. - rating
  2166. VideoRating:
  2167. properties:
  2168. video:
  2169. $ref: '#/components/schemas/Video'
  2170. rating:
  2171. type: number
  2172. description: 'Rating of the video'
  2173. required:
  2174. - video
  2175. - rating
  2176. RegisterUser:
  2177. properties:
  2178. username:
  2179. type: string
  2180. description: 'The username of the user '
  2181. password:
  2182. type: string
  2183. description: 'The password of the user '
  2184. email:
  2185. type: string
  2186. description: 'The email of the user '
  2187. required:
  2188. - username
  2189. - password
  2190. - email
  2191. VideoChannelInput:
  2192. properties:
  2193. name:
  2194. type: string
  2195. description:
  2196. type: string