openapi.yaml 305 KB

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