peertube.yaml 217 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509
  1. openapi: 3.0.0
  2. info:
  3. title: PeerTube
  4. version: 4.0.0
  5. contact:
  6. name: PeerTube Community
  7. url: https://joinpeertube.org
  8. license:
  9. name: AGPLv3.0
  10. url: https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE
  11. x-logo:
  12. url: https://joinpeertube.org/img/brand.png
  13. altText: PeerTube Project Homepage
  14. description: |
  15. The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite
  16. HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with
  17. [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
  18. which generates a client SDK in the language of your choice - we generate some client SDKs automatically:
  19. - [Python](https://framagit.org/framasoft/peertube/clients/python)
  20. - [Go](https://framagit.org/framasoft/peertube/clients/go)
  21. - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin)
  22. See the [REST API quick start](https://docs.joinpeertube.org/api-rest-getting-started) for a few
  23. examples of using the PeerTube API.
  24. # Authentication
  25. When you sign up for an account on a PeerTube instance, you are given the possibility
  26. to generate sessions on it, and authenticate there using an access token. Only __one
  27. access token can 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, completed by a [RFC7807-compliant](https://tools.ietf.org/html/rfc7807) response body.
  34. ```
  35. HTTP 1.1 404 Not Found
  36. Content-Type: application/problem+json; charset=utf-8
  37. {
  38. "detail": "Video not found",
  39. "docs": "https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo",
  40. "status": 404,
  41. "title": "Not Found",
  42. "type": "about:blank"
  43. }
  44. ```
  45. We provide error `type` values for [a growing number of cases](https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/server/server-error-code.enum.ts),
  46. but it is still optional. Types are used to disambiguate errors that bear the same status code
  47. and are non-obvious:
  48. ```
  49. HTTP 1.1 403 Forbidden
  50. Content-Type: application/problem+json; charset=utf-8
  51. {
  52. "detail": "Cannot get this video regarding follow constraints",
  53. "docs": "https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo",
  54. "status": 403,
  55. "title": "Forbidden",
  56. "type": "https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/does_not_respect_follow_constraints"
  57. }
  58. ```
  59. Here a 403 error could otherwise mean that the video is private or blocklisted.
  60. ### Validation errors
  61. Each parameter is evaluated on its own against a set of rules before the route validator
  62. proceeds with potential testing involving parameter combinations. Errors coming from validation
  63. errors appear earlier and benefit from a more detailed error description:
  64. ```
  65. HTTP 1.1 400 Bad Request
  66. Content-Type: application/problem+json; charset=utf-8
  67. {
  68. "detail": "Incorrect request parameters: id",
  69. "docs": "https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo",
  70. "instance": "/api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180",
  71. "invalid-params": {
  72. "id": {
  73. "location": "params",
  74. "msg": "Invalid value",
  75. "param": "id",
  76. "value": "9c9de5e8-0a1e-484a-b099-e80766180"
  77. }
  78. },
  79. "status": 400,
  80. "title": "Bad Request",
  81. "type": "about:blank"
  82. }
  83. ```
  84. Where `id` is the name of the field concerned by the error, within the route definition.
  85. `invalid-params.<field>.location` can be either 'params', 'body', 'header', 'query' or 'cookies', and
  86. `invalid-params.<field>.value` reports the value that didn't pass validation whose `invalid-params.<field>.msg`
  87. is about.
  88. ### Deprecated error fields
  89. Some fields could be included with previous versions. They are still included but their use is deprecated:
  90. - `error`: superseded by `detail`
  91. - `code`: superseded by `type` (which is now an URI)
  92. # Rate limits
  93. We are rate-limiting all endpoints of PeerTube's API. Custom values can be set by administrators:
  94. | Endpoint (prefix: `/api/v1`) | Calls | Time frame |
  95. |------------------------------|---------------|--------------|
  96. | `/*` | 50 | 10 seconds |
  97. | `POST /users/token` | 15 | 5 minutes |
  98. | `POST /users/register` | 2<sup>*</sup> | 5 minutes |
  99. | `POST /users/ask-send-verify-email` | 3 | 5 minutes |
  100. Depending on the endpoint, <sup>*</sup>failed requests are not taken into account. A service
  101. limit is announced by a `429 Too Many Requests` status code.
  102. You can get details about the current state of your rate limit by reading the
  103. following headers:
  104. | Header | Description |
  105. |-------------------------|------------------------------------------------------------|
  106. | `X-RateLimit-Limit` | Number of max requests allowed in the current time period |
  107. | `X-RateLimit-Remaining` | Number of remaining requests in the current time period |
  108. | `X-RateLimit-Reset` | Timestamp of end of current time period as UNIX timestamp |
  109. | `Retry-After` | Seconds to delay after the first `429` is received |
  110. # CORS
  111. This API features [Cross-Origin Resource Sharing (CORS)](https://fetch.spec.whatwg.org/),
  112. allowing cross-domain communication from the browser for some routes:
  113. | Endpoint |
  114. |------------------------- ---|
  115. | `/api/*` |
  116. | `/download/*` |
  117. | `/lazy-static/*` |
  118. | `/live/segments-sha256/*` |
  119. | `/.well-known/webfinger` |
  120. In addition, all routes serving ActivityPub are CORS-enabled for all origins.
  121. externalDocs:
  122. url: https://docs.joinpeertube.org/api-rest-reference.html
  123. tags:
  124. - name: Register
  125. description: |
  126. As a visitor, you can use this API to open an account (if registrations are open on
  127. that PeerTube instance). As an admin, you should use the dedicated [User creation
  128. API](#operation/addUser) instead.
  129. - name: Session
  130. x-displayName: Login/Logout
  131. description: |
  132. Sessions deal with access tokens over time. Only __one session token can currently be used at a time__.
  133. - name: Accounts
  134. description: >
  135. Accounts encompass remote accounts discovered across the federation,
  136. and correspond to the main Actor, along with video channels a user can create, which
  137. are also Actors.
  138. When a comment is posted, it is done with your Account's Actor.
  139. - name: Users
  140. description: >
  141. Using some features of PeerTube require authentication, for which User
  142. provide different levels of permission as well as associated user
  143. information. Each user has a corresponding local Account for federation.
  144. - name: My User
  145. description: >
  146. Operations related to your own User, when logged-in.
  147. - name: My Subscriptions
  148. description: >
  149. Operations related to your subscriptions to video channels, their
  150. new videos, and how to keep up to date with their latest publications!
  151. - name: My History
  152. description: >
  153. Operations related to your watch history.
  154. - name: My Notifications
  155. description: >
  156. Notifications following new videos, follows or reports. They allow you
  157. to keep track of the interactions and overall important information that
  158. concerns you. You MAY set per-notification type delivery preference, to
  159. receive the info either by mail, by in-browser notification or both.
  160. - name: Config
  161. description: >
  162. Each server exposes public information regarding supported videos and
  163. options.
  164. - name: Job
  165. description: >
  166. Jobs are long-running tasks enqueued and processed by the instance
  167. itself. No additional worker registration is currently available.
  168. - name: Instance Follows
  169. description: >
  170. Managing servers which the instance interacts with is crucial to the
  171. concept of federation in PeerTube and external video indexation. The PeerTube
  172. server then deals with inter-server ActivityPub operations and propagates
  173. information across its social graph by posting activities to actors' inbox
  174. endpoints.
  175. externalDocs:
  176. url: https://docs.joinpeertube.org/admin-following-instances?id=instances-follows
  177. - name: Instance Redundancy
  178. description: >
  179. Redundancy is part of the inter-server solidarity that PeerTube fosters.
  180. Manage the list of instances you wish to help by seeding their videos according
  181. to the policy of video selection of your choice. Note that you have a similar functionality
  182. to mirror individual videos, see [video mirroring](#tag/Video-Mirroring).
  183. externalDocs:
  184. url: https://docs.joinpeertube.org/admin-following-instances?id=instances-redundancy
  185. - name: Plugins
  186. description: >
  187. Managing plugins installed from a local path or from NPM, or search for new ones.
  188. externalDocs:
  189. url: https://docs.joinpeertube.org/api-plugins
  190. - name: Abuses
  191. description: |
  192. Abuses deal with reports of local or remote videos/comments/accounts alike.
  193. - name: Video
  194. description: |
  195. Operations dealing with listing, uploading, fetching or modifying videos.
  196. - name: Video Upload
  197. description: |
  198. Operations dealing with adding video or audio. PeerTube supports two upload modes, and three import modes.
  199. ### Upload
  200. - [_legacy_](#operation/uploadLegacy), where the video file is sent in a single request
  201. - [_resumable_](#operation/uploadResumableInit), where the video file is sent in chunks
  202. You can upload videos more reliably by using the resumable variant. Its protocol lets
  203. you resume an upload operation after a network interruption or other transmission failure,
  204. saving time and bandwidth in the event of network failures.
  205. Favor using resumable uploads in any of the following cases:
  206. - You are transferring large files
  207. - The likelihood of a network interruption is high
  208. - Uploads are originating from a device with a low-bandwidth or unstable Internet connection,
  209. such as a mobile device
  210. ### Import
  211. - _URL_-based: where the URL points to any service supported by [youtube-dl](https://ytdl-org.github.io/youtube-dl/)
  212. - _magnet_-based: where the URI resolves to a BitTorrent ressource containing a single supported video file
  213. - _torrent_-based: where the metainfo file resolves to a BitTorrent ressource containing a single supported video file
  214. The import function is practical when the desired video/audio is available online. It makes PeerTube
  215. download it for you, saving you as much bandwidth and avoiding any instability or limitation your network might have.
  216. - name: Video Imports
  217. description: Operations dealing with listing, adding and removing video imports.
  218. - name: Video Captions
  219. description: Operations dealing with listing, adding and removing closed captions of a video.
  220. - name: Video Channels
  221. description: Operations dealing with the creation, modification and listing of videos within a channel.
  222. - name: Video Comments
  223. description: >
  224. Operations dealing with comments to a video. Comments are organized in threads: adding a
  225. comment in response to the video starts a thread, adding a reply to a comment adds it to
  226. its root comment thread.
  227. - name: Video Blocks
  228. description: Operations dealing with blocking videos (removing them from view and preventing interactions).
  229. - name: Video Rates
  230. description: Like/dislike a video.
  231. - name: Video Playlists
  232. description: Operations dealing with playlists of videos. Playlists are bound to users and/or channels.
  233. - name: Video Files
  234. description: Operations on video files
  235. - name: Video Transcoding
  236. description: Video transcoding related operations
  237. - name: Feeds
  238. description: Server syndication feeds
  239. - name: Search
  240. description: |
  241. The search helps to find _videos_ or _channels_ from within the instance and beyond.
  242. Videos from other instances federated by the instance (that is, instances
  243. followed by the instance) can be found via keywords and other criteria of
  244. the advanced search.
  245. Administrators can also enable the use of a remote search system, indexing
  246. videos and channels not could be not federated by the instance.
  247. - name: Homepage
  248. description: Get and update the custom homepage
  249. - name: Video Mirroring
  250. description: |
  251. PeerTube instances can mirror videos from one another, and help distribute some videos.
  252. For importing videos as your own, refer to [video imports](#operation/importVideo).
  253. x-tagGroups:
  254. - name: Auth
  255. tags:
  256. - Register
  257. - Session
  258. - name: Accounts
  259. tags:
  260. - Accounts
  261. - Users
  262. - My User
  263. - My Subscriptions
  264. - My Notifications
  265. - My History
  266. - name: Videos
  267. tags:
  268. - Video
  269. - Video Upload
  270. - Video Imports
  271. - Video Captions
  272. - Video Channels
  273. - Video Comments
  274. - Video Rates
  275. - Video Playlists
  276. - Video Ownership Change
  277. - Video Mirroring
  278. - Video Files
  279. - Video Transcoding
  280. - Live Videos
  281. - Feeds
  282. - name: Search
  283. tags:
  284. - Search
  285. - name: Custom pages
  286. tags:
  287. - Homepage
  288. - name: Moderation
  289. tags:
  290. - Abuses
  291. - Video Blocks
  292. - Account Blocks
  293. - Server Blocks
  294. - name: Instance Configuration
  295. tags:
  296. - Config
  297. - Instance Follows
  298. - Instance Redundancy
  299. - Plugins
  300. - name: Jobs
  301. tags:
  302. - Job
  303. paths:
  304. '/accounts/{name}':
  305. get:
  306. tags:
  307. - Accounts
  308. summary: Get an account
  309. operationId: getAccount
  310. parameters:
  311. - $ref: '#/components/parameters/name'
  312. responses:
  313. '200':
  314. description: successful operation
  315. content:
  316. application/json:
  317. schema:
  318. $ref: '#/components/schemas/Account'
  319. '404':
  320. description: account not found
  321. '/accounts/{name}/videos':
  322. get:
  323. tags:
  324. - Accounts
  325. - Video
  326. summary: 'List videos of an account'
  327. operationId: getAccountVideos
  328. parameters:
  329. - $ref: '#/components/parameters/name'
  330. - $ref: '#/components/parameters/categoryOneOf'
  331. - $ref: '#/components/parameters/isLive'
  332. - $ref: '#/components/parameters/tagsOneOf'
  333. - $ref: '#/components/parameters/tagsAllOf'
  334. - $ref: '#/components/parameters/licenceOneOf'
  335. - $ref: '#/components/parameters/languageOneOf'
  336. - $ref: '#/components/parameters/nsfw'
  337. - $ref: '#/components/parameters/isLocal'
  338. - $ref: '#/components/parameters/include'
  339. - $ref: '#/components/parameters/privacyOneOf'
  340. - $ref: '#/components/parameters/hasHLSFiles'
  341. - $ref: '#/components/parameters/hasWebtorrentFiles'
  342. - $ref: '#/components/parameters/skipCount'
  343. - $ref: '#/components/parameters/start'
  344. - $ref: '#/components/parameters/count'
  345. - $ref: '#/components/parameters/videosSort'
  346. responses:
  347. '200':
  348. description: successful operation
  349. content:
  350. application/json:
  351. schema:
  352. $ref: '#/components/schemas/VideoListResponse'
  353. x-codeSamples:
  354. - lang: JavaScript
  355. source: |
  356. fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
  357. .then(function(response) {
  358. return response.json()
  359. }).then(function(data) {
  360. console.log(data)
  361. })
  362. - lang: Shell
  363. source: |
  364. ## DEPENDENCIES: jq
  365. curl -s https://peertube2.cpy.re/api/v1/accounts/{name}/videos | jq
  366. - lang: Ruby
  367. source: |
  368. require 'net/http'
  369. require 'json'
  370. uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
  371. http = Net::HTTP.new(uri.host, uri.port)
  372. http.use_ssl = true
  373. response = http.get(uri.request_uri)
  374. puts JSON.parse(response.read_body)
  375. - lang: Python
  376. source: |
  377. import requests
  378. r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
  379. json = r.json()
  380. print(json)
  381. '/accounts/{name}/followers':
  382. get:
  383. tags:
  384. - Accounts
  385. summary: 'List followers of an account'
  386. security:
  387. - OAuth2: []
  388. operationId: getAccountFollowers
  389. parameters:
  390. - $ref: '#/components/parameters/name'
  391. - $ref: '#/components/parameters/start'
  392. - $ref: '#/components/parameters/count'
  393. - $ref: '#/components/parameters/followersSort'
  394. - $ref: '#/components/parameters/search'
  395. responses:
  396. '200':
  397. description: successful operation
  398. content:
  399. application/json:
  400. schema:
  401. type: object
  402. properties:
  403. total:
  404. type: integer
  405. example: 1
  406. data:
  407. type: array
  408. items:
  409. $ref: '#/components/schemas/Follow'
  410. /accounts:
  411. get:
  412. tags:
  413. - Accounts
  414. summary: List accounts
  415. operationId: getAccounts
  416. parameters:
  417. - $ref: '#/components/parameters/start'
  418. - $ref: '#/components/parameters/count'
  419. - $ref: '#/components/parameters/sort'
  420. responses:
  421. '200':
  422. description: successful operation
  423. content:
  424. 'application/json':
  425. schema:
  426. type: array
  427. items:
  428. $ref: '#/components/schemas/Account'
  429. /config:
  430. get:
  431. tags:
  432. - Config
  433. summary: Get instance public configuration
  434. operationId: getConfig
  435. responses:
  436. '200':
  437. description: successful operation
  438. content:
  439. application/json:
  440. schema:
  441. $ref: '#/components/schemas/ServerConfig'
  442. examples:
  443. nightly:
  444. externalValue: https://peertube2.cpy.re/api/v1/config
  445. /config/about:
  446. get:
  447. summary: Get instance "About" information
  448. operationId: getAbout
  449. tags:
  450. - Config
  451. responses:
  452. '200':
  453. description: successful operation
  454. content:
  455. application/json:
  456. schema:
  457. $ref: '#/components/schemas/ServerConfigAbout'
  458. examples:
  459. nightly:
  460. externalValue: https://peertube2.cpy.re/api/v1/config/about
  461. /config/custom:
  462. get:
  463. summary: Get instance runtime configuration
  464. operationId: getCustomConfig
  465. tags:
  466. - Config
  467. security:
  468. - OAuth2:
  469. - admin
  470. responses:
  471. '200':
  472. description: successful operation
  473. content:
  474. application/json:
  475. schema:
  476. $ref: '#/components/schemas/ServerConfigCustom'
  477. put:
  478. summary: Set instance runtime configuration
  479. operationId: putCustomConfig
  480. tags:
  481. - Config
  482. security:
  483. - OAuth2:
  484. - admin
  485. responses:
  486. '200':
  487. description: successful operation
  488. '400':
  489. x-summary: field inconsistencies
  490. description: >
  491. Arises when:
  492. - the emailer is disabled and the instance is open to registrations
  493. - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled
  494. delete:
  495. summary: Delete instance runtime configuration
  496. operationId: delCustomConfig
  497. tags:
  498. - Config
  499. security:
  500. - OAuth2:
  501. - admin
  502. responses:
  503. '200':
  504. description: successful operation
  505. /custom-pages/homepage/instance:
  506. get:
  507. summary: Get instance custom homepage
  508. tags:
  509. - Homepage
  510. responses:
  511. '404':
  512. description: No homepage set
  513. '200':
  514. description: successful operation
  515. content:
  516. application/json:
  517. schema:
  518. $ref: '#/components/schemas/CustomHomepage'
  519. put:
  520. summary: Set instance custom homepage
  521. tags:
  522. - Homepage
  523. security:
  524. - OAuth2:
  525. - admin
  526. requestBody:
  527. content:
  528. application/json:
  529. schema:
  530. type: object
  531. properties:
  532. content:
  533. type: string
  534. description: content of the homepage, that will be injected in the client
  535. responses:
  536. '204':
  537. description: successful operation
  538. /jobs/pause:
  539. post:
  540. summary: Pause job queue
  541. security:
  542. - OAuth2:
  543. - admin
  544. tags:
  545. - Job
  546. responses:
  547. '204':
  548. description: successful operation
  549. /jobs/resume:
  550. post:
  551. summary: Resume job queue
  552. security:
  553. - OAuth2:
  554. - admin
  555. tags:
  556. - Job
  557. responses:
  558. '204':
  559. description: successful operation
  560. /jobs/{state}:
  561. get:
  562. summary: List instance jobs
  563. operationId: getJobs
  564. security:
  565. - OAuth2:
  566. - admin
  567. tags:
  568. - Job
  569. parameters:
  570. - name: state
  571. in: path
  572. required: true
  573. description: The state of the job ('' for for no filter)
  574. schema:
  575. type: string
  576. enum:
  577. - ''
  578. - active
  579. - completed
  580. - failed
  581. - waiting
  582. - delayed
  583. - $ref: '#/components/parameters/jobType'
  584. - $ref: '#/components/parameters/start'
  585. - $ref: '#/components/parameters/count'
  586. - $ref: '#/components/parameters/sort'
  587. responses:
  588. '200':
  589. description: successful operation
  590. content:
  591. application/json:
  592. schema:
  593. type: object
  594. properties:
  595. total:
  596. type: integer
  597. example: 1
  598. data:
  599. type: array
  600. maxItems: 100
  601. items:
  602. $ref: '#/components/schemas/Job'
  603. /server/followers:
  604. get:
  605. tags:
  606. - Instance Follows
  607. summary: List instances following the server
  608. parameters:
  609. - $ref: '#/components/parameters/followState'
  610. - $ref: '#/components/parameters/actorType'
  611. - $ref: '#/components/parameters/start'
  612. - $ref: '#/components/parameters/count'
  613. - $ref: '#/components/parameters/sort'
  614. responses:
  615. '200':
  616. description: successful operation
  617. content:
  618. application/json:
  619. schema:
  620. type: object
  621. properties:
  622. total:
  623. type: integer
  624. example: 1
  625. data:
  626. type: array
  627. items:
  628. $ref: '#/components/schemas/Follow'
  629. '/server/followers/{nameWithHost}':
  630. delete:
  631. summary: Remove or reject a follower to your server
  632. security:
  633. - OAuth2:
  634. - admin
  635. tags:
  636. - Instance Follows
  637. parameters:
  638. - name: nameWithHost
  639. in: path
  640. required: true
  641. description: The remote actor handle to remove from your followers
  642. schema:
  643. type: string
  644. format: email
  645. responses:
  646. '204':
  647. description: successful operation
  648. '404':
  649. description: follower not found
  650. '/server/followers/{nameWithHost}/reject':
  651. post:
  652. summary: Reject a pending follower to your server
  653. security:
  654. - OAuth2:
  655. - admin
  656. tags:
  657. - Instance Follows
  658. parameters:
  659. - name: nameWithHost
  660. in: path
  661. required: true
  662. description: The remote actor handle to remove from your followers
  663. schema:
  664. type: string
  665. format: email
  666. responses:
  667. '204':
  668. description: successful operation
  669. '404':
  670. description: follower not found
  671. '/server/followers/{nameWithHost}/accept':
  672. post:
  673. summary: Accept a pending follower to your server
  674. security:
  675. - OAuth2:
  676. - admin
  677. tags:
  678. - Instance Follows
  679. parameters:
  680. - name: nameWithHost
  681. in: path
  682. required: true
  683. description: The remote actor handle to remove from your followers
  684. schema:
  685. type: string
  686. format: email
  687. responses:
  688. '204':
  689. description: successful operation
  690. '404':
  691. description: follower not found
  692. /server/following:
  693. get:
  694. tags:
  695. - Instance Follows
  696. summary: List instances followed by the server
  697. parameters:
  698. - $ref: '#/components/parameters/followState'
  699. - $ref: '#/components/parameters/actorType'
  700. - $ref: '#/components/parameters/start'
  701. - $ref: '#/components/parameters/count'
  702. - $ref: '#/components/parameters/sort'
  703. responses:
  704. '200':
  705. description: successful operation
  706. content:
  707. application/json:
  708. schema:
  709. type: object
  710. properties:
  711. total:
  712. type: integer
  713. example: 1
  714. data:
  715. type: array
  716. items:
  717. $ref: '#/components/schemas/Follow'
  718. post:
  719. security:
  720. - OAuth2:
  721. - admin
  722. tags:
  723. - Instance Follows
  724. summary: Follow a list of actors (PeerTube instance, channel or account)
  725. responses:
  726. '204':
  727. description: successful operation
  728. '500':
  729. description: cannot follow a non-HTTPS server
  730. requestBody:
  731. content:
  732. application/json:
  733. schema:
  734. type: object
  735. properties:
  736. hosts:
  737. type: array
  738. items:
  739. type: string
  740. format: hostname
  741. uniqueItems: true
  742. handles:
  743. type: array
  744. items:
  745. type: string
  746. uniqueItems: true
  747. '/server/following/{hostOrHandle}':
  748. delete:
  749. summary: Unfollow an actor (PeerTube instance, channel or account)
  750. security:
  751. - OAuth2:
  752. - admin
  753. tags:
  754. - Instance Follows
  755. parameters:
  756. - name: hostOrHandle
  757. in: path
  758. required: true
  759. description: The hostOrHandle to unfollow
  760. schema:
  761. type: string
  762. responses:
  763. '204':
  764. description: successful operation
  765. '404':
  766. description: host or handle not found
  767. /users:
  768. post:
  769. summary: Create a user
  770. operationId: addUser
  771. security:
  772. - OAuth2:
  773. - admin
  774. tags:
  775. - Users
  776. responses:
  777. '200':
  778. description: user created
  779. content:
  780. application/json:
  781. schema:
  782. $ref: '#/components/schemas/AddUserResponse'
  783. links:
  784. # GET /users/{id}
  785. GetUser:
  786. operationId: getUser
  787. parameters:
  788. id: '$response.body#/user/id'
  789. # PUT /users/{id}
  790. PutUser:
  791. operationId: putUser
  792. parameters:
  793. id: '$response.body#/user/id'
  794. # DELETE /users/{id}
  795. DelUser:
  796. operationId: delUser
  797. parameters:
  798. id: '$response.body#/user/id'
  799. '403':
  800. description: insufficient authority to create an admin or moderator
  801. requestBody:
  802. content:
  803. application/json:
  804. schema:
  805. $ref: '#/components/schemas/AddUser'
  806. description: |
  807. If the smtp server is configured, you can leave the password empty and an email will be sent
  808. asking the user to set it first.
  809. required: true
  810. get:
  811. summary: List users
  812. operationId: getUsers
  813. security:
  814. - OAuth2:
  815. - admin
  816. tags:
  817. - Users
  818. parameters:
  819. - $ref: '#/components/parameters/usersSearch'
  820. - $ref: '#/components/parameters/usersBlocked'
  821. - $ref: '#/components/parameters/start'
  822. - $ref: '#/components/parameters/count'
  823. - $ref: '#/components/parameters/usersSort'
  824. responses:
  825. '200':
  826. description: successful operation
  827. content:
  828. application/json:
  829. schema:
  830. type: array
  831. items:
  832. $ref: '#/components/schemas/User'
  833. '/users/{id}':
  834. parameters:
  835. - $ref: '#/components/parameters/id'
  836. delete:
  837. summary: Delete a user
  838. security:
  839. - OAuth2:
  840. - admin
  841. tags:
  842. - Users
  843. operationId: delUser
  844. responses:
  845. '204':
  846. description: successful operation
  847. get:
  848. summary: Get a user
  849. security:
  850. - OAuth2: []
  851. tags:
  852. - Users
  853. operationId: getUser
  854. parameters:
  855. - name: withStats
  856. in: query
  857. description: include statistics about the user (only available as a moderator/admin)
  858. schema:
  859. type: boolean
  860. responses:
  861. '200':
  862. x-summary: successful operation
  863. description: |
  864. As an admin/moderator, you can request a response augmented with statistics about the user's
  865. moderation relations and videos usage, by using the `withStats` parameter.
  866. content:
  867. application/json:
  868. schema:
  869. oneOf:
  870. - $ref: '#/components/schemas/User'
  871. - $ref: '#/components/schemas/UserWithStats'
  872. put:
  873. summary: Update a user
  874. security:
  875. - OAuth2: []
  876. tags:
  877. - Users
  878. operationId: putUser
  879. responses:
  880. '204':
  881. description: successful operation
  882. requestBody:
  883. content:
  884. application/json:
  885. schema:
  886. $ref: '#/components/schemas/UpdateUser'
  887. required: true
  888. /oauth-clients/local:
  889. get:
  890. summary: Login prerequisite
  891. description: You need to retrieve a client id and secret before [logging in](#operation/getOAuthToken).
  892. operationId: getOAuthClient
  893. tags:
  894. - Session
  895. responses:
  896. '200':
  897. description: successful operation
  898. content:
  899. application/json:
  900. schema:
  901. $ref: '#/components/schemas/OAuthClient'
  902. links:
  903. UseOAuthClientToLogin:
  904. operationId: getOAuthToken
  905. parameters:
  906. client_id: '$response.body#/client_id'
  907. client_secret: '$response.body#/client_secret'
  908. x-codeSamples:
  909. - lang: Shell
  910. source: |
  911. API="https://peertube2.cpy.re/api/v1"
  912. ## AUTH
  913. curl -s "$API/oauth-clients/local"
  914. /users/token:
  915. post:
  916. summary: Login
  917. operationId: getOAuthToken
  918. description: With your [client id and secret](#operation/getOAuthClient), you can retrieve an access and refresh tokens.
  919. tags:
  920. - Session
  921. requestBody:
  922. content:
  923. application/x-www-form-urlencoded:
  924. schema:
  925. oneOf:
  926. - $ref: '#/components/schemas/OAuthToken-password'
  927. - $ref: '#/components/schemas/OAuthToken-refresh_token'
  928. discriminator:
  929. propertyName: grant_type
  930. mapping:
  931. password: '#/components/schemas/OAuthToken-password'
  932. refresh_token: '#/components/schemas/OAuthToken-refresh_token'
  933. responses:
  934. '200':
  935. description: successful operation
  936. content:
  937. application/json:
  938. schema:
  939. type: object
  940. properties:
  941. token_type:
  942. type: string
  943. example: Bearer
  944. access_token:
  945. type: string
  946. example: 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0
  947. description: valid for 1 day
  948. refresh_token:
  949. type: string
  950. example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7
  951. description: valid for 2 weeks
  952. expires_in:
  953. type: integer
  954. minimum: 0
  955. example: 14399
  956. refresh_token_expires_in:
  957. type: integer
  958. minimum: 0
  959. example: 1209600
  960. '400':
  961. x-summary: client or credentials are invalid
  962. description: |
  963. Disambiguate via `type`:
  964. - `invalid_client` for an unmatched `client_id`
  965. - `invalid_grant` for unmatched credentials
  966. '401':
  967. x-summary: token expired
  968. description: |
  969. Disambiguate via `type`:
  970. - default value for a regular authentication failure
  971. - `invalid_token` for an expired token
  972. x-codeSamples:
  973. - lang: Shell
  974. source: |
  975. ## DEPENDENCIES: jq
  976. API="https://peertube2.cpy.re/api/v1"
  977. USERNAME="<your_username>"
  978. PASSWORD="<your_password>"
  979. ## AUTH
  980. client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id")
  981. client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret")
  982. curl -s "$API/users/token" \
  983. --data client_id="$client_id" \
  984. --data client_secret="$client_secret" \
  985. --data grant_type=password \
  986. --data username="$USERNAME" \
  987. --data password="$PASSWORD" \
  988. | jq -r ".access_token"
  989. /users/revoke-token:
  990. post:
  991. summary: Logout
  992. description: Revokes your access token and its associated refresh token, destroying your current session.
  993. operationId: revokeOAuthToken
  994. tags:
  995. - Session
  996. security:
  997. - OAuth2: []
  998. responses:
  999. '200':
  1000. description: successful operation
  1001. /users/register:
  1002. post:
  1003. summary: Register a user
  1004. operationId: registerUser
  1005. tags:
  1006. - Users
  1007. - Register
  1008. responses:
  1009. '204':
  1010. description: successful operation
  1011. requestBody:
  1012. content:
  1013. application/json:
  1014. schema:
  1015. $ref: '#/components/schemas/RegisterUser'
  1016. required: true
  1017. /users/{id}/verify-email:
  1018. post:
  1019. summary: Verify a user
  1020. operationId: verifyUser
  1021. description: |
  1022. Following a user registration, the new user will receive an email asking to click a link
  1023. containing a secret.
  1024. tags:
  1025. - Users
  1026. - Register
  1027. parameters:
  1028. - $ref: '#/components/parameters/id'
  1029. requestBody:
  1030. content:
  1031. application/json:
  1032. schema:
  1033. type: object
  1034. properties:
  1035. verificationString:
  1036. type: string
  1037. format: url
  1038. isPendingEmail:
  1039. type: boolean
  1040. required:
  1041. - verificationString
  1042. responses:
  1043. '204':
  1044. description: successful operation
  1045. '403':
  1046. description: invalid verification string
  1047. '404':
  1048. description: user not found
  1049. /users/ask-send-verify-email:
  1050. post:
  1051. summary: Resend user verification link
  1052. operationId: resendEmailToVerifyUser
  1053. tags:
  1054. - Users
  1055. - Register
  1056. responses:
  1057. '204':
  1058. description: successful operation
  1059. /users/me:
  1060. get:
  1061. summary: Get my user information
  1062. operationId: getUserInfo
  1063. security:
  1064. - OAuth2:
  1065. - user
  1066. tags:
  1067. - My User
  1068. responses:
  1069. '200':
  1070. description: successful operation
  1071. content:
  1072. application/json:
  1073. schema:
  1074. type: array
  1075. items:
  1076. $ref: '#/components/schemas/User'
  1077. put:
  1078. summary: Update my user information
  1079. operationId: putUserInfo
  1080. security:
  1081. - OAuth2:
  1082. - user
  1083. tags:
  1084. - My User
  1085. responses:
  1086. '204':
  1087. description: successful operation
  1088. requestBody:
  1089. content:
  1090. application/json:
  1091. schema:
  1092. $ref: '#/components/schemas/UpdateMe'
  1093. required: true
  1094. /users/me/videos/imports:
  1095. get:
  1096. summary: Get video imports of my user
  1097. security:
  1098. - OAuth2:
  1099. - user
  1100. tags:
  1101. - Videos
  1102. - My User
  1103. parameters:
  1104. - $ref: '#/components/parameters/start'
  1105. - $ref: '#/components/parameters/count'
  1106. - $ref: '#/components/parameters/sort'
  1107. responses:
  1108. '200':
  1109. description: successful operation
  1110. content:
  1111. application/json:
  1112. schema:
  1113. $ref: '#/components/schemas/VideoImportsList'
  1114. /users/me/video-quota-used:
  1115. get:
  1116. summary: Get my user used quota
  1117. security:
  1118. - OAuth2:
  1119. - user
  1120. tags:
  1121. - My User
  1122. responses:
  1123. '200':
  1124. description: successful operation
  1125. content:
  1126. application/json:
  1127. schema:
  1128. type: object
  1129. properties:
  1130. videoQuotaUsed:
  1131. type: number
  1132. description: The user video quota used so far in bytes
  1133. example: 16810141515
  1134. videoQuotaUsedDaily:
  1135. type: number
  1136. description: The user video quota used today in bytes
  1137. example: 1681014151
  1138. '/users/me/videos/{videoId}/rating':
  1139. get:
  1140. summary: Get rate of my user for a video
  1141. security:
  1142. - OAuth2: []
  1143. tags:
  1144. - My User
  1145. - Video Rates
  1146. parameters:
  1147. - name: videoId
  1148. in: path
  1149. required: true
  1150. description: The video id
  1151. schema:
  1152. $ref: '#/components/schemas/Video/properties/id'
  1153. responses:
  1154. '200':
  1155. description: successful operation
  1156. content:
  1157. application/json:
  1158. schema:
  1159. $ref: '#/components/schemas/GetMeVideoRating'
  1160. /users/me/videos:
  1161. get:
  1162. summary: Get videos of my user
  1163. security:
  1164. - OAuth2:
  1165. - user
  1166. tags:
  1167. - My User
  1168. - Videos
  1169. parameters:
  1170. - $ref: '#/components/parameters/start'
  1171. - $ref: '#/components/parameters/count'
  1172. - $ref: '#/components/parameters/sort'
  1173. responses:
  1174. '200':
  1175. description: successful operation
  1176. content:
  1177. application/json:
  1178. schema:
  1179. $ref: '#/components/schemas/VideoListResponse'
  1180. /users/me/subscriptions:
  1181. get:
  1182. summary: Get my user subscriptions
  1183. security:
  1184. - OAuth2:
  1185. - user
  1186. tags:
  1187. - My Subscriptions
  1188. parameters:
  1189. - $ref: '#/components/parameters/start'
  1190. - $ref: '#/components/parameters/count'
  1191. - $ref: '#/components/parameters/sort'
  1192. responses:
  1193. '200':
  1194. description: successful operation
  1195. content:
  1196. application/json:
  1197. schema:
  1198. $ref: '#/components/schemas/VideoChannelList'
  1199. post:
  1200. tags:
  1201. - My Subscriptions
  1202. summary: Add subscription to my user
  1203. security:
  1204. - OAuth2:
  1205. - user
  1206. requestBody:
  1207. content:
  1208. application/json:
  1209. schema:
  1210. type: object
  1211. properties:
  1212. uri:
  1213. type: string
  1214. format: uri
  1215. description: uri of the video channels to subscribe to
  1216. required:
  1217. - uri
  1218. examples:
  1219. default:
  1220. value:
  1221. uri: 008a0e54-375d-49d0-8379-143202e24152@video.lqdn.fr
  1222. responses:
  1223. '200':
  1224. description: successful operation
  1225. /users/me/subscriptions/exist:
  1226. get:
  1227. summary: Get if subscriptions exist for my user
  1228. security:
  1229. - OAuth2:
  1230. - user
  1231. tags:
  1232. - My Subscriptions
  1233. parameters:
  1234. - $ref: '#/components/parameters/subscriptionsUris'
  1235. responses:
  1236. '200':
  1237. description: successful operation
  1238. content:
  1239. application/json:
  1240. schema:
  1241. type: object
  1242. /users/me/subscriptions/videos:
  1243. get:
  1244. summary: List videos of subscriptions of my user
  1245. security:
  1246. - OAuth2:
  1247. - user
  1248. tags:
  1249. - My Subscriptions
  1250. - Videos
  1251. parameters:
  1252. - $ref: '#/components/parameters/categoryOneOf'
  1253. - $ref: '#/components/parameters/isLive'
  1254. - $ref: '#/components/parameters/tagsOneOf'
  1255. - $ref: '#/components/parameters/tagsAllOf'
  1256. - $ref: '#/components/parameters/licenceOneOf'
  1257. - $ref: '#/components/parameters/languageOneOf'
  1258. - $ref: '#/components/parameters/nsfw'
  1259. - $ref: '#/components/parameters/isLocal'
  1260. - $ref: '#/components/parameters/include'
  1261. - $ref: '#/components/parameters/privacyOneOf'
  1262. - $ref: '#/components/parameters/hasHLSFiles'
  1263. - $ref: '#/components/parameters/hasWebtorrentFiles'
  1264. - $ref: '#/components/parameters/skipCount'
  1265. - $ref: '#/components/parameters/start'
  1266. - $ref: '#/components/parameters/count'
  1267. - $ref: '#/components/parameters/videosSort'
  1268. responses:
  1269. '200':
  1270. description: successful operation
  1271. content:
  1272. application/json:
  1273. schema:
  1274. $ref: '#/components/schemas/VideoListResponse'
  1275. '/users/me/subscriptions/{subscriptionHandle}':
  1276. get:
  1277. summary: Get subscription of my user
  1278. security:
  1279. - OAuth2:
  1280. - user
  1281. tags:
  1282. - My Subscriptions
  1283. parameters:
  1284. - $ref: '#/components/parameters/subscriptionHandle'
  1285. responses:
  1286. '200':
  1287. description: successful operation
  1288. content:
  1289. application/json:
  1290. schema:
  1291. $ref: '#/components/schemas/VideoChannel'
  1292. delete:
  1293. summary: Delete subscription of my user
  1294. security:
  1295. - OAuth2:
  1296. - user
  1297. tags:
  1298. - My Subscriptions
  1299. parameters:
  1300. - $ref: '#/components/parameters/subscriptionHandle'
  1301. responses:
  1302. '200':
  1303. description: successful operation
  1304. /users/me/notifications:
  1305. get:
  1306. summary: List my notifications
  1307. security:
  1308. - OAuth2: []
  1309. tags:
  1310. - My Notifications
  1311. parameters:
  1312. - name: unread
  1313. in: query
  1314. description: only list unread notifications
  1315. schema:
  1316. type: boolean
  1317. - $ref: '#/components/parameters/start'
  1318. - $ref: '#/components/parameters/count'
  1319. - $ref: '#/components/parameters/sort'
  1320. responses:
  1321. '200':
  1322. description: successful operation
  1323. content:
  1324. application/json:
  1325. schema:
  1326. $ref: '#/components/schemas/NotificationListResponse'
  1327. /users/me/notifications/read:
  1328. post:
  1329. summary: Mark notifications as read by their id
  1330. security:
  1331. - OAuth2: []
  1332. tags:
  1333. - My Notifications
  1334. requestBody:
  1335. content:
  1336. application/json:
  1337. schema:
  1338. type: object
  1339. properties:
  1340. ids:
  1341. type: array
  1342. description: ids of the notifications to mark as read
  1343. items:
  1344. type: integer
  1345. required:
  1346. - ids
  1347. responses:
  1348. '204':
  1349. description: successful operation
  1350. /users/me/notifications/read-all:
  1351. post:
  1352. summary: Mark all my notification as read
  1353. security:
  1354. - OAuth2: []
  1355. tags:
  1356. - My Notifications
  1357. responses:
  1358. '204':
  1359. description: successful operation
  1360. /users/me/notification-settings:
  1361. put:
  1362. summary: Update my notification settings
  1363. security:
  1364. - OAuth2: []
  1365. tags:
  1366. - My Notifications
  1367. requestBody:
  1368. content:
  1369. application/json:
  1370. schema:
  1371. type: object
  1372. properties:
  1373. newVideoFromSubscription:
  1374. $ref: '#/components/schemas/NotificationSettingValue'
  1375. newCommentOnMyVideo:
  1376. $ref: '#/components/schemas/NotificationSettingValue'
  1377. abuseAsModerator:
  1378. $ref: '#/components/schemas/NotificationSettingValue'
  1379. videoAutoBlacklistAsModerator:
  1380. $ref: '#/components/schemas/NotificationSettingValue'
  1381. blacklistOnMyVideo:
  1382. $ref: '#/components/schemas/NotificationSettingValue'
  1383. myVideoPublished:
  1384. $ref: '#/components/schemas/NotificationSettingValue'
  1385. myVideoImportFinished:
  1386. $ref: '#/components/schemas/NotificationSettingValue'
  1387. newFollow:
  1388. $ref: '#/components/schemas/NotificationSettingValue'
  1389. newUserRegistration:
  1390. $ref: '#/components/schemas/NotificationSettingValue'
  1391. commentMention:
  1392. $ref: '#/components/schemas/NotificationSettingValue'
  1393. newInstanceFollower:
  1394. $ref: '#/components/schemas/NotificationSettingValue'
  1395. autoInstanceFollowing:
  1396. $ref: '#/components/schemas/NotificationSettingValue'
  1397. responses:
  1398. '204':
  1399. description: successful operation
  1400. /users/me/history/videos:
  1401. get:
  1402. summary: List watched videos history
  1403. security:
  1404. - OAuth2: []
  1405. tags:
  1406. - My History
  1407. parameters:
  1408. - $ref: '#/components/parameters/start'
  1409. - $ref: '#/components/parameters/count'
  1410. - $ref: '#/components/parameters/search'
  1411. responses:
  1412. '200':
  1413. description: successful operation
  1414. content:
  1415. application/json:
  1416. schema:
  1417. $ref: '#/components/schemas/VideoListResponse'
  1418. /users/me/history/videos/{videoId}:
  1419. delete:
  1420. summary: Delete history element
  1421. security:
  1422. - OAuth2: []
  1423. tags:
  1424. - My History
  1425. parameters:
  1426. - name: videoId
  1427. in: path
  1428. required: true
  1429. schema:
  1430. $ref: '#/components/schemas/Video/properties/id'
  1431. responses:
  1432. '204':
  1433. description: successful operation
  1434. /users/me/history/videos/remove:
  1435. post:
  1436. summary: Clear video history
  1437. security:
  1438. - OAuth2: []
  1439. tags:
  1440. - My History
  1441. requestBody:
  1442. content:
  1443. multipart/form-data:
  1444. schema:
  1445. type: object
  1446. properties:
  1447. beforeDate:
  1448. description: history before this date will be deleted
  1449. type: string
  1450. format: date-time
  1451. responses:
  1452. '204':
  1453. description: successful operation
  1454. /users/me/avatar/pick:
  1455. post:
  1456. summary: Update my user avatar
  1457. security:
  1458. - OAuth2: []
  1459. tags:
  1460. - My User
  1461. responses:
  1462. '200':
  1463. description: successful operation
  1464. content:
  1465. application/json:
  1466. schema:
  1467. type: object
  1468. properties:
  1469. avatar:
  1470. $ref: '#/components/schemas/ActorImage'
  1471. '413':
  1472. description: image file too large
  1473. headers:
  1474. X-File-Maximum-Size:
  1475. schema:
  1476. type: string
  1477. format: Nginx size
  1478. description: Maximum file size for the avatar
  1479. requestBody:
  1480. content:
  1481. multipart/form-data:
  1482. schema:
  1483. type: object
  1484. properties:
  1485. avatarfile:
  1486. description: The file to upload
  1487. type: string
  1488. format: binary
  1489. encoding:
  1490. avatarfile:
  1491. contentType: image/png, image/jpeg
  1492. /users/me/avatar:
  1493. delete:
  1494. summary: Delete my avatar
  1495. security:
  1496. - OAuth2: []
  1497. tags:
  1498. - My User
  1499. responses:
  1500. '204':
  1501. description: successful operation
  1502. /videos/ownership:
  1503. get:
  1504. summary: List video ownership changes
  1505. tags:
  1506. - Video Ownership Change
  1507. security:
  1508. - OAuth2: []
  1509. responses:
  1510. '200':
  1511. description: successful operation
  1512. '/videos/ownership/{id}/accept':
  1513. post:
  1514. summary: Accept ownership change request
  1515. tags:
  1516. - Video Ownership Change
  1517. security:
  1518. - OAuth2: []
  1519. parameters:
  1520. - $ref: '#/components/parameters/idOrUUID'
  1521. responses:
  1522. '204':
  1523. description: successful operation
  1524. '403':
  1525. description: cannot terminate an ownership change of another user
  1526. '404':
  1527. description: video owneship change not found
  1528. '/videos/ownership/{id}/refuse':
  1529. post:
  1530. summary: Refuse ownership change request
  1531. tags:
  1532. - Video Ownership Change
  1533. security:
  1534. - OAuth2: []
  1535. parameters:
  1536. - $ref: '#/components/parameters/idOrUUID'
  1537. responses:
  1538. '204':
  1539. description: successful operation
  1540. '403':
  1541. description: cannot terminate an ownership change of another user
  1542. '404':
  1543. description: video owneship change not found
  1544. '/videos/{id}/give-ownership':
  1545. post:
  1546. summary: Request ownership change
  1547. tags:
  1548. - Video Ownership Change
  1549. security:
  1550. - OAuth2: []
  1551. parameters:
  1552. - $ref: '#/components/parameters/idOrUUID'
  1553. requestBody:
  1554. required: true
  1555. content:
  1556. application/x-www-form-urlencoded:
  1557. schema:
  1558. type: object
  1559. properties:
  1560. username:
  1561. type: string
  1562. required:
  1563. - username
  1564. responses:
  1565. '204':
  1566. description: successful operation
  1567. '400':
  1568. description: changing video ownership to a remote account is not supported yet
  1569. '404':
  1570. description: video not found
  1571. /videos:
  1572. get:
  1573. summary: List videos
  1574. operationId: getVideos
  1575. tags:
  1576. - Video
  1577. parameters:
  1578. - $ref: '#/components/parameters/categoryOneOf'
  1579. - $ref: '#/components/parameters/isLive'
  1580. - $ref: '#/components/parameters/tagsOneOf'
  1581. - $ref: '#/components/parameters/tagsAllOf'
  1582. - $ref: '#/components/parameters/licenceOneOf'
  1583. - $ref: '#/components/parameters/languageOneOf'
  1584. - $ref: '#/components/parameters/nsfw'
  1585. - $ref: '#/components/parameters/isLocal'
  1586. - $ref: '#/components/parameters/include'
  1587. - $ref: '#/components/parameters/privacyOneOf'
  1588. - $ref: '#/components/parameters/hasHLSFiles'
  1589. - $ref: '#/components/parameters/hasWebtorrentFiles'
  1590. - $ref: '#/components/parameters/skipCount'
  1591. - $ref: '#/components/parameters/start'
  1592. - $ref: '#/components/parameters/count'
  1593. - $ref: '#/components/parameters/videosSort'
  1594. responses:
  1595. '200':
  1596. description: successful operation
  1597. content:
  1598. application/json:
  1599. schema:
  1600. $ref: '#/components/schemas/VideoListResponse'
  1601. /videos/categories:
  1602. get:
  1603. summary: List available video categories
  1604. operationId: getCategories
  1605. tags:
  1606. - Video
  1607. responses:
  1608. '200':
  1609. description: successful operation
  1610. content:
  1611. application/json:
  1612. schema:
  1613. type: array
  1614. items:
  1615. type: string
  1616. examples:
  1617. nightly:
  1618. externalValue: https://peertube2.cpy.re/api/v1/videos/categories
  1619. /videos/licences:
  1620. get:
  1621. summary: List available video licences
  1622. operationId: getLicences
  1623. tags:
  1624. - Video
  1625. responses:
  1626. '200':
  1627. description: successful operation
  1628. content:
  1629. application/json:
  1630. schema:
  1631. type: array
  1632. items:
  1633. type: string
  1634. examples:
  1635. nightly:
  1636. externalValue: https://peertube2.cpy.re/api/v1/videos/licences
  1637. /videos/languages:
  1638. get:
  1639. summary: List available video languages
  1640. operationId: getLanguages
  1641. tags:
  1642. - Video
  1643. responses:
  1644. '200':
  1645. description: successful operation
  1646. content:
  1647. application/json:
  1648. schema:
  1649. type: array
  1650. items:
  1651. type: string
  1652. examples:
  1653. nightly:
  1654. externalValue: https://peertube2.cpy.re/api/v1/videos/languages
  1655. /videos/privacies:
  1656. get:
  1657. summary: List available video privacy policies
  1658. operationId: getPrivacyPolicies
  1659. tags:
  1660. - Video
  1661. responses:
  1662. '200':
  1663. description: successful operation
  1664. content:
  1665. application/json:
  1666. schema:
  1667. type: array
  1668. items:
  1669. type: string
  1670. examples:
  1671. nightly:
  1672. externalValue: https://peertube2.cpy.re/api/v1/videos/privacies
  1673. '/videos/{id}':
  1674. put:
  1675. summary: Update a video
  1676. operationId: putVideo
  1677. security:
  1678. - OAuth2: []
  1679. tags:
  1680. - Video
  1681. parameters:
  1682. - $ref: '#/components/parameters/idOrUUID'
  1683. responses:
  1684. '204':
  1685. description: successful operation
  1686. requestBody:
  1687. content:
  1688. multipart/form-data:
  1689. schema:
  1690. type: object
  1691. properties:
  1692. thumbnailfile:
  1693. description: Video thumbnail file
  1694. type: string
  1695. format: binary
  1696. previewfile:
  1697. description: Video preview file
  1698. type: string
  1699. format: binary
  1700. category:
  1701. $ref: '#/components/schemas/VideoCategorySet'
  1702. licence:
  1703. $ref: '#/components/schemas/VideoLicenceSet'
  1704. language:
  1705. $ref: '#/components/schemas/VideoLanguageSet'
  1706. privacy:
  1707. $ref: '#/components/schemas/VideoPrivacySet'
  1708. description:
  1709. description: Video description
  1710. type: string
  1711. waitTranscoding:
  1712. description: Whether or not we wait transcoding before publish the video
  1713. type: string
  1714. support:
  1715. description: A text tell the audience how to support the video creator
  1716. example: Please support our work on https://soutenir.framasoft.org/en/ <3
  1717. type: string
  1718. nsfw:
  1719. description: Whether or not this video contains sensitive content
  1720. type: boolean
  1721. name:
  1722. description: Video name
  1723. type: string
  1724. minLength: 3
  1725. maxLength: 120
  1726. tags:
  1727. description: Video tags (maximum 5 tags each between 2 and 30 characters)
  1728. type: array
  1729. minItems: 1
  1730. maxItems: 5
  1731. items:
  1732. type: string
  1733. minLength: 2
  1734. maxLength: 30
  1735. commentsEnabled:
  1736. description: Enable or disable comments for this video
  1737. type: boolean
  1738. downloadEnabled:
  1739. description: Enable or disable downloading for this video
  1740. type: boolean
  1741. originallyPublishedAt:
  1742. description: Date when the content was originally published
  1743. type: string
  1744. format: date-time
  1745. scheduleUpdate:
  1746. $ref: '#/components/schemas/VideoScheduledUpdate'
  1747. encoding:
  1748. thumbnailfile:
  1749. contentType: image/jpeg
  1750. previewfile:
  1751. contentType: image/jpeg
  1752. get:
  1753. summary: Get a video
  1754. operationId: getVideo
  1755. tags:
  1756. - Video
  1757. parameters:
  1758. - $ref: '#/components/parameters/idOrUUID'
  1759. responses:
  1760. '200':
  1761. description: successful operation
  1762. content:
  1763. application/json:
  1764. schema:
  1765. $ref: '#/components/schemas/VideoDetails'
  1766. delete:
  1767. summary: Delete a video
  1768. operationId: delVideo
  1769. security:
  1770. - OAuth2: []
  1771. tags:
  1772. - Video
  1773. parameters:
  1774. - $ref: '#/components/parameters/idOrUUID'
  1775. responses:
  1776. '204':
  1777. description: successful operation
  1778. '/videos/{id}/description':
  1779. get:
  1780. summary: Get complete video description
  1781. operationId: getVideoDesc
  1782. tags:
  1783. - Video
  1784. parameters:
  1785. - $ref: '#/components/parameters/idOrUUID'
  1786. responses:
  1787. '200':
  1788. description: successful operation
  1789. content:
  1790. application/json:
  1791. schema:
  1792. nullable: true
  1793. type: string
  1794. minLength: 3
  1795. maxLength: 10000
  1796. example: |
  1797. **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**
  1798. '/videos/{id}/views':
  1799. post:
  1800. summary: Add a view to a video
  1801. operationId: addView
  1802. tags:
  1803. - Video
  1804. parameters:
  1805. - $ref: '#/components/parameters/idOrUUID'
  1806. responses:
  1807. '204':
  1808. description: successful operation
  1809. '/videos/{id}/watching':
  1810. put:
  1811. summary: Set watching progress of a video
  1812. operationId: setProgress
  1813. tags:
  1814. - Video
  1815. security:
  1816. - OAuth2: []
  1817. parameters:
  1818. - $ref: '#/components/parameters/idOrUUID'
  1819. requestBody:
  1820. content:
  1821. application/json:
  1822. schema:
  1823. $ref: '#/components/schemas/UserWatchingVideo'
  1824. required: true
  1825. responses:
  1826. '204':
  1827. description: successful operation
  1828. /videos/upload:
  1829. post:
  1830. summary: Upload a video
  1831. description: Uses a single request to upload a video.
  1832. operationId: uploadLegacy
  1833. security:
  1834. - OAuth2: []
  1835. tags:
  1836. - Video
  1837. - Video Upload
  1838. responses:
  1839. '200':
  1840. description: successful operation
  1841. content:
  1842. application/json:
  1843. schema:
  1844. $ref: '#/components/schemas/VideoUploadResponse'
  1845. '403':
  1846. description: video didn't pass upload filter
  1847. '408':
  1848. description: upload has timed out
  1849. '413':
  1850. x-summary: video file too large, due to quota or max body size limit set by the reverse-proxy
  1851. description: |
  1852. If the response has no body, it means the reverse-proxy didn't let it through. Otherwise disambiguate via `type`:
  1853. - `quota_reached` for quota limits wether daily or global
  1854. headers:
  1855. X-File-Maximum-Size:
  1856. schema:
  1857. type: string
  1858. format: Nginx size
  1859. description: Maximum file size for the video
  1860. '415':
  1861. description: video type unsupported
  1862. '422':
  1863. description: video unreadable
  1864. requestBody:
  1865. content:
  1866. multipart/form-data:
  1867. schema:
  1868. $ref: '#/components/schemas/VideoUploadRequestLegacy'
  1869. encoding:
  1870. videofile:
  1871. contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
  1872. thumbnailfile:
  1873. contentType: image/jpeg
  1874. previewfile:
  1875. contentType: image/jpeg
  1876. x-codeSamples:
  1877. - lang: Shell
  1878. source: |
  1879. ## DEPENDENCIES: jq
  1880. USERNAME="<your_username>"
  1881. PASSWORD="<your_password>"
  1882. FILE_PATH="<your_file_path>"
  1883. CHANNEL_ID="<your_channel_id>"
  1884. NAME="<video_name>"
  1885. API="https://peertube2.cpy.re/api/v1"
  1886. ## AUTH
  1887. client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id")
  1888. client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret")
  1889. token=$(curl -s "$API/users/token" \
  1890. --data client_id="$client_id" \
  1891. --data client_secret="$client_secret" \
  1892. --data grant_type=password \
  1893. --data username="$USERNAME" \
  1894. --data password="$PASSWORD" \
  1895. | jq -r ".access_token")
  1896. ## VIDEO UPLOAD
  1897. curl -s "$API/videos/upload" \
  1898. -H "Authorization: Bearer $token" \
  1899. --max-time 600 \
  1900. --form videofile=@"$FILE_PATH" \
  1901. --form channelId=$CHANNEL_ID \
  1902. --form name="$NAME"
  1903. /videos/upload-resumable:
  1904. post:
  1905. summary: Initialize the resumable upload of a video
  1906. description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to initialize the upload of a video
  1907. operationId: uploadResumableInit
  1908. security:
  1909. - OAuth2: []
  1910. tags:
  1911. - Video
  1912. - Video Upload
  1913. parameters:
  1914. - name: X-Upload-Content-Length
  1915. in: header
  1916. schema:
  1917. type: number
  1918. example: 2469036
  1919. required: true
  1920. description: Number of bytes that will be uploaded in subsequent requests. Set this value to the size of the file you are uploading.
  1921. - name: X-Upload-Content-Type
  1922. in: header
  1923. schema:
  1924. type: string
  1925. format: mimetype
  1926. example: video/mp4
  1927. required: true
  1928. description: MIME type of the file that you are uploading. Depending on your instance settings, acceptable values might vary.
  1929. requestBody:
  1930. content:
  1931. application/json:
  1932. schema:
  1933. $ref: '#/components/schemas/VideoUploadRequestResumable'
  1934. responses:
  1935. '200':
  1936. description: file already exists, send a [`resume`](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) request instead
  1937. '201':
  1938. description: created
  1939. headers:
  1940. Location:
  1941. schema:
  1942. type: string
  1943. format: url
  1944. example: /api/v1/videos/upload-resumable?upload_id=471e97554f21dec3b8bb5d4602939c51
  1945. Content-Length:
  1946. schema:
  1947. type: number
  1948. example: 0
  1949. '413':
  1950. x-summary: video file too large, due to quota, absolute max file size or concurrent partial upload limit
  1951. description: |
  1952. Disambiguate via `type`:
  1953. - `max_file_size_reached` for the absolute file size limit
  1954. - `quota_reached` for quota limits whether daily or global
  1955. '415':
  1956. description: video type unsupported
  1957. put:
  1958. summary: Send chunk for the resumable upload of a video
  1959. description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to continue, pause or resume the upload of a video
  1960. operationId: uploadResumable
  1961. security:
  1962. - OAuth2: []
  1963. tags:
  1964. - Video
  1965. - Video Upload
  1966. parameters:
  1967. - name: upload_id
  1968. in: query
  1969. required: true
  1970. description: |
  1971. Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is
  1972. not valid anymore and you need to initialize a new upload.
  1973. schema:
  1974. type: string
  1975. - name: Content-Range
  1976. in: header
  1977. schema:
  1978. type: string
  1979. example: bytes 0-262143/2469036
  1980. required: true
  1981. description: |
  1982. Specifies the bytes in the file that the request is uploading.
  1983. For example, a value of `bytes 0-262143/1000000` shows that the request is sending the first
  1984. 262144 bytes (256 x 1024) in a 2,469,036 byte file.
  1985. - name: Content-Length
  1986. in: header
  1987. schema:
  1988. type: number
  1989. example: 262144
  1990. required: true
  1991. description: |
  1992. Size of the chunk that the request is sending.
  1993. The chunk size __must be a multiple of 256 KB__, and unlike [Google Resumable](https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol)
  1994. doesn't mandate for chunks to have the same size throughout the upload sequence.
  1995. Remember that larger chunks are more efficient. PeerTube's web client uses chunks varying from
  1996. 1048576 bytes (~1MB) and increases or reduces size depending on connection health.
  1997. requestBody:
  1998. content:
  1999. application/octet-stream:
  2000. schema:
  2001. type: string
  2002. format: binary
  2003. responses:
  2004. '200':
  2005. description: last chunk received
  2006. headers:
  2007. Content-Length:
  2008. schema:
  2009. type: number
  2010. content:
  2011. application/json:
  2012. schema:
  2013. $ref: '#/components/schemas/VideoUploadResponse'
  2014. '308':
  2015. description: resume incomplete
  2016. headers:
  2017. Range:
  2018. schema:
  2019. type: string
  2020. example: bytes=0-262143
  2021. Content-Length:
  2022. schema:
  2023. type: number
  2024. example: 0
  2025. '403':
  2026. description: video didn't pass upload filter
  2027. '404':
  2028. description: upload not found
  2029. '409':
  2030. description: chunk doesn't match range
  2031. '422':
  2032. description: video unreadable
  2033. '429':
  2034. description: too many concurrent requests
  2035. '503':
  2036. description: upload is already being processed
  2037. headers:
  2038. 'Retry-After':
  2039. schema:
  2040. type: number
  2041. example: 300
  2042. delete:
  2043. summary: Cancel the resumable upload of a video, deleting any data uploaded so far
  2044. description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to cancel the upload of a video
  2045. operationId: uploadResumableCancel
  2046. security:
  2047. - OAuth2: []
  2048. tags:
  2049. - Video
  2050. - Video Upload
  2051. parameters:
  2052. - name: upload_id
  2053. in: query
  2054. required: true
  2055. description: |
  2056. Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is
  2057. not valid anymore and the upload session has already been deleted with its data ;-)
  2058. schema:
  2059. type: string
  2060. - name: Content-Length
  2061. in: header
  2062. required: true
  2063. schema:
  2064. type: number
  2065. example: 0
  2066. responses:
  2067. '204':
  2068. description: upload cancelled
  2069. headers:
  2070. Content-Length:
  2071. schema:
  2072. type: number
  2073. example: 0
  2074. '404':
  2075. description: upload not found
  2076. /videos/imports:
  2077. post:
  2078. summary: Import a video
  2079. description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
  2080. operationId: importVideo
  2081. security:
  2082. - OAuth2: []
  2083. tags:
  2084. - Video Imports
  2085. - Video Upload
  2086. requestBody:
  2087. content:
  2088. multipart/form-data:
  2089. schema:
  2090. $ref: '#/components/schemas/VideoCreateImport'
  2091. encoding:
  2092. torrentfile:
  2093. contentType: application/x-bittorrent
  2094. thumbnailfile:
  2095. contentType: image/jpeg
  2096. previewfile:
  2097. contentType: image/jpeg
  2098. responses:
  2099. '200':
  2100. description: successful operation
  2101. content:
  2102. application/json:
  2103. schema:
  2104. $ref: '#/components/schemas/VideoUploadResponse'
  2105. '400':
  2106. description: '`magnetUri` or `targetUrl` or a torrent file missing'
  2107. '403':
  2108. description: video didn't pass pre-import filter
  2109. '409':
  2110. description: HTTP or Torrent/magnetURI import not enabled
  2111. /videos/imports/{id}/cancel:
  2112. post:
  2113. summary: Cancel video import
  2114. description: Cancel a pending video import
  2115. security:
  2116. - OAuth2: []
  2117. tags:
  2118. - Video Imports
  2119. parameters:
  2120. - $ref: '#/components/parameters/id'
  2121. responses:
  2122. '204':
  2123. description: successful operation
  2124. /videos/imports/{id}:
  2125. delete:
  2126. summary: Delete video import
  2127. description: Delete ended video import
  2128. security:
  2129. - OAuth2: []
  2130. tags:
  2131. - Video Imports
  2132. parameters:
  2133. - $ref: '#/components/parameters/id'
  2134. responses:
  2135. '204':
  2136. description: successful operation
  2137. /videos/live:
  2138. post:
  2139. summary: Create a live
  2140. operationId: addLive
  2141. security:
  2142. - OAuth2: []
  2143. tags:
  2144. - Live Videos
  2145. - Video
  2146. responses:
  2147. '200':
  2148. description: successful operation
  2149. content:
  2150. application/json:
  2151. schema:
  2152. $ref: '#/components/schemas/VideoUploadResponse'
  2153. '400':
  2154. x-summary: validation error, or conflicting `saveReplay` and `permanentLive` parameter set
  2155. description: |
  2156. Disambiguate via `type`:
  2157. - default type for a validation error
  2158. - `live_conflicting_permanent_and_save_replay` for conflicting parameters set
  2159. '403':
  2160. x-summary: live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded
  2161. description: |
  2162. Disambiguate via `type`:
  2163. - `live_not_enabled` for a disabled live feature
  2164. - `live_not_allowing_replay` for a disabled replay feature
  2165. - `max_instance_lives_limit_reached` for the absolute concurrent live limit
  2166. - `max_user_lives_limit_reached` for the user concurrent live limit
  2167. requestBody:
  2168. content:
  2169. multipart/form-data:
  2170. schema:
  2171. type: object
  2172. properties:
  2173. channelId:
  2174. description: Channel id that will contain this live video
  2175. type: integer
  2176. saveReplay:
  2177. type: boolean
  2178. permanentLive:
  2179. description: User can stream multiple times in a permanent live
  2180. type: boolean
  2181. thumbnailfile:
  2182. description: Live video/replay thumbnail file
  2183. type: string
  2184. format: binary
  2185. previewfile:
  2186. description: Live video/replay preview file
  2187. type: string
  2188. format: binary
  2189. privacy:
  2190. $ref: '#/components/schemas/VideoPrivacySet'
  2191. category:
  2192. $ref: '#/components/schemas/VideoCategorySet'
  2193. licence:
  2194. $ref: '#/components/schemas/VideoLicenceSet'
  2195. language:
  2196. $ref: '#/components/schemas/VideoLanguageSet'
  2197. description:
  2198. description: Live video/replay description
  2199. type: string
  2200. support:
  2201. description: A text tell the audience how to support the creator
  2202. example: Please support our work on https://soutenir.framasoft.org/en/ <3
  2203. type: string
  2204. nsfw:
  2205. description: Whether or not this live video/replay contains sensitive content
  2206. type: boolean
  2207. name:
  2208. description: Live video/replay name
  2209. type: string
  2210. minLength: 3
  2211. maxLength: 120
  2212. tags:
  2213. description: Live video/replay tags (maximum 5 tags each between 2 and 30 characters)
  2214. type: array
  2215. minItems: 1
  2216. maxItems: 5
  2217. items:
  2218. type: string
  2219. minLength: 2
  2220. maxLength: 30
  2221. commentsEnabled:
  2222. description: Enable or disable comments for this live video/replay
  2223. type: boolean
  2224. downloadEnabled:
  2225. description: Enable or disable downloading for the replay of this live video
  2226. type: boolean
  2227. required:
  2228. - channelId
  2229. - name
  2230. encoding:
  2231. thumbnailfile:
  2232. contentType: image/jpeg
  2233. previewfile:
  2234. contentType: image/jpeg
  2235. /videos/live/{id}:
  2236. get:
  2237. summary: Get information about a live
  2238. operationId: getLiveId
  2239. security:
  2240. - OAuth2: []
  2241. tags:
  2242. - Live Videos
  2243. - Video
  2244. parameters:
  2245. - $ref: '#/components/parameters/idOrUUID'
  2246. responses:
  2247. '200':
  2248. description: successful operation
  2249. content:
  2250. application/json:
  2251. schema:
  2252. $ref: '#/components/schemas/LiveVideoResponse'
  2253. put:
  2254. summary: Update information about a live
  2255. operationId: updateLiveId
  2256. security:
  2257. - OAuth2: []
  2258. tags:
  2259. - Live Videos
  2260. - Video
  2261. parameters:
  2262. - $ref: '#/components/parameters/idOrUUID'
  2263. requestBody:
  2264. content:
  2265. application/json:
  2266. schema:
  2267. $ref: '#/components/schemas/LiveVideoUpdate'
  2268. responses:
  2269. '204':
  2270. description: successful operation
  2271. '400':
  2272. description: bad parameters or trying to update a live that has already started
  2273. '403':
  2274. description: trying to save replay of the live but saving replay is not enabled on the instance
  2275. /users/me/abuses:
  2276. get:
  2277. summary: List my abuses
  2278. operationId: getMyAbuses
  2279. security:
  2280. - OAuth2: []
  2281. tags:
  2282. - Abuses
  2283. - My User
  2284. parameters:
  2285. - name: id
  2286. in: query
  2287. description: only list the report with this id
  2288. schema:
  2289. type: integer
  2290. - name: state
  2291. in: query
  2292. schema:
  2293. $ref: '#/components/schemas/AbuseStateSet'
  2294. - $ref: '#/components/parameters/abusesSort'
  2295. - $ref: '#/components/parameters/start'
  2296. - $ref: '#/components/parameters/count'
  2297. responses:
  2298. '200':
  2299. description: successful operation
  2300. content:
  2301. application/json:
  2302. schema:
  2303. type: object
  2304. properties:
  2305. total:
  2306. type: integer
  2307. example: 1
  2308. data:
  2309. type: array
  2310. items:
  2311. $ref: '#/components/schemas/Abuse'
  2312. /abuses:
  2313. get:
  2314. summary: List abuses
  2315. operationId: getAbuses
  2316. security:
  2317. - OAuth2:
  2318. - admin
  2319. - moderator
  2320. tags:
  2321. - Abuses
  2322. parameters:
  2323. - name: id
  2324. in: query
  2325. description: only list the report with this id
  2326. schema:
  2327. type: integer
  2328. - name: predefinedReason
  2329. in: query
  2330. description: predefined reason the listed reports should contain
  2331. schema:
  2332. $ref: '#/components/schemas/PredefinedAbuseReasons'
  2333. - name: search
  2334. in: query
  2335. description: plain search that will match with video titles, reporter names and more
  2336. schema:
  2337. type: string
  2338. - name: state
  2339. in: query
  2340. schema:
  2341. $ref: '#/components/schemas/AbuseStateSet'
  2342. - name: searchReporter
  2343. in: query
  2344. description: only list reports of a specific reporter
  2345. schema:
  2346. type: string
  2347. - name: searchReportee
  2348. description: only list reports of a specific reportee
  2349. in: query
  2350. schema:
  2351. type: string
  2352. - name: searchVideo
  2353. in: query
  2354. description: only list reports of a specific video
  2355. schema:
  2356. type: string
  2357. - name: searchVideoChannel
  2358. in: query
  2359. description: only list reports of a specific video channel
  2360. schema:
  2361. type: string
  2362. - name: videoIs
  2363. in: query
  2364. description: only list deleted or blocklisted videos
  2365. schema:
  2366. type: string
  2367. enum:
  2368. - 'deleted'
  2369. - 'blacklisted'
  2370. - name: filter
  2371. in: query
  2372. description: only list account, comment or video reports
  2373. schema:
  2374. type: string
  2375. enum:
  2376. - 'video'
  2377. - 'comment'
  2378. - 'account'
  2379. - $ref: '#/components/parameters/start'
  2380. - $ref: '#/components/parameters/count'
  2381. - $ref: '#/components/parameters/abusesSort'
  2382. responses:
  2383. '200':
  2384. description: successful operation
  2385. content:
  2386. application/json:
  2387. schema:
  2388. type: object
  2389. properties:
  2390. total:
  2391. type: integer
  2392. example: 1
  2393. data:
  2394. type: array
  2395. items:
  2396. $ref: '#/components/schemas/Abuse'
  2397. post:
  2398. summary: Report an abuse
  2399. security:
  2400. - OAuth2: []
  2401. tags:
  2402. - Abuses
  2403. requestBody:
  2404. required: true
  2405. content:
  2406. application/json:
  2407. schema:
  2408. type: object
  2409. properties:
  2410. reason:
  2411. description: Reason why the user reports this video
  2412. type: string
  2413. minLength: 2
  2414. maxLength: 3000
  2415. predefinedReasons:
  2416. $ref: '#/components/schemas/PredefinedAbuseReasons'
  2417. video:
  2418. type: object
  2419. properties:
  2420. id:
  2421. description: Video id to report
  2422. allOf:
  2423. - $ref: '#/components/schemas/Video/properties/id'
  2424. startAt:
  2425. type: integer
  2426. format: seconds
  2427. description: Timestamp in the video that marks the beginning of the report
  2428. minimum: 0
  2429. endAt:
  2430. type: integer
  2431. format: seconds
  2432. description: Timestamp in the video that marks the ending of the report
  2433. minimum: 0
  2434. comment:
  2435. type: object
  2436. properties:
  2437. id:
  2438. description: Comment id to report
  2439. allOf:
  2440. - $ref: '#/components/schemas/VideoComment/properties/id'
  2441. account:
  2442. type: object
  2443. properties:
  2444. id:
  2445. description: Account id to report
  2446. type: integer
  2447. required:
  2448. - reason
  2449. responses:
  2450. '200':
  2451. description: successful operation
  2452. content:
  2453. application/json:
  2454. schema:
  2455. type: object
  2456. properties:
  2457. abuse:
  2458. type: object
  2459. properties:
  2460. id:
  2461. $ref: '#/components/schemas/id'
  2462. '400':
  2463. description: incorrect request parameters
  2464. '/abuses/{abuseId}':
  2465. put:
  2466. summary: Update an abuse
  2467. security:
  2468. - OAuth2:
  2469. - admin
  2470. - moderator
  2471. tags:
  2472. - Abuses
  2473. parameters:
  2474. - $ref: '#/components/parameters/abuseId'
  2475. requestBody:
  2476. content:
  2477. application/json:
  2478. schema:
  2479. type: object
  2480. properties:
  2481. state:
  2482. $ref: '#/components/schemas/AbuseStateSet'
  2483. moderationComment:
  2484. type: string
  2485. description: Update the report comment visible only to the moderation team
  2486. minLength: 2
  2487. maxLength: 3000
  2488. responses:
  2489. '204':
  2490. description: successful operation
  2491. '404':
  2492. description: abuse not found
  2493. delete:
  2494. tags:
  2495. - Abuses
  2496. summary: Delete an abuse
  2497. security:
  2498. - OAuth2:
  2499. - admin
  2500. - moderator
  2501. parameters:
  2502. - $ref: '#/components/parameters/abuseId'
  2503. responses:
  2504. '204':
  2505. description: successful operation
  2506. '404':
  2507. description: block not found
  2508. '/abuses/{abuseId}/messages':
  2509. get:
  2510. summary: List messages of an abuse
  2511. security:
  2512. - OAuth2: []
  2513. tags:
  2514. - Abuses
  2515. parameters:
  2516. - $ref: '#/components/parameters/abuseId'
  2517. responses:
  2518. '200':
  2519. description: successful operation
  2520. content:
  2521. application/json:
  2522. schema:
  2523. type: object
  2524. properties:
  2525. total:
  2526. type: integer
  2527. example: 1
  2528. data:
  2529. type: array
  2530. items:
  2531. $ref: '#/components/schemas/AbuseMessage'
  2532. post:
  2533. summary: Add message to an abuse
  2534. security:
  2535. - OAuth2: []
  2536. tags:
  2537. - Abuses
  2538. parameters:
  2539. - $ref: '#/components/parameters/abuseId'
  2540. requestBody:
  2541. required: true
  2542. content:
  2543. application/json:
  2544. schema:
  2545. type: object
  2546. properties:
  2547. message:
  2548. description: Message to send
  2549. type: string
  2550. minLength: 2
  2551. maxLength: 3000
  2552. required:
  2553. - message
  2554. responses:
  2555. '200':
  2556. description: successful operation
  2557. '400':
  2558. description: incorrect request parameters
  2559. '/abuses/{abuseId}/messages/{abuseMessageId}':
  2560. delete:
  2561. summary: Delete an abuse message
  2562. security:
  2563. - OAuth2: []
  2564. tags:
  2565. - Abuses
  2566. parameters:
  2567. - $ref: '#/components/parameters/abuseId'
  2568. - $ref: '#/components/parameters/abuseMessageId'
  2569. responses:
  2570. '204':
  2571. description: successful operation
  2572. '/videos/{id}/blacklist':
  2573. post:
  2574. summary: Block a video
  2575. operationId: addVideoBlock
  2576. security:
  2577. - OAuth2:
  2578. - admin
  2579. - moderator
  2580. tags:
  2581. - Video Blocks
  2582. parameters:
  2583. - $ref: '#/components/parameters/idOrUUID'
  2584. responses:
  2585. '204':
  2586. description: successful operation
  2587. delete:
  2588. summary: Unblock a video by its id
  2589. operationId: delVideoBlock
  2590. security:
  2591. - OAuth2:
  2592. - admin
  2593. - moderator
  2594. tags:
  2595. - Video Blocks
  2596. parameters:
  2597. - $ref: '#/components/parameters/idOrUUID'
  2598. responses:
  2599. '204':
  2600. description: successful operation
  2601. '404':
  2602. description: block not found
  2603. /videos/blacklist:
  2604. get:
  2605. tags:
  2606. - Video Blocks
  2607. summary: List video blocks
  2608. operationId: getVideoBlocks
  2609. security:
  2610. - OAuth2:
  2611. - admin
  2612. - moderator
  2613. parameters:
  2614. - name: type
  2615. in: query
  2616. description: >
  2617. list only blocks that match this type:
  2618. - `1`: manual block
  2619. - `2`: automatic block that needs review
  2620. schema:
  2621. type: integer
  2622. enum:
  2623. - 1
  2624. - 2
  2625. - name: search
  2626. in: query
  2627. description: plain search that will match with video titles, and more
  2628. schema:
  2629. type: string
  2630. - $ref: '#/components/parameters/start'
  2631. - $ref: '#/components/parameters/count'
  2632. - $ref: '#/components/parameters/blacklistsSort'
  2633. responses:
  2634. '200':
  2635. description: successful operation
  2636. content:
  2637. application/json:
  2638. schema:
  2639. type: object
  2640. properties:
  2641. total:
  2642. type: integer
  2643. example: 1
  2644. data:
  2645. type: array
  2646. items:
  2647. $ref: '#/components/schemas/VideoBlacklist'
  2648. /videos/{id}/captions:
  2649. get:
  2650. summary: List captions of a video
  2651. operationId: getVideoCaptions
  2652. tags:
  2653. - Video Captions
  2654. parameters:
  2655. - $ref: '#/components/parameters/idOrUUID'
  2656. responses:
  2657. '200':
  2658. description: successful operation
  2659. content:
  2660. application/json:
  2661. schema:
  2662. type: object
  2663. properties:
  2664. total:
  2665. type: integer
  2666. example: 1
  2667. data:
  2668. type: array
  2669. items:
  2670. $ref: '#/components/schemas/VideoCaption'
  2671. /videos/{id}/captions/{captionLanguage}:
  2672. put:
  2673. summary: Add or replace a video caption
  2674. operationId: addVideoCaption
  2675. security:
  2676. - OAuth2:
  2677. - user
  2678. tags:
  2679. - Video Captions
  2680. parameters:
  2681. - $ref: '#/components/parameters/idOrUUID'
  2682. - $ref: '#/components/parameters/captionLanguage'
  2683. requestBody:
  2684. content:
  2685. multipart/form-data:
  2686. schema:
  2687. type: object
  2688. properties:
  2689. captionfile:
  2690. description: The file to upload.
  2691. type: string
  2692. format: binary
  2693. encoding:
  2694. captionfile:
  2695. contentType: text/vtt, application/x-subrip, text/plain
  2696. responses:
  2697. '204':
  2698. description: successful operation
  2699. '404':
  2700. description: video or language not found
  2701. delete:
  2702. summary: Delete a video caption
  2703. operationId: delVideoCaption
  2704. security:
  2705. - OAuth2:
  2706. - user
  2707. tags:
  2708. - Video Captions
  2709. parameters:
  2710. - $ref: '#/components/parameters/idOrUUID'
  2711. - $ref: '#/components/parameters/captionLanguage'
  2712. responses:
  2713. '204':
  2714. description: successful operation
  2715. '404':
  2716. description: video or language or caption for that language not found
  2717. /video-channels:
  2718. get:
  2719. summary: List video channels
  2720. operationId: getVideoChannels
  2721. tags:
  2722. - Video Channels
  2723. parameters:
  2724. - $ref: '#/components/parameters/start'
  2725. - $ref: '#/components/parameters/count'
  2726. - $ref: '#/components/parameters/sort'
  2727. responses:
  2728. '200':
  2729. description: successful operation
  2730. content:
  2731. application/json:
  2732. schema:
  2733. $ref: '#/components/schemas/VideoChannelList'
  2734. post:
  2735. summary: Create a video channel
  2736. operationId: addVideoChannel
  2737. security:
  2738. - OAuth2: []
  2739. tags:
  2740. - Video Channels
  2741. responses:
  2742. '204':
  2743. description: successful operation
  2744. content:
  2745. application/json:
  2746. schema:
  2747. type: object
  2748. properties:
  2749. videoChannel:
  2750. type: object
  2751. properties:
  2752. id:
  2753. $ref: '#/components/schemas/VideoChannel/properties/id'
  2754. requestBody:
  2755. content:
  2756. application/json:
  2757. schema:
  2758. $ref: '#/components/schemas/VideoChannelCreate'
  2759. '/video-channels/{channelHandle}':
  2760. get:
  2761. summary: Get a video channel
  2762. operationId: getVideoChannel
  2763. tags:
  2764. - Video Channels
  2765. parameters:
  2766. - $ref: '#/components/parameters/channelHandle'
  2767. responses:
  2768. '200':
  2769. description: successful operation
  2770. content:
  2771. application/json:
  2772. schema:
  2773. $ref: '#/components/schemas/VideoChannel'
  2774. put:
  2775. summary: Update a video channel
  2776. operationId: putVideoChannel
  2777. security:
  2778. - OAuth2: []
  2779. tags:
  2780. - Video Channels
  2781. parameters:
  2782. - $ref: '#/components/parameters/channelHandle'
  2783. responses:
  2784. '204':
  2785. description: successful operation
  2786. requestBody:
  2787. content:
  2788. application/json:
  2789. schema:
  2790. $ref: '#/components/schemas/VideoChannelUpdate'
  2791. delete:
  2792. summary: Delete a video channel
  2793. operationId: delVideoChannel
  2794. security:
  2795. - OAuth2: []
  2796. tags:
  2797. - Video Channels
  2798. parameters:
  2799. - $ref: '#/components/parameters/channelHandle'
  2800. responses:
  2801. '204':
  2802. description: successful operation
  2803. '/video-channels/{channelHandle}/videos':
  2804. get:
  2805. summary: List videos of a video channel
  2806. operationId: getVideoChannelVideos
  2807. tags:
  2808. - Video
  2809. - Video Channels
  2810. parameters:
  2811. - $ref: '#/components/parameters/channelHandle'
  2812. - $ref: '#/components/parameters/categoryOneOf'
  2813. - $ref: '#/components/parameters/isLive'
  2814. - $ref: '#/components/parameters/tagsOneOf'
  2815. - $ref: '#/components/parameters/tagsAllOf'
  2816. - $ref: '#/components/parameters/licenceOneOf'
  2817. - $ref: '#/components/parameters/languageOneOf'
  2818. - $ref: '#/components/parameters/nsfw'
  2819. - $ref: '#/components/parameters/isLocal'
  2820. - $ref: '#/components/parameters/include'
  2821. - $ref: '#/components/parameters/privacyOneOf'
  2822. - $ref: '#/components/parameters/hasHLSFiles'
  2823. - $ref: '#/components/parameters/hasWebtorrentFiles'
  2824. - $ref: '#/components/parameters/skipCount'
  2825. - $ref: '#/components/parameters/start'
  2826. - $ref: '#/components/parameters/count'
  2827. - $ref: '#/components/parameters/videosSort'
  2828. responses:
  2829. '200':
  2830. description: successful operation
  2831. content:
  2832. application/json:
  2833. schema:
  2834. $ref: '#/components/schemas/VideoListResponse'
  2835. '/video-channels/{channelHandle}/followers':
  2836. get:
  2837. tags:
  2838. - Video Channels
  2839. summary: 'List followers of a video channel'
  2840. security:
  2841. - OAuth2: []
  2842. operationId: getVideoChannelFollowers
  2843. parameters:
  2844. - $ref: '#/components/parameters/channelHandle'
  2845. - $ref: '#/components/parameters/start'
  2846. - $ref: '#/components/parameters/count'
  2847. - $ref: '#/components/parameters/followersSort'
  2848. - $ref: '#/components/parameters/search'
  2849. responses:
  2850. '200':
  2851. description: successful operation
  2852. content:
  2853. application/json:
  2854. schema:
  2855. type: object
  2856. properties:
  2857. total:
  2858. type: integer
  2859. example: 1
  2860. data:
  2861. type: array
  2862. items:
  2863. $ref: '#/components/schemas/Follow'
  2864. '/video-channels/{channelHandle}/avatar/pick':
  2865. post:
  2866. summary: Update channel avatar
  2867. security:
  2868. - OAuth2: []
  2869. tags:
  2870. - Video Channels
  2871. parameters:
  2872. - $ref: '#/components/parameters/channelHandle'
  2873. responses:
  2874. '200':
  2875. description: successful operation
  2876. content:
  2877. application/json:
  2878. schema:
  2879. type: object
  2880. properties:
  2881. avatar:
  2882. $ref: '#/components/schemas/ActorImage'
  2883. '413':
  2884. description: image file too large
  2885. headers:
  2886. X-File-Maximum-Size:
  2887. schema:
  2888. type: string
  2889. format: Nginx size
  2890. description: Maximum file size for the avatar
  2891. requestBody:
  2892. content:
  2893. multipart/form-data:
  2894. schema:
  2895. type: object
  2896. properties:
  2897. avatarfile:
  2898. description: The file to upload.
  2899. type: string
  2900. format: binary
  2901. encoding:
  2902. avatarfile:
  2903. contentType: image/png, image/jpeg
  2904. '/video-channels/{channelHandle}/avatar':
  2905. delete:
  2906. summary: Delete channel avatar
  2907. security:
  2908. - OAuth2: []
  2909. tags:
  2910. - Video Channels
  2911. parameters:
  2912. - $ref: '#/components/parameters/channelHandle'
  2913. responses:
  2914. '204':
  2915. description: successful operation
  2916. '/video-channels/{channelHandle}/banner/pick':
  2917. post:
  2918. summary: Update channel banner
  2919. security:
  2920. - OAuth2: []
  2921. tags:
  2922. - Video Channels
  2923. parameters:
  2924. - $ref: '#/components/parameters/channelHandle'
  2925. responses:
  2926. '200':
  2927. description: successful operation
  2928. content:
  2929. application/json:
  2930. schema:
  2931. type: object
  2932. properties:
  2933. banner:
  2934. $ref: '#/components/schemas/ActorImage'
  2935. '413':
  2936. description: image file too large
  2937. headers:
  2938. X-File-Maximum-Size:
  2939. schema:
  2940. type: string
  2941. format: Nginx size
  2942. description: Maximum file size for the banner
  2943. requestBody:
  2944. content:
  2945. multipart/form-data:
  2946. schema:
  2947. type: object
  2948. properties:
  2949. bannerfile:
  2950. description: The file to upload.
  2951. type: string
  2952. format: binary
  2953. encoding:
  2954. bannerfile:
  2955. contentType: image/png, image/jpeg
  2956. '/video-channels/{channelHandle}/banner':
  2957. delete:
  2958. summary: Delete channel banner
  2959. security:
  2960. - OAuth2: []
  2961. tags:
  2962. - Video Channels
  2963. parameters:
  2964. - $ref: '#/components/parameters/channelHandle'
  2965. responses:
  2966. '204':
  2967. description: successful operation
  2968. /video-playlists/privacies:
  2969. get:
  2970. summary: List available playlist privacy policies
  2971. operationId: getPlaylistPrivacyPolicies
  2972. tags:
  2973. - Video Playlists
  2974. responses:
  2975. '200':
  2976. description: successful operation
  2977. content:
  2978. application/json:
  2979. schema:
  2980. type: array
  2981. items:
  2982. type: string
  2983. examples:
  2984. nightly:
  2985. externalValue: https://peertube2.cpy.re/api/v1/video-playlists/privacies
  2986. /video-playlists:
  2987. get:
  2988. summary: List video playlists
  2989. operationId: getPlaylists
  2990. tags:
  2991. - Video Playlists
  2992. parameters:
  2993. - $ref: '#/components/parameters/start'
  2994. - $ref: '#/components/parameters/count'
  2995. - $ref: '#/components/parameters/sort'
  2996. responses:
  2997. '200':
  2998. description: successful operation
  2999. content:
  3000. application/json:
  3001. schema:
  3002. type: object
  3003. properties:
  3004. total:
  3005. type: integer
  3006. example: 1
  3007. data:
  3008. type: array
  3009. items:
  3010. $ref: '#/components/schemas/VideoPlaylist'
  3011. post:
  3012. summary: Create a video playlist
  3013. description: If the video playlist is set as public, `videoChannelId` is mandatory.
  3014. operationId: addPlaylist
  3015. security:
  3016. - OAuth2: []
  3017. tags:
  3018. - Video Playlists
  3019. responses:
  3020. '200':
  3021. description: successful operation
  3022. content:
  3023. application/json:
  3024. schema:
  3025. type: object
  3026. properties:
  3027. videoPlaylist:
  3028. type: object
  3029. properties:
  3030. id:
  3031. $ref: '#/components/schemas/VideoPlaylist/properties/id'
  3032. uuid:
  3033. $ref: '#/components/schemas/VideoPlaylist/properties/uuid'
  3034. shortUUID:
  3035. $ref: '#/components/schemas/VideoPlaylist/properties/shortUUID'
  3036. requestBody:
  3037. content:
  3038. multipart/form-data:
  3039. schema:
  3040. type: object
  3041. properties:
  3042. displayName:
  3043. description: Video playlist display name
  3044. type: string
  3045. minLength: 1
  3046. maxLength: 120
  3047. thumbnailfile:
  3048. description: Video playlist thumbnail file
  3049. type: string
  3050. format: binary
  3051. privacy:
  3052. $ref: '#/components/schemas/VideoPlaylistPrivacySet'
  3053. description:
  3054. description: Video playlist description
  3055. type: string
  3056. minLength: 3
  3057. maxLength: 1000
  3058. videoChannelId:
  3059. allOf:
  3060. - $ref: '#/components/schemas/id'
  3061. description: Video channel in which the playlist will be published
  3062. required:
  3063. - displayName
  3064. encoding:
  3065. thumbnailfile:
  3066. contentType: image/jpeg
  3067. /video-playlists/{playlistId}:
  3068. get:
  3069. summary: Get a video playlist
  3070. tags:
  3071. - Video Playlists
  3072. parameters:
  3073. - $ref: '#/components/parameters/playlistId'
  3074. responses:
  3075. '200':
  3076. description: successful operation
  3077. content:
  3078. application/json:
  3079. schema:
  3080. $ref: '#/components/schemas/VideoPlaylist'
  3081. put:
  3082. summary: Update a video playlist
  3083. description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
  3084. security:
  3085. - OAuth2: []
  3086. tags:
  3087. - Video Playlists
  3088. responses:
  3089. '204':
  3090. description: successful operation
  3091. parameters:
  3092. - $ref: '#/components/parameters/playlistId'
  3093. requestBody:
  3094. content:
  3095. multipart/form-data:
  3096. schema:
  3097. type: object
  3098. properties:
  3099. displayName:
  3100. description: Video playlist display name
  3101. type: string
  3102. minLength: 1
  3103. maxLength: 120
  3104. thumbnailfile:
  3105. description: Video playlist thumbnail file
  3106. type: string
  3107. format: binary
  3108. privacy:
  3109. $ref: '#/components/schemas/VideoPlaylistPrivacySet'
  3110. description:
  3111. description: Video playlist description
  3112. type: string
  3113. videoChannelId:
  3114. allOf:
  3115. - $ref: '#/components/schemas/id'
  3116. description: Video channel in which the playlist will be published
  3117. encoding:
  3118. thumbnailfile:
  3119. contentType: image/jpeg
  3120. delete:
  3121. summary: Delete a video playlist
  3122. security:
  3123. - OAuth2: []
  3124. tags:
  3125. - Video Playlists
  3126. parameters:
  3127. - $ref: '#/components/parameters/playlistId'
  3128. responses:
  3129. '204':
  3130. description: successful operation
  3131. /video-playlists/{playlistId}/videos:
  3132. get:
  3133. summary: 'List videos of a playlist'
  3134. operationId: getVideoPlaylistVideos
  3135. tags:
  3136. - Videos
  3137. - Video Playlists
  3138. parameters:
  3139. - $ref: '#/components/parameters/playlistId'
  3140. - $ref: '#/components/parameters/start'
  3141. - $ref: '#/components/parameters/count'
  3142. responses:
  3143. '200':
  3144. description: successful operation
  3145. content:
  3146. application/json:
  3147. schema:
  3148. $ref: '#/components/schemas/VideoListResponse'
  3149. post:
  3150. summary: Add a video in a playlist
  3151. operationId: addVideoPlaylistVideo
  3152. security:
  3153. - OAuth2: []
  3154. tags:
  3155. - Videos
  3156. - Video Playlists
  3157. parameters:
  3158. - $ref: '#/components/parameters/playlistId'
  3159. responses:
  3160. '200':
  3161. description: successful operation
  3162. content:
  3163. application/json:
  3164. schema:
  3165. type: object
  3166. properties:
  3167. videoPlaylistElement:
  3168. type: object
  3169. properties:
  3170. id:
  3171. type: integer
  3172. example: 2
  3173. requestBody:
  3174. content:
  3175. application/json:
  3176. schema:
  3177. type: object
  3178. properties:
  3179. videoId:
  3180. oneOf:
  3181. - $ref: '#/components/schemas/Video/properties/uuid'
  3182. - $ref: '#/components/schemas/Video/properties/id'
  3183. description: Video to add in the playlist
  3184. startTimestamp:
  3185. type: integer
  3186. format: seconds
  3187. description: Start the video at this specific timestamp
  3188. stopTimestamp:
  3189. type: integer
  3190. format: seconds
  3191. description: Stop the video at this specific timestamp
  3192. required:
  3193. - videoId
  3194. /video-playlists/{playlistId}/videos/reorder:
  3195. post:
  3196. summary: 'Reorder a playlist'
  3197. operationId: reorderVideoPlaylist
  3198. security:
  3199. - OAuth2: []
  3200. tags:
  3201. - Video Playlists
  3202. parameters:
  3203. - $ref: '#/components/parameters/playlistId'
  3204. responses:
  3205. '204':
  3206. description: successful operation
  3207. requestBody:
  3208. content:
  3209. application/json:
  3210. schema:
  3211. type: object
  3212. properties:
  3213. startPosition:
  3214. type: integer
  3215. description: 'Start position of the element to reorder'
  3216. minimum: 1
  3217. insertAfterPosition:
  3218. type: integer
  3219. description: 'New position for the block to reorder, to add the block before the first element'
  3220. minimum: 0
  3221. reorderLength:
  3222. type: integer
  3223. description: 'How many element from `startPosition` to reorder'
  3224. minimum: 1
  3225. required:
  3226. - startPosition
  3227. - insertAfterPosition
  3228. /video-playlists/{playlistId}/videos/{playlistElementId}:
  3229. put:
  3230. summary: Update a playlist element
  3231. operationId: putVideoPlaylistVideo
  3232. security:
  3233. - OAuth2: []
  3234. tags:
  3235. - Video Playlists
  3236. parameters:
  3237. - $ref: '#/components/parameters/playlistId'
  3238. - $ref: '#/components/parameters/playlistElementId'
  3239. responses:
  3240. '204':
  3241. description: successful operation
  3242. requestBody:
  3243. content:
  3244. application/json:
  3245. schema:
  3246. type: object
  3247. properties:
  3248. startTimestamp:
  3249. type: integer
  3250. format: seconds
  3251. description: Start the video at this specific timestamp
  3252. stopTimestamp:
  3253. type: integer
  3254. format: seconds
  3255. description: Stop the video at this specific timestamp
  3256. delete:
  3257. summary: Delete an element from a playlist
  3258. operationId: delVideoPlaylistVideo
  3259. security:
  3260. - OAuth2: []
  3261. tags:
  3262. - Video Playlists
  3263. parameters:
  3264. - $ref: '#/components/parameters/playlistId'
  3265. - $ref: '#/components/parameters/playlistElementId'
  3266. responses:
  3267. '204':
  3268. description: successful operation
  3269. '/users/me/video-playlists/videos-exist':
  3270. get:
  3271. summary: Check video exists in my playlists
  3272. security:
  3273. - OAuth2: []
  3274. tags:
  3275. - Video Playlists
  3276. parameters:
  3277. - name: videoIds
  3278. in: query
  3279. required: true
  3280. description: The video ids to check
  3281. schema:
  3282. type: array
  3283. items:
  3284. $ref: '#/components/schemas/Video/properties/id'
  3285. responses:
  3286. '200':
  3287. description: successful operation
  3288. content:
  3289. application/json:
  3290. schema:
  3291. type: object
  3292. properties:
  3293. videoId:
  3294. type: array
  3295. items:
  3296. type: object
  3297. properties:
  3298. playlistElementId:
  3299. type: integer
  3300. playlistId:
  3301. type: integer
  3302. startTimestamp:
  3303. type: integer
  3304. format: seconds
  3305. stopTimestamp:
  3306. type: integer
  3307. format: seconds
  3308. '/accounts/{name}/video-channels':
  3309. get:
  3310. summary: List video channels of an account
  3311. tags:
  3312. - Video Channels
  3313. - Accounts
  3314. parameters:
  3315. - $ref: '#/components/parameters/name'
  3316. - name: withStats
  3317. in: query
  3318. description: include view statistics for the last 30 days (only if authentified as the account user)
  3319. schema:
  3320. type: boolean
  3321. - $ref: '#/components/parameters/start'
  3322. - $ref: '#/components/parameters/count'
  3323. - $ref: '#/components/parameters/sort'
  3324. responses:
  3325. '200':
  3326. description: successful operation
  3327. content:
  3328. application/json:
  3329. schema:
  3330. $ref: '#/components/schemas/VideoChannelList'
  3331. '/accounts/{name}/ratings':
  3332. get:
  3333. summary: List ratings of an account
  3334. security:
  3335. - OAuth2: []
  3336. tags:
  3337. - Accounts
  3338. parameters:
  3339. - $ref: '#/components/parameters/name'
  3340. - $ref: '#/components/parameters/start'
  3341. - $ref: '#/components/parameters/count'
  3342. - $ref: '#/components/parameters/sort'
  3343. - name: rating
  3344. in: query
  3345. required: false
  3346. description: Optionally filter which ratings to retrieve
  3347. schema:
  3348. type: string
  3349. enum:
  3350. - like
  3351. - dislike
  3352. responses:
  3353. '200':
  3354. description: successful operation
  3355. content:
  3356. application/json:
  3357. schema:
  3358. type: array
  3359. items:
  3360. $ref: '#/components/schemas/VideoRating'
  3361. '/videos/{id}/comment-threads':
  3362. get:
  3363. summary: List threads of a video
  3364. tags:
  3365. - Video Comments
  3366. parameters:
  3367. - $ref: '#/components/parameters/idOrUUID'
  3368. - $ref: '#/components/parameters/start'
  3369. - $ref: '#/components/parameters/count'
  3370. - $ref: '#/components/parameters/commentsSort'
  3371. responses:
  3372. '200':
  3373. description: successful operation
  3374. content:
  3375. application/json:
  3376. schema:
  3377. $ref: '#/components/schemas/CommentThreadResponse'
  3378. post:
  3379. summary: Create a thread
  3380. security:
  3381. - OAuth2: []
  3382. tags:
  3383. - Video Comments
  3384. parameters:
  3385. - $ref: '#/components/parameters/idOrUUID'
  3386. responses:
  3387. '200':
  3388. description: successful operation
  3389. content:
  3390. application/json:
  3391. schema:
  3392. $ref: '#/components/schemas/CommentThreadPostResponse'
  3393. '404':
  3394. description: video does not exist
  3395. requestBody:
  3396. content:
  3397. application/json:
  3398. schema:
  3399. type: object
  3400. properties:
  3401. text:
  3402. allOf:
  3403. - $ref: '#/components/schemas/VideoComment/properties/text'
  3404. format: markdown
  3405. maxLength: 10000
  3406. required:
  3407. - text
  3408. '/videos/{id}/comment-threads/{threadId}':
  3409. get:
  3410. summary: Get a thread
  3411. tags:
  3412. - Video Comments
  3413. parameters:
  3414. - $ref: '#/components/parameters/idOrUUID'
  3415. - $ref: '#/components/parameters/threadId'
  3416. responses:
  3417. '200':
  3418. description: successful operation
  3419. content:
  3420. application/json:
  3421. schema:
  3422. $ref: '#/components/schemas/VideoCommentThreadTree'
  3423. '/videos/{id}/comments/{commentId}':
  3424. post:
  3425. summary: Reply to a thread of a video
  3426. security:
  3427. - OAuth2: []
  3428. tags:
  3429. - Video Comments
  3430. parameters:
  3431. - $ref: '#/components/parameters/idOrUUID'
  3432. - $ref: '#/components/parameters/commentId'
  3433. responses:
  3434. '200':
  3435. description: successful operation
  3436. content:
  3437. application/json:
  3438. schema:
  3439. $ref: '#/components/schemas/CommentThreadPostResponse'
  3440. '404':
  3441. description: thread or video does not exist
  3442. requestBody:
  3443. content:
  3444. application/json:
  3445. schema:
  3446. type: object
  3447. properties:
  3448. text:
  3449. allOf:
  3450. - $ref: '#/components/schemas/VideoComment/properties/text'
  3451. format: markdown
  3452. maxLength: 10000
  3453. required:
  3454. - text
  3455. delete:
  3456. summary: Delete a comment or a reply
  3457. security:
  3458. - OAuth2: []
  3459. tags:
  3460. - Video Comments
  3461. parameters:
  3462. - $ref: '#/components/parameters/idOrUUID'
  3463. - $ref: '#/components/parameters/commentId'
  3464. responses:
  3465. '204':
  3466. description: successful operation
  3467. '403':
  3468. description: cannot remove comment of another user
  3469. '404':
  3470. description: comment or video does not exist
  3471. '409':
  3472. description: comment is already deleted
  3473. '/videos/{id}/rate':
  3474. put:
  3475. summary: Like/dislike a video
  3476. security:
  3477. - OAuth2: []
  3478. tags:
  3479. - Video Rates
  3480. parameters:
  3481. - $ref: '#/components/parameters/idOrUUID'
  3482. requestBody:
  3483. content:
  3484. application/json:
  3485. schema:
  3486. type: object
  3487. properties:
  3488. rating:
  3489. type: string
  3490. enum:
  3491. - like
  3492. - dislike
  3493. required:
  3494. - rating
  3495. responses:
  3496. '204':
  3497. description: successful operation
  3498. '404':
  3499. description: video does not exist
  3500. '/videos/{id}/hls':
  3501. delete:
  3502. summary: Delete video HLS files
  3503. security:
  3504. - OAuth2:
  3505. - admin
  3506. tags:
  3507. - Video Files
  3508. operationId: delVideoHLS
  3509. parameters:
  3510. - $ref: '#/components/parameters/idOrUUID'
  3511. responses:
  3512. '204':
  3513. description: successful operation
  3514. '404':
  3515. description: video does not exist
  3516. '/videos/{id}/webtorrent':
  3517. delete:
  3518. summary: Delete video WebTorrent files
  3519. security:
  3520. - OAuth2:
  3521. - admin
  3522. tags:
  3523. - Video Files
  3524. operationId: delVideoWebTorrent
  3525. parameters:
  3526. - $ref: '#/components/parameters/idOrUUID'
  3527. responses:
  3528. '204':
  3529. description: successful operation
  3530. '404':
  3531. description: video does not exist
  3532. '/videos/{id}/transcoding':
  3533. post:
  3534. summary: Create a transcoding job
  3535. security:
  3536. - OAuth2:
  3537. - admin
  3538. tags:
  3539. - Video Transcoding
  3540. operationId: createVideoTranscoding
  3541. parameters:
  3542. - $ref: '#/components/parameters/idOrUUID'
  3543. requestBody:
  3544. content:
  3545. application/json:
  3546. schema:
  3547. type: object
  3548. properties:
  3549. transcodingType:
  3550. type: string
  3551. enum:
  3552. - hls
  3553. - webtorrent
  3554. required:
  3555. - transcodingType
  3556. responses:
  3557. '204':
  3558. description: successful operation
  3559. '404':
  3560. description: video does not exist
  3561. /search/videos:
  3562. get:
  3563. tags:
  3564. - Search
  3565. summary: Search videos
  3566. operationId: searchVideos
  3567. parameters:
  3568. - name: search
  3569. in: query
  3570. required: true
  3571. allowEmptyValue: false
  3572. description: >
  3573. String to search. If the user can make a remote URI search, and the string is an URI then the
  3574. PeerTube instance will fetch the remote object and add it to its database. Then,
  3575. you can use the REST API to fetch the complete video information and interact with it.
  3576. schema:
  3577. type: string
  3578. - $ref: '#/components/parameters/categoryOneOf'
  3579. - $ref: '#/components/parameters/isLive'
  3580. - $ref: '#/components/parameters/tagsOneOf'
  3581. - $ref: '#/components/parameters/tagsAllOf'
  3582. - $ref: '#/components/parameters/licenceOneOf'
  3583. - $ref: '#/components/parameters/languageOneOf'
  3584. - $ref: '#/components/parameters/nsfw'
  3585. - $ref: '#/components/parameters/isLocal'
  3586. - $ref: '#/components/parameters/include'
  3587. - $ref: '#/components/parameters/privacyOneOf'
  3588. - $ref: '#/components/parameters/hasHLSFiles'
  3589. - $ref: '#/components/parameters/hasWebtorrentFiles'
  3590. - $ref: '#/components/parameters/skipCount'
  3591. - $ref: '#/components/parameters/start'
  3592. - $ref: '#/components/parameters/count'
  3593. - $ref: '#/components/parameters/searchTarget'
  3594. - $ref: '#/components/parameters/videosSearchSort'
  3595. - name: startDate
  3596. in: query
  3597. description: Get videos that are published after this date
  3598. schema:
  3599. type: string
  3600. format: date-time
  3601. - name: endDate
  3602. in: query
  3603. description: Get videos that are published before this date
  3604. schema:
  3605. type: string
  3606. format: date-time
  3607. - name: originallyPublishedStartDate
  3608. in: query
  3609. description: Get videos that are originally published after this date
  3610. schema:
  3611. type: string
  3612. format: date-time
  3613. - name: originallyPublishedEndDate
  3614. in: query
  3615. description: Get videos that are originally published before this date
  3616. schema:
  3617. type: string
  3618. format: date-time
  3619. - name: durationMin
  3620. in: query
  3621. description: Get videos that have this minimum duration
  3622. schema:
  3623. type: integer
  3624. - name: durationMax
  3625. in: query
  3626. description: Get videos that have this maximum duration
  3627. schema:
  3628. type: integer
  3629. callbacks:
  3630. 'searchTarget === search-index':
  3631. $ref: '#/components/callbacks/searchIndex'
  3632. responses:
  3633. '200':
  3634. description: successful operation
  3635. content:
  3636. application/json:
  3637. schema:
  3638. $ref: '#/components/schemas/VideoListResponse'
  3639. '500':
  3640. description: search index unavailable
  3641. /search/video-channels:
  3642. get:
  3643. tags:
  3644. - Search
  3645. summary: Search channels
  3646. operationId: searchChannels
  3647. parameters:
  3648. - name: search
  3649. in: query
  3650. required: true
  3651. description: >
  3652. String to search. If the user can make a remote URI search, and the string is an URI then the
  3653. PeerTube instance will fetch the remote object and add it to its database. Then,
  3654. you can use the REST API to fetch the complete channel information and interact with it.
  3655. schema:
  3656. type: string
  3657. - $ref: '#/components/parameters/start'
  3658. - $ref: '#/components/parameters/count'
  3659. - $ref: '#/components/parameters/searchTarget'
  3660. - $ref: '#/components/parameters/sort'
  3661. callbacks:
  3662. 'searchTarget === search-index':
  3663. $ref: '#/components/callbacks/searchIndex'
  3664. responses:
  3665. '200':
  3666. description: successful operation
  3667. content:
  3668. application/json:
  3669. schema:
  3670. $ref: '#/components/schemas/VideoChannelList'
  3671. '500':
  3672. description: search index unavailable
  3673. /search/video-playlists:
  3674. get:
  3675. tags:
  3676. - Search
  3677. summary: Search playlists
  3678. operationId: searchPlaylists
  3679. parameters:
  3680. - name: search
  3681. in: query
  3682. required: true
  3683. description: >
  3684. String to search. If the user can make a remote URI search, and the string is an URI then the
  3685. PeerTube instance will fetch the remote object and add it to its database. Then,
  3686. you can use the REST API to fetch the complete playlist information and interact with it.
  3687. schema:
  3688. type: string
  3689. - $ref: '#/components/parameters/start'
  3690. - $ref: '#/components/parameters/count'
  3691. - $ref: '#/components/parameters/searchTarget'
  3692. - $ref: '#/components/parameters/sort'
  3693. callbacks:
  3694. 'searchTarget === search-index':
  3695. $ref: '#/components/callbacks/searchIndex'
  3696. responses:
  3697. '200':
  3698. description: successful operation
  3699. content:
  3700. application/json:
  3701. schema:
  3702. type: object
  3703. properties:
  3704. total:
  3705. type: integer
  3706. example: 1
  3707. data:
  3708. type: array
  3709. items:
  3710. $ref: '#/components/schemas/VideoPlaylist'
  3711. '500':
  3712. description: search index unavailable
  3713. /blocklist/status:
  3714. get:
  3715. tags:
  3716. - Account Blocks
  3717. - Server Blocks
  3718. summary: Get block status of accounts/hosts
  3719. parameters:
  3720. -
  3721. name: 'accounts'
  3722. in: query
  3723. description: 'Check if these accounts are blocked'
  3724. example: [ 'goofy@example.com', 'donald@example.com' ]
  3725. schema:
  3726. type: array
  3727. items:
  3728. type: string
  3729. -
  3730. name: 'hosts'
  3731. in: query
  3732. description: 'Check if these hosts are blocked'
  3733. example: [ 'example.com' ]
  3734. schema:
  3735. type: array
  3736. items:
  3737. type: string
  3738. responses:
  3739. '200':
  3740. description: successful operation
  3741. content:
  3742. 'application/json':
  3743. schema:
  3744. $ref: '#/components/schemas/BlockStatus'
  3745. /server/blocklist/accounts:
  3746. get:
  3747. tags:
  3748. - Account Blocks
  3749. summary: List account blocks
  3750. security:
  3751. - OAuth2:
  3752. - admin
  3753. parameters:
  3754. - $ref: '#/components/parameters/start'
  3755. - $ref: '#/components/parameters/count'
  3756. - $ref: '#/components/parameters/sort'
  3757. responses:
  3758. '200':
  3759. description: successful operation
  3760. post:
  3761. tags:
  3762. - Account Blocks
  3763. summary: Block an account
  3764. security:
  3765. - OAuth2:
  3766. - admin
  3767. requestBody:
  3768. content:
  3769. application/json:
  3770. schema:
  3771. type: object
  3772. properties:
  3773. accountName:
  3774. type: string
  3775. example: chocobozzz@example.org
  3776. description: account to block, in the form `username@domain`
  3777. required:
  3778. - accountName
  3779. responses:
  3780. '200':
  3781. description: successful operation
  3782. '409':
  3783. description: self-blocking forbidden
  3784. '/server/blocklist/accounts/{accountName}':
  3785. delete:
  3786. tags:
  3787. - Account Blocks
  3788. summary: Unblock an account by its handle
  3789. security:
  3790. - OAuth2:
  3791. - admin
  3792. parameters:
  3793. - name: accountName
  3794. in: path
  3795. required: true
  3796. description: account to unblock, in the form `username@domain`
  3797. schema:
  3798. type: string
  3799. responses:
  3800. '201':
  3801. description: successful operation
  3802. '404':
  3803. description: account or account block does not exist
  3804. /server/blocklist/servers:
  3805. get:
  3806. tags:
  3807. - Server Blocks
  3808. summary: List server blocks
  3809. security:
  3810. - OAuth2:
  3811. - admin
  3812. parameters:
  3813. - $ref: '#/components/parameters/start'
  3814. - $ref: '#/components/parameters/count'
  3815. - $ref: '#/components/parameters/sort'
  3816. responses:
  3817. '200':
  3818. description: successful operation
  3819. post:
  3820. tags:
  3821. - Server Blocks
  3822. summary: Block a server
  3823. security:
  3824. - OAuth2:
  3825. - admin
  3826. requestBody:
  3827. content:
  3828. application/json:
  3829. schema:
  3830. type: object
  3831. properties:
  3832. host:
  3833. type: string
  3834. format: hostname
  3835. description: server domain to block
  3836. required:
  3837. - host
  3838. responses:
  3839. '204':
  3840. description: successful operation
  3841. '409':
  3842. description: self-blocking forbidden
  3843. '/server/blocklist/servers/{host}':
  3844. delete:
  3845. tags:
  3846. - Server Blocks
  3847. summary: Unblock a server by its domain
  3848. security:
  3849. - OAuth2:
  3850. - admin
  3851. parameters:
  3852. - name: host
  3853. in: path
  3854. required: true
  3855. description: server domain to unblock
  3856. schema:
  3857. type: string
  3858. format: hostname
  3859. responses:
  3860. '204':
  3861. description: successful operation
  3862. '404':
  3863. description: account block does not exist
  3864. /server/redundancy/{host}:
  3865. put:
  3866. tags:
  3867. - Instance Redundancy
  3868. summary: Update a server redundancy policy
  3869. security:
  3870. - OAuth2:
  3871. - admin
  3872. parameters:
  3873. - name: host
  3874. in: path
  3875. required: true
  3876. description: server domain to mirror
  3877. schema:
  3878. type: string
  3879. format: hostname
  3880. requestBody:
  3881. content:
  3882. application/json:
  3883. schema:
  3884. type: object
  3885. properties:
  3886. redundancyAllowed:
  3887. type: boolean
  3888. description: allow mirroring of the host's local videos
  3889. required:
  3890. - redundancyAllowed
  3891. responses:
  3892. '204':
  3893. description: successful operation
  3894. '404':
  3895. description: server is not already known
  3896. /server/redundancy/videos:
  3897. get:
  3898. tags:
  3899. - Video Mirroring
  3900. summary: List videos being mirrored
  3901. operationId: getMirroredVideos
  3902. security:
  3903. - OAuth2:
  3904. - admin
  3905. parameters:
  3906. - name: target
  3907. in: query
  3908. required: true
  3909. description: direction of the mirror
  3910. schema:
  3911. type: string
  3912. enum:
  3913. - my-videos
  3914. - remote-videos
  3915. - $ref: '#/components/parameters/start'
  3916. - $ref: '#/components/parameters/count'
  3917. - $ref: '#/components/parameters/videoRedundanciesSort'
  3918. responses:
  3919. '200':
  3920. description: successful operation
  3921. content:
  3922. application/json:
  3923. schema:
  3924. type: array
  3925. items:
  3926. $ref: '#/components/schemas/VideoRedundancy'
  3927. post:
  3928. tags:
  3929. - Video Mirroring
  3930. summary: Mirror a video
  3931. operationId: putMirroredVideo
  3932. security:
  3933. - OAuth2:
  3934. - admin
  3935. requestBody:
  3936. content:
  3937. application/json:
  3938. schema:
  3939. type: object
  3940. properties:
  3941. videoId:
  3942. $ref: '#/components/schemas/Video/properties/id'
  3943. required:
  3944. - videoId
  3945. responses:
  3946. '204':
  3947. description: successful operation
  3948. '400':
  3949. description: cannot mirror a local video
  3950. '404':
  3951. description: video does not exist
  3952. '409':
  3953. description: video is already mirrored
  3954. /server/redundancy/videos/{redundancyId}:
  3955. delete:
  3956. tags:
  3957. - Video Mirroring
  3958. summary: Delete a mirror done on a video
  3959. operationId: delMirroredVideo
  3960. security:
  3961. - OAuth2:
  3962. - admin
  3963. parameters:
  3964. - name: redundancyId
  3965. in: path
  3966. required: true
  3967. description: id of an existing redundancy on a video
  3968. schema:
  3969. type: string
  3970. responses:
  3971. '204':
  3972. description: successful operation
  3973. '404':
  3974. description: video redundancy not found
  3975. '/feeds/video-comments.{format}':
  3976. get:
  3977. tags:
  3978. - Feeds
  3979. summary: List comments on videos
  3980. operationId: getSyndicatedComments
  3981. parameters:
  3982. - name: format
  3983. in: path
  3984. required: true
  3985. description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
  3986. schema:
  3987. type: string
  3988. enum:
  3989. - xml
  3990. - rss
  3991. - rss2
  3992. - atom
  3993. - atom1
  3994. - json
  3995. - json1
  3996. - name: videoId
  3997. in: query
  3998. description: 'limit listing to a specific video'
  3999. schema:
  4000. type: string
  4001. - name: accountId
  4002. in: query
  4003. description: 'limit listing to a specific account'
  4004. schema:
  4005. type: string
  4006. - name: accountName
  4007. in: query
  4008. description: 'limit listing to a specific account'
  4009. schema:
  4010. type: string
  4011. - name: videoChannelId
  4012. in: query
  4013. description: 'limit listing to a specific video channel'
  4014. schema:
  4015. type: string
  4016. - name: videoChannelName
  4017. in: query
  4018. description: 'limit listing to a specific video channel'
  4019. schema:
  4020. type: string
  4021. responses:
  4022. '204':
  4023. description: successful operation
  4024. headers:
  4025. Cache-Control:
  4026. schema:
  4027. type: string
  4028. default: 'max-age=900' # 15 min cache
  4029. content:
  4030. application/xml:
  4031. schema:
  4032. $ref: '#/components/schemas/VideoCommentsForXML'
  4033. examples:
  4034. nightly:
  4035. externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local
  4036. application/rss+xml:
  4037. schema:
  4038. $ref: '#/components/schemas/VideoCommentsForXML'
  4039. examples:
  4040. nightly:
  4041. externalValue: https://peertube2.cpy.re/feeds/video-comments.rss?filter=local
  4042. text/xml:
  4043. schema:
  4044. $ref: '#/components/schemas/VideoCommentsForXML'
  4045. examples:
  4046. nightly:
  4047. externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local
  4048. application/atom+xml:
  4049. schema:
  4050. $ref: '#/components/schemas/VideoCommentsForXML'
  4051. examples:
  4052. nightly:
  4053. externalValue: https://peertube2.cpy.re/feeds/video-comments.atom?filter=local
  4054. application/json:
  4055. schema:
  4056. type: object
  4057. examples:
  4058. nightly:
  4059. externalValue: https://peertube2.cpy.re/feeds/video-comments.json?filter=local
  4060. '400':
  4061. x-summary: field inconsistencies
  4062. description: >
  4063. Arises when:
  4064. - videoId filter is mixed with a channel filter
  4065. '404':
  4066. description: video, video channel or account not found
  4067. '406':
  4068. description: accept header unsupported
  4069. '/feeds/videos.{format}':
  4070. get:
  4071. tags:
  4072. - Feeds
  4073. summary: List videos
  4074. operationId: getSyndicatedVideos
  4075. parameters:
  4076. - name: format
  4077. in: path
  4078. required: true
  4079. description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
  4080. schema:
  4081. type: string
  4082. enum:
  4083. - xml
  4084. - rss
  4085. - rss2
  4086. - atom
  4087. - atom1
  4088. - json
  4089. - json1
  4090. - name: accountId
  4091. in: query
  4092. description: 'limit listing to a specific account'
  4093. schema:
  4094. type: string
  4095. - name: accountName
  4096. in: query
  4097. description: 'limit listing to a specific account'
  4098. schema:
  4099. type: string
  4100. - name: videoChannelId
  4101. in: query
  4102. description: 'limit listing to a specific video channel'
  4103. schema:
  4104. type: string
  4105. - name: videoChannelName
  4106. in: query
  4107. description: 'limit listing to a specific video channel'
  4108. schema:
  4109. type: string
  4110. - $ref: '#/components/parameters/sort'
  4111. - $ref: '#/components/parameters/nsfw'
  4112. - $ref: '#/components/parameters/isLocal'
  4113. - $ref: '#/components/parameters/include'
  4114. - $ref: '#/components/parameters/privacyOneOf'
  4115. - $ref: '#/components/parameters/hasHLSFiles'
  4116. - $ref: '#/components/parameters/hasWebtorrentFiles'
  4117. responses:
  4118. '204':
  4119. description: successful operation
  4120. headers:
  4121. Cache-Control:
  4122. schema:
  4123. type: string
  4124. default: 'max-age=900' # 15 min cache
  4125. content:
  4126. application/xml:
  4127. schema:
  4128. $ref: '#/components/schemas/VideosForXML'
  4129. examples:
  4130. nightly:
  4131. externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
  4132. application/rss+xml:
  4133. schema:
  4134. $ref: '#/components/schemas/VideosForXML'
  4135. examples:
  4136. nightly:
  4137. externalValue: https://peertube2.cpy.re/feeds/videos.rss?filter=local
  4138. text/xml:
  4139. schema:
  4140. $ref: '#/components/schemas/VideosForXML'
  4141. examples:
  4142. nightly:
  4143. externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
  4144. application/atom+xml:
  4145. schema:
  4146. $ref: '#/components/schemas/VideosForXML'
  4147. examples:
  4148. nightly:
  4149. externalValue: https://peertube2.cpy.re/feeds/videos.atom?filter=local
  4150. application/json:
  4151. schema:
  4152. type: object
  4153. examples:
  4154. nightly:
  4155. externalValue: https://peertube2.cpy.re/feeds/videos.json?filter=local
  4156. '404':
  4157. description: video channel or account not found
  4158. '406':
  4159. description: accept header unsupported
  4160. '/feeds/subscriptions.{format}':
  4161. get:
  4162. tags:
  4163. - Feeds
  4164. - Account
  4165. summary: List videos of subscriptions tied to a token
  4166. operationId: getSyndicatedSubscriptionVideos
  4167. parameters:
  4168. - name: format
  4169. in: path
  4170. required: true
  4171. description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
  4172. schema:
  4173. type: string
  4174. enum:
  4175. - xml
  4176. - rss
  4177. - rss2
  4178. - atom
  4179. - atom1
  4180. - json
  4181. - json1
  4182. - name: accountId
  4183. in: query
  4184. description: limit listing to a specific account
  4185. schema:
  4186. type: string
  4187. required: true
  4188. - name: token
  4189. in: query
  4190. description: private token allowing access
  4191. schema:
  4192. type: string
  4193. required: true
  4194. - $ref: '#/components/parameters/sort'
  4195. - $ref: '#/components/parameters/nsfw'
  4196. - $ref: '#/components/parameters/isLocal'
  4197. - $ref: '#/components/parameters/include'
  4198. - $ref: '#/components/parameters/privacyOneOf'
  4199. - $ref: '#/components/parameters/hasHLSFiles'
  4200. - $ref: '#/components/parameters/hasWebtorrentFiles'
  4201. responses:
  4202. '204':
  4203. description: successful operation
  4204. headers:
  4205. Cache-Control:
  4206. schema:
  4207. type: string
  4208. default: 'max-age=900' # 15 min cache
  4209. content:
  4210. application/xml:
  4211. schema:
  4212. $ref: '#/components/schemas/VideosForXML'
  4213. application/rss+xml:
  4214. schema:
  4215. $ref: '#/components/schemas/VideosForXML'
  4216. text/xml:
  4217. schema:
  4218. $ref: '#/components/schemas/VideosForXML'
  4219. application/atom+xml:
  4220. schema:
  4221. $ref: '#/components/schemas/VideosForXML'
  4222. application/json:
  4223. schema:
  4224. type: object
  4225. '406':
  4226. description: accept header unsupported
  4227. /plugins:
  4228. get:
  4229. tags:
  4230. - Plugins
  4231. summary: List plugins
  4232. operationId: getPlugins
  4233. security:
  4234. - OAuth2:
  4235. - admin
  4236. parameters:
  4237. - name: pluginType
  4238. in: query
  4239. schema:
  4240. type: integer
  4241. - name: uninstalled
  4242. in: query
  4243. schema:
  4244. type: boolean
  4245. - $ref: '#/components/parameters/start'
  4246. - $ref: '#/components/parameters/count'
  4247. - $ref: '#/components/parameters/sort'
  4248. responses:
  4249. '200':
  4250. description: successful operation
  4251. content:
  4252. application/json:
  4253. schema:
  4254. $ref: '#/components/schemas/PluginResponse'
  4255. /plugins/available:
  4256. get:
  4257. tags:
  4258. - Plugins
  4259. summary: List available plugins
  4260. operationId: getAvailablePlugins
  4261. security:
  4262. - OAuth2:
  4263. - admin
  4264. parameters:
  4265. - name: search
  4266. in: query
  4267. schema:
  4268. type: string
  4269. - name: pluginType
  4270. in: query
  4271. schema:
  4272. type: integer
  4273. - name: currentPeerTubeEngine
  4274. in: query
  4275. schema:
  4276. type: string
  4277. - $ref: '#/components/parameters/start'
  4278. - $ref: '#/components/parameters/count'
  4279. - $ref: '#/components/parameters/sort'
  4280. responses:
  4281. '200':
  4282. description: successful operation
  4283. content:
  4284. application/json:
  4285. schema:
  4286. $ref: '#/components/schemas/PluginResponse'
  4287. '503':
  4288. description: plugin index unavailable
  4289. /plugins/install:
  4290. post:
  4291. tags:
  4292. - Plugins
  4293. summary: Install a plugin
  4294. operationId: addPlugin
  4295. security:
  4296. - OAuth2:
  4297. - admin
  4298. requestBody:
  4299. content:
  4300. application/json:
  4301. schema:
  4302. oneOf:
  4303. - type: object
  4304. properties:
  4305. npmName:
  4306. type: string
  4307. example: peertube-plugin-auth-ldap
  4308. required:
  4309. - npmName
  4310. additionalProperties: false
  4311. - type: object
  4312. properties:
  4313. path:
  4314. type: string
  4315. required:
  4316. - path
  4317. additionalProperties: false
  4318. responses:
  4319. '204':
  4320. description: successful operation
  4321. '400':
  4322. description: should have either `npmName` or `path` set
  4323. /plugins/update:
  4324. post:
  4325. tags:
  4326. - Plugins
  4327. summary: Update a plugin
  4328. operationId: updatePlugin
  4329. security:
  4330. - OAuth2:
  4331. - admin
  4332. requestBody:
  4333. content:
  4334. application/json:
  4335. schema:
  4336. oneOf:
  4337. - type: object
  4338. properties:
  4339. npmName:
  4340. type: string
  4341. example: peertube-plugin-auth-ldap
  4342. required:
  4343. - npmName
  4344. additionalProperties: false
  4345. - type: object
  4346. properties:
  4347. path:
  4348. type: string
  4349. required:
  4350. - path
  4351. additionalProperties: false
  4352. responses:
  4353. '204':
  4354. description: successful operation
  4355. '400':
  4356. description: should have either `npmName` or `path` set
  4357. '404':
  4358. description: existing plugin not found
  4359. /plugins/uninstall:
  4360. post:
  4361. tags:
  4362. - Plugins
  4363. summary: Uninstall a plugin
  4364. operationId: uninstallPlugin
  4365. security:
  4366. - OAuth2:
  4367. - admin
  4368. requestBody:
  4369. content:
  4370. application/json:
  4371. schema:
  4372. type: object
  4373. properties:
  4374. npmName:
  4375. type: string
  4376. description: name of the plugin/theme in its package.json
  4377. example: peertube-plugin-auth-ldap
  4378. required:
  4379. - npmName
  4380. responses:
  4381. '204':
  4382. description: successful operation
  4383. '404':
  4384. description: existing plugin not found
  4385. /plugins/{npmName}:
  4386. get:
  4387. tags:
  4388. - Plugins
  4389. summary: Get a plugin
  4390. operationId: getPlugin
  4391. security:
  4392. - OAuth2:
  4393. - admin
  4394. parameters:
  4395. - $ref: '#/components/parameters/npmName'
  4396. responses:
  4397. '200':
  4398. description: successful operation
  4399. content:
  4400. application/json:
  4401. schema:
  4402. $ref: '#/components/schemas/Plugin'
  4403. '404':
  4404. description: plugin not found
  4405. /plugins/{npmName}/settings:
  4406. put:
  4407. tags:
  4408. - Plugins
  4409. summary: Set a plugin's settings
  4410. security:
  4411. - OAuth2:
  4412. - admin
  4413. parameters:
  4414. - $ref: '#/components/parameters/npmName'
  4415. requestBody:
  4416. content:
  4417. application/json:
  4418. schema:
  4419. type: object
  4420. properties:
  4421. settings:
  4422. type: object
  4423. additionalProperties: true
  4424. responses:
  4425. '204':
  4426. description: successful operation
  4427. '404':
  4428. description: plugin not found
  4429. /plugins/{npmName}/public-settings:
  4430. get:
  4431. tags:
  4432. - Plugins
  4433. summary: Get a plugin's public settings
  4434. parameters:
  4435. - $ref: '#/components/parameters/npmName'
  4436. responses:
  4437. '200':
  4438. description: successful operation
  4439. content:
  4440. application/json:
  4441. schema:
  4442. type: object
  4443. additionalProperties: true
  4444. '404':
  4445. description: plugin not found
  4446. /plugins/{npmName}/registered-settings:
  4447. get:
  4448. tags:
  4449. - Plugins
  4450. summary: Get a plugin's registered settings
  4451. security:
  4452. - OAuth2:
  4453. - admin
  4454. parameters:
  4455. - $ref: '#/components/parameters/npmName'
  4456. responses:
  4457. '200':
  4458. description: successful operation
  4459. content:
  4460. application/json:
  4461. schema:
  4462. type: object
  4463. additionalProperties: true
  4464. '404':
  4465. description: plugin not found
  4466. servers:
  4467. - url: 'https://peertube2.cpy.re/api/v1'
  4468. description: Live Test Server (live data - latest nightly version)
  4469. - url: 'https://peertube3.cpy.re/api/v1'
  4470. description: Live Test Server (live data - latest RC version)
  4471. - url: 'https://peertube.cpy.re/api/v1'
  4472. description: Live Test Server (live data - stable version)
  4473. components:
  4474. parameters:
  4475. start:
  4476. name: start
  4477. in: query
  4478. required: false
  4479. description: Offset used to paginate results
  4480. schema:
  4481. type: integer
  4482. minimum: 0
  4483. count:
  4484. name: count
  4485. in: query
  4486. required: false
  4487. description: "Number of items to return"
  4488. schema:
  4489. type: integer
  4490. default: 15
  4491. maximum: 100
  4492. minimum: 1
  4493. sort:
  4494. name: sort
  4495. in: query
  4496. required: false
  4497. description: Sort column
  4498. schema:
  4499. type: string
  4500. example: -createdAt
  4501. search:
  4502. name: search
  4503. in: query
  4504. required: false
  4505. description: Plain text search, applied to various parts of the model depending on endpoint
  4506. schema:
  4507. type: string
  4508. searchTarget:
  4509. name: searchTarget
  4510. in: query
  4511. required: false
  4512. description: >
  4513. If the administrator enabled search index support, you can override the default search target.
  4514. **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
  4515. It means the instance may not yet know the objects you fetched. If you want to load video/channel information:
  4516. * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
  4517. then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
  4518. After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
  4519. * 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
  4520. the data from the origin instance API
  4521. schema:
  4522. type: string
  4523. enum:
  4524. - 'local'
  4525. - 'search-index'
  4526. videosSort:
  4527. name: sort
  4528. in: query
  4529. required: false
  4530. description: Sort videos by criteria
  4531. schema:
  4532. type: string
  4533. enum:
  4534. - name
  4535. - -duration
  4536. - -createdAt
  4537. - -publishedAt
  4538. - -views
  4539. - -likes
  4540. - -trending
  4541. - -hot
  4542. videosSearchSort:
  4543. name: sort
  4544. in: query
  4545. required: false
  4546. description: Sort videos by criteria
  4547. schema:
  4548. type: string
  4549. enum:
  4550. - name
  4551. - -duration
  4552. - -createdAt
  4553. - -publishedAt
  4554. - -views
  4555. - -likes
  4556. - -match
  4557. commentsSort:
  4558. name: sort
  4559. in: query
  4560. required: false
  4561. description: Sort comments by criteria
  4562. schema:
  4563. type: string
  4564. enum:
  4565. - -createdAt
  4566. - -totalReplies
  4567. blacklistsSort:
  4568. name: sort
  4569. in: query
  4570. required: false
  4571. description: Sort blocklists by criteria
  4572. schema:
  4573. type: string
  4574. enum:
  4575. - -id
  4576. - name
  4577. - -duration
  4578. - -views
  4579. - -likes
  4580. - -dislikes
  4581. - -uuid
  4582. - -createdAt
  4583. usersSearch:
  4584. name: search
  4585. in: query
  4586. required: false
  4587. description: Plain text search that will match with user usernames or emails
  4588. schema:
  4589. type: string
  4590. usersBlocked:
  4591. name: blocked
  4592. in: query
  4593. required: false
  4594. description: Filter results down to (un)banned users
  4595. schema:
  4596. type: boolean
  4597. usersSort:
  4598. name: sort
  4599. in: query
  4600. required: false
  4601. description: Sort users by criteria
  4602. schema:
  4603. type: string
  4604. enum:
  4605. - -id
  4606. - -username
  4607. - -createdAt
  4608. abusesSort:
  4609. name: sort
  4610. in: query
  4611. required: false
  4612. description: Sort abuses by criteria
  4613. schema:
  4614. type: string
  4615. enum:
  4616. - -id
  4617. - -createdAt
  4618. - -state
  4619. videoRedundanciesSort:
  4620. name: sort
  4621. in: query
  4622. required: false
  4623. description: Sort abuses by criteria
  4624. schema:
  4625. type: string
  4626. enum:
  4627. - name
  4628. followersSort:
  4629. name: sort
  4630. in: query
  4631. required: false
  4632. description: Sort followers by criteria
  4633. schema:
  4634. type: string
  4635. enum:
  4636. - createdAt
  4637. name:
  4638. name: name
  4639. in: path
  4640. required: true
  4641. description: The username or handle of the account
  4642. schema:
  4643. type: string
  4644. example: chocobozzz | chocobozzz@example.org
  4645. id:
  4646. name: id
  4647. in: path
  4648. required: true
  4649. description: Entity id
  4650. schema:
  4651. $ref: '#/components/schemas/id'
  4652. idOrUUID:
  4653. name: id
  4654. in: path
  4655. required: true
  4656. description: The object id, uuid or short uuid
  4657. schema:
  4658. oneOf:
  4659. - $ref: '#/components/schemas/id'
  4660. - $ref: '#/components/schemas/UUIDv4'
  4661. - $ref: '#/components/schemas/shortUUID'
  4662. playlistId:
  4663. name: playlistId
  4664. in: path
  4665. required: true
  4666. description: Playlist id
  4667. schema:
  4668. $ref: '#/components/schemas/VideoPlaylist/properties/id'
  4669. playlistElementId:
  4670. name: playlistElementId
  4671. in: path
  4672. required: true
  4673. description: Playlist element id
  4674. schema:
  4675. $ref: '#/components/schemas/id'
  4676. abuseId:
  4677. name: abuseId
  4678. in: path
  4679. required: true
  4680. description: Abuse id
  4681. schema:
  4682. $ref: '#/components/schemas/Abuse/properties/id'
  4683. abuseMessageId:
  4684. name: abuseMessageId
  4685. in: path
  4686. required: true
  4687. description: Abuse message id
  4688. schema:
  4689. $ref: '#/components/schemas/AbuseMessage/properties/id'
  4690. captionLanguage:
  4691. name: captionLanguage
  4692. in: path
  4693. required: true
  4694. description: The caption language
  4695. schema:
  4696. $ref: '#/components/schemas/VideoLanguageSet'
  4697. channelHandle:
  4698. name: channelHandle
  4699. in: path
  4700. required: true
  4701. description: The video channel handle
  4702. schema:
  4703. type: string
  4704. example: my_username | my_username@example.com
  4705. subscriptionHandle:
  4706. name: subscriptionHandle
  4707. in: path
  4708. required: true
  4709. description: The subscription handle
  4710. schema:
  4711. type: string
  4712. example: my_username | my_username@example.com
  4713. threadId:
  4714. name: threadId
  4715. in: path
  4716. required: true
  4717. description: The thread id (root comment id)
  4718. schema:
  4719. type: integer
  4720. commentId:
  4721. name: commentId
  4722. in: path
  4723. required: true
  4724. description: The comment id
  4725. schema:
  4726. $ref: '#/components/schemas/VideoComment/properties/id'
  4727. isLive:
  4728. name: isLive
  4729. in: query
  4730. required: false
  4731. description: whether or not the video is a live
  4732. schema:
  4733. type: boolean
  4734. categoryOneOf:
  4735. name: categoryOneOf
  4736. in: query
  4737. required: false
  4738. description: category id of the video (see [/videos/categories](#operation/getCategories))
  4739. schema:
  4740. oneOf:
  4741. - $ref: '#/components/schemas/VideoCategorySet'
  4742. - type: array
  4743. items:
  4744. $ref: '#/components/schemas/VideoCategorySet'
  4745. style: form
  4746. explode: false
  4747. tagsOneOf:
  4748. name: tagsOneOf
  4749. in: query
  4750. required: false
  4751. description: tag(s) of the video
  4752. schema:
  4753. oneOf:
  4754. - type: string
  4755. - type: array
  4756. maxItems: 5
  4757. items:
  4758. type: string
  4759. style: form
  4760. explode: false
  4761. tagsAllOf:
  4762. name: tagsAllOf
  4763. in: query
  4764. required: false
  4765. description: tag(s) of the video, where all should be present in the video
  4766. schema:
  4767. oneOf:
  4768. - type: string
  4769. - type: array
  4770. items:
  4771. type: string
  4772. style: form
  4773. explode: false
  4774. languageOneOf:
  4775. name: languageOneOf
  4776. in: query
  4777. required: false
  4778. description: language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language
  4779. schema:
  4780. oneOf:
  4781. - $ref: '#/components/schemas/VideoLanguageSet'
  4782. - type: array
  4783. items:
  4784. $ref: '#/components/schemas/VideoLanguageSet'
  4785. style: form
  4786. explode: false
  4787. licenceOneOf:
  4788. name: licenceOneOf
  4789. in: query
  4790. required: false
  4791. description: licence id of the video (see [/videos/licences](#operation/getLicences))
  4792. schema:
  4793. oneOf:
  4794. - $ref: '#/components/schemas/VideoLicenceSet'
  4795. - type: array
  4796. items:
  4797. $ref: '#/components/schemas/VideoLicenceSet'
  4798. style: form
  4799. explode: false
  4800. skipCount:
  4801. name: skipCount
  4802. in: query
  4803. required: false
  4804. description: if you don't need the `total` in the response
  4805. schema:
  4806. type: string
  4807. enum:
  4808. - 'true'
  4809. - 'false'
  4810. default: 'false'
  4811. nsfw:
  4812. name: nsfw
  4813. in: query
  4814. required: false
  4815. description: whether to include nsfw videos, if any
  4816. schema:
  4817. type: string
  4818. enum:
  4819. - 'true'
  4820. - 'false'
  4821. isLocal:
  4822. name: isLocal
  4823. in: query
  4824. required: false
  4825. schema:
  4826. type: boolean
  4827. description: '**PeerTube >= 4.0** Display only local or remote videos'
  4828. hasHLSFiles:
  4829. name: hasHLSFiles
  4830. in: query
  4831. required: false
  4832. schema:
  4833. type: boolean
  4834. description: '**PeerTube >= 4.0** Display only videos that have HLS files'
  4835. hasWebtorrentFiles:
  4836. name: hasWebtorrentFiles
  4837. in: query
  4838. required: false
  4839. schema:
  4840. type: boolean
  4841. description: '**PeerTube >= 4.0** Display only videos that have WebTorrent files'
  4842. privacyOneOf:
  4843. name: privacyOneOf
  4844. in: query
  4845. required: false
  4846. schema:
  4847. $ref: '#/components/schemas/VideoPrivacySet'
  4848. description: '**PeerTube >= 4.0** Display only videos in this specific privacy/privacies'
  4849. include:
  4850. name: include
  4851. in: query
  4852. required: false
  4853. schema:
  4854. type: integer
  4855. enum:
  4856. - 0
  4857. - 1
  4858. - 2
  4859. - 4
  4860. - 8
  4861. description: >
  4862. **PeerTube >= 4.0** Include additional videos in results (can be combined using bitwise or operator)
  4863. - `0` NONE
  4864. - `1` NOT_PUBLISHED_STATE
  4865. - `2` BLACKLISTED
  4866. - `4` BLOCKED_OWNER
  4867. - `8` FILES
  4868. subscriptionsUris:
  4869. name: uris
  4870. in: query
  4871. required: true
  4872. description: list of uris to check if each is part of the user subscriptions
  4873. schema:
  4874. type: array
  4875. items:
  4876. type: string
  4877. format: uri
  4878. npmName:
  4879. name: npmName
  4880. in: path
  4881. required: true
  4882. description: name of the plugin/theme on npmjs.com or in its package.json
  4883. schema:
  4884. type: string
  4885. example: peertube-plugin-auth-ldap
  4886. jobType:
  4887. name: jobType
  4888. in: query
  4889. required: false
  4890. description: job type
  4891. schema:
  4892. type: string
  4893. enum:
  4894. - activitypub-follow
  4895. - activitypub-http-broadcast
  4896. - activitypub-http-fetcher
  4897. - activitypub-http-unicast
  4898. - email
  4899. - video-transcoding
  4900. - video-file-import
  4901. - video-import
  4902. - videos-views-stats
  4903. - activitypub-refresher
  4904. - video-redundancy
  4905. - video-live-ending
  4906. followState:
  4907. name: state
  4908. in: query
  4909. schema:
  4910. type: string
  4911. enum:
  4912. - pending
  4913. - accepted
  4914. actorType:
  4915. name: actorType
  4916. in: query
  4917. schema:
  4918. type: string
  4919. enum:
  4920. - Person
  4921. - Application
  4922. - Group
  4923. - Service
  4924. - Organization
  4925. securitySchemes:
  4926. OAuth2:
  4927. description: |
  4928. Authenticating via OAuth requires the following steps:
  4929. - Have an activated account
  4930. - [Generate] an access token for that account at `/api/v1/users/token`.
  4931. - Make requests with the *Authorization: Bearer <token\>* header
  4932. - Profit, depending on the role assigned to the account
  4933. Note that the __access token is valid for 1 day__ and is given
  4934. along with a __refresh token valid for 2 weeks__.
  4935. [Generate]: https://docs.joinpeertube.org/api-rest-getting-started
  4936. type: oauth2
  4937. flows:
  4938. password:
  4939. tokenUrl: /api/v1/users/token
  4940. scopes:
  4941. admin: Admin scope
  4942. moderator: Moderator scope
  4943. user: User scope
  4944. schemas:
  4945. # Resuable core properties
  4946. id:
  4947. type: integer
  4948. minimum: 1
  4949. example: 42
  4950. UUIDv4:
  4951. type: string
  4952. format: uuid
  4953. example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
  4954. pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'
  4955. minLength: 36
  4956. maxLength: 36
  4957. shortUUID:
  4958. type: string
  4959. description: translation of a uuid v4 with a bigger alphabet to have a shorter uuid
  4960. example: 2y84q2MQUMWPbiEcxNXMgC
  4961. username:
  4962. type: string
  4963. description: immutable name of the user, used to find or mention its actor
  4964. example: chocobozzz
  4965. pattern: '/^[a-z0-9._]+$/'
  4966. minLength: 1
  4967. maxLength: 50
  4968. usernameChannel:
  4969. type: string
  4970. description: immutable name of the channel, used to interact with its actor
  4971. example: framasoft_videos
  4972. pattern: '/^[a-zA-Z0-9\\-_.:]+$/'
  4973. minLength: 1
  4974. maxLength: 50
  4975. password:
  4976. type: string
  4977. format: password
  4978. minLength: 6
  4979. maxLength: 255
  4980. VideoCategorySet:
  4981. type: integer
  4982. description: category id of the video (see [/videos/categories](#operation/getCategories))
  4983. example: 15
  4984. VideoConstantNumber-Category:
  4985. properties:
  4986. id:
  4987. $ref: '#/components/schemas/VideoCategorySet'
  4988. label:
  4989. type: string
  4990. example: Science & Technology
  4991. VideoLicenceSet:
  4992. type: integer
  4993. description: licence id of the video (see [/videos/licences](#operation/getLicences))
  4994. example: 2
  4995. VideoConstantNumber-Licence:
  4996. properties:
  4997. id:
  4998. $ref: '#/components/schemas/VideoLicenceSet'
  4999. label:
  5000. type: string
  5001. example: Attribution - Share Alike
  5002. VideoLanguageSet:
  5003. type: string
  5004. description: language id of the video (see [/videos/languages](#operation/getLanguages))
  5005. example: en
  5006. VideoConstantString-Language:
  5007. properties:
  5008. id:
  5009. $ref: '#/components/schemas/VideoLanguageSet'
  5010. label:
  5011. type: string
  5012. example: English
  5013. VideoPlaylistPrivacySet:
  5014. type: integer
  5015. enum:
  5016. - 1
  5017. - 2
  5018. - 3
  5019. description: Video playlist privacy policy (see [/video-playlists/privacies])
  5020. VideoPlaylistPrivacyConstant:
  5021. properties:
  5022. id:
  5023. $ref: '#/components/schemas/VideoPlaylistPrivacySet'
  5024. label:
  5025. type: string
  5026. VideoPlaylistTypeSet:
  5027. type: integer
  5028. enum:
  5029. - 1
  5030. - 2
  5031. description: The video playlist type (Regular = `1`, Watch Later = `2`)
  5032. VideoPlaylistTypeConstant:
  5033. properties:
  5034. id:
  5035. $ref: '#/components/schemas/VideoPlaylistTypeSet'
  5036. label:
  5037. type: string
  5038. VideoPrivacySet:
  5039. type: integer
  5040. enum:
  5041. - 1
  5042. - 2
  5043. - 3
  5044. - 4
  5045. description: privacy id of the video (see [/videos/privacies](#operation/getPrivacyPolicies))
  5046. VideoPrivacyConstant:
  5047. properties:
  5048. id:
  5049. $ref: '#/components/schemas/VideoPrivacySet'
  5050. label:
  5051. type: string
  5052. BlockStatus:
  5053. properties:
  5054. accounts:
  5055. type: object
  5056. additionalProperties:
  5057. x-additionalPropertiesName: account
  5058. type: object
  5059. properties:
  5060. blockedByServer:
  5061. type: boolean
  5062. blockedByUser:
  5063. type: boolean
  5064. hosts:
  5065. type: object
  5066. additionalProperties:
  5067. x-additionalPropertiesName: host
  5068. type: object
  5069. properties:
  5070. blockedByServer:
  5071. type: boolean
  5072. blockedByUser:
  5073. type: boolean
  5074. NSFWPolicy:
  5075. type: string
  5076. enum:
  5077. - display
  5078. - blur
  5079. - do_not_list
  5080. UserRole:
  5081. type: integer
  5082. enum:
  5083. - 0
  5084. - 1
  5085. - 2
  5086. description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
  5087. example: 2
  5088. UserAdminFlags:
  5089. type: integer
  5090. enum:
  5091. - 0
  5092. - 1
  5093. description: 'Admin flags for the user (None = `0`, Bypass video blocklist = `1`)'
  5094. example: 1
  5095. VideoStateConstant:
  5096. properties:
  5097. id:
  5098. type: integer
  5099. enum:
  5100. - 1
  5101. - 2
  5102. - 3
  5103. description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)'
  5104. label:
  5105. type: string
  5106. AbuseStateSet:
  5107. type: integer
  5108. enum:
  5109. - 1
  5110. - 2
  5111. - 3
  5112. description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)'
  5113. AbuseStateConstant:
  5114. properties:
  5115. id:
  5116. $ref: '#/components/schemas/AbuseStateSet'
  5117. label:
  5118. type: string
  5119. AbusePredefinedReasons:
  5120. type: array
  5121. items:
  5122. type: string
  5123. enum:
  5124. - violentOrAbusive
  5125. - hatefulOrAbusive
  5126. - spamOrMisleading
  5127. - privacy
  5128. - rights
  5129. - serverRules
  5130. - thumbnails
  5131. - captions
  5132. example: [spamOrMisleading]
  5133. VideoResolutionSet:
  5134. type: integer
  5135. description: |
  5136. Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`)
  5137. `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos.
  5138. example: 240
  5139. VideoResolutionConstant:
  5140. description: resolutions and their labels for the video
  5141. properties:
  5142. id:
  5143. $ref: '#/components/schemas/VideoResolutionSet'
  5144. label:
  5145. type: string
  5146. example: 240p
  5147. VideoScheduledUpdate:
  5148. properties:
  5149. privacy:
  5150. $ref: '#/components/schemas/VideoPrivacySet'
  5151. updateAt:
  5152. type: string
  5153. format: date
  5154. description: When to update the video
  5155. required:
  5156. - updateAt
  5157. AccountSummary:
  5158. properties:
  5159. id:
  5160. type: integer
  5161. name:
  5162. type: string
  5163. displayName:
  5164. type: string
  5165. url:
  5166. type: string
  5167. format: url
  5168. host:
  5169. type: string
  5170. format: hostname
  5171. avatar:
  5172. nullable: true
  5173. allOf:
  5174. - $ref: '#/components/schemas/ActorImage'
  5175. VideoChannelSummary:
  5176. properties:
  5177. id:
  5178. $ref: '#/components/schemas/id'
  5179. name:
  5180. type: string
  5181. displayName:
  5182. type: string
  5183. url:
  5184. type: string
  5185. format: url
  5186. host:
  5187. type: string
  5188. format: hostname
  5189. avatar:
  5190. nullable: true
  5191. allOf:
  5192. - $ref: '#/components/schemas/ActorImage'
  5193. PlaylistElement:
  5194. properties:
  5195. position:
  5196. type: integer
  5197. startTimestamp:
  5198. type: integer
  5199. format: seconds
  5200. stopTimestamp:
  5201. type: integer
  5202. format: seconds
  5203. video:
  5204. nullable: true
  5205. allOf:
  5206. - $ref: '#/components/schemas/Video'
  5207. VideoFile:
  5208. readOnly: true
  5209. properties:
  5210. magnetUri:
  5211. type: string
  5212. format: uri
  5213. description: magnet URI allowing to resolve the video via BitTorrent without a metainfo file
  5214. pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
  5215. resolution:
  5216. $ref: '#/components/schemas/VideoResolutionConstant'
  5217. size:
  5218. type: integer
  5219. description: Video file size in bytes
  5220. torrentUrl:
  5221. type: string
  5222. description: Direct URL of the torrent file
  5223. format: url
  5224. torrentDownloadUrl:
  5225. type: string
  5226. description: URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog)
  5227. format: url
  5228. fileUrl:
  5229. type: string
  5230. description: Direct URL of the video
  5231. format: url
  5232. fileDownloadUrl:
  5233. type: string
  5234. description: URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog)
  5235. format: url
  5236. fps:
  5237. type: number
  5238. description: Frames per second of the video file
  5239. metadataUrl:
  5240. type: string
  5241. format: url
  5242. description: URL dereferencing the output of ffprobe on the file
  5243. VideoStreamingPlaylists:
  5244. allOf:
  5245. - type: object
  5246. properties:
  5247. id:
  5248. $ref: '#/components/schemas/id'
  5249. type:
  5250. type: integer
  5251. enum:
  5252. - 1
  5253. description: |
  5254. Playlist type:
  5255. - `1`: HLS
  5256. - $ref: '#/components/schemas/VideoStreamingPlaylists-HLS'
  5257. VideoStreamingPlaylists-HLS:
  5258. properties:
  5259. playlistUrl:
  5260. type: string
  5261. format: url
  5262. segmentsSha256Url:
  5263. type: string
  5264. format: url
  5265. files:
  5266. type: array
  5267. description: |
  5268. Video files associated to this playlist.
  5269. The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.)
  5270. items:
  5271. $ref: '#/components/schemas/VideoFile'
  5272. redundancies:
  5273. type: array
  5274. items:
  5275. type: object
  5276. properties:
  5277. baseUrl:
  5278. type: string
  5279. format: url
  5280. VideoInfo:
  5281. properties:
  5282. id:
  5283. $ref: '#/components/schemas/Video/properties/id'
  5284. uuid:
  5285. $ref: '#/components/schemas/Video/properties/uuid'
  5286. name:
  5287. $ref: '#/components/schemas/Video/properties/name'
  5288. Video:
  5289. properties:
  5290. id:
  5291. description: object id for the video
  5292. allOf:
  5293. - $ref: '#/components/schemas/id'
  5294. uuid:
  5295. description: universal identifier for the video, that can be used across instances
  5296. allOf:
  5297. - $ref: '#/components/schemas/UUIDv4'
  5298. shortUUID:
  5299. allOf:
  5300. - $ref: '#/components/schemas/shortUUID'
  5301. isLive:
  5302. type: boolean
  5303. createdAt:
  5304. type: string
  5305. format: date-time
  5306. example: 2017-10-01T10:52:46.396Z
  5307. description: time at which the video object was first drafted
  5308. publishedAt:
  5309. type: string
  5310. format: date-time
  5311. example: 2018-10-01T10:52:46.396Z
  5312. description: time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution.
  5313. updatedAt:
  5314. type: string
  5315. format: date-time
  5316. example: 2021-05-04T08:01:01.502Z
  5317. description: last time the video's metadata was modified
  5318. originallyPublishedAt:
  5319. type: string
  5320. format: date-time
  5321. example: 2010-10-01T10:52:46.396Z
  5322. description: used to represent a date of first publication, prior to the practical publication date of `publishedAt`
  5323. category:
  5324. allOf:
  5325. - $ref: '#/components/schemas/VideoConstantNumber-Category'
  5326. description: category in which the video is classified
  5327. licence:
  5328. allOf:
  5329. - $ref: '#/components/schemas/VideoConstantNumber-Licence'
  5330. description: licence under which the video is distributed
  5331. language:
  5332. allOf:
  5333. - $ref: '#/components/schemas/VideoConstantString-Language'
  5334. description: main language used in the video
  5335. privacy:
  5336. allOf:
  5337. - $ref: '#/components/schemas/VideoPrivacyConstant'
  5338. description: privacy policy used to distribute the video
  5339. description:
  5340. type: string
  5341. example: |
  5342. **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n
  5343. **Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\r\n*A decentralized video hosting network, based on fr...
  5344. minLength: 3
  5345. maxLength: 250
  5346. description: |
  5347. truncated description of the video, written in Markdown.
  5348. Resolve `descriptionPath` to get the full description of maximum `10000` characters.
  5349. duration:
  5350. type: integer
  5351. example: 1419
  5352. format: seconds
  5353. description: duration of the video in seconds
  5354. isLocal:
  5355. type: boolean
  5356. name:
  5357. type: string
  5358. description: title of the video
  5359. example: What is PeerTube?
  5360. minLength: 3
  5361. maxLength: 120
  5362. thumbnailPath:
  5363. type: string
  5364. example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
  5365. previewPath:
  5366. type: string
  5367. example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
  5368. embedPath:
  5369. type: string
  5370. example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee
  5371. views:
  5372. type: integer
  5373. example: 1337
  5374. likes:
  5375. type: integer
  5376. example: 42
  5377. dislikes:
  5378. type: integer
  5379. example: 7
  5380. nsfw:
  5381. type: boolean
  5382. waitTranscoding:
  5383. type: boolean
  5384. nullable: true
  5385. state:
  5386. allOf:
  5387. - $ref: '#/components/schemas/VideoStateConstant'
  5388. description: represents the internal state of the video processing within the PeerTube instance
  5389. scheduledUpdate:
  5390. nullable: true
  5391. allOf:
  5392. - $ref: '#/components/schemas/VideoScheduledUpdate'
  5393. blacklisted:
  5394. nullable: true
  5395. type: boolean
  5396. blacklistedReason:
  5397. nullable: true
  5398. type: string
  5399. account:
  5400. $ref: '#/components/schemas/AccountSummary'
  5401. channel:
  5402. $ref: '#/components/schemas/VideoChannelSummary'
  5403. userHistory:
  5404. nullable: true
  5405. type: object
  5406. properties:
  5407. currentTime:
  5408. type: integer
  5409. VideoDetails:
  5410. allOf:
  5411. - $ref: '#/components/schemas/Video'
  5412. - type: object
  5413. properties:
  5414. viewers:
  5415. type: integer
  5416. description: If the video is a live, you have the amount of current viewers
  5417. descriptionPath:
  5418. type: string
  5419. example: /api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180a6d/description
  5420. description: path at which to get the full description of maximum `10000` characters
  5421. support:
  5422. type: string
  5423. description: A text tell the audience how to support the video creator
  5424. example: Please support our work on https://soutenir.framasoft.org/en/ <3
  5425. minLength: 3
  5426. maxLength: 1000
  5427. channel:
  5428. $ref: '#/components/schemas/VideoChannel'
  5429. account:
  5430. $ref: '#/components/schemas/Account'
  5431. tags:
  5432. example: [flowers, gardening]
  5433. type: array
  5434. minItems: 1
  5435. maxItems: 5
  5436. items:
  5437. type: string
  5438. minLength: 2
  5439. maxLength: 30
  5440. commentsEnabled:
  5441. type: boolean
  5442. downloadEnabled:
  5443. type: boolean
  5444. trackerUrls:
  5445. type: array
  5446. items:
  5447. type: string
  5448. format: url
  5449. example:
  5450. - https://peertube2.cpy.re/tracker/announce
  5451. - wss://peertube2.cpy.re/tracker/socket
  5452. files:
  5453. type: array
  5454. items:
  5455. $ref: '#/components/schemas/VideoFile'
  5456. description: |
  5457. WebTorrent/raw video files. If WebTorrent is disabled on the server:
  5458. - field will be empty
  5459. - video files will be found in `streamingPlaylists[].files` field
  5460. streamingPlaylists:
  5461. type: array
  5462. items:
  5463. $ref: '#/components/schemas/VideoStreamingPlaylists'
  5464. description: |
  5465. HLS playlists/manifest files. If HLS is disabled on the server:
  5466. - field will be empty
  5467. - video files will be found in `files` field
  5468. FileRedundancyInformation:
  5469. properties:
  5470. id:
  5471. $ref: '#/components/schemas/id'
  5472. fileUrl:
  5473. type: string
  5474. format: url
  5475. strategy:
  5476. type: string
  5477. enum:
  5478. - manual
  5479. - most-views
  5480. - trending
  5481. - recently-added
  5482. size:
  5483. type: integer
  5484. createdAt:
  5485. type: string
  5486. format: date-time
  5487. updatedAt:
  5488. type: string
  5489. format: date-time
  5490. expiresOn:
  5491. type: string
  5492. format: date-time
  5493. VideoRedundancy:
  5494. properties:
  5495. id:
  5496. $ref: '#/components/schemas/id'
  5497. name:
  5498. type: string
  5499. url:
  5500. type: string
  5501. format: url
  5502. uuid:
  5503. $ref: '#/components/schemas/UUIDv4'
  5504. redundancies:
  5505. type: object
  5506. properties:
  5507. files:
  5508. type: array
  5509. items:
  5510. $ref: '#/components/schemas/FileRedundancyInformation'
  5511. streamingPlaylists:
  5512. type: array
  5513. items:
  5514. $ref: '#/components/schemas/FileRedundancyInformation'
  5515. VideoImportStateConstant:
  5516. properties:
  5517. id:
  5518. type: integer
  5519. enum:
  5520. - 1
  5521. - 2
  5522. - 3
  5523. description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
  5524. label:
  5525. type: string
  5526. example: Pending
  5527. VideoCreateImport:
  5528. allOf:
  5529. - type: object
  5530. additionalProperties: false
  5531. oneOf:
  5532. - properties:
  5533. targetUrl:
  5534. $ref: '#/components/schemas/VideoImport/properties/targetUrl'
  5535. required: [targetUrl]
  5536. - properties:
  5537. magnetUri:
  5538. $ref: '#/components/schemas/VideoImport/properties/magnetUri'
  5539. required: [magnetUri]
  5540. - properties:
  5541. torrentfile:
  5542. $ref: '#/components/schemas/VideoImport/properties/torrentfile'
  5543. required: [torrentfile]
  5544. - $ref: '#/components/schemas/VideoUploadRequestCommon'
  5545. required:
  5546. - channelId
  5547. - name
  5548. VideoImport:
  5549. properties:
  5550. id:
  5551. readOnly: true
  5552. allOf:
  5553. - $ref: '#/components/schemas/id'
  5554. targetUrl:
  5555. type: string
  5556. format: url
  5557. description: remote URL where to find the import's source video
  5558. example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d
  5559. magnetUri:
  5560. type: string
  5561. format: uri
  5562. description: magnet URI allowing to resolve the import's source video
  5563. pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
  5564. torrentfile:
  5565. writeOnly: true
  5566. type: string
  5567. format: binary
  5568. description: Torrent file containing only the video file
  5569. torrentName:
  5570. readOnly: true
  5571. type: string
  5572. state:
  5573. readOnly: true
  5574. allOf:
  5575. - $ref: '#/components/schemas/VideoImportStateConstant'
  5576. error:
  5577. readOnly: true
  5578. type: string
  5579. createdAt:
  5580. readOnly: true
  5581. type: string
  5582. format: date-time
  5583. updatedAt:
  5584. readOnly: true
  5585. type: string
  5586. format: date-time
  5587. video:
  5588. readOnly: true
  5589. nullable: true
  5590. allOf:
  5591. - $ref: '#/components/schemas/Video'
  5592. VideoImportsList:
  5593. properties:
  5594. total:
  5595. type: integer
  5596. example: 1
  5597. data:
  5598. type: array
  5599. maxItems: 100
  5600. items:
  5601. $ref: '#/components/schemas/VideoImport'
  5602. Abuse:
  5603. properties:
  5604. id:
  5605. $ref: '#/components/schemas/id'
  5606. reason:
  5607. type: string
  5608. example: The video is a spam
  5609. minLength: 2
  5610. maxLength: 3000
  5611. predefinedReasons:
  5612. $ref: '#/components/schemas/AbusePredefinedReasons'
  5613. reporterAccount:
  5614. $ref: '#/components/schemas/Account'
  5615. state:
  5616. $ref: '#/components/schemas/AbuseStateConstant'
  5617. moderationComment:
  5618. type: string
  5619. example: Decided to ban the server since it spams us regularly
  5620. minLength: 2
  5621. maxLength: 3000
  5622. video:
  5623. $ref: '#/components/schemas/VideoInfo'
  5624. createdAt:
  5625. type: string
  5626. format: date-time
  5627. AbuseMessage:
  5628. properties:
  5629. id:
  5630. $ref: '#/components/schemas/id'
  5631. message:
  5632. type: string
  5633. minLength: 2
  5634. maxLength: 3000
  5635. byModerator:
  5636. type: boolean
  5637. createdAt:
  5638. type: string
  5639. format: date-time
  5640. account:
  5641. $ref: '#/components/schemas/AccountSummary'
  5642. VideoBlacklist:
  5643. properties:
  5644. id:
  5645. $ref: '#/components/schemas/id'
  5646. videoId:
  5647. $ref: '#/components/schemas/Video/properties/id'
  5648. createdAt:
  5649. type: string
  5650. format: date-time
  5651. updatedAt:
  5652. type: string
  5653. format: date-time
  5654. name:
  5655. type: string
  5656. minLength: 3
  5657. maxLength: 120
  5658. uuid:
  5659. $ref: '#/components/schemas/UUIDv4'
  5660. description:
  5661. type: string
  5662. minLength: 3
  5663. maxLength: 10000
  5664. duration:
  5665. type: integer
  5666. views:
  5667. type: integer
  5668. likes:
  5669. type: integer
  5670. dislikes:
  5671. type: integer
  5672. nsfw:
  5673. type: boolean
  5674. VideoPlaylist:
  5675. properties:
  5676. id:
  5677. $ref: '#/components/schemas/id'
  5678. uuid:
  5679. $ref: '#/components/schemas/UUIDv4'
  5680. shortUUID:
  5681. allOf:
  5682. - $ref: '#/components/schemas/shortUUID'
  5683. createdAt:
  5684. type: string
  5685. format: date-time
  5686. updatedAt:
  5687. type: string
  5688. format: date-time
  5689. description:
  5690. type: string
  5691. minLength: 3
  5692. maxLength: 1000
  5693. displayName:
  5694. type: string
  5695. minLength: 1
  5696. maxLength: 120
  5697. isLocal:
  5698. type: boolean
  5699. videoLength:
  5700. type: integer
  5701. minimum: 0
  5702. thumbnailPath:
  5703. type: string
  5704. privacy:
  5705. $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
  5706. type:
  5707. $ref: '#/components/schemas/VideoPlaylistTypeConstant'
  5708. ownerAccount:
  5709. $ref: '#/components/schemas/AccountSummary'
  5710. videoChannel:
  5711. $ref: '#/components/schemas/VideoChannelSummary'
  5712. VideoComment:
  5713. properties:
  5714. id:
  5715. $ref: '#/components/schemas/id'
  5716. url:
  5717. type: string
  5718. format: url
  5719. text:
  5720. type: string
  5721. format: html
  5722. description: Text of the comment
  5723. minLength: 1
  5724. example: This video is wonderful!
  5725. threadId:
  5726. $ref: '#/components/schemas/id'
  5727. inReplyToCommentId:
  5728. nullable: true
  5729. allOf:
  5730. - $ref: '#/components/schemas/id'
  5731. videoId:
  5732. $ref: '#/components/schemas/Video/properties/id'
  5733. createdAt:
  5734. type: string
  5735. format: date-time
  5736. updatedAt:
  5737. type: string
  5738. format: date-time
  5739. deletedAt:
  5740. nullable: true
  5741. type: string
  5742. format: date-time
  5743. isDeleted:
  5744. type: boolean
  5745. default: false
  5746. totalRepliesFromVideoAuthor:
  5747. type: integer
  5748. minimum: 0
  5749. totalReplies:
  5750. type: integer
  5751. minimum: 0
  5752. account:
  5753. $ref: '#/components/schemas/Account'
  5754. VideoCommentThreadTree:
  5755. properties:
  5756. comment:
  5757. $ref: '#/components/schemas/VideoComment'
  5758. children:
  5759. type: array
  5760. items:
  5761. $ref: '#/components/schemas/VideoCommentThreadTree'
  5762. VideoCaption:
  5763. properties:
  5764. language:
  5765. $ref: '#/components/schemas/VideoConstantString-Language'
  5766. captionPath:
  5767. type: string
  5768. ActorImage:
  5769. properties:
  5770. path:
  5771. type: string
  5772. createdAt:
  5773. type: string
  5774. format: date-time
  5775. updatedAt:
  5776. type: string
  5777. format: date-time
  5778. ActorInfo:
  5779. properties:
  5780. id:
  5781. $ref: '#/components/schemas/id'
  5782. name:
  5783. type: string
  5784. displayName:
  5785. type: string
  5786. host:
  5787. type: string
  5788. format: hostname
  5789. avatar:
  5790. nullable: true
  5791. type: object
  5792. properties:
  5793. path:
  5794. type: string
  5795. Actor:
  5796. properties:
  5797. id:
  5798. $ref: '#/components/schemas/id'
  5799. url:
  5800. type: string
  5801. format: url
  5802. name:
  5803. description: immutable name of the actor, used to find or mention it
  5804. allOf:
  5805. - $ref: '#/components/schemas/username'
  5806. host:
  5807. type: string
  5808. format: hostname
  5809. description: server on which the actor is resident
  5810. hostRedundancyAllowed:
  5811. type: boolean
  5812. description: whether this actor's host allows redundancy of its videos
  5813. followingCount:
  5814. type: integer
  5815. minimum: 0
  5816. description: number of actors subscribed to by this actor, as seen by this instance
  5817. followersCount:
  5818. type: integer
  5819. minimum: 0
  5820. description: number of followers of this actor, as seen by this instance
  5821. createdAt:
  5822. type: string
  5823. format: date-time
  5824. updatedAt:
  5825. type: string
  5826. format: date-time
  5827. avatar:
  5828. $ref: '#/components/schemas/ActorImage'
  5829. Account:
  5830. allOf:
  5831. - $ref: '#/components/schemas/Actor'
  5832. - properties:
  5833. userId:
  5834. description: object id for the user tied to this account
  5835. allOf:
  5836. - $ref: '#/components/schemas/User/properties/id'
  5837. displayName:
  5838. type: string
  5839. description: editable name of the account, displayed in its representations
  5840. minLength: 3
  5841. maxLength: 120
  5842. description:
  5843. type: string
  5844. description: text or bio displayed on the account's profile
  5845. UserWatchingVideo:
  5846. properties:
  5847. currentTime:
  5848. type: integer
  5849. format: seconds
  5850. description: timestamp within the video, in seconds
  5851. example: 5
  5852. ServerConfig:
  5853. properties:
  5854. instance:
  5855. type: object
  5856. properties:
  5857. name:
  5858. type: string
  5859. shortDescription:
  5860. type: string
  5861. defaultClientRoute:
  5862. type: string
  5863. isNSFW:
  5864. type: boolean
  5865. defaultNSFWPolicy:
  5866. type: string
  5867. customizations:
  5868. type: object
  5869. properties:
  5870. javascript:
  5871. type: string
  5872. css:
  5873. type: string
  5874. search:
  5875. type: object
  5876. properties:
  5877. remoteUri:
  5878. type: object
  5879. properties:
  5880. users:
  5881. type: boolean
  5882. anonymous:
  5883. type: boolean
  5884. plugin:
  5885. type: object
  5886. properties:
  5887. registered:
  5888. type: array
  5889. items:
  5890. type: string
  5891. theme:
  5892. type: object
  5893. properties:
  5894. registered:
  5895. type: array
  5896. items:
  5897. type: string
  5898. email:
  5899. type: object
  5900. properties:
  5901. enabled:
  5902. type: boolean
  5903. contactForm:
  5904. type: object
  5905. properties:
  5906. enabled:
  5907. type: boolean
  5908. serverVersion:
  5909. type: string
  5910. serverCommit:
  5911. type: string
  5912. signup:
  5913. type: object
  5914. properties:
  5915. allowed:
  5916. type: boolean
  5917. allowedForCurrentIP:
  5918. type: boolean
  5919. requiresEmailVerification:
  5920. type: boolean
  5921. transcoding:
  5922. type: object
  5923. properties:
  5924. hls:
  5925. type: object
  5926. properties:
  5927. enabled:
  5928. type: boolean
  5929. webtorrent:
  5930. type: object
  5931. properties:
  5932. enabled:
  5933. type: boolean
  5934. enabledResolutions:
  5935. type: array
  5936. items:
  5937. $ref: '#/components/schemas/VideoResolutionSet'
  5938. import:
  5939. type: object
  5940. properties:
  5941. videos:
  5942. type: object
  5943. properties:
  5944. http:
  5945. type: object
  5946. properties:
  5947. enabled:
  5948. type: boolean
  5949. torrent:
  5950. type: object
  5951. properties:
  5952. enabled:
  5953. type: boolean
  5954. autoBlacklist:
  5955. type: object
  5956. properties:
  5957. videos:
  5958. type: object
  5959. properties:
  5960. ofUsers:
  5961. type: object
  5962. properties:
  5963. enabled:
  5964. type: boolean
  5965. avatar:
  5966. type: object
  5967. properties:
  5968. file:
  5969. type: object
  5970. properties:
  5971. size:
  5972. type: object
  5973. properties:
  5974. max:
  5975. type: integer
  5976. extensions:
  5977. type: array
  5978. items:
  5979. type: string
  5980. video:
  5981. type: object
  5982. properties:
  5983. image:
  5984. type: object
  5985. properties:
  5986. extensions:
  5987. type: array
  5988. items:
  5989. type: string
  5990. size:
  5991. type: object
  5992. properties:
  5993. max:
  5994. type: integer
  5995. file:
  5996. type: object
  5997. properties:
  5998. extensions:
  5999. type: array
  6000. items:
  6001. type: string
  6002. videoCaption:
  6003. type: object
  6004. properties:
  6005. file:
  6006. type: object
  6007. properties:
  6008. size:
  6009. type: object
  6010. properties:
  6011. max:
  6012. type: integer
  6013. extensions:
  6014. type: array
  6015. items:
  6016. type: string
  6017. user:
  6018. type: object
  6019. properties:
  6020. videoQuota:
  6021. type: integer
  6022. example: 16810141515
  6023. videoQuotaDaily:
  6024. type: integer
  6025. example: 1681014151
  6026. trending:
  6027. type: object
  6028. properties:
  6029. videos:
  6030. type: object
  6031. properties:
  6032. intervalDays:
  6033. type: integer
  6034. tracker:
  6035. type: object
  6036. properties:
  6037. enabled:
  6038. type: boolean
  6039. followings:
  6040. type: object
  6041. properties:
  6042. instance:
  6043. type: object
  6044. properties:
  6045. autoFollowIndex:
  6046. type: object
  6047. properties:
  6048. indexUrl:
  6049. type: string
  6050. format: url
  6051. homepage:
  6052. type: object
  6053. properties:
  6054. enabled:
  6055. type: boolean
  6056. ServerConfigAbout:
  6057. properties:
  6058. instance:
  6059. type: object
  6060. properties:
  6061. name:
  6062. type: string
  6063. shortDescription:
  6064. type: string
  6065. description:
  6066. type: string
  6067. terms:
  6068. type: string
  6069. ServerConfigCustom:
  6070. properties:
  6071. instance:
  6072. type: object
  6073. properties:
  6074. name:
  6075. type: string
  6076. shortDescription:
  6077. type: string
  6078. description:
  6079. type: string
  6080. terms:
  6081. type: string
  6082. defaultClientRoute:
  6083. type: string
  6084. isNSFW:
  6085. type: boolean
  6086. defaultNSFWPolicy:
  6087. type: string
  6088. customizations:
  6089. type: object
  6090. properties:
  6091. javascript:
  6092. type: string
  6093. css:
  6094. type: string
  6095. theme:
  6096. type: object
  6097. properties:
  6098. default:
  6099. type: string
  6100. services:
  6101. type: object
  6102. properties:
  6103. twitter:
  6104. type: object
  6105. properties:
  6106. username:
  6107. type: string
  6108. whitelisted:
  6109. type: boolean
  6110. cache:
  6111. type: object
  6112. properties:
  6113. previews:
  6114. type: object
  6115. properties:
  6116. size:
  6117. type: integer
  6118. captions:
  6119. type: object
  6120. properties:
  6121. size:
  6122. type: integer
  6123. signup:
  6124. type: object
  6125. properties:
  6126. enabled:
  6127. type: boolean
  6128. limit:
  6129. type: integer
  6130. requiresEmailVerification:
  6131. type: boolean
  6132. admin:
  6133. type: object
  6134. properties:
  6135. email:
  6136. type: string
  6137. format: email
  6138. contactForm:
  6139. type: object
  6140. properties:
  6141. enabled:
  6142. type: boolean
  6143. user:
  6144. type: object
  6145. description: Settings that apply to new users, if registration is enabled
  6146. properties:
  6147. videoQuota:
  6148. type: integer
  6149. example: 16810141515
  6150. videoQuotaDaily:
  6151. type: integer
  6152. example: 1681014151
  6153. transcoding:
  6154. type: object
  6155. description: Settings pertaining to transcoding jobs
  6156. properties:
  6157. enabled:
  6158. type: boolean
  6159. allowAdditionalExtensions:
  6160. type: boolean
  6161. description: Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos
  6162. allowAudioFiles:
  6163. type: boolean
  6164. description: If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file
  6165. threads:
  6166. type: integer
  6167. description: Amount of threads used by ffmpeg for 1 transcoding job
  6168. concurrency:
  6169. type: number
  6170. description: Amount of transcoding jobs to execute in parallel
  6171. profile:
  6172. type: string
  6173. enum:
  6174. - default
  6175. description: |
  6176. New profiles can be added by plugins ; available in core PeerTube: 'default'.
  6177. resolutions:
  6178. type: object
  6179. description: Resolutions to transcode _new videos_ to
  6180. properties:
  6181. 0p:
  6182. type: boolean
  6183. 144p:
  6184. type: boolean
  6185. 240p:
  6186. type: boolean
  6187. 360p:
  6188. type: boolean
  6189. 480p:
  6190. type: boolean
  6191. 720p:
  6192. type: boolean
  6193. 1080p:
  6194. type: boolean
  6195. 1440p:
  6196. type: boolean
  6197. 2160p:
  6198. type: boolean
  6199. webtorrent:
  6200. type: object
  6201. description: WebTorrent-specific settings
  6202. properties:
  6203. enabled:
  6204. type: boolean
  6205. hls:
  6206. type: object
  6207. description: HLS-specific settings
  6208. properties:
  6209. enabled:
  6210. type: boolean
  6211. import:
  6212. type: object
  6213. properties:
  6214. videos:
  6215. type: object
  6216. properties:
  6217. http:
  6218. type: object
  6219. properties:
  6220. enabled:
  6221. type: boolean
  6222. torrent:
  6223. type: object
  6224. properties:
  6225. enabled:
  6226. type: boolean
  6227. autoBlacklist:
  6228. type: object
  6229. properties:
  6230. videos:
  6231. type: object
  6232. properties:
  6233. ofUsers:
  6234. type: object
  6235. properties:
  6236. enabled:
  6237. type: boolean
  6238. followers:
  6239. type: object
  6240. properties:
  6241. instance:
  6242. type: object
  6243. properties:
  6244. enabled:
  6245. type: boolean
  6246. manualApproval:
  6247. type: boolean
  6248. CustomHomepage:
  6249. properties:
  6250. content:
  6251. type: string
  6252. Follow:
  6253. properties:
  6254. id:
  6255. $ref: '#/components/schemas/id'
  6256. follower:
  6257. $ref: '#/components/schemas/Actor'
  6258. following:
  6259. $ref: '#/components/schemas/Actor'
  6260. score:
  6261. type: number
  6262. description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`.
  6263. state:
  6264. type: string
  6265. enum:
  6266. - pending
  6267. - accepted
  6268. createdAt:
  6269. type: string
  6270. format: date-time
  6271. updatedAt:
  6272. type: string
  6273. format: date-time
  6274. PredefinedAbuseReasons:
  6275. description: Reason categories that help triage reports
  6276. type: array
  6277. maxItems: 8
  6278. items:
  6279. type: string
  6280. enum:
  6281. - violentOrAbusive
  6282. - hatefulOrAbusive
  6283. - spamOrMisleading
  6284. - privacy
  6285. - rights
  6286. - serverRules
  6287. - thumbnails
  6288. - captions
  6289. Job:
  6290. properties:
  6291. id:
  6292. $ref: '#/components/schemas/id'
  6293. state:
  6294. type: string
  6295. enum:
  6296. - active
  6297. - completed
  6298. - failed
  6299. - waiting
  6300. - delayed
  6301. type:
  6302. type: string
  6303. enum:
  6304. - activitypub-http-unicast
  6305. - activitypub-http-broadcast
  6306. - activitypub-http-fetcher
  6307. - activitypub-follow
  6308. - video-file-import
  6309. - video-transcoding
  6310. - email
  6311. - video-import
  6312. - videos-views-stats
  6313. - activitypub-refresher
  6314. - video-redundancy
  6315. data:
  6316. type: object
  6317. additionalProperties: true
  6318. error:
  6319. type: object
  6320. additionalProperties: true
  6321. createdAt:
  6322. type: string
  6323. format: date-time
  6324. finishedOn:
  6325. type: string
  6326. format: date-time
  6327. processedOn:
  6328. type: string
  6329. format: date-time
  6330. AddUserResponse:
  6331. properties:
  6332. user:
  6333. type: object
  6334. properties:
  6335. id:
  6336. $ref: '#/components/schemas/id'
  6337. account:
  6338. type: object
  6339. properties:
  6340. id:
  6341. $ref: '#/components/schemas/id'
  6342. VideoUploadRequestCommon:
  6343. properties:
  6344. name:
  6345. description: Video name
  6346. type: string
  6347. example: What is PeerTube?
  6348. minLength: 3
  6349. maxLength: 120
  6350. channelId:
  6351. description: Channel id that will contain this video
  6352. type: integer
  6353. example: 3
  6354. minimum: 1
  6355. privacy:
  6356. $ref: '#/components/schemas/VideoPrivacySet'
  6357. category:
  6358. $ref: '#/components/schemas/VideoCategorySet'
  6359. licence:
  6360. $ref: '#/components/schemas/VideoLicenceSet'
  6361. language:
  6362. $ref: '#/components/schemas/VideoLanguageSet'
  6363. description:
  6364. description: Video description
  6365. type: string
  6366. example: |
  6367. **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**
  6368. waitTranscoding:
  6369. description: Whether or not we wait transcoding before publish the video
  6370. type: boolean
  6371. support:
  6372. description: A text tell the audience how to support the video creator
  6373. example: Please support our work on https://soutenir.framasoft.org/en/ <3
  6374. type: string
  6375. nsfw:
  6376. description: Whether or not this video contains sensitive content
  6377. type: boolean
  6378. tags:
  6379. description: Video tags (maximum 5 tags each between 2 and 30 characters)
  6380. type: array
  6381. minItems: 1
  6382. maxItems: 5
  6383. uniqueItems: true
  6384. example:
  6385. - framasoft
  6386. - peertube
  6387. items:
  6388. type: string
  6389. minLength: 2
  6390. maxLength: 30
  6391. commentsEnabled:
  6392. description: Enable or disable comments for this video
  6393. type: boolean
  6394. downloadEnabled:
  6395. description: Enable or disable downloading for this video
  6396. type: boolean
  6397. originallyPublishedAt:
  6398. description: Date when the content was originally published
  6399. type: string
  6400. format: date-time
  6401. scheduleUpdate:
  6402. $ref: '#/components/schemas/VideoScheduledUpdate'
  6403. thumbnailfile:
  6404. description: Video thumbnail file
  6405. type: string
  6406. format: binary
  6407. previewfile:
  6408. description: Video preview file
  6409. type: string
  6410. format: binary
  6411. required:
  6412. - channelId
  6413. - name
  6414. VideoUploadRequestLegacy:
  6415. allOf:
  6416. - $ref: '#/components/schemas/VideoUploadRequestCommon'
  6417. - type: object
  6418. required:
  6419. - videofile
  6420. properties:
  6421. videofile:
  6422. description: Video file
  6423. type: string
  6424. format: binary
  6425. VideoUploadRequestResumable:
  6426. allOf:
  6427. - $ref: '#/components/schemas/VideoUploadRequestCommon'
  6428. - type: object
  6429. required:
  6430. - filename
  6431. properties:
  6432. filename:
  6433. description: Video filename including extension
  6434. type: string
  6435. format: filename
  6436. example: what_is_peertube.mp4
  6437. thumbnailfile:
  6438. description: Video thumbnail file
  6439. type: string
  6440. format: binary
  6441. previewfile:
  6442. description: Video preview file
  6443. type: string
  6444. format: binary
  6445. VideoUploadResponse:
  6446. properties:
  6447. video:
  6448. type: object
  6449. properties:
  6450. id:
  6451. $ref: '#/components/schemas/Video/properties/id'
  6452. uuid:
  6453. $ref: '#/components/schemas/Video/properties/uuid'
  6454. shortUUID:
  6455. $ref: '#/components/schemas/Video/properties/shortUUID'
  6456. CommentThreadResponse:
  6457. properties:
  6458. total:
  6459. type: integer
  6460. example: 1
  6461. data:
  6462. type: array
  6463. maxItems: 100
  6464. items:
  6465. $ref: '#/components/schemas/VideoComment'
  6466. CommentThreadPostResponse:
  6467. properties:
  6468. comment:
  6469. $ref: '#/components/schemas/VideoComment'
  6470. VideoListResponse:
  6471. properties:
  6472. total:
  6473. type: integer
  6474. example: 1
  6475. data:
  6476. type: array
  6477. maxItems: 100
  6478. items:
  6479. $ref: '#/components/schemas/Video'
  6480. User:
  6481. properties:
  6482. account:
  6483. $ref: '#/components/schemas/Account'
  6484. autoPlayNextVideo:
  6485. type: boolean
  6486. description: Automatically start playing the upcoming video after the currently playing video
  6487. autoPlayNextVideoPlaylist:
  6488. type: boolean
  6489. description: Automatically start playing the video on the playlist after the currently playing video
  6490. autoPlayVideo:
  6491. type: boolean
  6492. description: Automatically start playing the video on the watch page
  6493. blocked:
  6494. type: boolean
  6495. blockedReason:
  6496. type: string
  6497. createdAt:
  6498. type: string
  6499. email:
  6500. type: string
  6501. format: email
  6502. description: The user email
  6503. emailVerified:
  6504. type: boolean
  6505. description: Has the user confirmed their email address?
  6506. id:
  6507. allOf:
  6508. - $ref: '#/components/schemas/id'
  6509. readOnly: true
  6510. pluginAuth:
  6511. type: string
  6512. description: Auth plugin to use to authenticate the user
  6513. lastLoginDate:
  6514. type: string
  6515. format: date-time
  6516. noInstanceConfigWarningModal:
  6517. type: boolean
  6518. noAccountSetupWarningModal:
  6519. type: boolean
  6520. noWelcomeModal:
  6521. type: boolean
  6522. nsfwPolicy:
  6523. $ref: '#/components/schemas/NSFWPolicy'
  6524. role:
  6525. $ref: '#/components/schemas/UserRole'
  6526. roleLabel:
  6527. type: string
  6528. enum:
  6529. - User
  6530. - Moderator
  6531. - Administrator
  6532. theme:
  6533. type: string
  6534. description: Theme enabled by this user
  6535. username:
  6536. $ref: '#/components/schemas/username'
  6537. videoChannels:
  6538. type: array
  6539. items:
  6540. $ref: '#/components/schemas/VideoChannel'
  6541. videoQuota:
  6542. type: integer
  6543. description: The user video quota in bytes
  6544. example: -1
  6545. videoQuotaDaily:
  6546. type: integer
  6547. description: The user daily video quota in bytes
  6548. example: -1
  6549. p2pEnabled:
  6550. type: boolean
  6551. description: Enable P2P in the player
  6552. UserWithStats:
  6553. allOf:
  6554. - $ref: '#/components/schemas/User'
  6555. - properties:
  6556. # optionally present fields: they require WITH_STATS scope
  6557. videosCount:
  6558. type: integer
  6559. description: Count of videos published
  6560. abusesCount:
  6561. type: integer
  6562. description: Count of reports/abuses of which the user is a target
  6563. abusesAcceptedCount:
  6564. type: integer
  6565. description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team
  6566. abusesCreatedCount:
  6567. type: integer
  6568. description: Count of reports/abuses created by the user
  6569. videoCommentsCount:
  6570. type: integer
  6571. description: Count of comments published
  6572. AddUser:
  6573. properties:
  6574. username:
  6575. $ref: '#/components/schemas/username'
  6576. password:
  6577. $ref: '#/components/schemas/password'
  6578. email:
  6579. type: string
  6580. format: email
  6581. description: The user email
  6582. videoQuota:
  6583. type: integer
  6584. description: The user video quota in bytes
  6585. example: -1
  6586. videoQuotaDaily:
  6587. type: integer
  6588. description: The user daily video quota in bytes
  6589. example: -1
  6590. channelName:
  6591. $ref: '#/components/schemas/usernameChannel'
  6592. role:
  6593. $ref: '#/components/schemas/UserRole'
  6594. adminFlags:
  6595. $ref: '#/components/schemas/UserAdminFlags'
  6596. required:
  6597. - username
  6598. - password
  6599. - email
  6600. - videoQuota
  6601. - videoQuotaDaily
  6602. - role
  6603. UpdateUser:
  6604. properties:
  6605. email:
  6606. description: The updated email of the user
  6607. allOf:
  6608. - $ref: '#/components/schemas/User/properties/email'
  6609. emailVerified:
  6610. type: boolean
  6611. description: Set the email as verified
  6612. videoQuota:
  6613. type: integer
  6614. description: The updated video quota of the user in bytes
  6615. videoQuotaDaily:
  6616. type: integer
  6617. description: The updated daily video quota of the user in bytes
  6618. pluginAuth:
  6619. type: string
  6620. nullable: true
  6621. description: The auth plugin to use to authenticate the user
  6622. example: 'peertube-plugin-auth-saml2'
  6623. role:
  6624. $ref: '#/components/schemas/UserRole'
  6625. adminFlags:
  6626. $ref: '#/components/schemas/UserAdminFlags'
  6627. password:
  6628. $ref: '#/components/schemas/password'
  6629. UpdateMe:
  6630. # see shared/models/users/user-update-me.model.ts:
  6631. properties:
  6632. password:
  6633. $ref: '#/components/schemas/password'
  6634. currentPassword:
  6635. $ref: '#/components/schemas/password'
  6636. email:
  6637. description: new email used for login and service communications
  6638. allOf:
  6639. - $ref: '#/components/schemas/User/properties/email'
  6640. displayName:
  6641. type: string
  6642. description: new name of the user in its representations
  6643. minLength: 3
  6644. maxLength: 120
  6645. displayNSFW:
  6646. type: string
  6647. description: new NSFW display policy
  6648. enum:
  6649. - 'true'
  6650. - 'false'
  6651. - both
  6652. p2pEnabled:
  6653. type: boolean
  6654. description: whether to enable P2P in the player or not
  6655. autoPlayVideo:
  6656. type: boolean
  6657. description: new preference regarding playing videos automatically
  6658. autoPlayNextVideo:
  6659. type: boolean
  6660. description: new preference regarding playing following videos automatically
  6661. autoPlayNextVideoPlaylist:
  6662. type: boolean
  6663. description: new preference regarding playing following playlist videos automatically
  6664. videosHistoryEnabled:
  6665. type: boolean
  6666. description: whether to keep track of watched history or not
  6667. videoLanguages:
  6668. type: array
  6669. items:
  6670. type: string
  6671. description: list of languages to filter videos down to
  6672. theme:
  6673. type: string
  6674. noInstanceConfigWarningModal:
  6675. type: boolean
  6676. noAccountSetupWarningModal:
  6677. type: boolean
  6678. noWelcomeModal:
  6679. type: boolean
  6680. GetMeVideoRating:
  6681. properties:
  6682. id:
  6683. $ref: '#/components/schemas/id'
  6684. rating:
  6685. type: string
  6686. enum:
  6687. - like
  6688. - dislike
  6689. - none
  6690. description: Rating of the video
  6691. required:
  6692. - id
  6693. - rating
  6694. VideoRating:
  6695. properties:
  6696. video:
  6697. $ref: '#/components/schemas/Video'
  6698. rating:
  6699. type: string
  6700. enum:
  6701. - like
  6702. - dislike
  6703. - none
  6704. description: Rating of the video
  6705. required:
  6706. - video
  6707. - rating
  6708. RegisterUser:
  6709. properties:
  6710. username:
  6711. description: immutable name of the user, used to find or mention its actor
  6712. allOf:
  6713. - $ref: '#/components/schemas/username'
  6714. password:
  6715. $ref: '#/components/schemas/password'
  6716. email:
  6717. type: string
  6718. format: email
  6719. description: email of the user, used for login or service communications
  6720. displayName:
  6721. type: string
  6722. description: editable name of the user, displayed in its representations
  6723. minLength: 1
  6724. maxLength: 120
  6725. channel:
  6726. type: object
  6727. description: channel base information used to create the first channel of the user
  6728. properties:
  6729. name:
  6730. $ref: '#/components/schemas/usernameChannel'
  6731. displayName:
  6732. $ref: '#/components/schemas/VideoChannel/properties/displayName'
  6733. required:
  6734. - username
  6735. - password
  6736. - email
  6737. OAuthClient:
  6738. properties:
  6739. client_id:
  6740. type: string
  6741. pattern: /^[a-z0-9]$/
  6742. maxLength: 32
  6743. minLength: 32
  6744. example: v1ikx5hnfop4mdpnci8nsqh93c45rldf
  6745. client_secret:
  6746. type: string
  6747. pattern: /^[a-zA-Z0-9]$/
  6748. maxLength: 32
  6749. minLength: 32
  6750. example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt
  6751. OAuthToken-password:
  6752. allOf:
  6753. - $ref: '#/components/schemas/OAuthClient'
  6754. - type: object
  6755. properties:
  6756. grant_type:
  6757. type: string
  6758. enum:
  6759. - password
  6760. - refresh_token
  6761. default: password
  6762. username:
  6763. $ref: '#/components/schemas/User/properties/username'
  6764. password:
  6765. $ref: '#/components/schemas/password'
  6766. required:
  6767. - client_id
  6768. - client_secret
  6769. - grant_type
  6770. - username
  6771. - password
  6772. OAuthToken-refresh_token:
  6773. allOf:
  6774. - $ref: '#/components/schemas/OAuthClient'
  6775. - type: object
  6776. properties:
  6777. grant_type:
  6778. type: string
  6779. enum:
  6780. - password
  6781. - refresh_token
  6782. default: password
  6783. refresh_token:
  6784. type: string
  6785. example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7
  6786. required:
  6787. - client_id
  6788. - client_secret
  6789. - grant_type
  6790. - refresh_token
  6791. VideoChannel:
  6792. properties:
  6793. # GET/POST/PUT properties
  6794. displayName:
  6795. type: string
  6796. description: editable name of the channel, displayed in its representations
  6797. example: Videos of Framasoft
  6798. minLength: 1
  6799. maxLength: 120
  6800. description:
  6801. type: string
  6802. example: Videos made with <3 by Framasoft
  6803. minLength: 3
  6804. maxLength: 1000
  6805. support:
  6806. type: string
  6807. description: text shown by default on all videos of this channel, to tell the audience how to support it
  6808. example: Please support our work on https://soutenir.framasoft.org/en/ <3
  6809. minLength: 3
  6810. maxLength: 1000
  6811. # GET-only properties
  6812. id:
  6813. readOnly: true
  6814. allOf:
  6815. - $ref: '#/components/schemas/id'
  6816. isLocal:
  6817. readOnly: true
  6818. type: boolean
  6819. updatedAt:
  6820. readOnly: true
  6821. type: string
  6822. format: date-time
  6823. ownerAccount:
  6824. readOnly: true
  6825. nullable: true
  6826. type: object
  6827. properties:
  6828. id:
  6829. type: integer
  6830. uuid:
  6831. $ref: '#/components/schemas/UUIDv4'
  6832. VideoChannelCreate:
  6833. allOf:
  6834. - $ref: '#/components/schemas/VideoChannel'
  6835. - properties:
  6836. name:
  6837. description: username of the channel to create
  6838. allOf:
  6839. - $ref: '#/components/schemas/usernameChannel'
  6840. required:
  6841. - name
  6842. - displayName
  6843. VideoChannelUpdate:
  6844. allOf:
  6845. - $ref: '#/components/schemas/VideoChannel'
  6846. - properties:
  6847. bulkVideosSupportUpdate:
  6848. type: boolean
  6849. description: Update the support field for all videos of this channel
  6850. VideoChannelList:
  6851. properties:
  6852. total:
  6853. type: integer
  6854. example: 1
  6855. data:
  6856. type: array
  6857. items:
  6858. allOf:
  6859. - $ref: '#/components/schemas/VideoChannel'
  6860. - $ref: '#/components/schemas/Actor'
  6861. MRSSPeerLink:
  6862. type: object
  6863. xml:
  6864. name: 'media:peerLink'
  6865. properties:
  6866. href:
  6867. type: string
  6868. xml:
  6869. attribute: true
  6870. type:
  6871. type: string
  6872. enum:
  6873. - application/x-bittorrent
  6874. xml:
  6875. attribute: true
  6876. MRSSGroupContent:
  6877. type: object
  6878. xml:
  6879. name: 'media:content'
  6880. properties:
  6881. url:
  6882. type: string
  6883. format: url
  6884. xml:
  6885. attribute: true
  6886. fileSize:
  6887. type: integer
  6888. xml:
  6889. attribute: true
  6890. type:
  6891. type: string
  6892. xml:
  6893. attribute: true
  6894. framerate:
  6895. type: integer
  6896. xml:
  6897. attribute: true
  6898. duration:
  6899. type: integer
  6900. xml:
  6901. attribute: true
  6902. height:
  6903. type: integer
  6904. xml:
  6905. attribute: true
  6906. lang:
  6907. type: string
  6908. xml:
  6909. attribute: true
  6910. VideoCommentsForXML:
  6911. type: array
  6912. xml:
  6913. wrapped: true
  6914. name: 'channel'
  6915. items:
  6916. type: object
  6917. xml:
  6918. name: 'item'
  6919. properties:
  6920. link:
  6921. type: string
  6922. format: url
  6923. guid:
  6924. type: string
  6925. pubDate:
  6926. type: string
  6927. format: date-time
  6928. 'content:encoded':
  6929. type: string
  6930. 'dc:creator':
  6931. type: string
  6932. VideosForXML:
  6933. type: array
  6934. xml:
  6935. wrapped: true
  6936. name: 'channel'
  6937. items:
  6938. type: object
  6939. xml:
  6940. name: 'item'
  6941. properties:
  6942. link:
  6943. type: string
  6944. format: url
  6945. description: video watch page URL
  6946. guid:
  6947. type: string
  6948. description: video canonical URL
  6949. pubDate:
  6950. type: string
  6951. format: date-time
  6952. description: video publication date
  6953. description:
  6954. type: string
  6955. description: video description
  6956. 'content:encoded':
  6957. type: string
  6958. description: video description
  6959. 'dc:creator':
  6960. type: string
  6961. description: publisher user name
  6962. 'media:category':
  6963. type: integer
  6964. description: video category (MRSS)
  6965. 'media:community':
  6966. type: object
  6967. description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
  6968. properties:
  6969. 'media:statistics':
  6970. type: object
  6971. properties:
  6972. views:
  6973. type: integer
  6974. xml:
  6975. attribute: true
  6976. 'media:embed':
  6977. type: object
  6978. properties:
  6979. url:
  6980. type: string
  6981. format: url
  6982. description: video embed path, relative to the canonical URL domain (MRSS)
  6983. xml:
  6984. attribute: true
  6985. 'media:player':
  6986. type: object
  6987. properties:
  6988. url:
  6989. type: string
  6990. format: url
  6991. description: video watch path, relative to the canonical URL domain (MRSS)
  6992. xml:
  6993. attribute: true
  6994. 'media:thumbnail':
  6995. type: object
  6996. properties:
  6997. url:
  6998. type: string
  6999. format: url
  7000. xml:
  7001. attribute: true
  7002. height:
  7003. type: integer
  7004. xml:
  7005. attribute: true
  7006. width:
  7007. type: integer
  7008. xml:
  7009. attribute: true
  7010. 'media:title':
  7011. type: string
  7012. description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
  7013. 'media:description':
  7014. type: string
  7015. 'media:rating':
  7016. type: string
  7017. enum:
  7018. - nonadult
  7019. - adult
  7020. description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
  7021. 'enclosure':
  7022. type: object
  7023. description: main streamable file for the video
  7024. properties:
  7025. url:
  7026. type: string
  7027. format: url
  7028. xml:
  7029. attribute: true
  7030. type:
  7031. type: string
  7032. enum:
  7033. - application/x-bittorrent
  7034. xml:
  7035. attribute: true
  7036. length:
  7037. type: integer
  7038. xml:
  7039. attribute: true
  7040. 'media:group':
  7041. type: array
  7042. 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)
  7043. items:
  7044. anyOf:
  7045. - $ref: '#/components/schemas/MRSSPeerLink'
  7046. - $ref: '#/components/schemas/MRSSGroupContent'
  7047. NotificationSettingValue:
  7048. type: integer
  7049. description: >
  7050. Notification type
  7051. - `0` NONE
  7052. - `1` WEB
  7053. - `2` EMAIL
  7054. enum:
  7055. - 0
  7056. - 1
  7057. - 2
  7058. Notification:
  7059. properties:
  7060. id:
  7061. $ref: '#/components/schemas/id'
  7062. type:
  7063. type: integer
  7064. description: >
  7065. Notification type, following the `UserNotificationType` enum:
  7066. - `1` NEW_VIDEO_FROM_SUBSCRIPTION
  7067. - `2` NEW_COMMENT_ON_MY_VIDEO
  7068. - `3` NEW_ABUSE_FOR_MODERATORS
  7069. - `4` BLACKLIST_ON_MY_VIDEO
  7070. - `5` UNBLACKLIST_ON_MY_VIDEO
  7071. - `6` MY_VIDEO_PUBLISHED
  7072. - `7` MY_VIDEO_IMPORT_SUCCESS
  7073. - `8` MY_VIDEO_IMPORT_ERROR
  7074. - `9` NEW_USER_REGISTRATION
  7075. - `10` NEW_FOLLOW
  7076. - `11` COMMENT_MENTION
  7077. - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
  7078. - `13` NEW_INSTANCE_FOLLOWER
  7079. - `14` AUTO_INSTANCE_FOLLOWING
  7080. - `15` ABUSE_STATE_CHANGE
  7081. - `16` ABUSE_NEW_MESSAGE
  7082. - `17` NEW_PLUGIN_VERSION
  7083. - `18` NEW_PEERTUBE_VERSION
  7084. read:
  7085. type: boolean
  7086. video:
  7087. nullable: true
  7088. allOf:
  7089. - $ref: '#/components/schemas/VideoInfo'
  7090. - type: object
  7091. properties:
  7092. channel:
  7093. $ref: '#/components/schemas/ActorInfo'
  7094. videoImport:
  7095. nullable: true
  7096. type: object
  7097. properties:
  7098. id:
  7099. $ref: '#/components/schemas/id'
  7100. video:
  7101. nullable: true
  7102. $ref: '#/components/schemas/VideoInfo'
  7103. torrentName:
  7104. type: string
  7105. nullable: true
  7106. magnetUri:
  7107. $ref: '#/components/schemas/VideoImport/properties/magnetUri'
  7108. targetUri:
  7109. type: string
  7110. format: uri
  7111. nullable: true
  7112. comment:
  7113. nullable: true
  7114. type: object
  7115. properties:
  7116. id:
  7117. $ref: '#/components/schemas/id'
  7118. threadId:
  7119. type: integer
  7120. video:
  7121. $ref: '#/components/schemas/VideoInfo'
  7122. account:
  7123. $ref: '#/components/schemas/ActorInfo'
  7124. videoAbuse:
  7125. nullable: true
  7126. type: object
  7127. properties:
  7128. id:
  7129. $ref: '#/components/schemas/id'
  7130. video:
  7131. allOf:
  7132. - $ref: '#/components/schemas/VideoInfo'
  7133. videoBlacklist:
  7134. nullable: true
  7135. type: object
  7136. properties:
  7137. id:
  7138. $ref: '#/components/schemas/id'
  7139. video:
  7140. allOf:
  7141. - $ref: '#/components/schemas/VideoInfo'
  7142. account:
  7143. nullable: true
  7144. allOf:
  7145. - $ref: '#/components/schemas/ActorInfo'
  7146. actorFollow:
  7147. type: object
  7148. nullable: true
  7149. properties:
  7150. id:
  7151. $ref: '#/components/schemas/id'
  7152. follower:
  7153. $ref: '#/components/schemas/ActorInfo'
  7154. state:
  7155. type: string
  7156. enum:
  7157. - pending
  7158. - accepted
  7159. following:
  7160. type: object
  7161. properties:
  7162. type:
  7163. type: string
  7164. enum:
  7165. - account
  7166. - channel
  7167. - instance
  7168. name:
  7169. type: string
  7170. displayName:
  7171. type: string
  7172. host:
  7173. type: string
  7174. format: hostname
  7175. createdAt:
  7176. type: string
  7177. format: date-time
  7178. updatedAt:
  7179. type: string
  7180. format: date-time
  7181. NotificationListResponse:
  7182. properties:
  7183. total:
  7184. type: integer
  7185. example: 1
  7186. data:
  7187. type: array
  7188. maxItems: 100
  7189. items:
  7190. $ref: '#/components/schemas/Notification'
  7191. Plugin:
  7192. properties:
  7193. name:
  7194. type: string
  7195. example: peertube-plugin-auth-ldap
  7196. type:
  7197. type: integer
  7198. description: >
  7199. - `1`: PLUGIN
  7200. - `2`: THEME
  7201. enum:
  7202. - 1
  7203. - 2
  7204. latestVersion:
  7205. type: string
  7206. example: 0.0.3
  7207. version:
  7208. type: string
  7209. example: 0.0.1
  7210. enabled:
  7211. type: boolean
  7212. uninstalled:
  7213. type: boolean
  7214. peertubeEngine:
  7215. type: string
  7216. example: 2.2.0
  7217. description:
  7218. type: string
  7219. homepage:
  7220. type: string
  7221. format: url
  7222. example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap
  7223. settings:
  7224. type: object
  7225. additionalProperties: true
  7226. createdAt:
  7227. type: string
  7228. format: date-time
  7229. updatedAt:
  7230. type: string
  7231. format: date-time
  7232. PluginResponse:
  7233. properties:
  7234. total:
  7235. type: integer
  7236. example: 1
  7237. data:
  7238. type: array
  7239. maxItems: 100
  7240. items:
  7241. $ref: '#/components/schemas/Plugin'
  7242. LiveVideoUpdate:
  7243. properties:
  7244. saveReplay:
  7245. type: boolean
  7246. permanentLive:
  7247. description: User can stream multiple times in a permanent live
  7248. type: boolean
  7249. LiveVideoResponse:
  7250. properties:
  7251. rtmpUrl:
  7252. type: string
  7253. rtmpsUrl:
  7254. type: string
  7255. streamKey:
  7256. type: string
  7257. description: RTMP stream key to use to stream into this live video
  7258. saveReplay:
  7259. type: boolean
  7260. permanentLive:
  7261. description: User can stream multiple times in a permanent live
  7262. type: boolean
  7263. callbacks:
  7264. searchIndex:
  7265. 'https://search.example.org/api/v1/search/videos':
  7266. post:
  7267. summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget`
  7268. responses:
  7269. '200':
  7270. description: successful operation
  7271. content:
  7272. application/json:
  7273. schema:
  7274. $ref: '#/components/schemas/VideoListResponse'