openapi.yaml 247 KB

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