openapi.yaml 158 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679
  1. openapi: 3.0.0
  2. info:
  3. title: PeerTube
  4. version: 3.0.1
  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) and is RESTful. You can use your favorite
  17. HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with
  18. [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
  19. which generates a client SDK in the language of your choice - we generate some client SDKs automatically:
  20. - [Python](https://framagit.org/framasoft/peertube/clients/python)
  21. - [Go](https://framagit.org/framasoft/peertube/clients/go)
  22. - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin)
  23. See the [Quick Start guide](https://docs.joinpeertube.org/#/api-rest-getting-started) so you can play with the PeerTube API.
  24. # Authentication
  25. When you sign up for an account, you are given the possibility to generate
  26. sessions, and authenticate using this session token. One session token can
  27. currently be used at a time.
  28. ## Roles
  29. Accounts are given permissions based on their role. There are three roles on
  30. PeerTube: Administrator, Moderator, and User. See the [roles guide](https://docs.joinpeertube.org/#/admin-managing-users?id=roles) for a detail of their permissions.
  31. # Errors
  32. The API uses standard HTTP status codes to indicate the success or failure
  33. of the API call. The body of the response will be JSON in the following
  34. format.
  35. ```
  36. {
  37. "code": "unauthorized_request", // example inner error code
  38. "error": "Token is invalid." // example exposed error message
  39. }
  40. ```
  41. externalDocs:
  42. url: https://docs.joinpeertube.org/api-rest-reference.html
  43. tags:
  44. - name: Accounts
  45. description: >
  46. Accounts encompass remote accounts discovered across the federation,
  47. and correspond to the main Actor, along with video channels a user can create, which
  48. are also Actors.
  49. When a comment is posted, it is done with your Account's Actor.
  50. - name: Users
  51. description: >
  52. Using some features of PeerTube require authentication, for which User
  53. provide different levels of permission as well as associated user
  54. information. Each user has a corresponding local Account for federation.
  55. - name: My User
  56. description: >
  57. Operations related to your own User, when logged-in.
  58. - name: My Subscriptions
  59. description: >
  60. Operations related to your subscriptions to video channels, their
  61. new videos, and how to keep up to date with their latest publications!
  62. - name: My History
  63. description: >
  64. Operations related to your watch history.
  65. - name: My Notifications
  66. description: >
  67. Notifications following new videos, follows or reports. They allow you
  68. to keep track of the interactions and overall important information that
  69. concerns you. You MAY set per-notification type delivery preference, to
  70. receive the info either by mail, by in-browser notification or both.
  71. - name: Config
  72. description: >
  73. Each server exposes public information regarding supported videos and
  74. options.
  75. - name: Job
  76. description: >
  77. Jobs are long-running tasks enqueued and processed by the instance
  78. itself. No additional worker registration is currently available.
  79. - name: Instance Follows
  80. description: >
  81. Managing servers which the instance interacts with is crucial to the
  82. concept of federation in PeerTube and external video indexation. The PeerTube
  83. server then deals with inter-server ActivityPub operations and propagates
  84. information across its social graph by posting activities to actors' inbox
  85. endpoints.
  86. externalDocs:
  87. url: https://docs.joinpeertube.org/#/admin-following-instances?id=instances-follows
  88. - name: Instance Redundancy
  89. description: >
  90. Redundancy is part of the inter-server solidarity that PeerTube fosters.
  91. Manage the list of instances you wish to help by seeding their videos according
  92. to the policy of video selection of your choice. Note that you have a similar functionality
  93. to mirror individual videos, see `Video Mirroring`.
  94. externalDocs:
  95. url: https://docs.joinpeertube.org/#/admin-following-instances?id=instances-redundancy
  96. - name: Plugins
  97. description: >
  98. Managing plugins installed from a local path or from NPM, or search for new ones.
  99. externalDocs:
  100. url: https://docs.joinpeertube.org/#/api-plugins
  101. - name: Abuses
  102. description: |
  103. Abuses deal with reports of local or remote videos/comments/accounts alike.
  104. - name: Video
  105. description: |
  106. Operations dealing with listing, uploading, fetching or modifying videos.
  107. - name: Search
  108. description: |
  109. The search helps to find _videos_ or _channels_ from within the instance and beyond.
  110. Videos from other instances federated by the instance (that is, instances
  111. followed by the instance) can be found via keywords and other criteria of
  112. the advanced search.
  113. Administrators can also enable the use of a remote search system, indexing
  114. videos and channels not could be not federated by the instance.
  115. - name: Video Comments
  116. description: >
  117. Operations dealing with comments to a video. Comments are organized in
  118. threads.
  119. - name: Video Playlists
  120. description: >
  121. Operations dealing with playlists of videos. Playlists are bound to users
  122. and/or channels.
  123. - name: Video Channels
  124. description: >
  125. Operations dealing with the creation, modification and listing of videos within a channel.
  126. - name: Video Blocks
  127. description: >
  128. Operations dealing with blocking videos (removing them from view and
  129. preventing interactions).
  130. - name: Video Rates
  131. description: >
  132. Like/dislike a video.
  133. - name: Feeds
  134. description: >
  135. Server syndication feeds
  136. x-tagGroups:
  137. - name: Accounts
  138. tags:
  139. - Accounts
  140. - Users
  141. - My User
  142. - My Subscriptions
  143. - My Notifications
  144. - My History
  145. - name: Videos
  146. tags:
  147. - Video
  148. - Video Captions
  149. - Video Channels
  150. - Video Comments
  151. - Video Rates
  152. - Video Playlists
  153. - Video Ownership Change
  154. - Video Mirroring
  155. - Live Videos
  156. - Feeds
  157. - name: Search
  158. tags:
  159. - Search
  160. - name: Moderation
  161. tags:
  162. - Abuses
  163. - Video Blocks
  164. - Account Blocks
  165. - Server Blocks
  166. - name: Instance Configuration
  167. tags:
  168. - Config
  169. - Instance Follows
  170. - Instance Redundancy
  171. - Plugins
  172. - name: Jobs
  173. tags:
  174. - Job
  175. paths:
  176. '/accounts/{name}':
  177. get:
  178. tags:
  179. - Accounts
  180. summary: Get an account
  181. parameters:
  182. - $ref: '#/components/parameters/name'
  183. responses:
  184. '200':
  185. description: successful operation
  186. content:
  187. application/json:
  188. schema:
  189. $ref: '#/components/schemas/Account'
  190. '404':
  191. description: account not found
  192. '/accounts/{name}/videos':
  193. get:
  194. tags:
  195. - Accounts
  196. - Video
  197. summary: 'List videos of an account'
  198. parameters:
  199. - $ref: '#/components/parameters/name'
  200. - $ref: '#/components/parameters/categoryOneOf'
  201. - $ref: '#/components/parameters/tagsOneOf'
  202. - $ref: '#/components/parameters/tagsAllOf'
  203. - $ref: '#/components/parameters/licenceOneOf'
  204. - $ref: '#/components/parameters/languageOneOf'
  205. - $ref: '#/components/parameters/nsfw'
  206. - $ref: '#/components/parameters/filter'
  207. - $ref: '#/components/parameters/skipCount'
  208. - $ref: '#/components/parameters/start'
  209. - $ref: '#/components/parameters/count'
  210. - $ref: '#/components/parameters/videosSort'
  211. responses:
  212. '200':
  213. description: successful operation
  214. content:
  215. application/json:
  216. schema:
  217. $ref: '#/components/schemas/VideoListResponse'
  218. x-code-samples:
  219. - lang: JavaScript
  220. source: |
  221. fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
  222. .then(function(response) {
  223. return response.json()
  224. }).then(function(data) {
  225. console.log(data)
  226. })
  227. - lang: Shell
  228. source: |
  229. ## DEPENDENCIES: jq
  230. curl -s https://peertube2.cpy.re/api/v1/accounts/{name}/videos | jq
  231. - lang: Ruby
  232. source: |
  233. require 'net/http'
  234. require 'json'
  235. uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
  236. http = Net::HTTP.new(uri.host, uri.port)
  237. http.use_ssl = true
  238. response = http.get(uri.request_uri)
  239. puts JSON.parse(response.read_body)
  240. - lang: Python
  241. source: |
  242. import requests
  243. r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
  244. json = r.json()
  245. print(json)
  246. /accounts:
  247. get:
  248. tags:
  249. - Accounts
  250. summary: List accounts
  251. parameters:
  252. - $ref: '#/components/parameters/start'
  253. - $ref: '#/components/parameters/count'
  254. - $ref: '#/components/parameters/sort'
  255. responses:
  256. '200':
  257. description: successful operation
  258. content:
  259. 'application/json':
  260. schema:
  261. type: array
  262. items:
  263. $ref: '#/components/schemas/Account'
  264. /config:
  265. get:
  266. tags:
  267. - Config
  268. summary: Get instance public configuration
  269. responses:
  270. '200':
  271. description: successful operation
  272. content:
  273. application/json:
  274. schema:
  275. $ref: '#/components/schemas/ServerConfig'
  276. /config/about:
  277. get:
  278. summary: Get instance "About" information
  279. tags:
  280. - Config
  281. responses:
  282. '200':
  283. description: successful operation
  284. content:
  285. application/json:
  286. schema:
  287. $ref: '#/components/schemas/ServerConfigAbout'
  288. /config/custom:
  289. get:
  290. summary: Get instance runtime configuration
  291. tags:
  292. - Config
  293. security:
  294. - OAuth2:
  295. - admin
  296. responses:
  297. '200':
  298. description: successful operation
  299. content:
  300. application/json:
  301. schema:
  302. $ref: '#/components/schemas/ServerConfigCustom'
  303. put:
  304. summary: Set instance runtime configuration
  305. tags:
  306. - Config
  307. security:
  308. - OAuth2:
  309. - admin
  310. responses:
  311. '200':
  312. description: successful operation
  313. '400':
  314. x-summary: field inconsistencies
  315. description: >
  316. Arises when:
  317. - the emailer is disabled and the instance is open to registrations
  318. - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled
  319. delete:
  320. summary: Delete instance runtime configuration
  321. tags:
  322. - Config
  323. security:
  324. - OAuth2:
  325. - admin
  326. responses:
  327. '200':
  328. description: successful operation
  329. /jobs/{state}:
  330. get:
  331. summary: List instance jobs
  332. security:
  333. - OAuth2:
  334. - admin
  335. tags:
  336. - Job
  337. parameters:
  338. - name: state
  339. in: path
  340. required: true
  341. description: The state of the job ('' for for no filter)
  342. schema:
  343. type: string
  344. enum:
  345. - ''
  346. - active
  347. - completed
  348. - failed
  349. - waiting
  350. - delayed
  351. - $ref: '#/components/parameters/jobType'
  352. - $ref: '#/components/parameters/start'
  353. - $ref: '#/components/parameters/count'
  354. - $ref: '#/components/parameters/sort'
  355. responses:
  356. '200':
  357. description: successful operation
  358. content:
  359. application/json:
  360. schema:
  361. type: object
  362. properties:
  363. total:
  364. type: integer
  365. example: 1
  366. data:
  367. type: array
  368. maxItems: 100
  369. items:
  370. $ref: '#/components/schemas/Job'
  371. '/server/following/{host}':
  372. delete:
  373. security:
  374. - OAuth2:
  375. - admin
  376. tags:
  377. - Instance Follows
  378. summary: Unfollow a server
  379. parameters:
  380. - name: host
  381. in: path
  382. required: true
  383. description: 'The host to unfollow '
  384. schema:
  385. type: string
  386. format: hostname
  387. responses:
  388. '201':
  389. description: successful operation
  390. /server/followers:
  391. get:
  392. tags:
  393. - Instance Follows
  394. summary: List instance followers
  395. parameters:
  396. - $ref: '#/components/parameters/start'
  397. - $ref: '#/components/parameters/count'
  398. - $ref: '#/components/parameters/sort'
  399. responses:
  400. '200':
  401. description: successful operation
  402. content:
  403. application/json:
  404. schema:
  405. type: array
  406. items:
  407. $ref: '#/components/schemas/Follow'
  408. /server/following:
  409. get:
  410. tags:
  411. - Instance Follows
  412. summary: List instances followed by the server
  413. parameters:
  414. - name: state
  415. in: query
  416. schema:
  417. type: string
  418. enum:
  419. - pending
  420. - accepted
  421. - name: actorType
  422. in: query
  423. schema:
  424. type: string
  425. enum:
  426. - Person
  427. - Application
  428. - Group
  429. - Service
  430. - Organization
  431. - $ref: '#/components/parameters/start'
  432. - $ref: '#/components/parameters/count'
  433. - $ref: '#/components/parameters/sort'
  434. responses:
  435. '200':
  436. description: successful operation
  437. content:
  438. application/json:
  439. schema:
  440. type: array
  441. items:
  442. $ref: '#/components/schemas/Follow'
  443. post:
  444. security:
  445. - OAuth2:
  446. - admin
  447. tags:
  448. - Instance Follows
  449. summary: Follow a server
  450. responses:
  451. '204':
  452. description: successful operation
  453. '500':
  454. description: cannot follow a non-HTTPS server
  455. requestBody:
  456. content:
  457. application/json:
  458. schema:
  459. type: object
  460. properties:
  461. hosts:
  462. type: array
  463. items:
  464. type: string
  465. format: hostname
  466. uniqueItems: true
  467. /users:
  468. post:
  469. summary: Create a user
  470. security:
  471. - OAuth2:
  472. - admin
  473. tags:
  474. - Users
  475. responses:
  476. '200':
  477. description: user created
  478. content:
  479. application/json:
  480. schema:
  481. $ref: '#/components/schemas/AddUserResponse'
  482. links:
  483. # GET /users/{id}
  484. GetUserId:
  485. operationId: getUserId
  486. parameters:
  487. id: '$response.body#/user/id'
  488. # PUT /users/{id}
  489. PutUserId:
  490. operationId: putUserId
  491. parameters:
  492. id: '$response.body#/user/id'
  493. # DELETE /users/{id}
  494. DelUserId:
  495. operationId: delUserId
  496. parameters:
  497. id: '$response.body#/user/id'
  498. '403':
  499. description: insufficient authority to create an admin or moderator
  500. requestBody:
  501. content:
  502. application/json:
  503. schema:
  504. $ref: '#/components/schemas/AddUser'
  505. description: User to create
  506. required: true
  507. get:
  508. summary: List users
  509. security:
  510. - OAuth2:
  511. - admin
  512. tags:
  513. - Users
  514. parameters:
  515. - $ref: '#/components/parameters/usersSearch'
  516. - $ref: '#/components/parameters/usersBlocked'
  517. - $ref: '#/components/parameters/start'
  518. - $ref: '#/components/parameters/count'
  519. - $ref: '#/components/parameters/usersSort'
  520. responses:
  521. '200':
  522. description: successful operation
  523. content:
  524. application/json:
  525. schema:
  526. type: array
  527. items:
  528. $ref: '#/components/schemas/User'
  529. '/users/{id}':
  530. parameters:
  531. - $ref: '#/components/parameters/id'
  532. delete:
  533. summary: Delete a user
  534. security:
  535. - OAuth2:
  536. - admin
  537. tags:
  538. - Users
  539. operationId: delUserId
  540. responses:
  541. '204':
  542. description: successful operation
  543. get:
  544. summary: Get a user
  545. security:
  546. - OAuth2: []
  547. tags:
  548. - Users
  549. operationId: getUserId
  550. responses:
  551. '200':
  552. description: successful operation
  553. content:
  554. application/json:
  555. schema:
  556. $ref: '#/components/schemas/User'
  557. put:
  558. summary: Update a user
  559. security:
  560. - OAuth2: []
  561. tags:
  562. - Users
  563. operationId: putUserId
  564. responses:
  565. '204':
  566. description: successful operation
  567. requestBody:
  568. content:
  569. application/json:
  570. schema:
  571. $ref: '#/components/schemas/UpdateUser'
  572. required: true
  573. /users/register:
  574. post:
  575. summary: Register a user
  576. tags:
  577. - Users
  578. responses:
  579. '204':
  580. description: successful operation
  581. requestBody:
  582. content:
  583. application/json:
  584. schema:
  585. $ref: '#/components/schemas/RegisterUser'
  586. required: true
  587. /users/me:
  588. get:
  589. summary: Get my user information
  590. security:
  591. - OAuth2:
  592. - user
  593. tags:
  594. - My User
  595. responses:
  596. '200':
  597. description: successful operation
  598. content:
  599. application/json:
  600. schema:
  601. type: array
  602. items:
  603. $ref: '#/components/schemas/User'
  604. put:
  605. summary: Update my user information
  606. security:
  607. - OAuth2:
  608. - user
  609. tags:
  610. - My User
  611. responses:
  612. '204':
  613. description: successful operation
  614. requestBody:
  615. content:
  616. application/json:
  617. schema:
  618. $ref: '#/components/schemas/UpdateMe'
  619. required: true
  620. /users/me/videos/imports:
  621. get:
  622. summary: Get video imports of my user
  623. security:
  624. - OAuth2:
  625. - user
  626. tags:
  627. - Videos
  628. - My User
  629. parameters:
  630. - $ref: '#/components/parameters/start'
  631. - $ref: '#/components/parameters/count'
  632. - $ref: '#/components/parameters/sort'
  633. responses:
  634. '200':
  635. description: successful operation
  636. content:
  637. application/json:
  638. schema:
  639. $ref: '#/components/schemas/VideoImport'
  640. /users/me/video-quota-used:
  641. get:
  642. summary: Get my user used quota
  643. security:
  644. - OAuth2:
  645. - user
  646. tags:
  647. - My User
  648. responses:
  649. '200':
  650. description: successful operation
  651. content:
  652. application/json:
  653. schema:
  654. type: number
  655. '/users/me/videos/{videoId}/rating':
  656. get:
  657. summary: Get rate of my user for a video
  658. security:
  659. - OAuth2: []
  660. tags:
  661. - My User
  662. - Video Rates
  663. parameters:
  664. - name: videoId
  665. in: path
  666. required: true
  667. description: 'The video id '
  668. schema:
  669. type: string
  670. responses:
  671. '200':
  672. description: successful operation
  673. content:
  674. application/json:
  675. schema:
  676. $ref: '#/components/schemas/GetMeVideoRating'
  677. /users/me/videos:
  678. get:
  679. summary: Get videos of my user
  680. security:
  681. - OAuth2:
  682. - user
  683. tags:
  684. - My User
  685. - Videos
  686. parameters:
  687. - $ref: '#/components/parameters/start'
  688. - $ref: '#/components/parameters/count'
  689. - $ref: '#/components/parameters/sort'
  690. responses:
  691. '200':
  692. description: successful operation
  693. content:
  694. application/json:
  695. schema:
  696. $ref: '#/components/schemas/VideoListResponse'
  697. /users/me/subscriptions:
  698. get:
  699. summary: Get my user subscriptions
  700. security:
  701. - OAuth2:
  702. - user
  703. tags:
  704. - My Subscriptions
  705. parameters:
  706. - $ref: '#/components/parameters/start'
  707. - $ref: '#/components/parameters/count'
  708. - $ref: '#/components/parameters/sort'
  709. responses:
  710. '200':
  711. description: successful operation
  712. post:
  713. tags:
  714. - My Subscriptions
  715. summary: Add subscription to my user
  716. security:
  717. - OAuth2:
  718. - user
  719. requestBody:
  720. content:
  721. application/json:
  722. schema:
  723. type: object
  724. properties:
  725. uri:
  726. type: string
  727. format: uri
  728. description: uri of the video channels to subscribe to
  729. required:
  730. - uri
  731. examples:
  732. default:
  733. value:
  734. uri: 008a0e54-375d-49d0-8379-143202e24152@video.lqdn.fr
  735. responses:
  736. '200':
  737. description: successful operation
  738. /users/me/subscriptions/exist:
  739. get:
  740. summary: Get if subscriptions exist for my user
  741. security:
  742. - OAuth2:
  743. - user
  744. tags:
  745. - My Subscriptions
  746. parameters:
  747. - $ref: '#/components/parameters/subscriptionsUris'
  748. responses:
  749. '200':
  750. description: successful operation
  751. content:
  752. application/json:
  753. schema:
  754. type: object
  755. /users/me/subscriptions/videos:
  756. get:
  757. summary: List videos of subscriptions of my user
  758. security:
  759. - OAuth2:
  760. - user
  761. tags:
  762. - My Subscriptions
  763. - Videos
  764. parameters:
  765. - $ref: '#/components/parameters/categoryOneOf'
  766. - $ref: '#/components/parameters/tagsOneOf'
  767. - $ref: '#/components/parameters/tagsAllOf'
  768. - $ref: '#/components/parameters/licenceOneOf'
  769. - $ref: '#/components/parameters/languageOneOf'
  770. - $ref: '#/components/parameters/nsfw'
  771. - $ref: '#/components/parameters/filter'
  772. - $ref: '#/components/parameters/skipCount'
  773. - $ref: '#/components/parameters/start'
  774. - $ref: '#/components/parameters/count'
  775. - $ref: '#/components/parameters/videosSort'
  776. responses:
  777. '200':
  778. description: successful operation
  779. content:
  780. application/json:
  781. schema:
  782. $ref: '#/components/schemas/VideoListResponse'
  783. '/users/me/subscriptions/{subscriptionHandle}':
  784. get:
  785. summary: Get subscription of my user
  786. security:
  787. - OAuth2:
  788. - user
  789. tags:
  790. - My Subscriptions
  791. parameters:
  792. - $ref: '#/components/parameters/subscriptionHandle'
  793. responses:
  794. '200':
  795. description: successful operation
  796. content:
  797. application/json:
  798. schema:
  799. $ref: '#/components/schemas/VideoChannel'
  800. delete:
  801. summary: Delete subscription of my user
  802. security:
  803. - OAuth2:
  804. - user
  805. tags:
  806. - My Subscriptions
  807. parameters:
  808. - $ref: '#/components/parameters/subscriptionHandle'
  809. responses:
  810. '200':
  811. description: successful operation
  812. /users/me/notifications:
  813. get:
  814. summary: List my notifications
  815. security:
  816. - OAuth2: []
  817. tags:
  818. - My Notifications
  819. parameters:
  820. - name: unread
  821. in: query
  822. description: only list unread notifications
  823. schema:
  824. type: boolean
  825. - $ref: '#/components/parameters/start'
  826. - $ref: '#/components/parameters/count'
  827. - $ref: '#/components/parameters/sort'
  828. responses:
  829. '200':
  830. description: successful operation
  831. content:
  832. application/json:
  833. schema:
  834. $ref: '#/components/schemas/NotificationListResponse'
  835. /users/me/notifications/read:
  836. post:
  837. summary: Mark notifications as read by their id
  838. security:
  839. - OAuth2: []
  840. tags:
  841. - My Notifications
  842. requestBody:
  843. content:
  844. application/json:
  845. schema:
  846. type: object
  847. properties:
  848. ids:
  849. type: array
  850. description: ids of the notifications to mark as read
  851. items:
  852. type: integer
  853. required:
  854. - ids
  855. responses:
  856. '204':
  857. description: successful operation
  858. /users/me/notifications/read-all:
  859. post:
  860. summary: Mark all my notification as read
  861. security:
  862. - OAuth2: []
  863. tags:
  864. - My Notifications
  865. responses:
  866. '204':
  867. description: successful operation
  868. /users/me/notification-settings:
  869. put:
  870. summary: Update my notification settings
  871. security:
  872. - OAuth2: []
  873. tags:
  874. - My Notifications
  875. requestBody:
  876. content:
  877. application/json:
  878. schema:
  879. type: object
  880. properties:
  881. newVideoFromSubscription:
  882. $ref: '#/components/schemas/NotificationSettingValue'
  883. newCommentOnMyVideo:
  884. $ref: '#/components/schemas/NotificationSettingValue'
  885. abuseAsModerator:
  886. $ref: '#/components/schemas/NotificationSettingValue'
  887. videoAutoBlacklistAsModerator:
  888. $ref: '#/components/schemas/NotificationSettingValue'
  889. blacklistOnMyVideo:
  890. $ref: '#/components/schemas/NotificationSettingValue'
  891. myVideoPublished:
  892. $ref: '#/components/schemas/NotificationSettingValue'
  893. myVideoImportFinished:
  894. $ref: '#/components/schemas/NotificationSettingValue'
  895. newFollow:
  896. $ref: '#/components/schemas/NotificationSettingValue'
  897. newUserRegistration:
  898. $ref: '#/components/schemas/NotificationSettingValue'
  899. commentMention:
  900. $ref: '#/components/schemas/NotificationSettingValue'
  901. newInstanceFollower:
  902. $ref: '#/components/schemas/NotificationSettingValue'
  903. autoInstanceFollowing:
  904. $ref: '#/components/schemas/NotificationSettingValue'
  905. responses:
  906. '204':
  907. description: successful operation
  908. /users/me/history/videos:
  909. get:
  910. summary: List watched videos history
  911. security:
  912. - OAuth2: []
  913. tags:
  914. - My History
  915. parameters:
  916. - $ref: '#/components/parameters/start'
  917. - $ref: '#/components/parameters/count'
  918. - $ref: '#/components/parameters/search'
  919. responses:
  920. '200':
  921. description: successful operation
  922. content:
  923. application/json:
  924. schema:
  925. $ref: '#/components/schemas/VideoListResponse'
  926. /users/me/history/videos/remove:
  927. post:
  928. summary: Clear video history
  929. security:
  930. - OAuth2: []
  931. tags:
  932. - My History
  933. requestBody:
  934. content:
  935. multipart/form-data:
  936. schema:
  937. type: object
  938. properties:
  939. beforeDate:
  940. description: history before this date will be deleted
  941. type: string
  942. format: date-time
  943. responses:
  944. '204':
  945. description: successful operation
  946. /users/me/avatar/pick:
  947. post:
  948. summary: Update my user avatar
  949. security:
  950. - OAuth2: []
  951. tags:
  952. - My User
  953. responses:
  954. '200':
  955. description: successful operation
  956. content:
  957. application/json:
  958. schema:
  959. $ref: '#/components/schemas/Avatar'
  960. '413':
  961. description: image file too large
  962. headers:
  963. X-File-Maximum-Size:
  964. schema:
  965. type: string
  966. format: Nginx size
  967. description: Maximum file size for the avatar
  968. requestBody:
  969. content:
  970. multipart/form-data:
  971. schema:
  972. type: object
  973. properties:
  974. avatarfile:
  975. description: The file to upload.
  976. type: string
  977. format: binary
  978. encoding:
  979. avatarfile:
  980. contentType: image/png, image/jpeg
  981. /videos/ownership:
  982. get:
  983. summary: List video ownership changes
  984. tags:
  985. - Video Ownership Change
  986. security:
  987. - OAuth2: []
  988. responses:
  989. '200':
  990. description: successful operation
  991. '/videos/ownership/{id}/accept':
  992. post:
  993. summary: Accept ownership change request
  994. tags:
  995. - Video Ownership Change
  996. security:
  997. - OAuth2: []
  998. parameters:
  999. - $ref: '#/components/parameters/idOrUUID'
  1000. responses:
  1001. '204':
  1002. description: successful operation
  1003. '403':
  1004. description: cannot terminate an ownership change of another user
  1005. '404':
  1006. description: video owneship change not found
  1007. '/videos/ownership/{id}/refuse':
  1008. post:
  1009. summary: Refuse ownership change request
  1010. tags:
  1011. - Video Ownership Change
  1012. security:
  1013. - OAuth2: []
  1014. parameters:
  1015. - $ref: '#/components/parameters/idOrUUID'
  1016. responses:
  1017. '204':
  1018. description: successful operation
  1019. '403':
  1020. description: cannot terminate an ownership change of another user
  1021. '404':
  1022. description: video owneship change not found
  1023. '/videos/{id}/give-ownership':
  1024. post:
  1025. summary: Request ownership change
  1026. tags:
  1027. - Video Ownership Change
  1028. security:
  1029. - OAuth2: []
  1030. parameters:
  1031. - $ref: '#/components/parameters/idOrUUID'
  1032. requestBody:
  1033. required: true
  1034. content:
  1035. application/x-www-form-urlencoded:
  1036. schema:
  1037. type: object
  1038. properties:
  1039. username:
  1040. type: string
  1041. required:
  1042. - username
  1043. responses:
  1044. '204':
  1045. description: successful operation
  1046. '400':
  1047. description: changing video ownership to a remote account is not supported yet
  1048. '404':
  1049. description: video not found
  1050. /videos:
  1051. get:
  1052. summary: List videos
  1053. tags:
  1054. - Video
  1055. parameters:
  1056. - $ref: '#/components/parameters/categoryOneOf'
  1057. - $ref: '#/components/parameters/tagsOneOf'
  1058. - $ref: '#/components/parameters/tagsAllOf'
  1059. - $ref: '#/components/parameters/licenceOneOf'
  1060. - $ref: '#/components/parameters/languageOneOf'
  1061. - $ref: '#/components/parameters/nsfw'
  1062. - $ref: '#/components/parameters/filter'
  1063. - $ref: '#/components/parameters/skipCount'
  1064. - $ref: '#/components/parameters/start'
  1065. - $ref: '#/components/parameters/count'
  1066. - $ref: '#/components/parameters/videosSort'
  1067. responses:
  1068. '200':
  1069. description: successful operation
  1070. content:
  1071. application/json:
  1072. schema:
  1073. $ref: '#/components/schemas/VideoListResponse'
  1074. /videos/categories:
  1075. get:
  1076. summary: List available video categories
  1077. tags:
  1078. - Video
  1079. responses:
  1080. '200':
  1081. description: successful operation
  1082. content:
  1083. application/json:
  1084. schema:
  1085. type: array
  1086. items:
  1087. type: string
  1088. examples:
  1089. nightly:
  1090. externalValue: https://peertube2.cpy.re/api/v1/videos/categories
  1091. /videos/licences:
  1092. get:
  1093. summary: List available video licences
  1094. tags:
  1095. - Video
  1096. responses:
  1097. '200':
  1098. description: successful operation
  1099. content:
  1100. application/json:
  1101. schema:
  1102. type: array
  1103. items:
  1104. type: string
  1105. examples:
  1106. nightly:
  1107. externalValue: https://peertube2.cpy.re/api/v1/videos/licences
  1108. /videos/languages:
  1109. get:
  1110. summary: List available video languages
  1111. tags:
  1112. - Video
  1113. responses:
  1114. '200':
  1115. description: successful operation
  1116. content:
  1117. application/json:
  1118. schema:
  1119. type: array
  1120. items:
  1121. type: string
  1122. examples:
  1123. nightly:
  1124. externalValue: https://peertube2.cpy.re/api/v1/videos/languages
  1125. /videos/privacies:
  1126. get:
  1127. summary: List available video privacies
  1128. tags:
  1129. - Video
  1130. responses:
  1131. '200':
  1132. description: successful operation
  1133. content:
  1134. application/json:
  1135. schema:
  1136. type: array
  1137. items:
  1138. type: string
  1139. examples:
  1140. nightly:
  1141. externalValue: https://peertube2.cpy.re/api/v1/videos/privacies
  1142. '/videos/{id}':
  1143. put:
  1144. summary: Update a video
  1145. security:
  1146. - OAuth2: []
  1147. tags:
  1148. - Video
  1149. parameters:
  1150. - $ref: '#/components/parameters/idOrUUID'
  1151. responses:
  1152. '204':
  1153. description: successful operation
  1154. requestBody:
  1155. content:
  1156. multipart/form-data:
  1157. schema:
  1158. type: object
  1159. properties:
  1160. thumbnailfile:
  1161. description: Video thumbnail file
  1162. type: string
  1163. format: binary
  1164. previewfile:
  1165. description: Video preview file
  1166. type: string
  1167. format: binary
  1168. category:
  1169. description: Video category
  1170. type: integer
  1171. example: 4
  1172. licence:
  1173. description: Video licence
  1174. type: integer
  1175. example: 2
  1176. language:
  1177. description: Video language
  1178. type: string
  1179. privacy:
  1180. $ref: '#/components/schemas/VideoPrivacySet'
  1181. description:
  1182. description: Video description
  1183. type: string
  1184. waitTranscoding:
  1185. description: Whether or not we wait transcoding before publish the video
  1186. type: string
  1187. support:
  1188. description: A text tell the audience how to support the video creator
  1189. example: Please support my work on <insert crowdfunding plateform>! <3
  1190. type: string
  1191. nsfw:
  1192. description: Whether or not this video contains sensitive content
  1193. type: boolean
  1194. name:
  1195. description: Video name
  1196. type: string
  1197. tags:
  1198. description: Video tags (maximum 5 tags each between 2 and 30 characters)
  1199. type: array
  1200. minItems: 1
  1201. maxItems: 5
  1202. items:
  1203. type: string
  1204. minLength: 2
  1205. maxLength: 30
  1206. commentsEnabled:
  1207. description: Enable or disable comments for this video
  1208. type: boolean
  1209. originallyPublishedAt:
  1210. description: Date when the content was originally published
  1211. type: string
  1212. format: date-time
  1213. scheduleUpdate:
  1214. $ref: '#/components/schemas/VideoScheduledUpdate'
  1215. encoding:
  1216. thumbnailfile:
  1217. contentType: image/jpeg
  1218. previewfile:
  1219. contentType: image/jpeg
  1220. get:
  1221. summary: Get a video
  1222. tags:
  1223. - Video
  1224. parameters:
  1225. - $ref: '#/components/parameters/idOrUUID'
  1226. responses:
  1227. '200':
  1228. description: successful operation
  1229. content:
  1230. application/json:
  1231. schema:
  1232. $ref: '#/components/schemas/VideoDetails'
  1233. delete:
  1234. summary: Delete a video
  1235. security:
  1236. - OAuth2: []
  1237. tags:
  1238. - Video
  1239. parameters:
  1240. - $ref: '#/components/parameters/idOrUUID'
  1241. responses:
  1242. '204':
  1243. description: successful operation
  1244. '/videos/{id}/description':
  1245. get:
  1246. summary: Get complete video description
  1247. tags:
  1248. - Video
  1249. parameters:
  1250. - $ref: '#/components/parameters/idOrUUID'
  1251. responses:
  1252. '200':
  1253. description: successful operation
  1254. content:
  1255. application/json:
  1256. schema:
  1257. type: string
  1258. '/videos/{id}/views':
  1259. post:
  1260. summary: Add a view to a video
  1261. tags:
  1262. - Video
  1263. parameters:
  1264. - $ref: '#/components/parameters/idOrUUID'
  1265. responses:
  1266. '204':
  1267. description: successful operation
  1268. '/videos/{id}/watching':
  1269. put:
  1270. summary: Set watching progress of a video
  1271. tags:
  1272. - Video
  1273. security:
  1274. - OAuth2: []
  1275. parameters:
  1276. - $ref: '#/components/parameters/idOrUUID'
  1277. requestBody:
  1278. content:
  1279. application/json:
  1280. schema:
  1281. $ref: '#/components/schemas/UserWatchingVideo'
  1282. required: true
  1283. responses:
  1284. '204':
  1285. description: successful operation
  1286. /videos/upload:
  1287. post:
  1288. summary: Upload a video
  1289. security:
  1290. - OAuth2: []
  1291. tags:
  1292. - Video
  1293. responses:
  1294. '200':
  1295. description: successful operation
  1296. content:
  1297. application/json:
  1298. schema:
  1299. $ref: '#/components/schemas/VideoUploadResponse'
  1300. '400':
  1301. description: invalid file field, schedule date or parameter
  1302. '403':
  1303. description: video didn't pass upload filter
  1304. '408':
  1305. description: upload has timed out
  1306. '413':
  1307. description: video file too large, due to quota or max body size limit set by the reverse-proxy
  1308. headers:
  1309. X-File-Maximum-Size:
  1310. schema:
  1311. type: string
  1312. format: Nginx size
  1313. description: Maximum file size for the video
  1314. '415':
  1315. description: video type unsupported
  1316. '422':
  1317. description: video unreadable
  1318. requestBody:
  1319. content:
  1320. multipart/form-data:
  1321. schema:
  1322. type: object
  1323. properties:
  1324. videofile:
  1325. description: Video file
  1326. type: string
  1327. format: binary
  1328. channelId:
  1329. description: Channel id that will contain this video
  1330. type: integer
  1331. thumbnailfile:
  1332. description: Video thumbnail file
  1333. type: string
  1334. format: binary
  1335. previewfile:
  1336. description: Video preview file
  1337. type: string
  1338. format: binary
  1339. privacy:
  1340. $ref: '#/components/schemas/VideoPrivacySet'
  1341. category:
  1342. description: Video category
  1343. type: integer
  1344. example: 4
  1345. licence:
  1346. description: Video licence
  1347. type: string
  1348. language:
  1349. description: Video language
  1350. type: integer
  1351. example: 2
  1352. description:
  1353. description: Video description
  1354. type: string
  1355. waitTranscoding:
  1356. description: Whether or not we wait transcoding before publish the video
  1357. type: boolean
  1358. support:
  1359. description: A text tell the audience how to support the video creator
  1360. example: Please support my work on <insert crowdfunding plateform>! <3
  1361. type: string
  1362. nsfw:
  1363. description: Whether or not this video contains sensitive content
  1364. type: boolean
  1365. name:
  1366. description: Video name
  1367. type: string
  1368. tags:
  1369. description: Video tags (maximum 5 tags each between 2 and 30 characters)
  1370. type: array
  1371. minItems: 1
  1372. maxItems: 5
  1373. uniqueItems: true
  1374. items:
  1375. type: string
  1376. minLength: 2
  1377. maxLength: 30
  1378. commentsEnabled:
  1379. description: Enable or disable comments for this video
  1380. type: boolean
  1381. downloadEnabled:
  1382. description: Enable or disable downloading for this video
  1383. type: boolean
  1384. originallyPublishedAt:
  1385. description: Date when the content was originally published
  1386. type: string
  1387. format: date-time
  1388. scheduleUpdate:
  1389. $ref: '#/components/schemas/VideoScheduledUpdate'
  1390. required:
  1391. - videofile
  1392. - channelId
  1393. - name
  1394. encoding:
  1395. videofile:
  1396. contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
  1397. thumbnailfile:
  1398. contentType: image/jpeg
  1399. previewfile:
  1400. contentType: image/jpeg
  1401. x-code-samples:
  1402. - lang: Shell
  1403. source: |
  1404. ## DEPENDENCIES: jq
  1405. USERNAME="<your_username>"
  1406. PASSWORD="<your_password>"
  1407. FILE_PATH="<your_file_path>"
  1408. CHANNEL_ID="<your_channel_id>"
  1409. NAME="<video_name>"
  1410. API_PATH="https://peertube2.cpy.re/api/v1"
  1411. ## AUTH
  1412. client_id=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_id")
  1413. client_secret=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
  1414. token=$(curl -s "$API_PATH/users/token" \
  1415. --data client_id="$client_id" \
  1416. --data client_secret="$client_secret" \
  1417. --data grant_type=password \
  1418. --data response_type=code \
  1419. --data username="$USERNAME" \
  1420. --data password="$PASSWORD" \
  1421. | jq -r ".access_token")
  1422. ## VIDEO UPLOAD
  1423. curl -s "$API_PATH/videos/upload" \
  1424. -H "Authorization: Bearer $token" \
  1425. --max-time 600 \
  1426. --form videofile=@"$FILE_PATH" \
  1427. --form channelId=$CHANNEL_ID \
  1428. --form name="$NAME"
  1429. /videos/imports:
  1430. post:
  1431. summary: Import a video
  1432. description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
  1433. security:
  1434. - OAuth2: []
  1435. tags:
  1436. - Video
  1437. requestBody:
  1438. content:
  1439. multipart/form-data:
  1440. schema:
  1441. type: object
  1442. properties:
  1443. torrentfile:
  1444. description: Torrent File
  1445. type: string
  1446. format: binary
  1447. targetUrl:
  1448. description: HTTP target URL
  1449. type: string
  1450. magnetUri:
  1451. description: Magnet URI
  1452. type: string
  1453. channelId:
  1454. description: Channel id that will contain this video
  1455. type: integer
  1456. thumbnailfile:
  1457. description: Video thumbnail file
  1458. type: string
  1459. format: binary
  1460. previewfile:
  1461. description: Video preview file
  1462. type: string
  1463. format: binary
  1464. privacy:
  1465. $ref: '#/components/schemas/VideoPrivacySet'
  1466. category:
  1467. description: Video category
  1468. type: string
  1469. licence:
  1470. description: Video licence
  1471. type: string
  1472. language:
  1473. description: Video language
  1474. type: string
  1475. description:
  1476. description: Video description
  1477. type: string
  1478. waitTranscoding:
  1479. description: Whether or not we wait transcoding before publish the video
  1480. type: boolean
  1481. support:
  1482. description: A text tell the audience how to support the video creator
  1483. example: Please support my work on <insert crowdfunding plateform>! <3
  1484. type: string
  1485. nsfw:
  1486. description: Whether or not this video contains sensitive content
  1487. type: boolean
  1488. name:
  1489. description: Video name
  1490. type: string
  1491. tags:
  1492. description: Video tags (maximum 5 tags each between 2 and 30 characters)
  1493. type: array
  1494. minItems: 1
  1495. maxItems: 5
  1496. items:
  1497. type: string
  1498. minLength: 2
  1499. maxLength: 30
  1500. commentsEnabled:
  1501. description: Enable or disable comments for this video
  1502. type: boolean
  1503. downloadEnabled:
  1504. description: Enable or disable downloading for this video
  1505. type: boolean
  1506. scheduleUpdate:
  1507. $ref: '#/components/schemas/VideoScheduledUpdate'
  1508. required:
  1509. - channelId
  1510. - name
  1511. encoding:
  1512. torrentfile:
  1513. contentType: application/x-bittorrent
  1514. thumbnailfile:
  1515. contentType: image/jpeg
  1516. previewfile:
  1517. contentType: image/jpeg
  1518. responses:
  1519. '200':
  1520. description: successful operation
  1521. content:
  1522. application/json:
  1523. schema:
  1524. $ref: '#/components/schemas/VideoUploadResponse'
  1525. '400':
  1526. description: '`magnetUri` or `targetUrl` or a torrent file missing'
  1527. '403':
  1528. description: video didn't pass pre-import filter
  1529. '409':
  1530. description: HTTP or Torrent/magnetURI import not enabled
  1531. /videos/live:
  1532. post:
  1533. summary: Create a live
  1534. security:
  1535. - OAuth2: []
  1536. tags:
  1537. - Live Videos
  1538. - Video
  1539. responses:
  1540. '200':
  1541. description: successful operation
  1542. content:
  1543. application/json:
  1544. schema:
  1545. $ref: '#/components/schemas/VideoUploadResponse'
  1546. '403':
  1547. description: Live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded
  1548. requestBody:
  1549. content:
  1550. multipart/form-data:
  1551. schema:
  1552. type: object
  1553. properties:
  1554. channelId:
  1555. description: Channel id that will contain this live video
  1556. type: integer
  1557. saveReplay:
  1558. type: boolean
  1559. permanentLive:
  1560. description: User can stream multiple times in a permanent live
  1561. type: boolean
  1562. thumbnailfile:
  1563. description: Live video/replay thumbnail file
  1564. type: string
  1565. format: binary
  1566. previewfile:
  1567. description: Live video/replay preview file
  1568. type: string
  1569. format: binary
  1570. privacy:
  1571. $ref: '#/components/schemas/VideoPrivacySet'
  1572. category:
  1573. description: Live video/replay category
  1574. type: string
  1575. licence:
  1576. description: Live video/replay licence
  1577. type: string
  1578. language:
  1579. description: Live video/replay language
  1580. type: string
  1581. description:
  1582. description: Live video/replay description
  1583. type: string
  1584. support:
  1585. description: A text tell the audience how to support the creator
  1586. example: Please support my work on <insert crowdfunding plateform>! <3
  1587. type: string
  1588. nsfw:
  1589. description: Whether or not this live video/replay contains sensitive content
  1590. type: boolean
  1591. name:
  1592. description: Live video/replay name
  1593. type: string
  1594. tags:
  1595. description: Live video/replay tags (maximum 5 tags each between 2 and 30 characters)
  1596. type: array
  1597. minItems: 1
  1598. maxItems: 5
  1599. items:
  1600. type: string
  1601. minLength: 2
  1602. maxLength: 30
  1603. commentsEnabled:
  1604. description: Enable or disable comments for this live video/replay
  1605. type: boolean
  1606. downloadEnabled:
  1607. description: Enable or disable downloading for the replay of this live
  1608. type: boolean
  1609. required:
  1610. - channelId
  1611. - name
  1612. encoding:
  1613. thumbnailfile:
  1614. contentType: image/jpeg
  1615. previewfile:
  1616. contentType: image/jpeg
  1617. /videos/live/{id}:
  1618. get:
  1619. summary: Get a live information
  1620. security:
  1621. - OAuth2: []
  1622. tags:
  1623. - Live Videos
  1624. - Video
  1625. parameters:
  1626. - $ref: '#/components/parameters/idOrUUID'
  1627. responses:
  1628. '200':
  1629. description: successful operation
  1630. content:
  1631. application/json:
  1632. schema:
  1633. $ref: '#/components/schemas/LiveVideoResponse'
  1634. put:
  1635. summary: Update a live information
  1636. security:
  1637. - OAuth2: []
  1638. tags:
  1639. - Live Videos
  1640. - Video
  1641. parameters:
  1642. - $ref: '#/components/parameters/idOrUUID'
  1643. requestBody:
  1644. content:
  1645. application/json:
  1646. schema:
  1647. $ref: '#/components/schemas/LiveVideoUpdate'
  1648. responses:
  1649. '204':
  1650. description: Successful operation
  1651. '400':
  1652. description: Bad parameters or trying to update a live that has already started
  1653. '403':
  1654. description: Trying to save replay of the live but saving replay is not enabled on the instance
  1655. /users/me/abuses:
  1656. get:
  1657. summary: List my abuses
  1658. security:
  1659. - OAuth2: []
  1660. tags:
  1661. - Abuses
  1662. - My User
  1663. parameters:
  1664. - name: id
  1665. in: query
  1666. description: only list the report with this id
  1667. schema:
  1668. type: integer
  1669. - name: state
  1670. in: query
  1671. schema:
  1672. $ref: '#/components/schemas/AbuseStateSet'
  1673. - $ref: '#/components/parameters/start'
  1674. - $ref: '#/components/parameters/count'
  1675. - $ref: '#/components/parameters/abusesSort'
  1676. responses:
  1677. '200':
  1678. description: successful operation
  1679. content:
  1680. application/json:
  1681. schema:
  1682. type: array
  1683. items:
  1684. $ref: '#/components/schemas/Abuse'
  1685. /abuses:
  1686. get:
  1687. summary: List abuses
  1688. security:
  1689. - OAuth2:
  1690. - admin
  1691. - moderator
  1692. tags:
  1693. - Abuses
  1694. parameters:
  1695. - name: id
  1696. in: query
  1697. description: only list the report with this id
  1698. schema:
  1699. type: integer
  1700. - name: predefinedReason
  1701. in: query
  1702. description: predefined reason the listed reports should contain
  1703. schema:
  1704. $ref: '#/components/schemas/PredefinedAbuseReasons'
  1705. - name: search
  1706. in: query
  1707. description: plain search that will match with video titles, reporter names and more
  1708. schema:
  1709. type: string
  1710. - name: state
  1711. in: query
  1712. schema:
  1713. $ref: '#/components/schemas/AbuseStateSet'
  1714. - name: searchReporter
  1715. in: query
  1716. description: only list reports of a specific reporter
  1717. schema:
  1718. type: string
  1719. - name: searchReportee
  1720. description: only list reports of a specific reportee
  1721. in: query
  1722. schema:
  1723. type: string
  1724. - name: searchVideo
  1725. in: query
  1726. description: only list reports of a specific video
  1727. schema:
  1728. type: string
  1729. - name: searchVideoChannel
  1730. in: query
  1731. description: only list reports of a specific video channel
  1732. schema:
  1733. type: string
  1734. - name: videoIs
  1735. in: query
  1736. description: only list blacklisted or deleted videos
  1737. schema:
  1738. type: string
  1739. enum:
  1740. - 'deleted'
  1741. - 'blacklisted'
  1742. - name: filter
  1743. in: query
  1744. description: only list account, comment or video reports
  1745. schema:
  1746. type: string
  1747. enum:
  1748. - 'video'
  1749. - 'comment'
  1750. - 'account'
  1751. - $ref: '#/components/parameters/start'
  1752. - $ref: '#/components/parameters/count'
  1753. - $ref: '#/components/parameters/abusesSort'
  1754. responses:
  1755. '200':
  1756. description: successful operation
  1757. content:
  1758. application/json:
  1759. schema:
  1760. type: array
  1761. items:
  1762. $ref: '#/components/schemas/Abuse'
  1763. post:
  1764. summary: Report an abuse
  1765. security:
  1766. - OAuth2: []
  1767. tags:
  1768. - Abuses
  1769. requestBody:
  1770. required: true
  1771. content:
  1772. application/json:
  1773. schema:
  1774. type: object
  1775. properties:
  1776. reason:
  1777. description: Reason why the user reports this video
  1778. type: string
  1779. minLength: 4
  1780. predefinedReasons:
  1781. $ref: '#/components/schemas/PredefinedAbuseReasons'
  1782. video:
  1783. type: object
  1784. properties:
  1785. id:
  1786. description: Video id to report
  1787. type: number
  1788. startAt:
  1789. type: integer
  1790. description: Timestamp in the video that marks the beginning of the report
  1791. minimum: 0
  1792. endAt:
  1793. type: integer
  1794. description: Timestamp in the video that marks the ending of the report
  1795. minimum: 0
  1796. comment:
  1797. type: object
  1798. properties:
  1799. id:
  1800. description: Comment id to report
  1801. type: number
  1802. account:
  1803. type: object
  1804. properties:
  1805. id:
  1806. description: Account id to report
  1807. type: number
  1808. required:
  1809. - reason
  1810. responses:
  1811. '204':
  1812. description: successful operation
  1813. '400':
  1814. description: incorrect request parameters
  1815. '/abuses/{abuseId}':
  1816. put:
  1817. summary: Update an abuse
  1818. security:
  1819. - OAuth2:
  1820. - admin
  1821. - moderator
  1822. tags:
  1823. - Abuses
  1824. parameters:
  1825. - $ref: '#/components/parameters/abuseId'
  1826. requestBody:
  1827. content:
  1828. application/json:
  1829. schema:
  1830. type: object
  1831. properties:
  1832. state:
  1833. $ref: '#/components/schemas/AbuseStateSet'
  1834. moderationComment:
  1835. type: string
  1836. description: Update the report comment visible only to the moderation team
  1837. responses:
  1838. '204':
  1839. description: successful operation
  1840. '404':
  1841. description: abuse not found
  1842. delete:
  1843. tags:
  1844. - Abuses
  1845. summary: Delete an abuse
  1846. security:
  1847. - OAuth2:
  1848. - admin
  1849. - moderator
  1850. parameters:
  1851. - $ref: '#/components/parameters/abuseId'
  1852. responses:
  1853. '204':
  1854. description: successful operation
  1855. '404':
  1856. description: block not found
  1857. '/abuses/{abuseId}/messages':
  1858. get:
  1859. summary: List messages of an abuse
  1860. security:
  1861. - OAuth2: []
  1862. tags:
  1863. - Abuses
  1864. parameters:
  1865. - $ref: '#/components/parameters/abuseId'
  1866. responses:
  1867. '200':
  1868. description: successful operation
  1869. content:
  1870. application/json:
  1871. schema:
  1872. type: array
  1873. items:
  1874. $ref: '#/components/schemas/AbuseMessage'
  1875. post:
  1876. summary: Add message to an abuse
  1877. security:
  1878. - OAuth2: []
  1879. tags:
  1880. - Abuses
  1881. parameters:
  1882. - $ref: '#/components/parameters/abuseId'
  1883. requestBody:
  1884. required: true
  1885. content:
  1886. application/json:
  1887. schema:
  1888. type: object
  1889. properties:
  1890. message:
  1891. description: Message to send
  1892. type: string
  1893. required:
  1894. - message
  1895. responses:
  1896. '200':
  1897. description: successful operation
  1898. '400':
  1899. description: incorrect request parameters
  1900. '/abuses/{abuseId}/messages/{abuseMessageId}':
  1901. delete:
  1902. summary: Delete an abuse message
  1903. security:
  1904. - OAuth2: []
  1905. tags:
  1906. - Abuses
  1907. parameters:
  1908. - $ref: '#/components/parameters/abuseId'
  1909. - $ref: '#/components/parameters/abuseMessageId'
  1910. responses:
  1911. '204':
  1912. description: successful operation
  1913. '/videos/{id}/blacklist':
  1914. post:
  1915. summary: Block a video
  1916. security:
  1917. - OAuth2:
  1918. - admin
  1919. - moderator
  1920. tags:
  1921. - Video Blocks
  1922. parameters:
  1923. - $ref: '#/components/parameters/idOrUUID'
  1924. responses:
  1925. '204':
  1926. description: successful operation
  1927. delete:
  1928. summary: Unblock a video by its id
  1929. security:
  1930. - OAuth2:
  1931. - admin
  1932. - moderator
  1933. tags:
  1934. - Video Blocks
  1935. parameters:
  1936. - $ref: '#/components/parameters/idOrUUID'
  1937. responses:
  1938. '204':
  1939. description: successful operation
  1940. '404':
  1941. description: block not found
  1942. /videos/blacklist:
  1943. get:
  1944. tags:
  1945. - Video Blocks
  1946. summary: List video blocks
  1947. security:
  1948. - OAuth2:
  1949. - admin
  1950. - moderator
  1951. parameters:
  1952. - name: type
  1953. in: query
  1954. description: >
  1955. list only blocks that match this type:
  1956. - `1`: manual block
  1957. - `2`: automatic block that needs review
  1958. schema:
  1959. type: integer
  1960. enum:
  1961. - 1
  1962. - 2
  1963. - name: search
  1964. in: query
  1965. description: plain search that will match with video titles, and more
  1966. schema:
  1967. type: string
  1968. - $ref: '#/components/parameters/start'
  1969. - $ref: '#/components/parameters/count'
  1970. - $ref: '#/components/parameters/blacklistsSort'
  1971. responses:
  1972. '200':
  1973. description: successful operation
  1974. content:
  1975. application/json:
  1976. schema:
  1977. type: object
  1978. properties:
  1979. total:
  1980. type: integer
  1981. example: 1
  1982. data:
  1983. type: array
  1984. items:
  1985. $ref: '#/components/schemas/VideoBlacklist'
  1986. /videos/{id}/captions:
  1987. get:
  1988. summary: List captions of a video
  1989. tags:
  1990. - Video Captions
  1991. parameters:
  1992. - $ref: '#/components/parameters/idOrUUID'
  1993. responses:
  1994. '200':
  1995. description: successful operation
  1996. content:
  1997. application/json:
  1998. schema:
  1999. type: object
  2000. properties:
  2001. total:
  2002. type: integer
  2003. example: 1
  2004. data:
  2005. type: array
  2006. items:
  2007. $ref: '#/components/schemas/VideoCaption'
  2008. /videos/{id}/captions/{captionLanguage}:
  2009. put:
  2010. summary: Add or replace a video caption
  2011. security:
  2012. - OAuth2:
  2013. - user
  2014. tags:
  2015. - Video Captions
  2016. parameters:
  2017. - $ref: '#/components/parameters/idOrUUID'
  2018. - $ref: '#/components/parameters/captionLanguage'
  2019. requestBody:
  2020. content:
  2021. multipart/form-data:
  2022. schema:
  2023. type: object
  2024. properties:
  2025. captionfile:
  2026. description: The file to upload.
  2027. type: string
  2028. format: binary
  2029. encoding:
  2030. captionfile:
  2031. contentType: text/vtt, application/x-subrip, text/plain
  2032. responses:
  2033. '204':
  2034. description: successful operation
  2035. '404':
  2036. description: video or language not found
  2037. delete:
  2038. summary: Delete a video caption
  2039. security:
  2040. - OAuth2:
  2041. - user
  2042. tags:
  2043. - Video Captions
  2044. parameters:
  2045. - $ref: '#/components/parameters/idOrUUID'
  2046. - $ref: '#/components/parameters/captionLanguage'
  2047. responses:
  2048. '204':
  2049. description: successful operation
  2050. '404':
  2051. description: video or language or caption for that language not found
  2052. /video-channels:
  2053. get:
  2054. summary: List video channels
  2055. tags:
  2056. - Video Channels
  2057. parameters:
  2058. - $ref: '#/components/parameters/start'
  2059. - $ref: '#/components/parameters/count'
  2060. - $ref: '#/components/parameters/sort'
  2061. responses:
  2062. '200':
  2063. description: successful operation
  2064. content:
  2065. application/json:
  2066. schema:
  2067. type: object
  2068. properties:
  2069. total:
  2070. type: integer
  2071. example: 1
  2072. data:
  2073. type: array
  2074. items:
  2075. $ref: '#/components/schemas/VideoChannel'
  2076. post:
  2077. summary: Create a video channel
  2078. security:
  2079. - OAuth2: []
  2080. tags:
  2081. - Video Channels
  2082. responses:
  2083. '204':
  2084. description: successful operation
  2085. requestBody:
  2086. content:
  2087. application/json:
  2088. schema:
  2089. $ref: '#/components/schemas/VideoChannelCreate'
  2090. '/video-channels/{channelHandle}':
  2091. get:
  2092. summary: Get a video channel
  2093. tags:
  2094. - Video Channels
  2095. parameters:
  2096. - $ref: '#/components/parameters/channelHandle'
  2097. responses:
  2098. '200':
  2099. description: successful operation
  2100. content:
  2101. application/json:
  2102. schema:
  2103. $ref: '#/components/schemas/VideoChannel'
  2104. put:
  2105. summary: Update a video channel
  2106. security:
  2107. - OAuth2: []
  2108. tags:
  2109. - Video Channels
  2110. parameters:
  2111. - $ref: '#/components/parameters/channelHandle'
  2112. responses:
  2113. '204':
  2114. description: successful operation
  2115. requestBody:
  2116. content:
  2117. application/json:
  2118. schema:
  2119. $ref: '#/components/schemas/VideoChannelUpdate'
  2120. delete:
  2121. summary: Delete a video channel
  2122. security:
  2123. - OAuth2: []
  2124. tags:
  2125. - Video Channels
  2126. parameters:
  2127. - $ref: '#/components/parameters/channelHandle'
  2128. responses:
  2129. '204':
  2130. description: successful operation
  2131. '/video-channels/{channelHandle}/videos':
  2132. get:
  2133. summary: List videos of a video channel
  2134. tags:
  2135. - Video
  2136. - Video Channels
  2137. parameters:
  2138. - $ref: '#/components/parameters/channelHandle'
  2139. - $ref: '#/components/parameters/categoryOneOf'
  2140. - $ref: '#/components/parameters/tagsOneOf'
  2141. - $ref: '#/components/parameters/tagsAllOf'
  2142. - $ref: '#/components/parameters/licenceOneOf'
  2143. - $ref: '#/components/parameters/languageOneOf'
  2144. - $ref: '#/components/parameters/nsfw'
  2145. - $ref: '#/components/parameters/filter'
  2146. - $ref: '#/components/parameters/skipCount'
  2147. - $ref: '#/components/parameters/start'
  2148. - $ref: '#/components/parameters/count'
  2149. - $ref: '#/components/parameters/videosSort'
  2150. responses:
  2151. '200':
  2152. description: successful operation
  2153. content:
  2154. application/json:
  2155. schema:
  2156. $ref: '#/components/schemas/VideoListResponse'
  2157. /video-playlists/privacies:
  2158. get:
  2159. summary: List available playlist privacies
  2160. tags:
  2161. - Video Playlists
  2162. responses:
  2163. '200':
  2164. description: successful operation
  2165. content:
  2166. application/json:
  2167. schema:
  2168. type: array
  2169. items:
  2170. type: string
  2171. examples:
  2172. nightly:
  2173. externalValue: https://peertube2.cpy.re/api/v1/video-playlists/privacies
  2174. /video-playlists:
  2175. get:
  2176. summary: List video playlists
  2177. tags:
  2178. - Video Playlists
  2179. parameters:
  2180. - $ref: '#/components/parameters/start'
  2181. - $ref: '#/components/parameters/count'
  2182. - $ref: '#/components/parameters/sort'
  2183. responses:
  2184. '200':
  2185. description: successful operation
  2186. content:
  2187. application/json:
  2188. schema:
  2189. type: object
  2190. properties:
  2191. total:
  2192. type: integer
  2193. example: 1
  2194. data:
  2195. type: array
  2196. items:
  2197. $ref: '#/components/schemas/VideoPlaylist'
  2198. post:
  2199. summary: Create a video playlist
  2200. description: 'If the video playlist is set as public, the videoChannelId is mandatory.'
  2201. security:
  2202. - OAuth2: []
  2203. tags:
  2204. - Video Playlists
  2205. responses:
  2206. '200':
  2207. description: successful operation
  2208. content:
  2209. application/json:
  2210. schema:
  2211. type: object
  2212. properties:
  2213. videoPlaylist:
  2214. type: object
  2215. properties:
  2216. id:
  2217. type: integer
  2218. uuid:
  2219. type: string
  2220. requestBody:
  2221. content:
  2222. multipart/form-data:
  2223. schema:
  2224. type: object
  2225. properties:
  2226. displayName:
  2227. description: Video playlist display name
  2228. type: string
  2229. thumbnailfile:
  2230. description: Video playlist thumbnail file
  2231. type: string
  2232. format: binary
  2233. privacy:
  2234. $ref: '#/components/schemas/VideoPlaylistPrivacySet'
  2235. description:
  2236. description: Video playlist description
  2237. type: string
  2238. videoChannelId:
  2239. description: Video channel in which the playlist will be published
  2240. type: integer
  2241. required:
  2242. - displayName
  2243. encoding:
  2244. thumbnailfile:
  2245. contentType: image/jpeg
  2246. /video-playlists/{id}:
  2247. get:
  2248. summary: Get a video playlist
  2249. tags:
  2250. - Video Playlists
  2251. parameters:
  2252. - $ref: '#/components/parameters/idOrUUID'
  2253. responses:
  2254. '200':
  2255. description: successful operation
  2256. content:
  2257. application/json:
  2258. schema:
  2259. $ref: '#/components/schemas/VideoPlaylist'
  2260. put:
  2261. summary: Update a video playlist
  2262. description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
  2263. security:
  2264. - OAuth2: []
  2265. tags:
  2266. - Video Playlists
  2267. responses:
  2268. '204':
  2269. description: successful operation
  2270. parameters:
  2271. - $ref: '#/components/parameters/idOrUUID'
  2272. requestBody:
  2273. content:
  2274. multipart/form-data:
  2275. schema:
  2276. type: object
  2277. properties:
  2278. displayName:
  2279. description: Video playlist display name
  2280. type: string
  2281. thumbnailfile:
  2282. description: Video playlist thumbnail file
  2283. type: string
  2284. format: binary
  2285. privacy:
  2286. $ref: '#/components/schemas/VideoPlaylistPrivacySet'
  2287. description:
  2288. description: Video playlist description
  2289. type: string
  2290. videoChannelId:
  2291. description: Video channel in which the playlist will be published
  2292. type: integer
  2293. encoding:
  2294. thumbnailfile:
  2295. contentType: image/jpeg
  2296. delete:
  2297. summary: Delete a video playlist
  2298. security:
  2299. - OAuth2: []
  2300. tags:
  2301. - Video Playlists
  2302. parameters:
  2303. - $ref: '#/components/parameters/idOrUUID'
  2304. responses:
  2305. '204':
  2306. description: successful operation
  2307. /video-playlists/{id}/videos:
  2308. get:
  2309. summary: 'List videos of a playlist'
  2310. tags:
  2311. - Videos
  2312. - Video Playlists
  2313. parameters:
  2314. - $ref: '#/components/parameters/idOrUUID'
  2315. responses:
  2316. '200':
  2317. description: successful operation
  2318. content:
  2319. application/json:
  2320. schema:
  2321. $ref: '#/components/schemas/VideoListResponse'
  2322. post:
  2323. summary: 'Add a video in a playlist'
  2324. security:
  2325. - OAuth2: []
  2326. tags:
  2327. - Videos
  2328. - Video Playlists
  2329. parameters:
  2330. - $ref: '#/components/parameters/idOrUUID'
  2331. responses:
  2332. '200':
  2333. description: successful operation
  2334. content:
  2335. application/json:
  2336. schema:
  2337. type: object
  2338. properties:
  2339. videoPlaylistElement:
  2340. type: object
  2341. properties:
  2342. id:
  2343. type: integer
  2344. requestBody:
  2345. content:
  2346. application/json:
  2347. schema:
  2348. type: object
  2349. properties:
  2350. videoId:
  2351. type: integer
  2352. description: 'Video to add in the playlist'
  2353. startTimestamp:
  2354. type: integer
  2355. description: 'Start the video at this specific timestamp (in seconds)'
  2356. stopTimestamp:
  2357. type: integer
  2358. description: 'Stop the video at this specific timestamp (in seconds)'
  2359. required:
  2360. - videoId
  2361. /video-playlists/{id}/videos/reorder:
  2362. post:
  2363. summary: 'Reorder a playlist'
  2364. security:
  2365. - OAuth2: []
  2366. tags:
  2367. - Video Playlists
  2368. parameters:
  2369. - $ref: '#/components/parameters/idOrUUID'
  2370. responses:
  2371. '204':
  2372. description: successful operation
  2373. requestBody:
  2374. content:
  2375. application/json:
  2376. schema:
  2377. type: object
  2378. properties:
  2379. startPosition:
  2380. type: integer
  2381. description: 'Start position of the element to reorder'
  2382. minimum: 1
  2383. insertAfterPosition:
  2384. type: integer
  2385. description: 'New position for the block to reorder, to add the block before the first element'
  2386. minimum: 0
  2387. reorderLength:
  2388. type: integer
  2389. description: 'How many element from `startPosition` to reorder'
  2390. minimum: 1
  2391. required:
  2392. - startPosition
  2393. - insertAfterPosition
  2394. /video-playlists/{id}/videos/{playlistElementId}:
  2395. put:
  2396. summary: 'Update a playlist element'
  2397. security:
  2398. - OAuth2: []
  2399. tags:
  2400. - Video Playlists
  2401. parameters:
  2402. - $ref: '#/components/parameters/idOrUUID'
  2403. - $ref: '#/components/parameters/playlistElementId'
  2404. responses:
  2405. '204':
  2406. description: successful operation
  2407. requestBody:
  2408. content:
  2409. application/json:
  2410. schema:
  2411. type: object
  2412. properties:
  2413. startTimestamp:
  2414. type: integer
  2415. description: 'Start the video at this specific timestamp (in seconds)'
  2416. stopTimestamp:
  2417. type: integer
  2418. description: 'Stop the video at this specific timestamp (in seconds)'
  2419. delete:
  2420. summary: 'Delete an element from a playlist'
  2421. security:
  2422. - OAuth2: []
  2423. tags:
  2424. - Video Playlists
  2425. parameters:
  2426. - $ref: '#/components/parameters/idOrUUID'
  2427. - $ref: '#/components/parameters/playlistElementId'
  2428. responses:
  2429. '204':
  2430. description: successful operation
  2431. '/users/me/video-playlists/videos-exist':
  2432. get:
  2433. summary: 'Check video exists in my playlists'
  2434. security:
  2435. - OAuth2: []
  2436. tags:
  2437. - Video Playlists
  2438. parameters:
  2439. - name: videoIds
  2440. in: query
  2441. required: true
  2442. description: The video ids to check
  2443. schema:
  2444. type: array
  2445. items:
  2446. type: integer
  2447. responses:
  2448. '200':
  2449. description: successful operation
  2450. content:
  2451. application/json:
  2452. schema:
  2453. type: object
  2454. properties:
  2455. videoId:
  2456. type: array
  2457. items:
  2458. type: object
  2459. properties:
  2460. playlistElementId:
  2461. type: integer
  2462. playlistId:
  2463. type: integer
  2464. startTimestamp:
  2465. type: integer
  2466. stopTimestamp:
  2467. type: integer
  2468. '/accounts/{name}/video-channels':
  2469. get:
  2470. summary: List video channels of an account
  2471. tags:
  2472. - Video Channels
  2473. - Accounts
  2474. parameters:
  2475. - $ref: '#/components/parameters/name'
  2476. - name: withStats
  2477. in: query
  2478. description: include view statistics for the last 30 days (only if authentified as the account user)
  2479. schema:
  2480. type: boolean
  2481. - $ref: '#/components/parameters/start'
  2482. - $ref: '#/components/parameters/count'
  2483. - $ref: '#/components/parameters/sort'
  2484. responses:
  2485. '200':
  2486. description: successful operation
  2487. content:
  2488. application/json:
  2489. schema:
  2490. type: array
  2491. items:
  2492. $ref: '#/components/schemas/VideoChannel'
  2493. '/accounts/{name}/ratings':
  2494. get:
  2495. summary: List ratings of an account
  2496. security:
  2497. - OAuth2: []
  2498. tags:
  2499. - Accounts
  2500. parameters:
  2501. - $ref: '#/components/parameters/name'
  2502. - $ref: '#/components/parameters/start'
  2503. - $ref: '#/components/parameters/count'
  2504. - $ref: '#/components/parameters/sort'
  2505. - name: rating
  2506. in: query
  2507. required: false
  2508. description: Optionally filter which ratings to retrieve
  2509. schema:
  2510. type: string
  2511. enum:
  2512. - like
  2513. - dislike
  2514. responses:
  2515. '200':
  2516. description: successful operation
  2517. content:
  2518. application/json:
  2519. schema:
  2520. type: array
  2521. items:
  2522. $ref: '#/components/schemas/VideoRating'
  2523. '/videos/{id}/comment-threads':
  2524. get:
  2525. summary: List threads of a video
  2526. tags:
  2527. - Video Comments
  2528. parameters:
  2529. - $ref: '#/components/parameters/idOrUUID'
  2530. - $ref: '#/components/parameters/start'
  2531. - $ref: '#/components/parameters/count'
  2532. - $ref: '#/components/parameters/commentsSort'
  2533. responses:
  2534. '200':
  2535. description: successful operation
  2536. content:
  2537. application/json:
  2538. schema:
  2539. $ref: '#/components/schemas/CommentThreadResponse'
  2540. post:
  2541. summary: Create a thread
  2542. security:
  2543. - OAuth2: []
  2544. tags:
  2545. - Video Comments
  2546. parameters:
  2547. - $ref: '#/components/parameters/idOrUUID'
  2548. responses:
  2549. '200':
  2550. description: successful operation
  2551. content:
  2552. application/json:
  2553. schema:
  2554. $ref: '#/components/schemas/CommentThreadPostResponse'
  2555. '404':
  2556. description: video does not exist
  2557. requestBody:
  2558. content:
  2559. application/json:
  2560. schema:
  2561. type: object
  2562. properties:
  2563. text:
  2564. type: string
  2565. description: 'Text comment'
  2566. required:
  2567. - text
  2568. '/videos/{id}/comment-threads/{threadId}':
  2569. get:
  2570. summary: Get a thread
  2571. tags:
  2572. - Video Comments
  2573. parameters:
  2574. - $ref: '#/components/parameters/idOrUUID'
  2575. - $ref: '#/components/parameters/threadId'
  2576. responses:
  2577. '200':
  2578. description: successful operation
  2579. content:
  2580. application/json:
  2581. schema:
  2582. $ref: '#/components/schemas/VideoCommentThreadTree'
  2583. '/videos/{id}/comments/{commentId}':
  2584. post:
  2585. summary: Reply to a thread of a video
  2586. security:
  2587. - OAuth2: []
  2588. tags:
  2589. - Video Comments
  2590. parameters:
  2591. - $ref: '#/components/parameters/idOrUUID'
  2592. - $ref: '#/components/parameters/commentId'
  2593. responses:
  2594. '200':
  2595. description: successful operation
  2596. content:
  2597. application/json:
  2598. schema:
  2599. $ref: '#/components/schemas/CommentThreadPostResponse'
  2600. '404':
  2601. description: thread or video does not exist
  2602. requestBody:
  2603. content:
  2604. application/json:
  2605. schema:
  2606. type: object
  2607. properties:
  2608. text:
  2609. type: string
  2610. description: 'Text comment'
  2611. required:
  2612. - text
  2613. delete:
  2614. summary: Delete a comment or a reply
  2615. security:
  2616. - OAuth2: []
  2617. tags:
  2618. - Video Comments
  2619. parameters:
  2620. - $ref: '#/components/parameters/idOrUUID'
  2621. - $ref: '#/components/parameters/commentId'
  2622. responses:
  2623. '204':
  2624. description: successful operation
  2625. '403':
  2626. description: cannot remove comment of another user
  2627. '404':
  2628. description: comment or video does not exist
  2629. '409':
  2630. description: comment is already deleted
  2631. '/videos/{id}/rate':
  2632. put:
  2633. summary: Like/dislike a video
  2634. security:
  2635. - OAuth2: []
  2636. tags:
  2637. - Video Rates
  2638. parameters:
  2639. - $ref: '#/components/parameters/idOrUUID'
  2640. responses:
  2641. '204':
  2642. description: successful operation
  2643. '404':
  2644. description: video does not exist
  2645. /search/videos:
  2646. get:
  2647. tags:
  2648. - Search
  2649. summary: Search videos
  2650. parameters:
  2651. - name: search
  2652. in: query
  2653. required: true
  2654. allowEmptyValue: false
  2655. description: >
  2656. String to search. If the user can make a remote URI search, and the string is an URI then the
  2657. PeerTube instance will fetch the remote object and add it to its database. Then,
  2658. you can use the REST API to fetch the complete video information and interact with it.
  2659. schema:
  2660. type: string
  2661. - $ref: '#/components/parameters/categoryOneOf'
  2662. - $ref: '#/components/parameters/tagsOneOf'
  2663. - $ref: '#/components/parameters/tagsAllOf'
  2664. - $ref: '#/components/parameters/licenceOneOf'
  2665. - $ref: '#/components/parameters/languageOneOf'
  2666. - $ref: '#/components/parameters/nsfw'
  2667. - $ref: '#/components/parameters/filter'
  2668. - $ref: '#/components/parameters/skipCount'
  2669. - $ref: '#/components/parameters/start'
  2670. - $ref: '#/components/parameters/count'
  2671. - $ref: '#/components/parameters/searchTarget'
  2672. - $ref: '#/components/parameters/videosSearchSort'
  2673. - name: startDate
  2674. in: query
  2675. description: Get videos that are published after this date
  2676. schema:
  2677. type: string
  2678. format: date-time
  2679. - name: endDate
  2680. in: query
  2681. description: Get videos that are published before this date
  2682. schema:
  2683. type: string
  2684. format: date-time
  2685. - name: originallyPublishedStartDate
  2686. in: query
  2687. description: Get videos that are originally published after this date
  2688. schema:
  2689. type: string
  2690. format: date-time
  2691. - name: originallyPublishedEndDate
  2692. in: query
  2693. description: Get videos that are originally published before this date
  2694. schema:
  2695. type: string
  2696. format: date-time
  2697. - name: durationMin
  2698. in: query
  2699. description: Get videos that have this minimum duration
  2700. schema:
  2701. type: integer
  2702. - name: durationMax
  2703. in: query
  2704. description: Get videos that have this maximum duration
  2705. schema:
  2706. type: integer
  2707. callbacks:
  2708. 'searchTarget === search-index':
  2709. $ref: '#/components/callbacks/searchIndex'
  2710. responses:
  2711. '200':
  2712. description: successful operation
  2713. content:
  2714. application/json:
  2715. schema:
  2716. $ref: '#/components/schemas/VideoListResponse'
  2717. '500':
  2718. description: search index unavailable
  2719. /search/video-channels:
  2720. get:
  2721. tags:
  2722. - Search
  2723. summary: Search channels
  2724. parameters:
  2725. - name: search
  2726. in: query
  2727. required: true
  2728. description: >
  2729. String to search. If the user can make a remote URI search, and the string is an URI then the
  2730. PeerTube instance will fetch the remote object and add it to its database. Then,
  2731. you can use the REST API to fetch the complete channel information and interact with it.
  2732. schema:
  2733. type: string
  2734. - $ref: '#/components/parameters/start'
  2735. - $ref: '#/components/parameters/count'
  2736. - $ref: '#/components/parameters/searchTarget'
  2737. - $ref: '#/components/parameters/sort'
  2738. callbacks:
  2739. 'searchTarget === search-index':
  2740. $ref: '#/components/callbacks/searchIndex'
  2741. responses:
  2742. '200':
  2743. description: successful operation
  2744. content:
  2745. application/json:
  2746. schema:
  2747. type: array
  2748. items:
  2749. $ref: '#/components/schemas/VideoChannel'
  2750. '500':
  2751. description: search index unavailable
  2752. /blocklist/accounts:
  2753. get:
  2754. tags:
  2755. - Account Blocks
  2756. summary: List account blocks
  2757. security:
  2758. - OAuth2:
  2759. - admin
  2760. parameters:
  2761. - $ref: '#/components/parameters/start'
  2762. - $ref: '#/components/parameters/count'
  2763. - $ref: '#/components/parameters/sort'
  2764. responses:
  2765. '200':
  2766. description: successful operation
  2767. post:
  2768. tags:
  2769. - Account Blocks
  2770. summary: Block an account
  2771. security:
  2772. - OAuth2:
  2773. - admin
  2774. requestBody:
  2775. content:
  2776. application/json:
  2777. schema:
  2778. type: object
  2779. properties:
  2780. accountName:
  2781. type: string
  2782. example: chocobozzz@example.org
  2783. description: account to block, in the form `username@domain`
  2784. required:
  2785. - accountName
  2786. responses:
  2787. '200':
  2788. description: successful operation
  2789. '409':
  2790. description: self-blocking forbidden
  2791. '/blocklist/accounts/{accountName}':
  2792. delete:
  2793. tags:
  2794. - Account Blocks
  2795. summary: Unblock an account by its handle
  2796. security:
  2797. - OAuth2:
  2798. - admin
  2799. parameters:
  2800. - name: accountName
  2801. in: path
  2802. required: true
  2803. description: account to unblock, in the form `username@domain`
  2804. schema:
  2805. type: string
  2806. responses:
  2807. '201':
  2808. description: successful operation
  2809. '404':
  2810. description: account or account block does not exist
  2811. /blocklist/servers:
  2812. get:
  2813. tags:
  2814. - Server Blocks
  2815. summary: List server blocks
  2816. security:
  2817. - OAuth2:
  2818. - admin
  2819. parameters:
  2820. - $ref: '#/components/parameters/start'
  2821. - $ref: '#/components/parameters/count'
  2822. - $ref: '#/components/parameters/sort'
  2823. responses:
  2824. '200':
  2825. description: successful operation
  2826. post:
  2827. tags:
  2828. - Server Blocks
  2829. summary: Block a server
  2830. security:
  2831. - OAuth2:
  2832. - admin
  2833. requestBody:
  2834. content:
  2835. application/json:
  2836. schema:
  2837. type: object
  2838. properties:
  2839. host:
  2840. type: string
  2841. format: hostname
  2842. description: server domain to block
  2843. required:
  2844. - host
  2845. responses:
  2846. '200':
  2847. description: successful operation
  2848. '409':
  2849. description: self-blocking forbidden
  2850. '/blocklist/servers/{host}':
  2851. delete:
  2852. tags:
  2853. - Server Blocks
  2854. summary: Unblock a server by its domain
  2855. security:
  2856. - OAuth2:
  2857. - admin
  2858. parameters:
  2859. - name: host
  2860. in: path
  2861. required: true
  2862. description: server domain to unblock
  2863. schema:
  2864. type: string
  2865. format: hostname
  2866. responses:
  2867. '201':
  2868. description: successful operation
  2869. '404':
  2870. description: account block does not exist
  2871. /redundancy/{host}:
  2872. put:
  2873. tags:
  2874. - Instance Redundancy
  2875. summary: Update a server redundancy policy
  2876. security:
  2877. - OAuth2:
  2878. - admin
  2879. parameters:
  2880. - name: host
  2881. in: path
  2882. required: true
  2883. description: server domain to mirror
  2884. schema:
  2885. type: string
  2886. format: hostname
  2887. requestBody:
  2888. content:
  2889. application/json:
  2890. schema:
  2891. type: object
  2892. properties:
  2893. redundancyAllowed:
  2894. type: boolean
  2895. description: allow mirroring of the host's local videos
  2896. required:
  2897. - redundancyAllowed
  2898. responses:
  2899. '204':
  2900. description: successful operation
  2901. '404':
  2902. description: server is not already known
  2903. /redundancy/videos:
  2904. get:
  2905. tags:
  2906. - Video Mirroring
  2907. summary: List videos being mirrored
  2908. security:
  2909. - OAuth2:
  2910. - admin
  2911. parameters:
  2912. - name: target
  2913. in: query
  2914. required: true
  2915. description: direction of the mirror
  2916. schema:
  2917. type: string
  2918. enum:
  2919. - my-videos
  2920. - remote-videos
  2921. - $ref: '#/components/parameters/start'
  2922. - $ref: '#/components/parameters/count'
  2923. - $ref: '#/components/parameters/videoRedundanciesSort'
  2924. responses:
  2925. '200':
  2926. description: successful operation
  2927. content:
  2928. application/json:
  2929. schema:
  2930. type: array
  2931. items:
  2932. $ref: '#/components/schemas/VideoRedundancy'
  2933. post:
  2934. tags:
  2935. - Video Mirroring
  2936. summary: Mirror a video
  2937. security:
  2938. - OAuth2:
  2939. - admin
  2940. requestBody:
  2941. content:
  2942. application/json:
  2943. schema:
  2944. type: object
  2945. properties:
  2946. videoId:
  2947. type: integer
  2948. required:
  2949. - videoId
  2950. responses:
  2951. '204':
  2952. description: successful operation
  2953. '400':
  2954. description: cannot mirror a local video
  2955. '404':
  2956. description: video does not exist
  2957. '409':
  2958. description: video is already mirrored
  2959. /redundancy/videos/{redundancyId}:
  2960. delete:
  2961. tags:
  2962. - Video Mirroring
  2963. summary: Delete a mirror done on a video
  2964. security:
  2965. - OAuth2:
  2966. - admin
  2967. parameters:
  2968. - name: redundancyId
  2969. in: path
  2970. required: true
  2971. description: id of an existing redundancy on a video
  2972. schema:
  2973. type: string
  2974. responses:
  2975. '204':
  2976. description: successful operation
  2977. '404':
  2978. description: video redundancy not found
  2979. '/feeds/video-comments.{format}':
  2980. get:
  2981. tags:
  2982. - Feeds
  2983. summary: List comments on videos
  2984. servers:
  2985. - url: 'https://peertube2.cpy.re'
  2986. description: Live Test Server (live data - latest nightly version)
  2987. - url: 'https://peertube3.cpy.re'
  2988. description: Live Test Server (live data - latest RC version)
  2989. - url: 'https://peertube.cpy.re'
  2990. description: Live Test Server (live data - stable version)
  2991. parameters:
  2992. - name: format
  2993. in: path
  2994. required: true
  2995. description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
  2996. schema:
  2997. type: string
  2998. enum:
  2999. - xml
  3000. - rss
  3001. - rss2
  3002. - atom
  3003. - atom1
  3004. - json
  3005. - json1
  3006. - name: videoId
  3007. in: query
  3008. description: 'limit listing to a specific video'
  3009. schema:
  3010. type: string
  3011. - name: accountId
  3012. in: query
  3013. description: 'limit listing to a specific account'
  3014. schema:
  3015. type: string
  3016. - name: accountName
  3017. in: query
  3018. description: 'limit listing to a specific account'
  3019. schema:
  3020. type: string
  3021. - name: videoChannelId
  3022. in: query
  3023. description: 'limit listing to a specific video channel'
  3024. schema:
  3025. type: string
  3026. - name: videoChannelName
  3027. in: query
  3028. description: 'limit listing to a specific video channel'
  3029. schema:
  3030. type: string
  3031. responses:
  3032. '204':
  3033. description: successful operation
  3034. headers:
  3035. Cache-Control:
  3036. schema:
  3037. type: string
  3038. default: 'max-age=900' # 15 min cache
  3039. content:
  3040. application/xml:
  3041. schema:
  3042. $ref: '#/components/schemas/VideoCommentsForXML'
  3043. application/rss+xml:
  3044. schema:
  3045. $ref: '#/components/schemas/VideoCommentsForXML'
  3046. text/xml:
  3047. schema:
  3048. $ref: '#/components/schemas/VideoCommentsForXML'
  3049. application/atom+xml:
  3050. schema:
  3051. $ref: '#/components/schemas/VideoCommentsForXML'
  3052. application/json:
  3053. schema:
  3054. type: object
  3055. '400':
  3056. x-summary: field inconsistencies
  3057. description: >
  3058. Arises when:
  3059. - videoId filter is mixed with a channel filter
  3060. '404':
  3061. description: video, video channel or account not found
  3062. '406':
  3063. description: accept header unsupported
  3064. '/feeds/videos.{format}':
  3065. get:
  3066. tags:
  3067. - Feeds
  3068. summary: List videos
  3069. servers:
  3070. - url: 'https://peertube2.cpy.re'
  3071. description: Live Test Server (live data - latest nightly version)
  3072. - url: 'https://peertube3.cpy.re'
  3073. description: Live Test Server (live data - latest RC version)
  3074. - url: 'https://peertube.cpy.re'
  3075. description: Live Test Server (live data - stable version)
  3076. parameters:
  3077. - name: format
  3078. in: path
  3079. required: true
  3080. description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
  3081. schema:
  3082. type: string
  3083. enum:
  3084. - xml
  3085. - rss
  3086. - rss2
  3087. - atom
  3088. - atom1
  3089. - json
  3090. - json1
  3091. - name: accountId
  3092. in: query
  3093. description: 'limit listing to a specific account'
  3094. schema:
  3095. type: string
  3096. - name: accountName
  3097. in: query
  3098. description: 'limit listing to a specific account'
  3099. schema:
  3100. type: string
  3101. - name: videoChannelId
  3102. in: query
  3103. description: 'limit listing to a specific video channel'
  3104. schema:
  3105. type: string
  3106. - name: videoChannelName
  3107. in: query
  3108. description: 'limit listing to a specific video channel'
  3109. schema:
  3110. type: string
  3111. - $ref: '#/components/parameters/sort'
  3112. - $ref: '#/components/parameters/nsfw'
  3113. - $ref: '#/components/parameters/filter'
  3114. responses:
  3115. '204':
  3116. description: successful operation
  3117. headers:
  3118. Cache-Control:
  3119. schema:
  3120. type: string
  3121. default: 'max-age=900' # 15 min cache
  3122. content:
  3123. application/xml:
  3124. schema:
  3125. $ref: '#/components/schemas/VideosForXML'
  3126. examples:
  3127. nightly:
  3128. externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
  3129. application/rss+xml:
  3130. schema:
  3131. $ref: '#/components/schemas/VideosForXML'
  3132. text/xml:
  3133. schema:
  3134. $ref: '#/components/schemas/VideosForXML'
  3135. application/atom+xml:
  3136. schema:
  3137. $ref: '#/components/schemas/VideosForXML'
  3138. application/json:
  3139. schema:
  3140. type: object
  3141. '404':
  3142. description: video channel or account not found
  3143. '406':
  3144. description: accept header unsupported
  3145. /plugins:
  3146. get:
  3147. tags:
  3148. - Plugins
  3149. summary: List plugins
  3150. security:
  3151. - OAuth2:
  3152. - admin
  3153. parameters:
  3154. - name: pluginType
  3155. in: query
  3156. schema:
  3157. type: integer
  3158. - name: uninstalled
  3159. in: query
  3160. schema:
  3161. type: boolean
  3162. - $ref: '#/components/parameters/start'
  3163. - $ref: '#/components/parameters/count'
  3164. - $ref: '#/components/parameters/sort'
  3165. responses:
  3166. '200':
  3167. description: successful operation
  3168. content:
  3169. application/json:
  3170. schema:
  3171. $ref: '#/components/schemas/PluginResponse'
  3172. /plugins/available:
  3173. get:
  3174. tags:
  3175. - Plugins
  3176. summary: List available plugins
  3177. security:
  3178. - OAuth2:
  3179. - admin
  3180. parameters:
  3181. - name: search
  3182. in: query
  3183. schema:
  3184. type: string
  3185. - name: pluginType
  3186. in: query
  3187. schema:
  3188. type: integer
  3189. - name: currentPeerTubeEngine
  3190. in: query
  3191. schema:
  3192. type: string
  3193. - $ref: '#/components/parameters/start'
  3194. - $ref: '#/components/parameters/count'
  3195. - $ref: '#/components/parameters/sort'
  3196. responses:
  3197. '200':
  3198. description: successful operation
  3199. content:
  3200. application/json:
  3201. schema:
  3202. $ref: '#/components/schemas/PluginResponse'
  3203. '503':
  3204. description: plugin index unavailable
  3205. /plugins/install:
  3206. post:
  3207. tags:
  3208. - Plugins
  3209. summary: Install a plugin
  3210. security:
  3211. - OAuth2:
  3212. - admin
  3213. requestBody:
  3214. content:
  3215. application/json:
  3216. schema:
  3217. oneOf:
  3218. - type: object
  3219. properties:
  3220. npmName:
  3221. type: string
  3222. example: peertube-plugin-auth-ldap
  3223. required:
  3224. - npmName
  3225. additionalProperties: false
  3226. - type: object
  3227. properties:
  3228. path:
  3229. type: string
  3230. required:
  3231. - path
  3232. additionalProperties: false
  3233. responses:
  3234. '204':
  3235. description: successful operation
  3236. '400':
  3237. description: should have either `npmName` or `path` set
  3238. /plugins/update:
  3239. post:
  3240. tags:
  3241. - Plugins
  3242. summary: Update a plugin
  3243. security:
  3244. - OAuth2:
  3245. - admin
  3246. requestBody:
  3247. content:
  3248. application/json:
  3249. schema:
  3250. oneOf:
  3251. - type: object
  3252. properties:
  3253. npmName:
  3254. type: string
  3255. example: peertube-plugin-auth-ldap
  3256. required:
  3257. - npmName
  3258. additionalProperties: false
  3259. - type: object
  3260. properties:
  3261. path:
  3262. type: string
  3263. required:
  3264. - path
  3265. additionalProperties: false
  3266. responses:
  3267. '204':
  3268. description: successful operation
  3269. '400':
  3270. description: should have either `npmName` or `path` set
  3271. '404':
  3272. description: existing plugin not found
  3273. /plugins/uninstall:
  3274. post:
  3275. tags:
  3276. - Plugins
  3277. summary: Uninstall a plugin
  3278. security:
  3279. - OAuth2:
  3280. - admin
  3281. requestBody:
  3282. content:
  3283. application/json:
  3284. schema:
  3285. type: object
  3286. properties:
  3287. npmName:
  3288. type: string
  3289. description: name of the plugin/theme in its package.json
  3290. example: peertube-plugin-auth-ldap
  3291. required:
  3292. - npmName
  3293. responses:
  3294. '204':
  3295. description: successful operation
  3296. '404':
  3297. description: existing plugin not found
  3298. /plugins/{npmName}:
  3299. get:
  3300. tags:
  3301. - Plugins
  3302. summary: Get a plugin
  3303. security:
  3304. - OAuth2:
  3305. - admin
  3306. parameters:
  3307. - $ref: '#/components/parameters/npmName'
  3308. responses:
  3309. '200':
  3310. description: successful operation
  3311. content:
  3312. application/json:
  3313. schema:
  3314. $ref: '#/components/schemas/Plugin'
  3315. '404':
  3316. description: plugin not found
  3317. /plugins/{npmName}/settings:
  3318. put:
  3319. tags:
  3320. - Plugins
  3321. summary: Set a plugin's settings
  3322. security:
  3323. - OAuth2:
  3324. - admin
  3325. parameters:
  3326. - $ref: '#/components/parameters/npmName'
  3327. requestBody:
  3328. content:
  3329. application/json:
  3330. schema:
  3331. type: object
  3332. properties:
  3333. settings:
  3334. type: object
  3335. additionalProperties: true
  3336. responses:
  3337. '204':
  3338. description: successful operation
  3339. '404':
  3340. description: plugin not found
  3341. /plugins/{npmName}/public-settings:
  3342. get:
  3343. tags:
  3344. - Plugins
  3345. summary: Get a plugin's public settings
  3346. parameters:
  3347. - $ref: '#/components/parameters/npmName'
  3348. responses:
  3349. '200':
  3350. description: successful operation
  3351. content:
  3352. application/json:
  3353. schema:
  3354. type: object
  3355. additionalProperties: true
  3356. '404':
  3357. description: plugin not found
  3358. /plugins/{npmName}/registered-settings:
  3359. get:
  3360. tags:
  3361. - Plugins
  3362. summary: Get a plugin's registered settings
  3363. security:
  3364. - OAuth2:
  3365. - admin
  3366. parameters:
  3367. - $ref: '#/components/parameters/npmName'
  3368. responses:
  3369. '200':
  3370. description: successful operation
  3371. content:
  3372. application/json:
  3373. schema:
  3374. type: object
  3375. additionalProperties: true
  3376. '404':
  3377. description: plugin not found
  3378. servers:
  3379. - url: 'https://peertube2.cpy.re/api/v1'
  3380. description: Live Test Server (live data - latest nightly version)
  3381. - url: 'https://peertube3.cpy.re/api/v1'
  3382. description: Live Test Server (live data - latest RC version)
  3383. - url: 'https://peertube.cpy.re/api/v1'
  3384. description: Live Test Server (live data - stable version)
  3385. components:
  3386. parameters:
  3387. start:
  3388. name: start
  3389. in: query
  3390. required: false
  3391. description: Offset used to paginate results
  3392. schema:
  3393. type: integer
  3394. minimum: 0
  3395. count:
  3396. name: count
  3397. in: query
  3398. required: false
  3399. description: "Number of items to return"
  3400. schema:
  3401. type: integer
  3402. default: 15
  3403. maximum: 100
  3404. minimum: 1
  3405. sort:
  3406. name: sort
  3407. in: query
  3408. required: false
  3409. description: Sort column
  3410. schema:
  3411. type: string
  3412. example: -createdAt
  3413. search:
  3414. name: search
  3415. in: query
  3416. required: false
  3417. description: Plain text search, applied to various parts of the model depending on endpoint
  3418. schema:
  3419. type: string
  3420. searchTarget:
  3421. name: searchTarget
  3422. in: query
  3423. required: false
  3424. description: >
  3425. If the administrator enabled search index support, you can override the default search target.
  3426. **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
  3427. It means the instance may not yet know the objects you fetched. If you want to load video/channel information:
  3428. * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
  3429. then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
  3430. After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
  3431. * If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch
  3432. the data from the origin instance API
  3433. schema:
  3434. type: string
  3435. enum:
  3436. - 'local'
  3437. - 'search-index'
  3438. videosSort:
  3439. name: sort
  3440. in: query
  3441. required: false
  3442. description: Sort videos by criteria
  3443. schema:
  3444. type: string
  3445. enum:
  3446. - name
  3447. - -duration
  3448. - -createdAt
  3449. - -publishedAt
  3450. - -views
  3451. - -likes
  3452. - -trending
  3453. videosSearchSort:
  3454. name: sort
  3455. in: query
  3456. required: false
  3457. description: Sort videos by criteria
  3458. schema:
  3459. type: string
  3460. enum:
  3461. - name
  3462. - -duration
  3463. - -createdAt
  3464. - -publishedAt
  3465. - -views
  3466. - -likes
  3467. - -match
  3468. commentsSort:
  3469. name: sort
  3470. in: query
  3471. required: false
  3472. description: Sort comments by criteria
  3473. schema:
  3474. type: string
  3475. enum:
  3476. - -createdAt
  3477. - -totalReplies
  3478. blacklistsSort:
  3479. name: sort
  3480. in: query
  3481. required: false
  3482. description: Sort blacklists by criteria
  3483. schema:
  3484. type: string
  3485. enum:
  3486. - -id
  3487. - name
  3488. - -duration
  3489. - -views
  3490. - -likes
  3491. - -dislikes
  3492. - -uuid
  3493. - -createdAt
  3494. usersSearch:
  3495. name: search
  3496. in: query
  3497. required: false
  3498. description: Plain text search that will match with user usernames or emails
  3499. schema:
  3500. type: string
  3501. usersBlocked:
  3502. name: blocked
  3503. in: query
  3504. required: false
  3505. description: Filter results down to (un)banned users
  3506. schema:
  3507. type: boolean
  3508. usersSort:
  3509. name: sort
  3510. in: query
  3511. required: false
  3512. description: Sort users by criteria
  3513. schema:
  3514. type: string
  3515. enum:
  3516. - -id
  3517. - -username
  3518. - -createdAt
  3519. abusesSort:
  3520. name: sort
  3521. in: query
  3522. required: false
  3523. description: Sort abuses by criteria
  3524. schema:
  3525. type: string
  3526. enum:
  3527. - -id
  3528. - -createdAt
  3529. - -state
  3530. videoRedundanciesSort:
  3531. name: sort
  3532. in: query
  3533. required: false
  3534. description: Sort abuses by criteria
  3535. schema:
  3536. type: string
  3537. enum:
  3538. - name
  3539. name:
  3540. name: name
  3541. in: path
  3542. required: true
  3543. description: The username or handle of the account
  3544. schema:
  3545. type: string
  3546. example: chocobozzz | chocobozzz@example.org
  3547. id:
  3548. name: id
  3549. in: path
  3550. required: true
  3551. description: The user id
  3552. schema:
  3553. type: integer
  3554. minimum: 0
  3555. example: 42
  3556. idOrUUID:
  3557. name: id
  3558. in: path
  3559. required: true
  3560. description: The object id or uuid
  3561. schema:
  3562. oneOf:
  3563. - type: integer
  3564. minimum: 0
  3565. example: 42
  3566. - type: string
  3567. format: uuid
  3568. example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
  3569. playlistElementId:
  3570. name: playlistElementId
  3571. in: path
  3572. required: true
  3573. description: Playlist element id
  3574. schema:
  3575. type: integer
  3576. abuseId:
  3577. name: abuseId
  3578. in: path
  3579. required: true
  3580. description: Abuse id
  3581. schema:
  3582. type: integer
  3583. abuseMessageId:
  3584. name: abuseMessageId
  3585. in: path
  3586. required: true
  3587. description: Abuse message id
  3588. schema:
  3589. type: integer
  3590. captionLanguage:
  3591. name: captionLanguage
  3592. in: path
  3593. required: true
  3594. description: The caption language
  3595. schema:
  3596. type: string
  3597. channelHandle:
  3598. name: channelHandle
  3599. in: path
  3600. required: true
  3601. description: The video channel handle
  3602. schema:
  3603. type: string
  3604. example: my_username | my_username@example.com
  3605. subscriptionHandle:
  3606. name: subscriptionHandle
  3607. in: path
  3608. required: true
  3609. description: The subscription handle
  3610. schema:
  3611. type: string
  3612. example: my_username | my_username@example.com
  3613. threadId:
  3614. name: threadId
  3615. in: path
  3616. required: true
  3617. description: The thread id (root comment id)
  3618. schema:
  3619. type: integer
  3620. commentId:
  3621. name: commentId
  3622. in: path
  3623. required: true
  3624. description: The comment id
  3625. schema:
  3626. type: integer
  3627. categoryOneOf:
  3628. name: categoryOneOf
  3629. in: query
  3630. required: false
  3631. description: category id of the video (see [/videos/categories](#tag/Video/paths/~1videos~1categories/get))
  3632. schema:
  3633. oneOf:
  3634. - type: integer
  3635. - type: array
  3636. items:
  3637. type: integer
  3638. style: form
  3639. explode: false
  3640. tagsOneOf:
  3641. name: tagsOneOf
  3642. in: query
  3643. required: false
  3644. description: tag(s) of the video
  3645. schema:
  3646. oneOf:
  3647. - type: string
  3648. - type: array
  3649. items:
  3650. type: string
  3651. style: form
  3652. explode: false
  3653. tagsAllOf:
  3654. name: tagsAllOf
  3655. in: query
  3656. required: false
  3657. description: tag(s) of the video, where all should be present in the video
  3658. schema:
  3659. oneOf:
  3660. - type: string
  3661. - type: array
  3662. items:
  3663. type: string
  3664. style: form
  3665. explode: false
  3666. languageOneOf:
  3667. name: languageOneOf
  3668. in: query
  3669. required: false
  3670. description: language id of the video (see [/videos/languages](#tag/Video/paths/~1videos~1languages/get)). Use `_unknown` to filter on videos that don't have a video language
  3671. schema:
  3672. oneOf:
  3673. - type: string
  3674. - type: array
  3675. items:
  3676. type: string
  3677. style: form
  3678. explode: false
  3679. licenceOneOf:
  3680. name: licenceOneOf
  3681. in: query
  3682. required: false
  3683. description: licence id of the video (see [/videos/licences](#tag/Video/paths/~1videos~1licences/get))
  3684. schema:
  3685. oneOf:
  3686. - type: integer
  3687. - type: array
  3688. items:
  3689. type: integer
  3690. style: form
  3691. explode: false
  3692. skipCount:
  3693. name: skipCount
  3694. in: query
  3695. required: false
  3696. description: if you don't need the `total` in the response
  3697. schema:
  3698. type: string
  3699. enum:
  3700. - 'true'
  3701. - 'false'
  3702. default: 'false'
  3703. nsfw:
  3704. name: nsfw
  3705. in: query
  3706. required: false
  3707. description: whether to include nsfw videos, if any
  3708. schema:
  3709. type: string
  3710. enum:
  3711. - 'true'
  3712. - 'false'
  3713. filter:
  3714. name: filter
  3715. in: query
  3716. required: false
  3717. description: >
  3718. Special filters which might require special rights:
  3719. * `local` - only videos local to the instance
  3720. * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
  3721. * `all` - all videos, showing private and unlisted videos (requires Admin privileges)
  3722. schema:
  3723. type: string
  3724. enum:
  3725. - local
  3726. - all-local
  3727. subscriptionsUris:
  3728. name: uris
  3729. in: query
  3730. required: true
  3731. description: list of uris to check if each is part of the user subscriptions
  3732. schema:
  3733. type: array
  3734. items:
  3735. type: string
  3736. format: uri
  3737. npmName:
  3738. name: npmName
  3739. in: path
  3740. required: true
  3741. description: name of the plugin/theme on npmjs.com or in its package.json
  3742. schema:
  3743. type: string
  3744. example: peertube-plugin-auth-ldap
  3745. jobType:
  3746. name: jobType
  3747. in: query
  3748. required: false
  3749. description: job type
  3750. schema:
  3751. type: string
  3752. enum:
  3753. - activitypub-follow
  3754. - activitypub-http-broadcast
  3755. - activitypub-http-fetcher
  3756. - activitypub-http-unicast
  3757. - email
  3758. - video-transcoding
  3759. - video-file-import
  3760. - video-import
  3761. - videos-views
  3762. - activitypub-refresher
  3763. - video-redundancy
  3764. - video-live-ending
  3765. securitySchemes:
  3766. OAuth2:
  3767. description: >
  3768. In the header: *Authorization: Bearer <token\>*
  3769. Authenticating via OAuth requires the following steps:
  3770. - Have an account with sufficient authorization levels
  3771. - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
  3772. Bearer Token
  3773. - Make Authenticated Requests
  3774. type: oauth2
  3775. flows:
  3776. password:
  3777. tokenUrl: 'https://peertube.example.com/api/v1/users/token'
  3778. scopes:
  3779. admin: Admin scope
  3780. moderator: Moderator scope
  3781. user: User scope
  3782. schemas:
  3783. VideoConstantNumber:
  3784. properties:
  3785. id:
  3786. type: integer
  3787. label:
  3788. type: string
  3789. VideoConstantString:
  3790. properties:
  3791. id:
  3792. type: string
  3793. label:
  3794. type: string
  3795. VideoPlaylistPrivacySet:
  3796. type: integer
  3797. enum:
  3798. - 1
  3799. - 2
  3800. - 3
  3801. description: 'The video playlist privacy (Public = `1`, Unlisted = `2`, Private = `3`)'
  3802. VideoPlaylistPrivacyConstant:
  3803. properties:
  3804. id:
  3805. $ref: '#/components/schemas/VideoPlaylistPrivacySet'
  3806. label:
  3807. type: string
  3808. VideoPlaylistTypeSet:
  3809. type: integer
  3810. enum:
  3811. - 1
  3812. - 2
  3813. description: 'The video playlist type (Regular = `1`, Watch Later = `2`)'
  3814. VideoPlaylistTypeConstant:
  3815. properties:
  3816. id:
  3817. $ref: '#/components/schemas/VideoPlaylistTypeSet'
  3818. label:
  3819. type: string
  3820. VideoPrivacySet:
  3821. type: integer
  3822. enum:
  3823. - 1
  3824. - 2
  3825. - 3
  3826. - 4
  3827. description: 'The video privacy (Public = `1`, Unlisted = `2`, Private = `3`, Internal = `4`)'
  3828. VideoPrivacyConstant:
  3829. properties:
  3830. id:
  3831. $ref: '#/components/schemas/VideoPrivacySet'
  3832. label:
  3833. type: string
  3834. NSFWPolicy:
  3835. type: string
  3836. enum:
  3837. - display
  3838. - blur
  3839. - do_not_list
  3840. UserRole:
  3841. type: integer
  3842. enum:
  3843. - 0
  3844. - 1
  3845. - 2
  3846. description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
  3847. example: 2
  3848. VideoStateConstant:
  3849. properties:
  3850. id:
  3851. type: integer
  3852. enum:
  3853. - 1
  3854. - 2
  3855. - 3
  3856. description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)'
  3857. label:
  3858. type: string
  3859. AbuseStateSet:
  3860. type: integer
  3861. enum:
  3862. - 1
  3863. - 2
  3864. - 3
  3865. description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)'
  3866. AbuseStateConstant:
  3867. properties:
  3868. id:
  3869. $ref: '#/components/schemas/AbuseStateSet'
  3870. label:
  3871. type: string
  3872. AbusePredefinedReasons:
  3873. type: array
  3874. items:
  3875. type: string
  3876. enum:
  3877. - violentOrAbusive
  3878. - hatefulOrAbusive
  3879. - spamOrMisleading
  3880. - privacy
  3881. - rights
  3882. - serverRules
  3883. - thumbnails
  3884. - captions
  3885. example: [spamOrMisleading]
  3886. VideoResolutionConstant:
  3887. properties:
  3888. id:
  3889. type: integer
  3890. description: 'Video resolution (240, 360, 720, 1080, 1440 or 2160)'
  3891. example: 240
  3892. label:
  3893. type: string
  3894. example: 240p
  3895. VideoScheduledUpdate:
  3896. properties:
  3897. privacy:
  3898. $ref: '#/components/schemas/VideoPrivacySet'
  3899. updateAt:
  3900. type: string
  3901. format: date
  3902. description: When to update the video
  3903. required:
  3904. - updateAt
  3905. AccountSummary:
  3906. properties:
  3907. id:
  3908. type: integer
  3909. name:
  3910. type: string
  3911. displayName:
  3912. type: string
  3913. url:
  3914. type: string
  3915. format: url
  3916. host:
  3917. type: string
  3918. format: hostname
  3919. avatar:
  3920. nullable: true
  3921. allOf:
  3922. - $ref: '#/components/schemas/Avatar'
  3923. VideoChannelSummary:
  3924. properties:
  3925. id:
  3926. type: integer
  3927. name:
  3928. type: string
  3929. displayName:
  3930. type: string
  3931. url:
  3932. type: string
  3933. format: url
  3934. host:
  3935. type: string
  3936. format: hostname
  3937. avatar:
  3938. nullable: true
  3939. allOf:
  3940. - $ref: '#/components/schemas/Avatar'
  3941. PlaylistElement:
  3942. properties:
  3943. position:
  3944. type: integer
  3945. startTimestamp:
  3946. type: integer
  3947. stopTimestamp:
  3948. type: integer
  3949. video:
  3950. nullable: true
  3951. allOf:
  3952. - $ref: '#/components/schemas/Video'
  3953. VideoFile:
  3954. properties:
  3955. magnetUri:
  3956. type: string
  3957. resolution:
  3958. $ref: '#/components/schemas/VideoResolutionConstant'
  3959. size:
  3960. type: integer
  3961. description: 'Video file size in bytes'
  3962. torrentUrl:
  3963. type: string
  3964. format: url
  3965. torrentDownloadUrl:
  3966. type: string
  3967. format: url
  3968. fileUrl:
  3969. type: string
  3970. format: url
  3971. fileDownloadUrl:
  3972. type: string
  3973. format: url
  3974. fps:
  3975. type: number
  3976. metadataUrl:
  3977. type: string
  3978. format: url
  3979. VideoStreamingPlaylists:
  3980. properties:
  3981. id:
  3982. type: integer
  3983. type:
  3984. type: integer
  3985. enum:
  3986. - 1
  3987. description: 'Playlist type (HLS = `1`)'
  3988. playlistUrl:
  3989. type: string
  3990. format: url
  3991. segmentsSha256Url:
  3992. type: string
  3993. format: url
  3994. files:
  3995. type: array
  3996. description: 'Video files associated to this playlist. The difference with the root "files" property is that these files are fragmented, so they can be used in this streaming playlist (HLS etc)'
  3997. items:
  3998. $ref: '#/components/schemas/VideoFile'
  3999. redundancies:
  4000. type: array
  4001. items:
  4002. type: object
  4003. properties:
  4004. baseUrl:
  4005. type: string
  4006. format: url
  4007. VideoInfo:
  4008. properties:
  4009. id:
  4010. type: integer
  4011. uuid:
  4012. type: string
  4013. format: uuid
  4014. example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
  4015. name:
  4016. type: string
  4017. Video:
  4018. properties:
  4019. id:
  4020. type: integer
  4021. example: 8
  4022. uuid:
  4023. type: string
  4024. format: uuid
  4025. example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
  4026. isLive:
  4027. type: boolean
  4028. createdAt:
  4029. type: string
  4030. format: date-time
  4031. publishedAt:
  4032. type: string
  4033. format: date-time
  4034. updatedAt:
  4035. type: string
  4036. format: date-time
  4037. originallyPublishedAt:
  4038. type: string
  4039. format: date-time
  4040. category:
  4041. $ref: '#/components/schemas/VideoConstantNumber'
  4042. licence:
  4043. $ref: '#/components/schemas/VideoConstantNumber'
  4044. language:
  4045. $ref: '#/components/schemas/VideoConstantString'
  4046. privacy:
  4047. $ref: '#/components/schemas/VideoPrivacyConstant'
  4048. description:
  4049. type: string
  4050. duration:
  4051. type: integer
  4052. example: 1419
  4053. isLocal:
  4054. type: boolean
  4055. name:
  4056. type: string
  4057. example: What is PeerTube?
  4058. thumbnailPath:
  4059. type: string
  4060. example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
  4061. previewPath:
  4062. type: string
  4063. example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
  4064. embedPath:
  4065. type: string
  4066. example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee
  4067. views:
  4068. type: integer
  4069. example: 1337
  4070. likes:
  4071. type: integer
  4072. example: 42
  4073. dislikes:
  4074. type: integer
  4075. example: 7
  4076. nsfw:
  4077. type: boolean
  4078. waitTranscoding:
  4079. type: boolean
  4080. nullable: true
  4081. state:
  4082. $ref: '#/components/schemas/VideoStateConstant'
  4083. scheduledUpdate:
  4084. nullable: true
  4085. allOf:
  4086. - $ref: '#/components/schemas/VideoScheduledUpdate'
  4087. blacklisted:
  4088. nullable: true
  4089. type: boolean
  4090. blacklistedReason:
  4091. nullable: true
  4092. type: string
  4093. account:
  4094. $ref: '#/components/schemas/AccountSummary'
  4095. channel:
  4096. $ref: '#/components/schemas/VideoChannelSummary'
  4097. userHistory:
  4098. nullable: true
  4099. type: object
  4100. properties:
  4101. currentTime:
  4102. type: integer
  4103. VideoDetails:
  4104. allOf:
  4105. - $ref: '#/components/schemas/Video'
  4106. - type: object
  4107. properties:
  4108. descriptionPath:
  4109. type: string
  4110. support:
  4111. type: string
  4112. description: A text tell the audience how to support the video creator
  4113. example: Please support my work on <insert crowdfunding plateform>! <3
  4114. channel:
  4115. $ref: '#/components/schemas/VideoChannel'
  4116. account:
  4117. $ref: '#/components/schemas/Account'
  4118. tags:
  4119. type: array
  4120. items:
  4121. type: string
  4122. example: [flowers, gardening]
  4123. files:
  4124. type: array
  4125. description: 'WebTorrent/raw video files. Can be empty if WebTorrent is disabled on the server. In this case, video files will be in the "streamingPlaylists[].files" property'
  4126. items:
  4127. $ref: '#/components/schemas/VideoFile'
  4128. commentsEnabled:
  4129. type: boolean
  4130. downloadEnabled:
  4131. type: boolean
  4132. trackerUrls:
  4133. type: array
  4134. items:
  4135. type: string
  4136. format: url
  4137. streamingPlaylists:
  4138. type: array
  4139. items:
  4140. $ref: '#/components/schemas/VideoStreamingPlaylists'
  4141. FileRedundancyInformation:
  4142. properties:
  4143. id:
  4144. type: integer
  4145. fileUrl:
  4146. type: string
  4147. format: url
  4148. strategy:
  4149. type: string
  4150. enum:
  4151. - manual
  4152. - most-views
  4153. - trending
  4154. - recently-added
  4155. size:
  4156. type: integer
  4157. createdAt:
  4158. type: string
  4159. format: date-time
  4160. updatedAt:
  4161. type: string
  4162. format: date-time
  4163. expiresOn:
  4164. type: string
  4165. format: date-time
  4166. VideoRedundancy:
  4167. properties:
  4168. id:
  4169. type: integer
  4170. name:
  4171. type: string
  4172. url:
  4173. type: string
  4174. format: url
  4175. uuid:
  4176. type: string
  4177. format: uuid
  4178. example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
  4179. redundancies:
  4180. type: object
  4181. properties:
  4182. files:
  4183. type: array
  4184. items:
  4185. $ref: '#/components/schemas/FileRedundancyInformation'
  4186. streamingPlaylists:
  4187. type: array
  4188. items:
  4189. $ref: '#/components/schemas/FileRedundancyInformation'
  4190. VideoImportStateConstant:
  4191. properties:
  4192. id:
  4193. type: integer
  4194. enum:
  4195. - 1
  4196. - 2
  4197. - 3
  4198. description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
  4199. label:
  4200. type: string
  4201. example: Pending
  4202. VideoImport:
  4203. properties:
  4204. id:
  4205. type: integer
  4206. example: 2
  4207. targetUrl:
  4208. type: string
  4209. format: url
  4210. example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d
  4211. magnetUri:
  4212. type: string
  4213. format: uri
  4214. example: magnet:?xs=https%3A%2F%2Fframatube.org%2Fstatic%2Ftorrents%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.torrent&xt=urn:btih:38b4747ff788b30bf61f59d1965cd38f9e48e01f&dn=What+is+PeerTube%3F&tr=wss%3A%2F%2Fframatube.org%2Ftracker%2Fsocket&tr=https%3A%2F%2Fframatube.org%2Ftracker%2Fannounce&ws=https%3A%2F%2Fframatube.org%2Fstatic%2Fwebseed%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.mp4
  4215. torrentName:
  4216. type: string
  4217. state:
  4218. $ref: '#/components/schemas/VideoImportStateConstant'
  4219. error:
  4220. type: string
  4221. createdAt:
  4222. type: string
  4223. format: date-time
  4224. updatedAt:
  4225. type: string
  4226. format: date-time
  4227. video:
  4228. $ref: '#/components/schemas/Video'
  4229. Abuse:
  4230. properties:
  4231. id:
  4232. type: integer
  4233. example: 7
  4234. reason:
  4235. type: string
  4236. example: The video is a spam
  4237. predefinedReasons:
  4238. $ref: '#/components/schemas/AbusePredefinedReasons'
  4239. reporterAccount:
  4240. $ref: '#/components/schemas/Account'
  4241. state:
  4242. $ref: '#/components/schemas/AbuseStateConstant'
  4243. moderationComment:
  4244. type: string
  4245. example: Decided to ban the server since it spams us regularly
  4246. video:
  4247. type: object
  4248. properties:
  4249. id:
  4250. type: integer
  4251. name:
  4252. type: string
  4253. uuid:
  4254. type: string
  4255. format: uuid
  4256. example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
  4257. createdAt:
  4258. type: string
  4259. format: date-time
  4260. AbuseMessage:
  4261. properties:
  4262. id:
  4263. type: integer
  4264. message:
  4265. type: string
  4266. byModerator:
  4267. type: boolean
  4268. createdAt:
  4269. type: string
  4270. format: date-time
  4271. account:
  4272. $ref: '#/components/schemas/AccountSummary'
  4273. VideoBlacklist:
  4274. properties:
  4275. id:
  4276. type: integer
  4277. videoId:
  4278. type: integer
  4279. createdAt:
  4280. type: string
  4281. format: date-time
  4282. updatedAt:
  4283. type: string
  4284. format: date-time
  4285. name:
  4286. type: string
  4287. uuid:
  4288. type: string
  4289. format: uuid
  4290. example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
  4291. description:
  4292. type: string
  4293. duration:
  4294. type: integer
  4295. views:
  4296. type: integer
  4297. likes:
  4298. type: integer
  4299. dislikes:
  4300. type: integer
  4301. nsfw:
  4302. type: boolean
  4303. VideoChannel:
  4304. properties:
  4305. displayName:
  4306. type: string
  4307. description:
  4308. type: string
  4309. isLocal:
  4310. type: boolean
  4311. ownerAccount:
  4312. type: object
  4313. properties:
  4314. id:
  4315. type: integer
  4316. uuid:
  4317. type: string
  4318. format: uuid
  4319. example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
  4320. VideoPlaylist:
  4321. properties:
  4322. id:
  4323. type: integer
  4324. createdAt:
  4325. type: string
  4326. format: date-time
  4327. updatedAt:
  4328. type: string
  4329. format: date-time
  4330. description:
  4331. type: string
  4332. uuid:
  4333. type: string
  4334. format: uuid
  4335. example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
  4336. displayName:
  4337. type: string
  4338. isLocal:
  4339. type: boolean
  4340. videoLength:
  4341. type: integer
  4342. thumbnailPath:
  4343. type: string
  4344. privacy:
  4345. $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
  4346. type:
  4347. $ref: '#/components/schemas/VideoPlaylistTypeConstant'
  4348. ownerAccount:
  4349. $ref: '#/components/schemas/AccountSummary'
  4350. videoChannel:
  4351. $ref: '#/components/schemas/VideoChannelSummary'
  4352. VideoComment:
  4353. properties:
  4354. id:
  4355. type: integer
  4356. url:
  4357. type: string
  4358. format: url
  4359. text:
  4360. type: string
  4361. threadId:
  4362. type: integer
  4363. inReplyToCommentId:
  4364. type: integer
  4365. videoId:
  4366. type: integer
  4367. createdAt:
  4368. type: string
  4369. format: date-time
  4370. updatedAt:
  4371. type: string
  4372. format: date-time
  4373. totalRepliesFromVideoAuthor:
  4374. type: integer
  4375. totalReplies:
  4376. type: integer
  4377. account:
  4378. $ref: '#/components/schemas/Account'
  4379. VideoCommentThreadTree:
  4380. properties:
  4381. comment:
  4382. $ref: '#/components/schemas/VideoComment'
  4383. children:
  4384. type: array
  4385. items:
  4386. $ref: '#/components/schemas/VideoCommentThreadTree'
  4387. VideoCaption:
  4388. properties:
  4389. language:
  4390. $ref: '#/components/schemas/VideoConstantString'
  4391. captionPath:
  4392. type: string
  4393. Avatar:
  4394. properties:
  4395. path:
  4396. type: string
  4397. createdAt:
  4398. type: string
  4399. format: date-time
  4400. updatedAt:
  4401. type: string
  4402. format: date-time
  4403. ActorInfo:
  4404. properties:
  4405. id:
  4406. type: integer
  4407. example: 11
  4408. name:
  4409. type: string
  4410. displayName:
  4411. type: string
  4412. host:
  4413. type: string
  4414. format: hostname
  4415. avatar:
  4416. nullable: true
  4417. type: object
  4418. properties:
  4419. path:
  4420. type: string
  4421. Actor:
  4422. properties:
  4423. id:
  4424. type: integer
  4425. example: 11
  4426. url:
  4427. type: string
  4428. format: url
  4429. name:
  4430. type: string
  4431. host:
  4432. type: string
  4433. format: hostname
  4434. followingCount:
  4435. type: integer
  4436. followersCount:
  4437. type: integer
  4438. createdAt:
  4439. type: string
  4440. format: date-time
  4441. updatedAt:
  4442. type: string
  4443. format: date-time
  4444. avatar:
  4445. $ref: '#/components/schemas/Avatar'
  4446. Account:
  4447. allOf:
  4448. - $ref: '#/components/schemas/Actor'
  4449. - properties:
  4450. userId:
  4451. type: string
  4452. example: 2
  4453. displayName:
  4454. type: string
  4455. description:
  4456. type: string
  4457. UserWatchingVideo:
  4458. properties:
  4459. currentTime:
  4460. type: integer
  4461. description: timestamp within the video, in seconds
  4462. example: 5
  4463. ServerConfig:
  4464. properties:
  4465. instance:
  4466. type: object
  4467. properties:
  4468. name:
  4469. type: string
  4470. shortDescription:
  4471. type: string
  4472. defaultClientRoute:
  4473. type: string
  4474. isNSFW:
  4475. type: boolean
  4476. defaultNSFWPolicy:
  4477. type: string
  4478. customizations:
  4479. type: object
  4480. properties:
  4481. javascript:
  4482. type: string
  4483. css:
  4484. type: string
  4485. search:
  4486. type: object
  4487. properties:
  4488. remoteUri:
  4489. type: object
  4490. properties:
  4491. users:
  4492. type: boolean
  4493. anonymous:
  4494. type: boolean
  4495. plugin:
  4496. type: object
  4497. properties:
  4498. registered:
  4499. type: array
  4500. items:
  4501. type: string
  4502. theme:
  4503. type: object
  4504. properties:
  4505. registered:
  4506. type: array
  4507. items:
  4508. type: string
  4509. email:
  4510. type: object
  4511. properties:
  4512. enabled:
  4513. type: boolean
  4514. contactForm:
  4515. type: object
  4516. properties:
  4517. enabled:
  4518. type: boolean
  4519. serverVersion:
  4520. type: string
  4521. serverCommit:
  4522. type: string
  4523. signup:
  4524. type: object
  4525. properties:
  4526. allowed:
  4527. type: boolean
  4528. allowedForCurrentIP:
  4529. type: boolean
  4530. requiresEmailVerification:
  4531. type: boolean
  4532. transcoding:
  4533. type: object
  4534. properties:
  4535. hls:
  4536. type: object
  4537. properties:
  4538. enabled:
  4539. type: boolean
  4540. webtorrent:
  4541. type: object
  4542. properties:
  4543. enabled:
  4544. type: boolean
  4545. enabledResolutions:
  4546. type: array
  4547. items:
  4548. type: integer
  4549. import:
  4550. type: object
  4551. properties:
  4552. videos:
  4553. type: object
  4554. properties:
  4555. http:
  4556. type: object
  4557. properties:
  4558. enabled:
  4559. type: boolean
  4560. torrent:
  4561. type: object
  4562. properties:
  4563. enabled:
  4564. type: boolean
  4565. autoBlacklist:
  4566. type: object
  4567. properties:
  4568. videos:
  4569. type: object
  4570. properties:
  4571. ofUsers:
  4572. type: object
  4573. properties:
  4574. enabled:
  4575. type: boolean
  4576. avatar:
  4577. type: object
  4578. properties:
  4579. file:
  4580. type: object
  4581. properties:
  4582. size:
  4583. type: object
  4584. properties:
  4585. max:
  4586. type: integer
  4587. extensions:
  4588. type: array
  4589. items:
  4590. type: string
  4591. video:
  4592. type: object
  4593. properties:
  4594. image:
  4595. type: object
  4596. properties:
  4597. extensions:
  4598. type: array
  4599. items:
  4600. type: string
  4601. size:
  4602. type: object
  4603. properties:
  4604. max:
  4605. type: integer
  4606. file:
  4607. type: object
  4608. properties:
  4609. extensions:
  4610. type: array
  4611. items:
  4612. type: string
  4613. videoCaption:
  4614. type: object
  4615. properties:
  4616. file:
  4617. type: object
  4618. properties:
  4619. size:
  4620. type: object
  4621. properties:
  4622. max:
  4623. type: integer
  4624. extensions:
  4625. type: array
  4626. items:
  4627. type: string
  4628. user:
  4629. type: object
  4630. properties:
  4631. videoQuota:
  4632. type: integer
  4633. videoQuotaDaily:
  4634. type: integer
  4635. trending:
  4636. type: object
  4637. properties:
  4638. videos:
  4639. type: object
  4640. properties:
  4641. intervalDays:
  4642. type: integer
  4643. tracker:
  4644. type: object
  4645. properties:
  4646. enabled:
  4647. type: boolean
  4648. followings:
  4649. type: object
  4650. properties:
  4651. instance:
  4652. type: object
  4653. properties:
  4654. autoFollowIndex:
  4655. type: object
  4656. properties:
  4657. indexUrl:
  4658. type: string
  4659. format: url
  4660. ServerConfigAbout:
  4661. properties:
  4662. instance:
  4663. type: object
  4664. properties:
  4665. name:
  4666. type: string
  4667. shortDescription:
  4668. type: string
  4669. description:
  4670. type: string
  4671. terms:
  4672. type: string
  4673. ServerConfigCustom:
  4674. properties:
  4675. instance:
  4676. type: object
  4677. properties:
  4678. name:
  4679. type: string
  4680. shortDescription:
  4681. type: string
  4682. description:
  4683. type: string
  4684. terms:
  4685. type: string
  4686. defaultClientRoute:
  4687. type: string
  4688. isNSFW:
  4689. type: boolean
  4690. defaultNSFWPolicy:
  4691. type: string
  4692. customizations:
  4693. type: object
  4694. properties:
  4695. javascript:
  4696. type: string
  4697. css:
  4698. type: string
  4699. theme:
  4700. type: object
  4701. properties:
  4702. default:
  4703. type: string
  4704. services:
  4705. type: object
  4706. properties:
  4707. twitter:
  4708. type: object
  4709. properties:
  4710. username:
  4711. type: string
  4712. whitelisted:
  4713. type: boolean
  4714. cache:
  4715. type: object
  4716. properties:
  4717. previews:
  4718. type: object
  4719. properties:
  4720. size:
  4721. type: integer
  4722. captions:
  4723. type: object
  4724. properties:
  4725. size:
  4726. type: integer
  4727. signup:
  4728. type: object
  4729. properties:
  4730. enabled:
  4731. type: boolean
  4732. limit:
  4733. type: integer
  4734. requiresEmailVerification:
  4735. type: boolean
  4736. admin:
  4737. type: object
  4738. properties:
  4739. email:
  4740. type: string
  4741. format: email
  4742. contactForm:
  4743. type: object
  4744. properties:
  4745. enabled:
  4746. type: boolean
  4747. user:
  4748. type: object
  4749. properties:
  4750. videoQuota:
  4751. type: integer
  4752. videoQuotaDaily:
  4753. type: integer
  4754. transcoding:
  4755. type: object
  4756. properties:
  4757. enabled:
  4758. type: boolean
  4759. allowAdditionalExtensions:
  4760. type: boolean
  4761. allowAudioFiles:
  4762. type: boolean
  4763. threads:
  4764. type: integer
  4765. resolutions:
  4766. type: object
  4767. properties:
  4768. 240p:
  4769. type: boolean
  4770. 360p:
  4771. type: boolean
  4772. 480p:
  4773. type: boolean
  4774. 720p:
  4775. type: boolean
  4776. 1080p:
  4777. type: boolean
  4778. 1440p:
  4779. type: boolean
  4780. 2160p:
  4781. type: boolean
  4782. hls:
  4783. type: object
  4784. properties:
  4785. enabled:
  4786. type: boolean
  4787. import:
  4788. type: object
  4789. properties:
  4790. videos:
  4791. type: object
  4792. properties:
  4793. http:
  4794. type: object
  4795. properties:
  4796. enabled:
  4797. type: boolean
  4798. torrent:
  4799. type: object
  4800. properties:
  4801. enabled:
  4802. type: boolean
  4803. autoBlacklist:
  4804. type: object
  4805. properties:
  4806. videos:
  4807. type: object
  4808. properties:
  4809. ofUsers:
  4810. type: object
  4811. properties:
  4812. enabled:
  4813. type: boolean
  4814. followers:
  4815. type: object
  4816. properties:
  4817. instance:
  4818. type: object
  4819. properties:
  4820. enabled:
  4821. type: boolean
  4822. manualApproval:
  4823. type: boolean
  4824. Follow:
  4825. properties:
  4826. id:
  4827. type: integer
  4828. follower:
  4829. $ref: '#/components/schemas/Actor'
  4830. following:
  4831. $ref: '#/components/schemas/Actor'
  4832. score:
  4833. type: number
  4834. description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`.
  4835. state:
  4836. type: string
  4837. enum:
  4838. - pending
  4839. - accepted
  4840. createdAt:
  4841. type: string
  4842. format: date-time
  4843. updatedAt:
  4844. type: string
  4845. format: date-time
  4846. PredefinedAbuseReasons:
  4847. description: Reason categories that help triage reports
  4848. type: array
  4849. items:
  4850. type: string
  4851. enum:
  4852. - violentOrAbusive
  4853. - hatefulOrAbusive
  4854. - spamOrMisleading
  4855. - privacy
  4856. - rights
  4857. - serverRules
  4858. - thumbnails
  4859. - captions
  4860. Job:
  4861. properties:
  4862. id:
  4863. type: integer
  4864. minimum: 0
  4865. example: 42
  4866. state:
  4867. type: string
  4868. enum:
  4869. - active
  4870. - completed
  4871. - failed
  4872. - waiting
  4873. - delayed
  4874. type:
  4875. type: string
  4876. enum:
  4877. - activitypub-http-unicast
  4878. - activitypub-http-broadcast
  4879. - activitypub-http-fetcher
  4880. - activitypub-follow
  4881. - video-file-import
  4882. - video-transcoding
  4883. - email
  4884. - video-import
  4885. - videos-views
  4886. - activitypub-refresher
  4887. - video-redundancy
  4888. data:
  4889. type: object
  4890. additionalProperties: true
  4891. error:
  4892. type: object
  4893. additionalProperties: true
  4894. createdAt:
  4895. type: string
  4896. format: date-time
  4897. finishedOn:
  4898. type: string
  4899. format: date-time
  4900. processedOn:
  4901. type: string
  4902. format: date-time
  4903. AddUserResponse:
  4904. properties:
  4905. user:
  4906. type: object
  4907. properties:
  4908. id:
  4909. type: integer
  4910. example: 8
  4911. account:
  4912. type: object
  4913. properties:
  4914. id:
  4915. type: integer
  4916. example: 37
  4917. VideoUploadResponse:
  4918. properties:
  4919. video:
  4920. type: object
  4921. properties:
  4922. id:
  4923. type: integer
  4924. example: 8
  4925. uuid:
  4926. type: string
  4927. format: uuid
  4928. example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
  4929. CommentThreadResponse:
  4930. properties:
  4931. total:
  4932. type: integer
  4933. example: 1
  4934. data:
  4935. type: array
  4936. maxItems: 100
  4937. items:
  4938. $ref: '#/components/schemas/VideoComment'
  4939. CommentThreadPostResponse:
  4940. properties:
  4941. comment:
  4942. $ref: '#/components/schemas/VideoComment'
  4943. VideoListResponse:
  4944. properties:
  4945. total:
  4946. type: integer
  4947. example: 1
  4948. data:
  4949. type: array
  4950. maxItems: 100
  4951. items:
  4952. $ref: '#/components/schemas/Video'
  4953. User:
  4954. properties:
  4955. id:
  4956. type: integer
  4957. readOnly: true
  4958. username:
  4959. type: string
  4960. description: The user username
  4961. minLength: 1
  4962. maxLength: 50
  4963. email:
  4964. type: string
  4965. format: email
  4966. description: The user email
  4967. theme:
  4968. type: string
  4969. description: Theme enabled by this user
  4970. emailVerified:
  4971. type: boolean
  4972. description: Has the user confirmed their email address?
  4973. nsfwPolicy:
  4974. $ref: '#/components/schemas/NSFWPolicy'
  4975. webtorrentEnabled:
  4976. type: boolean
  4977. description: Enable P2P in the player
  4978. autoPlayVideo:
  4979. type: boolean
  4980. description: Automatically start playing the video on the watch page
  4981. role:
  4982. $ref: '#/components/schemas/UserRole'
  4983. roleLabel:
  4984. type: string
  4985. enum:
  4986. - User
  4987. - Moderator
  4988. - Administrator
  4989. videoQuota:
  4990. type: integer
  4991. description: The user video quota
  4992. videoQuotaDaily:
  4993. type: integer
  4994. description: The user daily video quota
  4995. videosCount:
  4996. type: integer
  4997. abusesCount:
  4998. type: integer
  4999. abusesAcceptedCount:
  5000. type: integer
  5001. abusesCreatedCount:
  5002. type: integer
  5003. videoCommentsCount:
  5004. type: integer
  5005. noInstanceConfigWarningModal:
  5006. type: boolean
  5007. noWelcomeModal:
  5008. type: boolean
  5009. blocked:
  5010. type: boolean
  5011. blockedReason:
  5012. type: string
  5013. createdAt:
  5014. type: string
  5015. account:
  5016. $ref: '#/components/schemas/Account'
  5017. videoChannels:
  5018. type: array
  5019. items:
  5020. $ref: '#/components/schemas/VideoChannel'
  5021. AddUser:
  5022. properties:
  5023. username:
  5024. type: string
  5025. description: The user username
  5026. minLength: 1
  5027. maxLength: 50
  5028. password:
  5029. type: string
  5030. format: password
  5031. description: The user password. If the smtp server is configured, you can leave empty and an email will be sent
  5032. minLength: 6
  5033. maxLength: 255
  5034. email:
  5035. type: string
  5036. format: email
  5037. description: The user email
  5038. videoQuota:
  5039. type: integer
  5040. description: The user video quota
  5041. videoQuotaDaily:
  5042. type: integer
  5043. description: The user daily video quota
  5044. role:
  5045. $ref: '#/components/schemas/UserRole'
  5046. required:
  5047. - username
  5048. - password
  5049. - email
  5050. - videoQuota
  5051. - videoQuotaDaily
  5052. - role
  5053. UpdateUser:
  5054. properties:
  5055. id:
  5056. type: string
  5057. description: The user id
  5058. email:
  5059. type: string
  5060. format: email
  5061. description: The updated email of the user
  5062. videoQuota:
  5063. type: integer
  5064. description: The updated video quota of the user
  5065. videoQuotaDaily:
  5066. type: integer
  5067. description: The updated daily video quota of the user
  5068. role:
  5069. $ref: '#/components/schemas/UserRole'
  5070. required:
  5071. - id
  5072. - email
  5073. - videoQuota
  5074. - videoQuotaDaily
  5075. - role
  5076. UpdateMe:
  5077. properties:
  5078. password:
  5079. type: string
  5080. format: password
  5081. description: Your new password
  5082. minLength: 6
  5083. maxLength: 255
  5084. email:
  5085. type: string
  5086. format: email
  5087. description: Your new email
  5088. displayNSFW:
  5089. type: string
  5090. description: Your new displayNSFW
  5091. enum:
  5092. - 'true'
  5093. - 'false'
  5094. - both
  5095. autoPlayVideo:
  5096. type: boolean
  5097. description: Your new autoPlayVideo
  5098. required:
  5099. - password
  5100. - email
  5101. - displayNSFW
  5102. - autoPlayVideo
  5103. GetMeVideoRating:
  5104. properties:
  5105. id:
  5106. type: string
  5107. description: Id of the video
  5108. rating:
  5109. type: number
  5110. description: Rating of the video
  5111. required:
  5112. - id
  5113. - rating
  5114. VideoRating:
  5115. properties:
  5116. video:
  5117. $ref: '#/components/schemas/Video'
  5118. rating:
  5119. type: number
  5120. description: 'Rating of the video'
  5121. required:
  5122. - video
  5123. - rating
  5124. RegisterUser:
  5125. properties:
  5126. username:
  5127. type: string
  5128. description: The username of the user
  5129. minLength: 1
  5130. maxLength: 50
  5131. pattern: '/^[a-z0-9._]{1,50}$/'
  5132. password:
  5133. type: string
  5134. format: password
  5135. description: The password of the user
  5136. minLength: 6
  5137. maxLength: 255
  5138. email:
  5139. type: string
  5140. format: email
  5141. description: The email of the user
  5142. displayName:
  5143. type: string
  5144. description: The user display name
  5145. minLength: 1
  5146. maxLength: 120
  5147. channel:
  5148. type: object
  5149. properties:
  5150. name:
  5151. type: string
  5152. description: The username for the default channel
  5153. pattern: '/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.:]+$/'
  5154. displayName:
  5155. type: string
  5156. description: The display name for the default channel
  5157. minLength: 1
  5158. maxLength: 120
  5159. required:
  5160. - username
  5161. - password
  5162. - email
  5163. VideoChannelCreate:
  5164. properties:
  5165. name:
  5166. type: string
  5167. displayName:
  5168. type: string
  5169. description:
  5170. type: string
  5171. support:
  5172. type: string
  5173. description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
  5174. example: Please support my work on <insert crowdfunding plateform>! <3
  5175. required:
  5176. - name
  5177. - displayName
  5178. VideoChannelUpdate:
  5179. properties:
  5180. displayName:
  5181. type: string
  5182. description:
  5183. type: string
  5184. support:
  5185. type: string
  5186. description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
  5187. example: Please support my work on <insert crowdfunding plateform>! <3
  5188. bulkVideosSupportUpdate:
  5189. type: boolean
  5190. description: 'Update the support field for all videos of this channel'
  5191. MRSSPeerLink:
  5192. type: object
  5193. xml:
  5194. name: 'media:peerLink'
  5195. properties:
  5196. href:
  5197. type: string
  5198. xml:
  5199. attribute: true
  5200. type:
  5201. type: string
  5202. enum:
  5203. - application/x-bittorrent
  5204. xml:
  5205. attribute: true
  5206. MRSSGroupContent:
  5207. type: object
  5208. xml:
  5209. name: 'media:content'
  5210. properties:
  5211. url:
  5212. type: string
  5213. format: url
  5214. xml:
  5215. attribute: true
  5216. fileSize:
  5217. type: integer
  5218. xml:
  5219. attribute: true
  5220. type:
  5221. type: string
  5222. xml:
  5223. attribute: true
  5224. framerate:
  5225. type: integer
  5226. xml:
  5227. attribute: true
  5228. duration:
  5229. type: integer
  5230. xml:
  5231. attribute: true
  5232. height:
  5233. type: integer
  5234. xml:
  5235. attribute: true
  5236. lang:
  5237. type: string
  5238. xml:
  5239. attribute: true
  5240. VideoCommentsForXML:
  5241. type: array
  5242. xml:
  5243. wrapped: true
  5244. name: 'channel'
  5245. items:
  5246. type: object
  5247. xml:
  5248. name: 'item'
  5249. properties:
  5250. link:
  5251. type: string
  5252. format: url
  5253. guid:
  5254. type: string
  5255. pubDate:
  5256. type: string
  5257. format: date-time
  5258. 'content:encoded':
  5259. type: string
  5260. 'dc:creator':
  5261. type: string
  5262. VideosForXML:
  5263. type: array
  5264. xml:
  5265. wrapped: true
  5266. name: 'channel'
  5267. items:
  5268. type: object
  5269. xml:
  5270. name: 'item'
  5271. properties:
  5272. link:
  5273. type: string
  5274. format: url
  5275. description: video watch page URL
  5276. guid:
  5277. type: string
  5278. description: video canonical URL
  5279. pubDate:
  5280. type: string
  5281. format: date-time
  5282. description: video publication date
  5283. description:
  5284. type: string
  5285. description: video description
  5286. 'content:encoded':
  5287. type: string
  5288. description: video description
  5289. 'dc:creator':
  5290. type: string
  5291. description: publisher user name
  5292. 'media:category':
  5293. type: integer
  5294. description: video category (MRSS)
  5295. 'media:community':
  5296. type: object
  5297. description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
  5298. properties:
  5299. 'media:statistics':
  5300. type: object
  5301. properties:
  5302. views:
  5303. type: integer
  5304. xml:
  5305. attribute: true
  5306. 'media:embed':
  5307. type: object
  5308. properties:
  5309. url:
  5310. type: string
  5311. format: url
  5312. description: video embed path, relative to the canonical URL domain (MRSS)
  5313. xml:
  5314. attribute: true
  5315. 'media:player':
  5316. type: object
  5317. properties:
  5318. url:
  5319. type: string
  5320. format: url
  5321. description: video watch path, relative to the canonical URL domain (MRSS)
  5322. xml:
  5323. attribute: true
  5324. 'media:thumbnail':
  5325. type: object
  5326. properties:
  5327. url:
  5328. type: string
  5329. format: url
  5330. xml:
  5331. attribute: true
  5332. height:
  5333. type: integer
  5334. xml:
  5335. attribute: true
  5336. width:
  5337. type: integer
  5338. xml:
  5339. attribute: true
  5340. 'media:title':
  5341. type: string
  5342. description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
  5343. 'media:description':
  5344. type: string
  5345. 'media:rating':
  5346. type: string
  5347. enum:
  5348. - nonadult
  5349. - adult
  5350. description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
  5351. 'enclosure':
  5352. type: object
  5353. description: main streamable file for the video
  5354. properties:
  5355. url:
  5356. type: string
  5357. format: url
  5358. xml:
  5359. attribute: true
  5360. type:
  5361. type: string
  5362. enum:
  5363. - application/x-bittorrent
  5364. xml:
  5365. attribute: true
  5366. length:
  5367. type: integer
  5368. xml:
  5369. attribute: true
  5370. 'media:group':
  5371. type: array
  5372. description: list of streamable files for the video. see [media:peerLink](https://www.rssboard.org/media-rss#media-peerlink) and [media:content](https://www.rssboard.org/media-rss#media-content) or (MRSS)
  5373. items:
  5374. anyOf:
  5375. - $ref: '#/components/schemas/MRSSPeerLink'
  5376. - $ref: '#/components/schemas/MRSSGroupContent'
  5377. NotificationSettingValue:
  5378. type: integer
  5379. description: >
  5380. Notification type
  5381. - `0` NONE
  5382. - `1` WEB
  5383. - `2` EMAIL
  5384. enum:
  5385. - 0
  5386. - 1
  5387. - 3
  5388. Notification:
  5389. properties:
  5390. id:
  5391. type: integer
  5392. type:
  5393. type: integer
  5394. description: >
  5395. Notification type, following the `UserNotificationType` enum:
  5396. - `1` NEW_VIDEO_FROM_SUBSCRIPTION
  5397. - `2` NEW_COMMENT_ON_MY_VIDEO
  5398. - `3` NEW_ABUSE_FOR_MODERATORS
  5399. - `4` BLACKLIST_ON_MY_VIDEO
  5400. - `5` UNBLACKLIST_ON_MY_VIDEO
  5401. - `6` MY_VIDEO_PUBLISHED
  5402. - `7` MY_VIDEO_IMPORT_SUCCESS
  5403. - `8` MY_VIDEO_IMPORT_ERROR
  5404. - `9` NEW_USER_REGISTRATION
  5405. - `10` NEW_FOLLOW
  5406. - `11` COMMENT_MENTION
  5407. - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
  5408. - `13` NEW_INSTANCE_FOLLOWER
  5409. - `14` AUTO_INSTANCE_FOLLOWING
  5410. read:
  5411. type: boolean
  5412. video:
  5413. nullable: true
  5414. allOf:
  5415. - $ref: '#/components/schemas/VideoInfo'
  5416. - type: object
  5417. properties:
  5418. channel:
  5419. $ref: '#/components/schemas/ActorInfo'
  5420. videoImport:
  5421. nullable: true
  5422. type: object
  5423. properties:
  5424. id:
  5425. type: integer
  5426. video:
  5427. nullable: true
  5428. $ref: '#/components/schemas/VideoInfo'
  5429. torrentName:
  5430. type: string
  5431. nullable: true
  5432. magnetUri:
  5433. type: string
  5434. format: uri
  5435. nullable: true
  5436. targetUri:
  5437. type: string
  5438. format: uri
  5439. nullable: true
  5440. comment:
  5441. nullable: true
  5442. type: object
  5443. properties:
  5444. id:
  5445. type: integer
  5446. threadId:
  5447. type: integer
  5448. video:
  5449. $ref: '#/components/schemas/VideoInfo'
  5450. account:
  5451. $ref: '#/components/schemas/ActorInfo'
  5452. videoAbuse:
  5453. nullable: true
  5454. type: object
  5455. properties:
  5456. id:
  5457. type: integer
  5458. video:
  5459. allOf:
  5460. - $ref: '#/components/schemas/VideoInfo'
  5461. videoBlacklist:
  5462. nullable: true
  5463. type: object
  5464. properties:
  5465. id:
  5466. type: integer
  5467. video:
  5468. allOf:
  5469. - $ref: '#/components/schemas/VideoInfo'
  5470. account:
  5471. nullable: true
  5472. allOf:
  5473. - $ref: '#/components/schemas/ActorInfo'
  5474. actorFollow:
  5475. type: object
  5476. nullable: true
  5477. properties:
  5478. id:
  5479. type: integer
  5480. follower:
  5481. $ref: '#/components/schemas/ActorInfo'
  5482. state:
  5483. type: string
  5484. enum:
  5485. - pending
  5486. - accepted
  5487. following:
  5488. type: object
  5489. properties:
  5490. type:
  5491. type: string
  5492. enum:
  5493. - account
  5494. - channel
  5495. - instance
  5496. name:
  5497. type: string
  5498. displayName:
  5499. type: string
  5500. host:
  5501. type: string
  5502. format: hostname
  5503. createdAt:
  5504. type: string
  5505. format: date-time
  5506. updatedAt:
  5507. type: string
  5508. format: date-time
  5509. NotificationListResponse:
  5510. properties:
  5511. total:
  5512. type: integer
  5513. example: 1
  5514. data:
  5515. type: array
  5516. maxItems: 100
  5517. items:
  5518. $ref: '#/components/schemas/Notification'
  5519. Plugin:
  5520. properties:
  5521. name:
  5522. type: string
  5523. example: peertube-plugin-auth-ldap
  5524. type:
  5525. type: integer
  5526. description: >
  5527. - `1`: PLUGIN
  5528. - `2`: THEME
  5529. enum:
  5530. - 1
  5531. - 2
  5532. latestVersion:
  5533. type: string
  5534. example: 0.0.3
  5535. version:
  5536. type: string
  5537. example: 0.0.1
  5538. enabled:
  5539. type: boolean
  5540. uninstalled:
  5541. type: boolean
  5542. peertubeEngine:
  5543. type: string
  5544. example: 2.2.0
  5545. description:
  5546. type: string
  5547. homepage:
  5548. type: string
  5549. format: url
  5550. example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap
  5551. settings:
  5552. type: object
  5553. additionalProperties: true
  5554. createdAt:
  5555. type: string
  5556. format: date-time
  5557. updatedAt:
  5558. type: string
  5559. format: date-time
  5560. PluginResponse:
  5561. properties:
  5562. total:
  5563. type: integer
  5564. example: 1
  5565. data:
  5566. type: array
  5567. maxItems: 100
  5568. items:
  5569. $ref: '#/components/schemas/Plugin'
  5570. LiveVideoUpdate:
  5571. properties:
  5572. saveReplay:
  5573. type: boolean
  5574. permanentLive:
  5575. description: User can stream multiple times in a permanent live
  5576. type: boolean
  5577. LiveVideoResponse:
  5578. properties:
  5579. rtmpUrl:
  5580. type: string
  5581. streamKey:
  5582. type: string
  5583. description: RTMP stream key to use to stream into this live video
  5584. saveReplay:
  5585. type: boolean
  5586. permanentLive:
  5587. description: User can stream multiple times in a permanent live
  5588. type: boolean
  5589. callbacks:
  5590. searchIndex:
  5591. 'https://search.example.org/api/v1/search/videos':
  5592. post:
  5593. summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget`
  5594. responses:
  5595. '200':
  5596. description: successful operation
  5597. content:
  5598. application/json:
  5599. schema:
  5600. $ref: '#/components/schemas/VideoListResponse'