openapi.yaml 303 KB

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