openapi.yaml 255 KB

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