openapi.yaml 242 KB

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