openapi.yaml 213 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415
  1. openapi: 3.0.3
  2. tags:
  3. - name: healthcheck
  4. - name: token
  5. - name: maintenance
  6. - name: admins
  7. - name: API keys
  8. - name: connections
  9. - name: defender
  10. - name: quota
  11. - name: folders
  12. - name: groups
  13. - name: users
  14. - name: data retention
  15. - name: events
  16. - name: metadata
  17. - name: user APIs
  18. - name: public shares
  19. - name: event manager
  20. info:
  21. title: SFTPGo
  22. description: |
  23. SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well.
  24. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one.
  25. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, an S3 user that exposes a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one.
  26. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user.
  27. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user.
  28. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps.
  29. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date.
  30. version: 2.3.4-dev
  31. contact:
  32. name: API support
  33. url: 'https://github.com/drakkan/sftpgo'
  34. license:
  35. name: AGPL-3.0-only
  36. url: 'https://www.gnu.org/licenses/agpl-3.0.en.html'
  37. servers:
  38. - url: /api/v2
  39. security:
  40. - BearerAuth: []
  41. - APIKeyAuth: []
  42. paths:
  43. /healthz:
  44. get:
  45. security: []
  46. servers:
  47. - url: /
  48. tags:
  49. - healthcheck
  50. summary: health check
  51. description: This endpoint can be used to check if the application is running and responding to requests
  52. operationId: healthz
  53. responses:
  54. '200':
  55. description: successful operation
  56. content:
  57. text/plain:
  58. schema:
  59. type: string
  60. example: ok
  61. /shares/{id}:
  62. parameters:
  63. - name: id
  64. in: path
  65. description: the share id
  66. required: true
  67. schema:
  68. type: string
  69. get:
  70. security:
  71. - BasicAuth: []
  72. tags:
  73. - public shares
  74. summary: Download shared files and folders as a single zip file
  75. description: A zip file, containing the shared files and folders, will be generated on the fly and returned as response body. Only folders and regular files will be included in the zip. The share must be defined with the read scope and the associated user must have list and download permissions
  76. operationId: get_share
  77. parameters:
  78. - in: query
  79. name: compress
  80. schema:
  81. type: boolean
  82. default: true
  83. required: false
  84. responses:
  85. '200':
  86. description: successful operation
  87. content:
  88. '*/*':
  89. schema:
  90. type: string
  91. format: binary
  92. '400':
  93. $ref: '#/components/responses/BadRequest'
  94. '401':
  95. $ref: '#/components/responses/Unauthorized'
  96. '403':
  97. $ref: '#/components/responses/Forbidden'
  98. '500':
  99. $ref: '#/components/responses/InternalServerError'
  100. default:
  101. $ref: '#/components/responses/DefaultResponse'
  102. post:
  103. security:
  104. - BasicAuth: []
  105. tags:
  106. - public shares
  107. summary: Upload one or more files to the shared path
  108. description: The share must be defined with the write scope and the associated user must have the upload permission
  109. operationId: upload_to_share
  110. requestBody:
  111. content:
  112. multipart/form-data:
  113. schema:
  114. type: object
  115. properties:
  116. filenames:
  117. type: array
  118. items:
  119. type: string
  120. format: binary
  121. minItems: 1
  122. uniqueItems: true
  123. required: true
  124. responses:
  125. '201':
  126. description: successful operation
  127. content:
  128. application/json:
  129. schema:
  130. type: array
  131. items:
  132. $ref: '#/components/schemas/ApiResponse'
  133. '400':
  134. $ref: '#/components/responses/BadRequest'
  135. '401':
  136. $ref: '#/components/responses/Unauthorized'
  137. '403':
  138. $ref: '#/components/responses/Forbidden'
  139. '413':
  140. $ref: '#/components/responses/RequestEntityTooLarge'
  141. '500':
  142. $ref: '#/components/responses/InternalServerError'
  143. default:
  144. $ref: '#/components/responses/DefaultResponse'
  145. /shares/{id}/files:
  146. parameters:
  147. - name: id
  148. in: path
  149. description: the share id
  150. required: true
  151. schema:
  152. type: string
  153. get:
  154. security:
  155. - BasicAuth: []
  156. tags:
  157. - public shares
  158. summary: Download a single file
  159. description: Returns the file contents as response body. The share must have exactly one path defined and it must be a directory for this to work
  160. operationId: download_share_file
  161. parameters:
  162. - in: query
  163. name: path
  164. required: true
  165. description: Path to the file to download. It must be URL encoded, for example the path "my dir/àdir/file.txt" must be sent as "my%20dir%2F%C3%A0dir%2Ffile.txt"
  166. schema:
  167. type: string
  168. - in: query
  169. name: inline
  170. required: false
  171. description: 'If set, the response will not have the Content-Disposition header set to `attachment`'
  172. schema:
  173. type: string
  174. responses:
  175. '200':
  176. description: successful operation
  177. content:
  178. '*/*':
  179. schema:
  180. type: string
  181. format: binary
  182. '206':
  183. description: successful operation
  184. content:
  185. '*/*':
  186. schema:
  187. type: string
  188. format: binary
  189. '400':
  190. $ref: '#/components/responses/BadRequest'
  191. '401':
  192. $ref: '#/components/responses/Unauthorized'
  193. '403':
  194. $ref: '#/components/responses/Forbidden'
  195. '500':
  196. $ref: '#/components/responses/InternalServerError'
  197. default:
  198. $ref: '#/components/responses/DefaultResponse'
  199. /shares/{id}/dirs:
  200. parameters:
  201. - name: id
  202. in: path
  203. description: the share id
  204. required: true
  205. schema:
  206. type: string
  207. get:
  208. security:
  209. - BasicAuth: []
  210. tags:
  211. - public shares
  212. summary: Read directory contents
  213. description: Returns the contents of the specified directory for the specified share. The share must have exactly one path defined and it must be a directory for this to work
  214. operationId: get_share_dir_contents
  215. parameters:
  216. - in: query
  217. name: path
  218. description: Path to the folder to read. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir". If empty or missing the user's start directory is assumed. If relative, the user's start directory is used as the base
  219. schema:
  220. type: string
  221. responses:
  222. '200':
  223. description: successful operation
  224. content:
  225. application/json:
  226. schema:
  227. type: array
  228. items:
  229. $ref: '#/components/schemas/DirEntry'
  230. '400':
  231. $ref: '#/components/responses/BadRequest'
  232. '401':
  233. $ref: '#/components/responses/Unauthorized'
  234. '403':
  235. $ref: '#/components/responses/Forbidden'
  236. '500':
  237. $ref: '#/components/responses/InternalServerError'
  238. default:
  239. $ref: '#/components/responses/DefaultResponse'
  240. /shares/{id}/{fileName}:
  241. parameters:
  242. - name: id
  243. in: path
  244. description: the share id
  245. required: true
  246. schema:
  247. type: string
  248. - name: fileName
  249. in: path
  250. description: the name of the new file. It must be path encoded. Sub directories are not accepted
  251. required: true
  252. schema:
  253. type: string
  254. - name: X-SFTPGO-MTIME
  255. in: header
  256. schema:
  257. type: integer
  258. description: File modification time as unix timestamp in milliseconds
  259. post:
  260. security:
  261. - BasicAuth: []
  262. tags:
  263. - public shares
  264. summary: Upload a single file to the shared path
  265. description: The share must be defined with the write scope and the associated user must have the upload/overwrite permissions
  266. operationId: upload_single_to_share
  267. requestBody:
  268. content:
  269. application/*:
  270. schema:
  271. type: string
  272. format: binary
  273. text/*:
  274. schema:
  275. type: string
  276. format: binary
  277. image/*:
  278. schema:
  279. type: string
  280. format: binary
  281. audio/*:
  282. schema:
  283. type: string
  284. format: binary
  285. video/*:
  286. schema:
  287. type: string
  288. format: binary
  289. required: true
  290. responses:
  291. '201':
  292. description: successful operation
  293. content:
  294. application/json:
  295. schema:
  296. type: array
  297. items:
  298. $ref: '#/components/schemas/ApiResponse'
  299. '400':
  300. $ref: '#/components/responses/BadRequest'
  301. '401':
  302. $ref: '#/components/responses/Unauthorized'
  303. '403':
  304. $ref: '#/components/responses/Forbidden'
  305. '413':
  306. $ref: '#/components/responses/RequestEntityTooLarge'
  307. '500':
  308. $ref: '#/components/responses/InternalServerError'
  309. default:
  310. $ref: '#/components/responses/DefaultResponse'
  311. /token:
  312. get:
  313. security:
  314. - BasicAuth: []
  315. tags:
  316. - token
  317. summary: Get a new admin access token
  318. description: Returns an access token and its expiration
  319. operationId: get_token
  320. parameters:
  321. - in: header
  322. name: X-SFTPGO-OTP
  323. schema:
  324. type: string
  325. required: false
  326. description: 'If you have 2FA configured for the admin attempting to log in you need to set the authentication code using this header parameter'
  327. responses:
  328. '200':
  329. description: successful operation
  330. content:
  331. application/json:
  332. schema:
  333. $ref: '#/components/schemas/Token'
  334. '401':
  335. $ref: '#/components/responses/Unauthorized'
  336. '403':
  337. $ref: '#/components/responses/Forbidden'
  338. '500':
  339. $ref: '#/components/responses/InternalServerError'
  340. default:
  341. $ref: '#/components/responses/DefaultResponse'
  342. /logout:
  343. get:
  344. security:
  345. - BearerAuth: []
  346. tags:
  347. - token
  348. summary: Invalidate an admin access token
  349. description: Allows to invalidate an admin token before its expiration
  350. operationId: logout
  351. responses:
  352. '200':
  353. description: successful operation
  354. content:
  355. application/json:
  356. schema:
  357. $ref: '#/components/schemas/ApiResponse'
  358. '401':
  359. $ref: '#/components/responses/Unauthorized'
  360. '403':
  361. $ref: '#/components/responses/Forbidden'
  362. '500':
  363. $ref: '#/components/responses/InternalServerError'
  364. default:
  365. $ref: '#/components/responses/DefaultResponse'
  366. /user/token:
  367. get:
  368. security:
  369. - BasicAuth: []
  370. tags:
  371. - token
  372. summary: Get a new user access token
  373. description: Returns an access token and its expiration
  374. operationId: get_user_token
  375. parameters:
  376. - in: header
  377. name: X-SFTPGO-OTP
  378. schema:
  379. type: string
  380. required: false
  381. description: 'If you have 2FA configured, for the HTTP protocol, for the user attempting to log in you need to set the authentication code using this header parameter'
  382. responses:
  383. '200':
  384. description: successful operation
  385. content:
  386. application/json:
  387. schema:
  388. $ref: '#/components/schemas/Token'
  389. '401':
  390. $ref: '#/components/responses/Unauthorized'
  391. '403':
  392. $ref: '#/components/responses/Forbidden'
  393. '500':
  394. $ref: '#/components/responses/InternalServerError'
  395. default:
  396. $ref: '#/components/responses/DefaultResponse'
  397. /user/logout:
  398. get:
  399. security:
  400. - BearerAuth: []
  401. tags:
  402. - token
  403. summary: Invalidate a user access token
  404. description: Allows to invalidate a client token before its expiration
  405. operationId: client_logout
  406. responses:
  407. '200':
  408. description: successful operation
  409. content:
  410. application/json:
  411. schema:
  412. $ref: '#/components/schemas/ApiResponse'
  413. '401':
  414. $ref: '#/components/responses/Unauthorized'
  415. '403':
  416. $ref: '#/components/responses/Forbidden'
  417. '500':
  418. $ref: '#/components/responses/InternalServerError'
  419. default:
  420. $ref: '#/components/responses/DefaultResponse'
  421. /version:
  422. get:
  423. tags:
  424. - maintenance
  425. summary: Get version details
  426. description: 'Returns version details such as the version number, build date, commit hash and enabled features'
  427. operationId: get_version
  428. responses:
  429. '200':
  430. description: successful operation
  431. content:
  432. application/json:
  433. schema:
  434. $ref: '#/components/schemas/VersionInfo'
  435. '401':
  436. $ref: '#/components/responses/Unauthorized'
  437. '403':
  438. $ref: '#/components/responses/Forbidden'
  439. '500':
  440. $ref: '#/components/responses/InternalServerError'
  441. default:
  442. $ref: '#/components/responses/DefaultResponse'
  443. /admin/changepwd:
  444. put:
  445. security:
  446. - BearerAuth: []
  447. tags:
  448. - admins
  449. summary: Change admin password
  450. description: Changes the password for the logged in admin
  451. operationId: change_admin_password
  452. requestBody:
  453. required: true
  454. content:
  455. application/json:
  456. schema:
  457. $ref: '#/components/schemas/PwdChange'
  458. responses:
  459. '200':
  460. description: successful operation
  461. content:
  462. application/json:
  463. schema:
  464. $ref: '#/components/schemas/ApiResponse'
  465. '401':
  466. $ref: '#/components/responses/Unauthorized'
  467. '403':
  468. $ref: '#/components/responses/Forbidden'
  469. '500':
  470. $ref: '#/components/responses/InternalServerError'
  471. default:
  472. $ref: '#/components/responses/DefaultResponse'
  473. /admin/profile:
  474. get:
  475. security:
  476. - BearerAuth: []
  477. tags:
  478. - admins
  479. summary: Get admin profile
  480. description: 'Returns the profile for the logged in admin'
  481. operationId: get_admin_profile
  482. responses:
  483. '200':
  484. description: successful operation
  485. content:
  486. application/json:
  487. schema:
  488. $ref: '#/components/schemas/AdminProfile'
  489. '401':
  490. $ref: '#/components/responses/Unauthorized'
  491. '403':
  492. $ref: '#/components/responses/Forbidden'
  493. '500':
  494. $ref: '#/components/responses/InternalServerError'
  495. default:
  496. $ref: '#/components/responses/DefaultResponse'
  497. put:
  498. security:
  499. - BearerAuth: []
  500. tags:
  501. - admins
  502. summary: Update admin profile
  503. description: 'Allows to update the profile for the logged in admin'
  504. operationId: update_admin_profile
  505. requestBody:
  506. required: true
  507. content:
  508. application/json:
  509. schema:
  510. $ref: '#/components/schemas/AdminProfile'
  511. responses:
  512. '200':
  513. description: successful operation
  514. content:
  515. application/json:
  516. schema:
  517. $ref: '#/components/schemas/ApiResponse'
  518. '400':
  519. $ref: '#/components/responses/BadRequest'
  520. '401':
  521. $ref: '#/components/responses/Unauthorized'
  522. '403':
  523. $ref: '#/components/responses/Forbidden'
  524. '500':
  525. $ref: '#/components/responses/InternalServerError'
  526. default:
  527. $ref: '#/components/responses/DefaultResponse'
  528. /admin/2fa/recoverycodes:
  529. get:
  530. security:
  531. - BearerAuth: []
  532. tags:
  533. - admins
  534. summary: Get recovery codes
  535. description: 'Returns the recovery codes for the logged in admin. Recovery codes can be used if the admin loses access to their second factor auth device. Recovery codes are returned unencrypted'
  536. operationId: get_admin_recovery_codes
  537. responses:
  538. '200':
  539. description: successful operation
  540. content:
  541. application/json:
  542. schema:
  543. type: array
  544. items:
  545. $ref: '#/components/schemas/RecoveryCode'
  546. '401':
  547. $ref: '#/components/responses/Unauthorized'
  548. '403':
  549. $ref: '#/components/responses/Forbidden'
  550. '500':
  551. $ref: '#/components/responses/InternalServerError'
  552. default:
  553. $ref: '#/components/responses/DefaultResponse'
  554. post:
  555. security:
  556. - BearerAuth: []
  557. tags:
  558. - admins
  559. summary: Generate recovery codes
  560. description: 'Generates new recovery codes for the logged in admin. Generating new recovery codes you automatically invalidate old ones'
  561. operationId: generate_admin_recovery_codes
  562. responses:
  563. '200':
  564. description: successful operation
  565. content:
  566. application/json:
  567. schema:
  568. type: array
  569. items:
  570. type: string
  571. '400':
  572. $ref: '#/components/responses/BadRequest'
  573. '401':
  574. $ref: '#/components/responses/Unauthorized'
  575. '403':
  576. $ref: '#/components/responses/Forbidden'
  577. '500':
  578. $ref: '#/components/responses/InternalServerError'
  579. default:
  580. $ref: '#/components/responses/DefaultResponse'
  581. /admin/totp/configs:
  582. get:
  583. security:
  584. - BearerAuth: []
  585. tags:
  586. - admins
  587. summary: Get available TOTP configuration
  588. description: Returns the available TOTP configurations for the logged in admin
  589. operationId: get_admin_totp_configs
  590. responses:
  591. '200':
  592. description: successful operation
  593. content:
  594. application/json:
  595. schema:
  596. type: array
  597. items:
  598. $ref: '#/components/schemas/TOTPConfig'
  599. '401':
  600. $ref: '#/components/responses/Unauthorized'
  601. '403':
  602. $ref: '#/components/responses/Forbidden'
  603. '500':
  604. $ref: '#/components/responses/InternalServerError'
  605. default:
  606. $ref: '#/components/responses/DefaultResponse'
  607. /admin/totp/generate:
  608. post:
  609. security:
  610. - BearerAuth: []
  611. tags:
  612. - admins
  613. summary: Generate a new TOTP secret
  614. description: 'Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in admin'
  615. operationId: generate_admin_totp_secret
  616. requestBody:
  617. required: true
  618. content:
  619. application/json:
  620. schema:
  621. type: object
  622. properties:
  623. config_name:
  624. type: string
  625. description: 'name of the configuration to use to generate the secret'
  626. responses:
  627. '200':
  628. description: successful operation
  629. content:
  630. application/json:
  631. schema:
  632. type: object
  633. properties:
  634. config_name:
  635. type: string
  636. issuer:
  637. type: string
  638. secret:
  639. type: string
  640. qr_code:
  641. type: string
  642. format: byte
  643. description: 'QR code png encoded as BASE64'
  644. '400':
  645. $ref: '#/components/responses/BadRequest'
  646. '401':
  647. $ref: '#/components/responses/Unauthorized'
  648. '403':
  649. $ref: '#/components/responses/Forbidden'
  650. '500':
  651. $ref: '#/components/responses/InternalServerError'
  652. default:
  653. $ref: '#/components/responses/DefaultResponse'
  654. /admin/totp/validate:
  655. post:
  656. security:
  657. - BearerAuth: []
  658. tags:
  659. - admins
  660. summary: Validate a one time authentication code
  661. description: 'Checks if the given authentication code can be validated using the specified secret and config name'
  662. operationId: validate_admin_totp_secret
  663. requestBody:
  664. required: true
  665. content:
  666. application/json:
  667. schema:
  668. type: object
  669. properties:
  670. config_name:
  671. type: string
  672. description: 'name of the configuration to use to validate the passcode'
  673. passcode:
  674. type: string
  675. description: 'passcode to validate'
  676. secret:
  677. type: string
  678. description: 'secret to use to validate the passcode'
  679. responses:
  680. '200':
  681. description: successful operation
  682. content:
  683. application/json:
  684. schema:
  685. $ref: '#/components/schemas/ApiResponse'
  686. example:
  687. message: Passcode successfully validated
  688. '400':
  689. $ref: '#/components/responses/BadRequest'
  690. '401':
  691. $ref: '#/components/responses/Unauthorized'
  692. '403':
  693. $ref: '#/components/responses/Forbidden'
  694. '500':
  695. $ref: '#/components/responses/InternalServerError'
  696. default:
  697. $ref: '#/components/responses/DefaultResponse'
  698. /admin/totp/save:
  699. post:
  700. security:
  701. - BearerAuth: []
  702. tags:
  703. - admins
  704. summary: Save a TOTP config
  705. description: 'Saves the specified TOTP config for the logged in admin'
  706. operationId: save_admin_totp_config
  707. requestBody:
  708. required: true
  709. content:
  710. application/json:
  711. schema:
  712. $ref: '#/components/schemas/AdminTOTPConfig'
  713. responses:
  714. '200':
  715. description: successful operation
  716. content:
  717. application/json:
  718. schema:
  719. $ref: '#/components/schemas/ApiResponse'
  720. example:
  721. message: TOTP configuration saved
  722. '400':
  723. $ref: '#/components/responses/BadRequest'
  724. '401':
  725. $ref: '#/components/responses/Unauthorized'
  726. '403':
  727. $ref: '#/components/responses/Forbidden'
  728. '500':
  729. $ref: '#/components/responses/InternalServerError'
  730. default:
  731. $ref: '#/components/responses/DefaultResponse'
  732. /connections:
  733. get:
  734. tags:
  735. - connections
  736. summary: Get connections details
  737. description: Returns the active users and info about their current uploads/downloads
  738. operationId: get_connections
  739. responses:
  740. '200':
  741. description: successful operation
  742. content:
  743. application/json:
  744. schema:
  745. type: array
  746. items:
  747. $ref: '#/components/schemas/ConnectionStatus'
  748. '401':
  749. $ref: '#/components/responses/Unauthorized'
  750. '403':
  751. $ref: '#/components/responses/Forbidden'
  752. '500':
  753. $ref: '#/components/responses/InternalServerError'
  754. default:
  755. $ref: '#/components/responses/DefaultResponse'
  756. '/connections/{connectionID}':
  757. delete:
  758. tags:
  759. - connections
  760. summary: Close connection
  761. description: Terminates an active connection
  762. operationId: close_connection
  763. parameters:
  764. - name: connectionID
  765. in: path
  766. description: ID of the connection to close
  767. required: true
  768. schema:
  769. type: string
  770. responses:
  771. '200':
  772. description: successful operation
  773. content:
  774. application/json:
  775. schema:
  776. $ref: '#/components/schemas/ApiResponse'
  777. example:
  778. message: Connection closed
  779. '401':
  780. $ref: '#/components/responses/Unauthorized'
  781. '403':
  782. $ref: '#/components/responses/Forbidden'
  783. '404':
  784. $ref: '#/components/responses/NotFound'
  785. '500':
  786. $ref: '#/components/responses/InternalServerError'
  787. default:
  788. $ref: '#/components/responses/DefaultResponse'
  789. /defender/hosts:
  790. get:
  791. tags:
  792. - defender
  793. summary: Get hosts
  794. description: Returns hosts that are banned or for which some violations have been detected
  795. operationId: get_defender_hosts
  796. responses:
  797. '200':
  798. description: successful operation
  799. content:
  800. application/json:
  801. schema:
  802. type: array
  803. items:
  804. $ref: '#/components/schemas/DefenderEntry'
  805. '401':
  806. $ref: '#/components/responses/Unauthorized'
  807. '403':
  808. $ref: '#/components/responses/Forbidden'
  809. '404':
  810. $ref: '#/components/responses/NotFound'
  811. '500':
  812. $ref: '#/components/responses/InternalServerError'
  813. default:
  814. $ref: '#/components/responses/DefaultResponse'
  815. /defender/hosts/{id}:
  816. parameters:
  817. - name: id
  818. in: path
  819. description: host id
  820. required: true
  821. schema:
  822. type: string
  823. get:
  824. tags:
  825. - defender
  826. summary: Get host by id
  827. description: Returns the host with the given id, if it exists
  828. operationId: get_defender_host_by_id
  829. responses:
  830. '200':
  831. description: successful operation
  832. content:
  833. application/json:
  834. schema:
  835. $ref: '#/components/schemas/DefenderEntry'
  836. '401':
  837. $ref: '#/components/responses/Unauthorized'
  838. '403':
  839. $ref: '#/components/responses/Forbidden'
  840. '404':
  841. $ref: '#/components/responses/NotFound'
  842. '500':
  843. $ref: '#/components/responses/InternalServerError'
  844. default:
  845. $ref: '#/components/responses/DefaultResponse'
  846. delete:
  847. tags:
  848. - defender
  849. summary: Removes a host from the defender lists
  850. description: Unbans the specified host or clears its violations
  851. operationId: delete_defender_host_by_id
  852. responses:
  853. '200':
  854. description: successful operation
  855. content:
  856. application/json:
  857. schema:
  858. $ref: '#/components/schemas/ApiResponse'
  859. '401':
  860. $ref: '#/components/responses/Unauthorized'
  861. '403':
  862. $ref: '#/components/responses/Forbidden'
  863. '404':
  864. $ref: '#/components/responses/NotFound'
  865. '500':
  866. $ref: '#/components/responses/InternalServerError'
  867. default:
  868. $ref: '#/components/responses/DefaultResponse'
  869. /metadata/users/checks:
  870. get:
  871. tags:
  872. - metadata
  873. summary: Get metadata checks
  874. description: Returns the active metadata checks
  875. operationId: get_users_metadata_checks
  876. responses:
  877. '200':
  878. description: successful operation
  879. content:
  880. application/json:
  881. schema:
  882. type: array
  883. items:
  884. $ref: '#/components/schemas/MetadataCheck'
  885. '401':
  886. $ref: '#/components/responses/Unauthorized'
  887. '403':
  888. $ref: '#/components/responses/Forbidden'
  889. '500':
  890. $ref: '#/components/responses/InternalServerError'
  891. default:
  892. $ref: '#/components/responses/DefaultResponse'
  893. /metadata/users/{username}/check:
  894. parameters:
  895. - name: username
  896. in: path
  897. description: the username
  898. required: true
  899. schema:
  900. type: string
  901. post:
  902. tags:
  903. - metadata
  904. summary: Start a metadata check
  905. description: 'Starts a new metadata check for the given user. A metadata check requires a metadata plugin and removes the metadata associated to missing items (for example objects deleted outside SFTPGo). If a metadata check for this user is already active a 409 status code is returned. Metadata are stored for cloud storage backends. This API does nothing for other backends or if no metadata plugin is configured'
  906. operationId: start_user_metadata_check
  907. responses:
  908. '202':
  909. description: successful operation
  910. content:
  911. application/json:
  912. schema:
  913. $ref: '#/components/schemas/ApiResponse'
  914. example:
  915. message: Check started
  916. '400':
  917. $ref: '#/components/responses/BadRequest'
  918. '401':
  919. $ref: '#/components/responses/Unauthorized'
  920. '403':
  921. $ref: '#/components/responses/Forbidden'
  922. '404':
  923. $ref: '#/components/responses/NotFound'
  924. '409':
  925. $ref: '#/components/responses/Conflict'
  926. '500':
  927. $ref: '#/components/responses/InternalServerError'
  928. default:
  929. $ref: '#/components/responses/DefaultResponse'
  930. /retention/users/checks:
  931. get:
  932. tags:
  933. - data retention
  934. summary: Get retention checks
  935. description: Returns the active retention checks
  936. operationId: get_users_retention_checks
  937. responses:
  938. '200':
  939. description: successful operation
  940. content:
  941. application/json:
  942. schema:
  943. type: array
  944. items:
  945. $ref: '#/components/schemas/RetentionCheck'
  946. '401':
  947. $ref: '#/components/responses/Unauthorized'
  948. '403':
  949. $ref: '#/components/responses/Forbidden'
  950. '500':
  951. $ref: '#/components/responses/InternalServerError'
  952. default:
  953. $ref: '#/components/responses/DefaultResponse'
  954. /retention/users/{username}/check:
  955. parameters:
  956. - name: username
  957. in: path
  958. description: the username
  959. required: true
  960. schema:
  961. type: string
  962. - name: notifications
  963. in: query
  964. description: 'specify how to notify results'
  965. explode: false
  966. schema:
  967. type: array
  968. items:
  969. $ref: '#/components/schemas/RetentionCheckNotification'
  970. post:
  971. tags:
  972. - data retention
  973. summary: Start a retention check
  974. description: 'Starts a new retention check for the given user. If a retention check for this user is already active a 409 status code is returned'
  975. operationId: start_user_retention_check
  976. requestBody:
  977. required: true
  978. description: 'Defines virtual paths to check and their retention time in hours'
  979. content:
  980. application/json:
  981. schema:
  982. type: array
  983. items:
  984. $ref: '#/components/schemas/FolderRetention'
  985. responses:
  986. '202':
  987. description: successful operation
  988. content:
  989. application/json:
  990. schema:
  991. $ref: '#/components/schemas/ApiResponse'
  992. example:
  993. message: Check started
  994. '400':
  995. $ref: '#/components/responses/BadRequest'
  996. '401':
  997. $ref: '#/components/responses/Unauthorized'
  998. '403':
  999. $ref: '#/components/responses/Forbidden'
  1000. '404':
  1001. $ref: '#/components/responses/NotFound'
  1002. '409':
  1003. $ref: '#/components/responses/Conflict'
  1004. '500':
  1005. $ref: '#/components/responses/InternalServerError'
  1006. default:
  1007. $ref: '#/components/responses/DefaultResponse'
  1008. /quotas/users/scans:
  1009. get:
  1010. tags:
  1011. - quota
  1012. summary: Get active user quota scans
  1013. description: Returns the active user quota scans
  1014. operationId: get_users_quota_scans
  1015. responses:
  1016. '200':
  1017. description: successful operation
  1018. content:
  1019. application/json:
  1020. schema:
  1021. type: array
  1022. items:
  1023. $ref: '#/components/schemas/QuotaScan'
  1024. '401':
  1025. $ref: '#/components/responses/Unauthorized'
  1026. '403':
  1027. $ref: '#/components/responses/Forbidden'
  1028. '500':
  1029. $ref: '#/components/responses/InternalServerError'
  1030. default:
  1031. $ref: '#/components/responses/DefaultResponse'
  1032. /quotas/users/{username}/scan:
  1033. parameters:
  1034. - name: username
  1035. in: path
  1036. description: the username
  1037. required: true
  1038. schema:
  1039. type: string
  1040. post:
  1041. tags:
  1042. - quota
  1043. summary: Start a user quota scan
  1044. description: Starts a new quota scan for the given user. A quota scan updates the number of files and their total size for the specified user and the virtual folders, if any, included in his quota
  1045. operationId: start_user_quota_scan
  1046. responses:
  1047. '202':
  1048. description: successful operation
  1049. content:
  1050. application/json:
  1051. schema:
  1052. $ref: '#/components/schemas/ApiResponse'
  1053. example:
  1054. message: Scan started
  1055. '400':
  1056. $ref: '#/components/responses/BadRequest'
  1057. '401':
  1058. $ref: '#/components/responses/Unauthorized'
  1059. '403':
  1060. $ref: '#/components/responses/Forbidden'
  1061. '404':
  1062. $ref: '#/components/responses/NotFound'
  1063. '409':
  1064. $ref: '#/components/responses/Conflict'
  1065. '500':
  1066. $ref: '#/components/responses/InternalServerError'
  1067. default:
  1068. $ref: '#/components/responses/DefaultResponse'
  1069. /quotas/users/{username}/usage:
  1070. parameters:
  1071. - name: username
  1072. in: path
  1073. description: the username
  1074. required: true
  1075. schema:
  1076. type: string
  1077. - in: query
  1078. name: mode
  1079. required: false
  1080. description: the update mode specifies if the given quota usage values should be added or replace the current ones
  1081. schema:
  1082. type: string
  1083. enum:
  1084. - add
  1085. - reset
  1086. description: |
  1087. Update type:
  1088. * `add` - add the specified quota limits to the current used ones
  1089. * `reset` - reset the values to the specified ones. This is the default
  1090. example: reset
  1091. put:
  1092. tags:
  1093. - quota
  1094. summary: Update disk quota usage limits
  1095. description: Sets the current used quota limits for the given user
  1096. operationId: user_quota_update_usage
  1097. requestBody:
  1098. required: true
  1099. description: 'If used_quota_size and used_quota_files are missing they will default to 0, this means that if mode is "add" the current value, for the missing field, will remain unchanged, if mode is "reset" the missing field is set to 0'
  1100. content:
  1101. application/json:
  1102. schema:
  1103. $ref: '#/components/schemas/QuotaUsage'
  1104. responses:
  1105. '200':
  1106. description: successful operation
  1107. content:
  1108. application/json:
  1109. schema:
  1110. $ref: '#/components/schemas/ApiResponse'
  1111. example:
  1112. message: Quota updated
  1113. '400':
  1114. $ref: '#/components/responses/BadRequest'
  1115. '401':
  1116. $ref: '#/components/responses/Unauthorized'
  1117. '403':
  1118. $ref: '#/components/responses/Forbidden'
  1119. '404':
  1120. $ref: '#/components/responses/NotFound'
  1121. '409':
  1122. $ref: '#/components/responses/Conflict'
  1123. '500':
  1124. $ref: '#/components/responses/InternalServerError'
  1125. default:
  1126. $ref: '#/components/responses/DefaultResponse'
  1127. /quotas/users/{username}/transfer-usage:
  1128. parameters:
  1129. - name: username
  1130. in: path
  1131. description: the username
  1132. required: true
  1133. schema:
  1134. type: string
  1135. - in: query
  1136. name: mode
  1137. required: false
  1138. description: the update mode specifies if the given quota usage values should be added or replace the current ones
  1139. schema:
  1140. type: string
  1141. enum:
  1142. - add
  1143. - reset
  1144. description: |
  1145. Update type:
  1146. * `add` - add the specified quota limits to the current used ones
  1147. * `reset` - reset the values to the specified ones. This is the default
  1148. example: reset
  1149. put:
  1150. tags:
  1151. - quota
  1152. summary: Update transfer quota usage limits
  1153. description: Sets the current used transfer quota limits for the given user
  1154. operationId: user_transfer_quota_update_usage
  1155. requestBody:
  1156. required: true
  1157. description: 'If used_upload_data_transfer and used_download_data_transfer are missing they will default to 0, this means that if mode is "add" the current value, for the missing field, will remain unchanged, if mode is "reset" the missing field is set to 0'
  1158. content:
  1159. application/json:
  1160. schema:
  1161. $ref: '#/components/schemas/TransferQuotaUsage'
  1162. responses:
  1163. '200':
  1164. description: successful operation
  1165. content:
  1166. application/json:
  1167. schema:
  1168. $ref: '#/components/schemas/ApiResponse'
  1169. example:
  1170. message: Quota updated
  1171. '400':
  1172. $ref: '#/components/responses/BadRequest'
  1173. '401':
  1174. $ref: '#/components/responses/Unauthorized'
  1175. '403':
  1176. $ref: '#/components/responses/Forbidden'
  1177. '404':
  1178. $ref: '#/components/responses/NotFound'
  1179. '409':
  1180. $ref: '#/components/responses/Conflict'
  1181. '500':
  1182. $ref: '#/components/responses/InternalServerError'
  1183. default:
  1184. $ref: '#/components/responses/DefaultResponse'
  1185. /quotas/folders/scans:
  1186. get:
  1187. tags:
  1188. - quota
  1189. summary: Get active folder quota scans
  1190. description: Returns the active folder quota scans
  1191. operationId: get_folders_quota_scans
  1192. responses:
  1193. '200':
  1194. description: successful operation
  1195. content:
  1196. application/json:
  1197. schema:
  1198. type: array
  1199. items:
  1200. $ref: '#/components/schemas/FolderQuotaScan'
  1201. '401':
  1202. $ref: '#/components/responses/Unauthorized'
  1203. '403':
  1204. $ref: '#/components/responses/Forbidden'
  1205. '500':
  1206. $ref: '#/components/responses/InternalServerError'
  1207. default:
  1208. $ref: '#/components/responses/DefaultResponse'
  1209. /quotas/folders/{name}/scan:
  1210. parameters:
  1211. - name: name
  1212. in: path
  1213. description: folder name
  1214. required: true
  1215. schema:
  1216. type: string
  1217. post:
  1218. tags:
  1219. - quota
  1220. summary: Start a folder quota scan
  1221. description: Starts a new quota scan for the given folder. A quota scan update the number of files and their total size for the specified folder
  1222. operationId: start_folder_quota_scan
  1223. responses:
  1224. '202':
  1225. description: successful operation
  1226. content:
  1227. application/json:
  1228. schema:
  1229. $ref: '#/components/schemas/ApiResponse'
  1230. example:
  1231. message: Scan started
  1232. '400':
  1233. $ref: '#/components/responses/BadRequest'
  1234. '401':
  1235. $ref: '#/components/responses/Unauthorized'
  1236. '403':
  1237. $ref: '#/components/responses/Forbidden'
  1238. '404':
  1239. $ref: '#/components/responses/NotFound'
  1240. '409':
  1241. $ref: '#/components/responses/Conflict'
  1242. '500':
  1243. $ref: '#/components/responses/InternalServerError'
  1244. default:
  1245. $ref: '#/components/responses/DefaultResponse'
  1246. /quotas/folders/{name}/usage:
  1247. parameters:
  1248. - name: name
  1249. in: path
  1250. description: folder name
  1251. required: true
  1252. schema:
  1253. type: string
  1254. - in: query
  1255. name: mode
  1256. required: false
  1257. description: the update mode specifies if the given quota usage values should be added or replace the current ones
  1258. schema:
  1259. type: string
  1260. enum:
  1261. - add
  1262. - reset
  1263. description: |
  1264. Update type:
  1265. * `add` - add the specified quota limits to the current used ones
  1266. * `reset` - reset the values to the specified ones. This is the default
  1267. example: reset
  1268. put:
  1269. tags:
  1270. - quota
  1271. summary: Update folder quota usage limits
  1272. description: Sets the current used quota limits for the given folder
  1273. operationId: folder_quota_update_usage
  1274. parameters:
  1275. - in: query
  1276. name: mode
  1277. required: false
  1278. description: the update mode specifies if the given quota usage values should be added or replace the current ones
  1279. schema:
  1280. type: string
  1281. enum:
  1282. - add
  1283. - reset
  1284. description: |
  1285. Update type:
  1286. * `add` - add the specified quota limits to the current used ones
  1287. * `reset` - reset the values to the specified ones. This is the default
  1288. example: reset
  1289. requestBody:
  1290. required: true
  1291. description: 'If used_quota_size and used_quota_files are missing they will default to 0, this means that if mode is "add" the current value, for the missing field, will remain unchanged, if mode is "reset" the missing field is set to 0'
  1292. content:
  1293. application/json:
  1294. schema:
  1295. $ref: '#/components/schemas/QuotaUsage'
  1296. responses:
  1297. '200':
  1298. description: successful operation
  1299. content:
  1300. application/json:
  1301. schema:
  1302. $ref: '#/components/schemas/ApiResponse'
  1303. example:
  1304. message: Quota updated
  1305. '400':
  1306. $ref: '#/components/responses/BadRequest'
  1307. '401':
  1308. $ref: '#/components/responses/Unauthorized'
  1309. '403':
  1310. $ref: '#/components/responses/Forbidden'
  1311. '404':
  1312. $ref: '#/components/responses/NotFound'
  1313. '409':
  1314. $ref: '#/components/responses/Conflict'
  1315. '500':
  1316. $ref: '#/components/responses/InternalServerError'
  1317. default:
  1318. $ref: '#/components/responses/DefaultResponse'
  1319. /folders:
  1320. get:
  1321. tags:
  1322. - folders
  1323. summary: Get folders
  1324. description: Returns an array with one or more folders
  1325. operationId: get_folders
  1326. parameters:
  1327. - in: query
  1328. name: offset
  1329. schema:
  1330. type: integer
  1331. minimum: 0
  1332. default: 0
  1333. required: false
  1334. - in: query
  1335. name: limit
  1336. schema:
  1337. type: integer
  1338. minimum: 1
  1339. maximum: 500
  1340. default: 100
  1341. required: false
  1342. description: 'The maximum number of items to return. Max value is 500, default is 100'
  1343. - in: query
  1344. name: order
  1345. required: false
  1346. description: Ordering folders by name. Default ASC
  1347. schema:
  1348. type: string
  1349. enum:
  1350. - ASC
  1351. - DESC
  1352. example: ASC
  1353. responses:
  1354. '200':
  1355. description: successful operation
  1356. content:
  1357. application/json:
  1358. schema:
  1359. type: array
  1360. items:
  1361. $ref: '#/components/schemas/BaseVirtualFolder'
  1362. '400':
  1363. $ref: '#/components/responses/BadRequest'
  1364. '401':
  1365. $ref: '#/components/responses/Unauthorized'
  1366. '403':
  1367. $ref: '#/components/responses/Forbidden'
  1368. '500':
  1369. $ref: '#/components/responses/InternalServerError'
  1370. default:
  1371. $ref: '#/components/responses/DefaultResponse'
  1372. post:
  1373. tags:
  1374. - folders
  1375. summary: Add folder
  1376. operationId: add_folder
  1377. description: Adds a new folder. A quota scan is required to update the used files/size
  1378. requestBody:
  1379. required: true
  1380. content:
  1381. application/json:
  1382. schema:
  1383. $ref: '#/components/schemas/BaseVirtualFolder'
  1384. responses:
  1385. '201':
  1386. description: successful operation
  1387. content:
  1388. application/json:
  1389. schema:
  1390. $ref: '#/components/schemas/BaseVirtualFolder'
  1391. '400':
  1392. $ref: '#/components/responses/BadRequest'
  1393. '401':
  1394. $ref: '#/components/responses/Unauthorized'
  1395. '403':
  1396. $ref: '#/components/responses/Forbidden'
  1397. '500':
  1398. $ref: '#/components/responses/InternalServerError'
  1399. default:
  1400. $ref: '#/components/responses/DefaultResponse'
  1401. '/folders/{name}':
  1402. parameters:
  1403. - name: name
  1404. in: path
  1405. description: folder name
  1406. required: true
  1407. schema:
  1408. type: string
  1409. get:
  1410. tags:
  1411. - folders
  1412. summary: Find folders by name
  1413. description: Returns the folder with the given name if it exists.
  1414. operationId: get_folder_by_name
  1415. responses:
  1416. '200':
  1417. description: successful operation
  1418. content:
  1419. application/json:
  1420. schema:
  1421. $ref: '#/components/schemas/BaseVirtualFolder'
  1422. '400':
  1423. $ref: '#/components/responses/BadRequest'
  1424. '401':
  1425. $ref: '#/components/responses/Unauthorized'
  1426. '403':
  1427. $ref: '#/components/responses/Forbidden'
  1428. '404':
  1429. $ref: '#/components/responses/NotFound'
  1430. '500':
  1431. $ref: '#/components/responses/InternalServerError'
  1432. default:
  1433. $ref: '#/components/responses/DefaultResponse'
  1434. put:
  1435. tags:
  1436. - folders
  1437. summary: Update folder
  1438. description: Updates an existing folder
  1439. operationId: update_folder
  1440. requestBody:
  1441. required: true
  1442. content:
  1443. application/json:
  1444. schema:
  1445. $ref: '#/components/schemas/BaseVirtualFolder'
  1446. responses:
  1447. '200':
  1448. description: successful operation
  1449. content:
  1450. application/json:
  1451. schema:
  1452. $ref: '#/components/schemas/ApiResponse'
  1453. example:
  1454. message: Folder updated
  1455. '400':
  1456. $ref: '#/components/responses/BadRequest'
  1457. '401':
  1458. $ref: '#/components/responses/Unauthorized'
  1459. '403':
  1460. $ref: '#/components/responses/Forbidden'
  1461. '404':
  1462. $ref: '#/components/responses/NotFound'
  1463. '500':
  1464. $ref: '#/components/responses/InternalServerError'
  1465. default:
  1466. $ref: '#/components/responses/DefaultResponse'
  1467. delete:
  1468. tags:
  1469. - folders
  1470. summary: Delete folder
  1471. description: Deletes an existing folder
  1472. operationId: delete_folder
  1473. responses:
  1474. '200':
  1475. description: successful operation
  1476. content:
  1477. application/json:
  1478. schema:
  1479. $ref: '#/components/schemas/ApiResponse'
  1480. example:
  1481. message: User deleted
  1482. '400':
  1483. $ref: '#/components/responses/BadRequest'
  1484. '401':
  1485. $ref: '#/components/responses/Unauthorized'
  1486. '403':
  1487. $ref: '#/components/responses/Forbidden'
  1488. '404':
  1489. $ref: '#/components/responses/NotFound'
  1490. '500':
  1491. $ref: '#/components/responses/InternalServerError'
  1492. default:
  1493. $ref: '#/components/responses/DefaultResponse'
  1494. /groups:
  1495. get:
  1496. tags:
  1497. - groups
  1498. summary: Get groups
  1499. description: Returns an array with one or more groups
  1500. operationId: get_groups
  1501. parameters:
  1502. - in: query
  1503. name: offset
  1504. schema:
  1505. type: integer
  1506. minimum: 0
  1507. default: 0
  1508. required: false
  1509. - in: query
  1510. name: limit
  1511. schema:
  1512. type: integer
  1513. minimum: 1
  1514. maximum: 500
  1515. default: 100
  1516. required: false
  1517. description: 'The maximum number of items to return. Max value is 500, default is 100'
  1518. - in: query
  1519. name: order
  1520. required: false
  1521. description: Ordering groups by name. Default ASC
  1522. schema:
  1523. type: string
  1524. enum:
  1525. - ASC
  1526. - DESC
  1527. example: ASC
  1528. responses:
  1529. '200':
  1530. description: successful operation
  1531. content:
  1532. application/json:
  1533. schema:
  1534. type: array
  1535. items:
  1536. $ref: '#/components/schemas/Group'
  1537. '400':
  1538. $ref: '#/components/responses/BadRequest'
  1539. '401':
  1540. $ref: '#/components/responses/Unauthorized'
  1541. '403':
  1542. $ref: '#/components/responses/Forbidden'
  1543. '500':
  1544. $ref: '#/components/responses/InternalServerError'
  1545. default:
  1546. $ref: '#/components/responses/DefaultResponse'
  1547. post:
  1548. tags:
  1549. - groups
  1550. summary: Add group
  1551. operationId: add_group
  1552. description: Adds a new group
  1553. requestBody:
  1554. required: true
  1555. content:
  1556. application/json:
  1557. schema:
  1558. $ref: '#/components/schemas/Group'
  1559. responses:
  1560. '201':
  1561. description: successful operation
  1562. content:
  1563. application/json:
  1564. schema:
  1565. $ref: '#/components/schemas/Group'
  1566. '400':
  1567. $ref: '#/components/responses/BadRequest'
  1568. '401':
  1569. $ref: '#/components/responses/Unauthorized'
  1570. '403':
  1571. $ref: '#/components/responses/Forbidden'
  1572. '500':
  1573. $ref: '#/components/responses/InternalServerError'
  1574. default:
  1575. $ref: '#/components/responses/DefaultResponse'
  1576. '/groups/{name}':
  1577. parameters:
  1578. - name: name
  1579. in: path
  1580. description: group name
  1581. required: true
  1582. schema:
  1583. type: string
  1584. get:
  1585. tags:
  1586. - groups
  1587. summary: Find groups by name
  1588. description: Returns the group with the given name if it exists.
  1589. operationId: get_group_by_name
  1590. responses:
  1591. '200':
  1592. description: successful operation
  1593. content:
  1594. application/json:
  1595. schema:
  1596. $ref: '#/components/schemas/Group'
  1597. '400':
  1598. $ref: '#/components/responses/BadRequest'
  1599. '401':
  1600. $ref: '#/components/responses/Unauthorized'
  1601. '403':
  1602. $ref: '#/components/responses/Forbidden'
  1603. '404':
  1604. $ref: '#/components/responses/NotFound'
  1605. '500':
  1606. $ref: '#/components/responses/InternalServerError'
  1607. default:
  1608. $ref: '#/components/responses/DefaultResponse'
  1609. put:
  1610. tags:
  1611. - groups
  1612. summary: Update group
  1613. description: Updates an existing group
  1614. operationId: update_group
  1615. requestBody:
  1616. required: true
  1617. content:
  1618. application/json:
  1619. schema:
  1620. $ref: '#/components/schemas/Group'
  1621. responses:
  1622. '200':
  1623. description: successful operation
  1624. content:
  1625. application/json:
  1626. schema:
  1627. $ref: '#/components/schemas/ApiResponse'
  1628. example:
  1629. message: Group updated
  1630. '400':
  1631. $ref: '#/components/responses/BadRequest'
  1632. '401':
  1633. $ref: '#/components/responses/Unauthorized'
  1634. '403':
  1635. $ref: '#/components/responses/Forbidden'
  1636. '404':
  1637. $ref: '#/components/responses/NotFound'
  1638. '500':
  1639. $ref: '#/components/responses/InternalServerError'
  1640. default:
  1641. $ref: '#/components/responses/DefaultResponse'
  1642. delete:
  1643. tags:
  1644. - groups
  1645. summary: Delete group
  1646. description: Deletes an existing group
  1647. operationId: delete_group
  1648. responses:
  1649. '200':
  1650. description: successful operation
  1651. content:
  1652. application/json:
  1653. schema:
  1654. $ref: '#/components/schemas/ApiResponse'
  1655. example:
  1656. message: Group deleted
  1657. '400':
  1658. $ref: '#/components/responses/BadRequest'
  1659. '401':
  1660. $ref: '#/components/responses/Unauthorized'
  1661. '403':
  1662. $ref: '#/components/responses/Forbidden'
  1663. '404':
  1664. $ref: '#/components/responses/NotFound'
  1665. '500':
  1666. $ref: '#/components/responses/InternalServerError'
  1667. default:
  1668. $ref: '#/components/responses/DefaultResponse'
  1669. /eventactions:
  1670. get:
  1671. tags:
  1672. - event manager
  1673. summary: Get event actions
  1674. description: Returns an array with one or more event actions
  1675. operationId: get_event_actons
  1676. parameters:
  1677. - in: query
  1678. name: offset
  1679. schema:
  1680. type: integer
  1681. minimum: 0
  1682. default: 0
  1683. required: false
  1684. - in: query
  1685. name: limit
  1686. schema:
  1687. type: integer
  1688. minimum: 1
  1689. maximum: 500
  1690. default: 100
  1691. required: false
  1692. description: 'The maximum number of items to return. Max value is 500, default is 100'
  1693. - in: query
  1694. name: order
  1695. required: false
  1696. description: Ordering actions by name. Default ASC
  1697. schema:
  1698. type: string
  1699. enum:
  1700. - ASC
  1701. - DESC
  1702. example: ASC
  1703. responses:
  1704. '200':
  1705. description: successful operation
  1706. content:
  1707. application/json:
  1708. schema:
  1709. type: array
  1710. items:
  1711. $ref: '#/components/schemas/BaseEventAction'
  1712. '400':
  1713. $ref: '#/components/responses/BadRequest'
  1714. '401':
  1715. $ref: '#/components/responses/Unauthorized'
  1716. '403':
  1717. $ref: '#/components/responses/Forbidden'
  1718. '500':
  1719. $ref: '#/components/responses/InternalServerError'
  1720. default:
  1721. $ref: '#/components/responses/DefaultResponse'
  1722. post:
  1723. tags:
  1724. - event manager
  1725. summary: Add event action
  1726. operationId: add_event_action
  1727. description: Adds a new event actions
  1728. requestBody:
  1729. required: true
  1730. content:
  1731. application/json:
  1732. schema:
  1733. $ref: '#/components/schemas/BaseEventAction'
  1734. responses:
  1735. '201':
  1736. description: successful operation
  1737. content:
  1738. application/json:
  1739. schema:
  1740. $ref: '#/components/schemas/BaseEventAction'
  1741. '400':
  1742. $ref: '#/components/responses/BadRequest'
  1743. '401':
  1744. $ref: '#/components/responses/Unauthorized'
  1745. '403':
  1746. $ref: '#/components/responses/Forbidden'
  1747. '500':
  1748. $ref: '#/components/responses/InternalServerError'
  1749. default:
  1750. $ref: '#/components/responses/DefaultResponse'
  1751. '/eventactions/{name}':
  1752. parameters:
  1753. - name: name
  1754. in: path
  1755. description: action name
  1756. required: true
  1757. schema:
  1758. type: string
  1759. get:
  1760. tags:
  1761. - event manager
  1762. summary: Find event actions by name
  1763. description: Returns the event action with the given name if it exists.
  1764. operationId: get_event_action_by_name
  1765. responses:
  1766. '200':
  1767. description: successful operation
  1768. content:
  1769. application/json:
  1770. schema:
  1771. $ref: '#/components/schemas/BaseEventAction'
  1772. '400':
  1773. $ref: '#/components/responses/BadRequest'
  1774. '401':
  1775. $ref: '#/components/responses/Unauthorized'
  1776. '403':
  1777. $ref: '#/components/responses/Forbidden'
  1778. '404':
  1779. $ref: '#/components/responses/NotFound'
  1780. '500':
  1781. $ref: '#/components/responses/InternalServerError'
  1782. default:
  1783. $ref: '#/components/responses/DefaultResponse'
  1784. put:
  1785. tags:
  1786. - event manager
  1787. summary: Update event action
  1788. description: Updates an existing event action
  1789. operationId: update_event_action
  1790. requestBody:
  1791. required: true
  1792. content:
  1793. application/json:
  1794. schema:
  1795. $ref: '#/components/schemas/BaseEventAction'
  1796. responses:
  1797. '200':
  1798. description: successful operation
  1799. content:
  1800. application/json:
  1801. schema:
  1802. $ref: '#/components/schemas/ApiResponse'
  1803. example:
  1804. message: Event action updated
  1805. '400':
  1806. $ref: '#/components/responses/BadRequest'
  1807. '401':
  1808. $ref: '#/components/responses/Unauthorized'
  1809. '403':
  1810. $ref: '#/components/responses/Forbidden'
  1811. '404':
  1812. $ref: '#/components/responses/NotFound'
  1813. '500':
  1814. $ref: '#/components/responses/InternalServerError'
  1815. default:
  1816. $ref: '#/components/responses/DefaultResponse'
  1817. delete:
  1818. tags:
  1819. - event manager
  1820. summary: Delete event action
  1821. description: Deletes an existing event action
  1822. operationId: delete_event_action
  1823. responses:
  1824. '200':
  1825. description: successful operation
  1826. content:
  1827. application/json:
  1828. schema:
  1829. $ref: '#/components/schemas/ApiResponse'
  1830. example:
  1831. message: Event action deleted
  1832. '400':
  1833. $ref: '#/components/responses/BadRequest'
  1834. '401':
  1835. $ref: '#/components/responses/Unauthorized'
  1836. '403':
  1837. $ref: '#/components/responses/Forbidden'
  1838. '404':
  1839. $ref: '#/components/responses/NotFound'
  1840. '500':
  1841. $ref: '#/components/responses/InternalServerError'
  1842. default:
  1843. $ref: '#/components/responses/DefaultResponse'
  1844. /eventrules:
  1845. get:
  1846. tags:
  1847. - event manager
  1848. summary: Get event rules
  1849. description: Returns an array with one or more event rules
  1850. operationId: get_event_rules
  1851. parameters:
  1852. - in: query
  1853. name: offset
  1854. schema:
  1855. type: integer
  1856. minimum: 0
  1857. default: 0
  1858. required: false
  1859. - in: query
  1860. name: limit
  1861. schema:
  1862. type: integer
  1863. minimum: 1
  1864. maximum: 500
  1865. default: 100
  1866. required: false
  1867. description: 'The maximum number of items to return. Max value is 500, default is 100'
  1868. - in: query
  1869. name: order
  1870. required: false
  1871. description: Ordering rules by name. Default ASC
  1872. schema:
  1873. type: string
  1874. enum:
  1875. - ASC
  1876. - DESC
  1877. example: ASC
  1878. responses:
  1879. '200':
  1880. description: successful operation
  1881. content:
  1882. application/json:
  1883. schema:
  1884. type: array
  1885. items:
  1886. $ref: '#/components/schemas/EventRule'
  1887. '400':
  1888. $ref: '#/components/responses/BadRequest'
  1889. '401':
  1890. $ref: '#/components/responses/Unauthorized'
  1891. '403':
  1892. $ref: '#/components/responses/Forbidden'
  1893. '500':
  1894. $ref: '#/components/responses/InternalServerError'
  1895. default:
  1896. $ref: '#/components/responses/DefaultResponse'
  1897. post:
  1898. tags:
  1899. - event manager
  1900. summary: Add event rule
  1901. operationId: add_event_rule
  1902. description: Adds a new event rule
  1903. requestBody:
  1904. required: true
  1905. content:
  1906. application/json:
  1907. schema:
  1908. $ref: '#/components/schemas/EventRuleMinimal'
  1909. responses:
  1910. '201':
  1911. description: successful operation
  1912. content:
  1913. application/json:
  1914. schema:
  1915. $ref: '#/components/schemas/EventRule'
  1916. '400':
  1917. $ref: '#/components/responses/BadRequest'
  1918. '401':
  1919. $ref: '#/components/responses/Unauthorized'
  1920. '403':
  1921. $ref: '#/components/responses/Forbidden'
  1922. '500':
  1923. $ref: '#/components/responses/InternalServerError'
  1924. default:
  1925. $ref: '#/components/responses/DefaultResponse'
  1926. '/eventrules/{name}':
  1927. parameters:
  1928. - name: name
  1929. in: path
  1930. description: rule name
  1931. required: true
  1932. schema:
  1933. type: string
  1934. get:
  1935. tags:
  1936. - event manager
  1937. summary: Find event rules by name
  1938. description: Returns the event rule with the given name if it exists.
  1939. operationId: get_event_rile_by_name
  1940. responses:
  1941. '200':
  1942. description: successful operation
  1943. content:
  1944. application/json:
  1945. schema:
  1946. $ref: '#/components/schemas/EventRule'
  1947. '400':
  1948. $ref: '#/components/responses/BadRequest'
  1949. '401':
  1950. $ref: '#/components/responses/Unauthorized'
  1951. '403':
  1952. $ref: '#/components/responses/Forbidden'
  1953. '404':
  1954. $ref: '#/components/responses/NotFound'
  1955. '500':
  1956. $ref: '#/components/responses/InternalServerError'
  1957. default:
  1958. $ref: '#/components/responses/DefaultResponse'
  1959. put:
  1960. tags:
  1961. - event manager
  1962. summary: Update event rule
  1963. description: Updates an existing event rule
  1964. operationId: update_event_rule
  1965. requestBody:
  1966. required: true
  1967. content:
  1968. application/json:
  1969. schema:
  1970. $ref: '#/components/schemas/EventRuleMinimal'
  1971. responses:
  1972. '200':
  1973. description: successful operation
  1974. content:
  1975. application/json:
  1976. schema:
  1977. $ref: '#/components/schemas/ApiResponse'
  1978. example:
  1979. message: Event rules updated
  1980. '400':
  1981. $ref: '#/components/responses/BadRequest'
  1982. '401':
  1983. $ref: '#/components/responses/Unauthorized'
  1984. '403':
  1985. $ref: '#/components/responses/Forbidden'
  1986. '404':
  1987. $ref: '#/components/responses/NotFound'
  1988. '500':
  1989. $ref: '#/components/responses/InternalServerError'
  1990. default:
  1991. $ref: '#/components/responses/DefaultResponse'
  1992. delete:
  1993. tags:
  1994. - event manager
  1995. summary: Delete event rule
  1996. description: Deletes an existing event rule
  1997. operationId: delete_event_rule
  1998. responses:
  1999. '200':
  2000. description: successful operation
  2001. content:
  2002. application/json:
  2003. schema:
  2004. $ref: '#/components/schemas/ApiResponse'
  2005. example:
  2006. message: Event rules deleted
  2007. '400':
  2008. $ref: '#/components/responses/BadRequest'
  2009. '401':
  2010. $ref: '#/components/responses/Unauthorized'
  2011. '403':
  2012. $ref: '#/components/responses/Forbidden'
  2013. '404':
  2014. $ref: '#/components/responses/NotFound'
  2015. '500':
  2016. $ref: '#/components/responses/InternalServerError'
  2017. default:
  2018. $ref: '#/components/responses/DefaultResponse'
  2019. /events/fs:
  2020. get:
  2021. tags:
  2022. - events
  2023. summary: Get filesystem events
  2024. description: 'Returns an array with one or more filesystem events applying the specified filters. This API is only available if you configure an "eventsearcher" plugin'
  2025. operationId: get_fs_events
  2026. parameters:
  2027. - in: query
  2028. name: start_timestamp
  2029. schema:
  2030. type: integer
  2031. format: int64
  2032. minimum: 0
  2033. default: 0
  2034. required: false
  2035. description: 'the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter'
  2036. - in: query
  2037. name: end_timestamp
  2038. schema:
  2039. type: integer
  2040. format: int64
  2041. minimum: 0
  2042. default: 0
  2043. required: false
  2044. description: 'the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter'
  2045. - in: query
  2046. name: actions
  2047. schema:
  2048. type: array
  2049. items:
  2050. $ref: '#/components/schemas/FsEventAction'
  2051. description: 'the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated'
  2052. explode: false
  2053. required: false
  2054. - in: query
  2055. name: username
  2056. schema:
  2057. type: string
  2058. description: 'the event username must be the same as the one specified. Empty or missing means omit this filter'
  2059. required: false
  2060. - in: query
  2061. name: ip
  2062. schema:
  2063. type: string
  2064. description: 'the event IP must be the same as the one specified. Empty or missing means omit this filter'
  2065. required: false
  2066. - in: query
  2067. name: ssh_cmd
  2068. schema:
  2069. type: string
  2070. description: 'the event SSH command must be the same as the one specified. Empty or missing means omit this filter'
  2071. required: false
  2072. - in: query
  2073. name: fs_provider
  2074. schema:
  2075. $ref: '#/components/schemas/FsProviders'
  2076. description: 'the event filesystem provider must be the same as the one specified. Empty or missing means omit this filter'
  2077. required: false
  2078. - in: query
  2079. name: bucket
  2080. schema:
  2081. type: string
  2082. description: 'the bucket must be the same as the one specified. Empty or missing means omit this filter'
  2083. required: false
  2084. - in: query
  2085. name: endpoint
  2086. schema:
  2087. type: string
  2088. description: 'the endpoint must be the same as the one specified. Empty or missing means omit this filter'
  2089. required: false
  2090. - in: query
  2091. name: protocols
  2092. schema:
  2093. type: array
  2094. items:
  2095. $ref: '#/components/schemas/EventProtocols'
  2096. description: 'the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2097. explode: false
  2098. required: false
  2099. - in: query
  2100. name: statuses
  2101. schema:
  2102. type: array
  2103. items:
  2104. $ref: '#/components/schemas/FsEventStatus'
  2105. description: 'the event status must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2106. explode: false
  2107. required: false
  2108. - in: query
  2109. name: instance_ids
  2110. schema:
  2111. type: array
  2112. items:
  2113. type: string
  2114. description: 'the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2115. explode: false
  2116. required: false
  2117. - in: query
  2118. name: exclude_ids
  2119. schema:
  2120. type: array
  2121. items:
  2122. type: string
  2123. description: 'the event id must not be included among those specified. This is useful for cursor based pagination. Empty or missing means omit this filter. Values must be specified comma separated'
  2124. explode: false
  2125. required: false
  2126. - in: query
  2127. name: limit
  2128. schema:
  2129. type: integer
  2130. minimum: 1
  2131. maximum: 1000
  2132. default: 100
  2133. required: false
  2134. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2135. - in: query
  2136. name: order
  2137. required: false
  2138. description: Ordering events by timestamp. Default DESC
  2139. schema:
  2140. type: string
  2141. enum:
  2142. - ASC
  2143. - DESC
  2144. example: DESC
  2145. responses:
  2146. '200':
  2147. description: successful operation
  2148. content:
  2149. application/json:
  2150. schema:
  2151. type: array
  2152. items:
  2153. $ref: '#/components/schemas/FsEvent'
  2154. '400':
  2155. $ref: '#/components/responses/BadRequest'
  2156. '401':
  2157. $ref: '#/components/responses/Unauthorized'
  2158. '403':
  2159. $ref: '#/components/responses/Forbidden'
  2160. '500':
  2161. $ref: '#/components/responses/InternalServerError'
  2162. default:
  2163. $ref: '#/components/responses/DefaultResponse'
  2164. /events/provider:
  2165. get:
  2166. tags:
  2167. - events
  2168. summary: Get provider events
  2169. description: 'Returns an array with one or more provider events applying the specified filters. This API is only available if you configure an "eventsearcher" plugin'
  2170. operationId: get_provider_events
  2171. parameters:
  2172. - in: query
  2173. name: start_timestamp
  2174. schema:
  2175. type: integer
  2176. format: int64
  2177. minimum: 0
  2178. default: 0
  2179. required: false
  2180. description: 'the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter'
  2181. - in: query
  2182. name: end_timestamp
  2183. schema:
  2184. type: integer
  2185. format: int64
  2186. minimum: 0
  2187. default: 0
  2188. required: false
  2189. description: 'the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter'
  2190. - in: query
  2191. name: actions
  2192. schema:
  2193. type: array
  2194. items:
  2195. $ref: '#/components/schemas/ProviderEventAction'
  2196. description: 'the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated'
  2197. explode: false
  2198. required: false
  2199. - in: query
  2200. name: username
  2201. schema:
  2202. type: string
  2203. description: 'the event username must be the same as the one specified. Empty or missing means omit this filter'
  2204. required: false
  2205. - in: query
  2206. name: ip
  2207. schema:
  2208. type: string
  2209. description: 'the event IP must be the same as the one specified. Empty or missing means omit this filter'
  2210. required: false
  2211. - in: query
  2212. name: object_name
  2213. schema:
  2214. type: string
  2215. description: 'the event object name must be the same as the one specified. Empty or missing means omit this filter'
  2216. required: false
  2217. - in: query
  2218. name: object_types
  2219. schema:
  2220. type: array
  2221. items:
  2222. $ref: '#/components/schemas/ProviderEventObjectType'
  2223. description: 'the event object type must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2224. explode: false
  2225. required: false
  2226. - in: query
  2227. name: instance_ids
  2228. schema:
  2229. type: array
  2230. items:
  2231. type: string
  2232. description: 'the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2233. explode: false
  2234. required: false
  2235. - in: query
  2236. name: exclude_ids
  2237. schema:
  2238. type: array
  2239. items:
  2240. type: string
  2241. description: 'the event id must not be included among those specified. This is useful for cursor based pagination. Empty or missing means omit this filter. Values must be specified comma separated'
  2242. explode: false
  2243. required: false
  2244. - in: query
  2245. name: limit
  2246. schema:
  2247. type: integer
  2248. minimum: 1
  2249. maximum: 1000
  2250. default: 100
  2251. required: false
  2252. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2253. - in: query
  2254. name: order
  2255. required: false
  2256. description: Ordering events by timestamp. Default DESC
  2257. schema:
  2258. type: string
  2259. enum:
  2260. - ASC
  2261. - DESC
  2262. example: DESC
  2263. responses:
  2264. '200':
  2265. description: successful operation
  2266. content:
  2267. application/json:
  2268. schema:
  2269. type: array
  2270. items:
  2271. $ref: '#/components/schemas/ProviderEvent'
  2272. '400':
  2273. $ref: '#/components/responses/BadRequest'
  2274. '401':
  2275. $ref: '#/components/responses/Unauthorized'
  2276. '403':
  2277. $ref: '#/components/responses/Forbidden'
  2278. '500':
  2279. $ref: '#/components/responses/InternalServerError'
  2280. default:
  2281. $ref: '#/components/responses/DefaultResponse'
  2282. /apikeys:
  2283. get:
  2284. security:
  2285. - BearerAuth: []
  2286. tags:
  2287. - API keys
  2288. summary: Get API keys
  2289. description: Returns an array with one or more API keys. For security reasons hashed keys are omitted in the response
  2290. operationId: get_api_keys
  2291. parameters:
  2292. - in: query
  2293. name: offset
  2294. schema:
  2295. type: integer
  2296. minimum: 0
  2297. default: 0
  2298. required: false
  2299. - in: query
  2300. name: limit
  2301. schema:
  2302. type: integer
  2303. minimum: 1
  2304. maximum: 500
  2305. default: 100
  2306. required: false
  2307. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2308. - in: query
  2309. name: order
  2310. required: false
  2311. description: Ordering API keys by id. Default ASC
  2312. schema:
  2313. type: string
  2314. enum:
  2315. - ASC
  2316. - DESC
  2317. example: ASC
  2318. responses:
  2319. '200':
  2320. description: successful operation
  2321. content:
  2322. application/json:
  2323. schema:
  2324. type: array
  2325. items:
  2326. $ref: '#/components/schemas/APIKey'
  2327. '400':
  2328. $ref: '#/components/responses/BadRequest'
  2329. '401':
  2330. $ref: '#/components/responses/Unauthorized'
  2331. '403':
  2332. $ref: '#/components/responses/Forbidden'
  2333. '500':
  2334. $ref: '#/components/responses/InternalServerError'
  2335. default:
  2336. $ref: '#/components/responses/DefaultResponse'
  2337. post:
  2338. security:
  2339. - BearerAuth: []
  2340. tags:
  2341. - API keys
  2342. summary: Add API key
  2343. description: Adds a new API key
  2344. operationId: add_api_key
  2345. requestBody:
  2346. required: true
  2347. content:
  2348. application/json:
  2349. schema:
  2350. $ref: '#/components/schemas/APIKey'
  2351. responses:
  2352. '201':
  2353. description: successful operation
  2354. headers:
  2355. X-Object-ID:
  2356. schema:
  2357. type: string
  2358. description: ID for the new created API key
  2359. Location:
  2360. schema:
  2361. type: string
  2362. description: URL to retrieve the details for the new created API key
  2363. content:
  2364. application/json:
  2365. schema:
  2366. type: object
  2367. properties:
  2368. mesage:
  2369. type: string
  2370. example: 'API key created. This is the only time the API key is visible, please save it.'
  2371. key:
  2372. type: string
  2373. description: 'generated API key'
  2374. '400':
  2375. $ref: '#/components/responses/BadRequest'
  2376. '401':
  2377. $ref: '#/components/responses/Unauthorized'
  2378. '403':
  2379. $ref: '#/components/responses/Forbidden'
  2380. '500':
  2381. $ref: '#/components/responses/InternalServerError'
  2382. default:
  2383. $ref: '#/components/responses/DefaultResponse'
  2384. '/apikeys/{id}':
  2385. parameters:
  2386. - name: id
  2387. in: path
  2388. description: the key id
  2389. required: true
  2390. schema:
  2391. type: string
  2392. get:
  2393. security:
  2394. - BearerAuth: []
  2395. tags:
  2396. - API keys
  2397. summary: Find API key by id
  2398. description: Returns the API key with the given id, if it exists. For security reasons the hashed key is omitted in the response
  2399. operationId: get_api_key_by_id
  2400. responses:
  2401. '200':
  2402. description: successful operation
  2403. content:
  2404. application/json:
  2405. schema:
  2406. $ref: '#/components/schemas/APIKey'
  2407. '400':
  2408. $ref: '#/components/responses/BadRequest'
  2409. '401':
  2410. $ref: '#/components/responses/Unauthorized'
  2411. '403':
  2412. $ref: '#/components/responses/Forbidden'
  2413. '404':
  2414. $ref: '#/components/responses/NotFound'
  2415. '500':
  2416. $ref: '#/components/responses/InternalServerError'
  2417. default:
  2418. $ref: '#/components/responses/DefaultResponse'
  2419. put:
  2420. security:
  2421. - BearerAuth: []
  2422. tags:
  2423. - API keys
  2424. summary: Update API key
  2425. description: Updates an existing API key. You cannot update the key itself, the creation date and the last use
  2426. operationId: update_api_key
  2427. requestBody:
  2428. required: true
  2429. content:
  2430. application/json:
  2431. schema:
  2432. $ref: '#/components/schemas/APIKey'
  2433. responses:
  2434. '200':
  2435. description: successful operation
  2436. content:
  2437. application/json:
  2438. schema:
  2439. $ref: '#/components/schemas/ApiResponse'
  2440. example:
  2441. message: API key updated
  2442. '400':
  2443. $ref: '#/components/responses/BadRequest'
  2444. '401':
  2445. $ref: '#/components/responses/Unauthorized'
  2446. '403':
  2447. $ref: '#/components/responses/Forbidden'
  2448. '404':
  2449. $ref: '#/components/responses/NotFound'
  2450. '500':
  2451. $ref: '#/components/responses/InternalServerError'
  2452. default:
  2453. $ref: '#/components/responses/DefaultResponse'
  2454. delete:
  2455. security:
  2456. - BearerAuth: []
  2457. tags:
  2458. - API keys
  2459. summary: Delete API key
  2460. description: Deletes an existing API key
  2461. operationId: delete_api_key
  2462. responses:
  2463. '200':
  2464. description: successful operation
  2465. content:
  2466. application/json:
  2467. schema:
  2468. $ref: '#/components/schemas/ApiResponse'
  2469. example:
  2470. message: Admin deleted
  2471. '400':
  2472. $ref: '#/components/responses/BadRequest'
  2473. '401':
  2474. $ref: '#/components/responses/Unauthorized'
  2475. '403':
  2476. $ref: '#/components/responses/Forbidden'
  2477. '404':
  2478. $ref: '#/components/responses/NotFound'
  2479. '500':
  2480. $ref: '#/components/responses/InternalServerError'
  2481. default:
  2482. $ref: '#/components/responses/DefaultResponse'
  2483. /admins:
  2484. get:
  2485. tags:
  2486. - admins
  2487. summary: Get admins
  2488. description: Returns an array with one or more admins. For security reasons hashed passwords are omitted in the response
  2489. operationId: get_admins
  2490. parameters:
  2491. - in: query
  2492. name: offset
  2493. schema:
  2494. type: integer
  2495. minimum: 0
  2496. default: 0
  2497. required: false
  2498. - in: query
  2499. name: limit
  2500. schema:
  2501. type: integer
  2502. minimum: 1
  2503. maximum: 500
  2504. default: 100
  2505. required: false
  2506. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2507. - in: query
  2508. name: order
  2509. required: false
  2510. description: Ordering admins by username. Default ASC
  2511. schema:
  2512. type: string
  2513. enum:
  2514. - ASC
  2515. - DESC
  2516. example: ASC
  2517. responses:
  2518. '200':
  2519. description: successful operation
  2520. content:
  2521. application/json:
  2522. schema:
  2523. type: array
  2524. items:
  2525. $ref: '#/components/schemas/Admin'
  2526. '400':
  2527. $ref: '#/components/responses/BadRequest'
  2528. '401':
  2529. $ref: '#/components/responses/Unauthorized'
  2530. '403':
  2531. $ref: '#/components/responses/Forbidden'
  2532. '500':
  2533. $ref: '#/components/responses/InternalServerError'
  2534. default:
  2535. $ref: '#/components/responses/DefaultResponse'
  2536. post:
  2537. tags:
  2538. - admins
  2539. summary: Add admin
  2540. description: 'Adds a new admin. Recovery codes and TOTP configuration cannot be set using this API: each admin must use the specific APIs'
  2541. operationId: add_admin
  2542. requestBody:
  2543. required: true
  2544. content:
  2545. application/json:
  2546. schema:
  2547. $ref: '#/components/schemas/Admin'
  2548. examples:
  2549. example-1:
  2550. value:
  2551. id: 1
  2552. status: 0
  2553. username: string
  2554. description: string
  2555. password: pa$$word
  2556. email: [email protected]
  2557. permissions:
  2558. - '*'
  2559. filters:
  2560. allow_list:
  2561. - 192.0.2.0/24
  2562. - '2001:db8::/32'
  2563. additional_info: string
  2564. responses:
  2565. '201':
  2566. description: successful operation
  2567. content:
  2568. application/json:
  2569. schema:
  2570. $ref: '#/components/schemas/Admin'
  2571. '400':
  2572. $ref: '#/components/responses/BadRequest'
  2573. '401':
  2574. $ref: '#/components/responses/Unauthorized'
  2575. '403':
  2576. $ref: '#/components/responses/Forbidden'
  2577. '500':
  2578. $ref: '#/components/responses/InternalServerError'
  2579. default:
  2580. $ref: '#/components/responses/DefaultResponse'
  2581. '/admins/{username}':
  2582. parameters:
  2583. - name: username
  2584. in: path
  2585. description: the admin username
  2586. required: true
  2587. schema:
  2588. type: string
  2589. get:
  2590. tags:
  2591. - admins
  2592. summary: Find admins by username
  2593. description: 'Returns the admin with the given username, if it exists. For security reasons the hashed password is omitted in the response'
  2594. operationId: get_admin_by_username
  2595. responses:
  2596. '200':
  2597. description: successful operation
  2598. content:
  2599. application/json:
  2600. schema:
  2601. $ref: '#/components/schemas/Admin'
  2602. '400':
  2603. $ref: '#/components/responses/BadRequest'
  2604. '401':
  2605. $ref: '#/components/responses/Unauthorized'
  2606. '403':
  2607. $ref: '#/components/responses/Forbidden'
  2608. '404':
  2609. $ref: '#/components/responses/NotFound'
  2610. '500':
  2611. $ref: '#/components/responses/InternalServerError'
  2612. default:
  2613. $ref: '#/components/responses/DefaultResponse'
  2614. put:
  2615. tags:
  2616. - admins
  2617. summary: Update admin
  2618. description: 'Updates an existing admin. Recovery codes and TOTP configuration cannot be set/updated using this API: each admin must use the specific APIs. You are not allowed to update the admin impersonated using an API key'
  2619. operationId: update_admin
  2620. requestBody:
  2621. required: true
  2622. content:
  2623. application/json:
  2624. schema:
  2625. $ref: '#/components/schemas/Admin'
  2626. responses:
  2627. '200':
  2628. description: successful operation
  2629. content:
  2630. application/json:
  2631. schema:
  2632. $ref: '#/components/schemas/ApiResponse'
  2633. example:
  2634. message: Admin updated
  2635. '400':
  2636. $ref: '#/components/responses/BadRequest'
  2637. '401':
  2638. $ref: '#/components/responses/Unauthorized'
  2639. '403':
  2640. $ref: '#/components/responses/Forbidden'
  2641. '404':
  2642. $ref: '#/components/responses/NotFound'
  2643. '500':
  2644. $ref: '#/components/responses/InternalServerError'
  2645. default:
  2646. $ref: '#/components/responses/DefaultResponse'
  2647. delete:
  2648. tags:
  2649. - admins
  2650. summary: Delete admin
  2651. description: Deletes an existing admin
  2652. operationId: delete_admin
  2653. responses:
  2654. '200':
  2655. description: successful operation
  2656. content:
  2657. application/json:
  2658. schema:
  2659. $ref: '#/components/schemas/ApiResponse'
  2660. example:
  2661. message: Admin deleted
  2662. '400':
  2663. $ref: '#/components/responses/BadRequest'
  2664. '401':
  2665. $ref: '#/components/responses/Unauthorized'
  2666. '403':
  2667. $ref: '#/components/responses/Forbidden'
  2668. '404':
  2669. $ref: '#/components/responses/NotFound'
  2670. '500':
  2671. $ref: '#/components/responses/InternalServerError'
  2672. default:
  2673. $ref: '#/components/responses/DefaultResponse'
  2674. '/admins/{username}/2fa/disable':
  2675. parameters:
  2676. - name: username
  2677. in: path
  2678. description: the admin username
  2679. required: true
  2680. schema:
  2681. type: string
  2682. put:
  2683. tags:
  2684. - admins
  2685. summary: Disable second factor authentication
  2686. description: 'Disables second factor authentication for the given admin. This API must be used if the admin loses access to their second factor auth device and has no recovery codes'
  2687. operationId: disable_admin_2fa
  2688. responses:
  2689. '200':
  2690. description: successful operation
  2691. content:
  2692. application/json:
  2693. schema:
  2694. $ref: '#/components/schemas/ApiResponse'
  2695. example:
  2696. message: 2FA disabled
  2697. '400':
  2698. $ref: '#/components/responses/BadRequest'
  2699. '401':
  2700. $ref: '#/components/responses/Unauthorized'
  2701. '403':
  2702. $ref: '#/components/responses/Forbidden'
  2703. '404':
  2704. $ref: '#/components/responses/NotFound'
  2705. '500':
  2706. $ref: '#/components/responses/InternalServerError'
  2707. default:
  2708. $ref: '#/components/responses/DefaultResponse'
  2709. '/admins/{username}/forgot-password':
  2710. parameters:
  2711. - name: username
  2712. in: path
  2713. description: the admin username
  2714. required: true
  2715. schema:
  2716. type: string
  2717. post:
  2718. security: []
  2719. tags:
  2720. - admins
  2721. summary: Send a password reset code by email
  2722. description: 'You must set up an SMTP server and the account must have a valid email address, in which case SFTPGo will send a code via email to reset the password. If the specified admin does not exist, the request will be silently ignored (a success response will be returned) to avoid disclosing existing admins'
  2723. operationId: admin_forgot_password
  2724. responses:
  2725. '200':
  2726. description: successful operation
  2727. content:
  2728. application/json:
  2729. schema:
  2730. $ref: '#/components/schemas/ApiResponse'
  2731. '400':
  2732. $ref: '#/components/responses/BadRequest'
  2733. '401':
  2734. $ref: '#/components/responses/Unauthorized'
  2735. '403':
  2736. $ref: '#/components/responses/Forbidden'
  2737. '404':
  2738. $ref: '#/components/responses/NotFound'
  2739. '500':
  2740. $ref: '#/components/responses/InternalServerError'
  2741. default:
  2742. $ref: '#/components/responses/DefaultResponse'
  2743. '/admins/{username}/reset-password':
  2744. parameters:
  2745. - name: username
  2746. in: path
  2747. description: the admin username
  2748. required: true
  2749. schema:
  2750. type: string
  2751. post:
  2752. security: []
  2753. tags:
  2754. - admins
  2755. summary: Reset the password
  2756. description: 'Set a new password using the code received via email'
  2757. operationId: admin_reset_password
  2758. requestBody:
  2759. content:
  2760. application/json:
  2761. schema:
  2762. type: object
  2763. properties:
  2764. code:
  2765. type: string
  2766. password:
  2767. type: string
  2768. required: true
  2769. responses:
  2770. '200':
  2771. description: successful operation
  2772. content:
  2773. application/json:
  2774. schema:
  2775. $ref: '#/components/schemas/ApiResponse'
  2776. '400':
  2777. $ref: '#/components/responses/BadRequest'
  2778. '401':
  2779. $ref: '#/components/responses/Unauthorized'
  2780. '403':
  2781. $ref: '#/components/responses/Forbidden'
  2782. '404':
  2783. $ref: '#/components/responses/NotFound'
  2784. '500':
  2785. $ref: '#/components/responses/InternalServerError'
  2786. default:
  2787. $ref: '#/components/responses/DefaultResponse'
  2788. /users:
  2789. get:
  2790. tags:
  2791. - users
  2792. summary: Get users
  2793. description: Returns an array with one or more users. For security reasons hashed passwords are omitted in the response
  2794. operationId: get_users
  2795. parameters:
  2796. - in: query
  2797. name: offset
  2798. schema:
  2799. type: integer
  2800. minimum: 0
  2801. default: 0
  2802. required: false
  2803. - in: query
  2804. name: limit
  2805. schema:
  2806. type: integer
  2807. minimum: 1
  2808. maximum: 500
  2809. default: 100
  2810. required: false
  2811. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2812. - in: query
  2813. name: order
  2814. required: false
  2815. description: Ordering users by username. Default ASC
  2816. schema:
  2817. type: string
  2818. enum:
  2819. - ASC
  2820. - DESC
  2821. example: ASC
  2822. responses:
  2823. '200':
  2824. description: successful operation
  2825. content:
  2826. application/json:
  2827. schema:
  2828. type: array
  2829. items:
  2830. $ref: '#/components/schemas/User'
  2831. '400':
  2832. $ref: '#/components/responses/BadRequest'
  2833. '401':
  2834. $ref: '#/components/responses/Unauthorized'
  2835. '403':
  2836. $ref: '#/components/responses/Forbidden'
  2837. '500':
  2838. $ref: '#/components/responses/InternalServerError'
  2839. default:
  2840. $ref: '#/components/responses/DefaultResponse'
  2841. post:
  2842. tags:
  2843. - users
  2844. summary: Add user
  2845. description: 'Adds a new user.Recovery codes and TOTP configuration cannot be set using this API: each user must use the specific APIs'
  2846. operationId: add_user
  2847. requestBody:
  2848. required: true
  2849. content:
  2850. application/json:
  2851. schema:
  2852. $ref: '#/components/schemas/User'
  2853. responses:
  2854. '201':
  2855. description: successful operation
  2856. content:
  2857. application/json:
  2858. schema:
  2859. $ref: '#/components/schemas/User'
  2860. '400':
  2861. $ref: '#/components/responses/BadRequest'
  2862. '401':
  2863. $ref: '#/components/responses/Unauthorized'
  2864. '403':
  2865. $ref: '#/components/responses/Forbidden'
  2866. '500':
  2867. $ref: '#/components/responses/InternalServerError'
  2868. default:
  2869. $ref: '#/components/responses/DefaultResponse'
  2870. '/users/{username}':
  2871. parameters:
  2872. - name: username
  2873. in: path
  2874. description: the username
  2875. required: true
  2876. schema:
  2877. type: string
  2878. get:
  2879. tags:
  2880. - users
  2881. summary: Find users by username
  2882. description: Returns the user with the given username if it exists. For security reasons the hashed password is omitted in the response
  2883. operationId: get_user_by_username
  2884. responses:
  2885. '200':
  2886. description: successful operation
  2887. content:
  2888. application/json:
  2889. schema:
  2890. $ref: '#/components/schemas/User'
  2891. '400':
  2892. $ref: '#/components/responses/BadRequest'
  2893. '401':
  2894. $ref: '#/components/responses/Unauthorized'
  2895. '403':
  2896. $ref: '#/components/responses/Forbidden'
  2897. '404':
  2898. $ref: '#/components/responses/NotFound'
  2899. '500':
  2900. $ref: '#/components/responses/InternalServerError'
  2901. default:
  2902. $ref: '#/components/responses/DefaultResponse'
  2903. put:
  2904. tags:
  2905. - users
  2906. summary: Update user
  2907. description: 'Updates an existing user and optionally disconnects it, if connected, to apply the new settings. Recovery codes and TOTP configuration cannot be set/updated using this API: each user must use the specific APIs'
  2908. operationId: update_user
  2909. parameters:
  2910. - in: query
  2911. name: disconnect
  2912. schema:
  2913. type: integer
  2914. enum:
  2915. - 0
  2916. - 1
  2917. description: |
  2918. Disconnect:
  2919. * `0` The user will not be disconnected and it will continue to use the old configuration until connected. This is the default
  2920. * `1` The user will be disconnected after a successful update. It must login again and so it will be forced to use the new configuration
  2921. requestBody:
  2922. required: true
  2923. content:
  2924. application/json:
  2925. schema:
  2926. $ref: '#/components/schemas/User'
  2927. responses:
  2928. '200':
  2929. description: successful operation
  2930. content:
  2931. application/json:
  2932. schema:
  2933. $ref: '#/components/schemas/ApiResponse'
  2934. example:
  2935. message: User updated
  2936. '400':
  2937. $ref: '#/components/responses/BadRequest'
  2938. '401':
  2939. $ref: '#/components/responses/Unauthorized'
  2940. '403':
  2941. $ref: '#/components/responses/Forbidden'
  2942. '404':
  2943. $ref: '#/components/responses/NotFound'
  2944. '500':
  2945. $ref: '#/components/responses/InternalServerError'
  2946. default:
  2947. $ref: '#/components/responses/DefaultResponse'
  2948. delete:
  2949. tags:
  2950. - users
  2951. summary: Delete user
  2952. description: Deletes an existing user
  2953. operationId: delete_user
  2954. responses:
  2955. '200':
  2956. description: successful operation
  2957. content:
  2958. application/json:
  2959. schema:
  2960. $ref: '#/components/schemas/ApiResponse'
  2961. example:
  2962. message: User deleted
  2963. '400':
  2964. $ref: '#/components/responses/BadRequest'
  2965. '401':
  2966. $ref: '#/components/responses/Unauthorized'
  2967. '403':
  2968. $ref: '#/components/responses/Forbidden'
  2969. '404':
  2970. $ref: '#/components/responses/NotFound'
  2971. '500':
  2972. $ref: '#/components/responses/InternalServerError'
  2973. default:
  2974. $ref: '#/components/responses/DefaultResponse'
  2975. '/users/{username}/2fa/disable':
  2976. parameters:
  2977. - name: username
  2978. in: path
  2979. description: the username
  2980. required: true
  2981. schema:
  2982. type: string
  2983. put:
  2984. tags:
  2985. - users
  2986. summary: Disable second factor authentication
  2987. description: 'Disables second factor authentication for the given user. This API must be used if the user loses access to their second factor auth device and has no recovery codes'
  2988. operationId: disable_user_2fa
  2989. responses:
  2990. '200':
  2991. description: successful operation
  2992. content:
  2993. application/json:
  2994. schema:
  2995. $ref: '#/components/schemas/ApiResponse'
  2996. example:
  2997. message: 2FA disabled
  2998. '400':
  2999. $ref: '#/components/responses/BadRequest'
  3000. '401':
  3001. $ref: '#/components/responses/Unauthorized'
  3002. '403':
  3003. $ref: '#/components/responses/Forbidden'
  3004. '404':
  3005. $ref: '#/components/responses/NotFound'
  3006. '500':
  3007. $ref: '#/components/responses/InternalServerError'
  3008. default:
  3009. $ref: '#/components/responses/DefaultResponse'
  3010. '/users/{username}/forgot-password':
  3011. parameters:
  3012. - name: username
  3013. in: path
  3014. description: the username
  3015. required: true
  3016. schema:
  3017. type: string
  3018. post:
  3019. security: []
  3020. tags:
  3021. - users
  3022. summary: Send a password reset code by email
  3023. description: 'You must configure an SMTP server, the account must have a valid email address and must not have the "reset-password-disabled" restriction, in which case SFTPGo will send a code via email to reset the password. If the specified user does not exist, the request will be silently ignored (a success response will be returned) to avoid disclosing existing users'
  3024. operationId: user_forgot_password
  3025. responses:
  3026. '200':
  3027. description: successful operation
  3028. content:
  3029. application/json:
  3030. schema:
  3031. $ref: '#/components/schemas/ApiResponse'
  3032. '400':
  3033. $ref: '#/components/responses/BadRequest'
  3034. '401':
  3035. $ref: '#/components/responses/Unauthorized'
  3036. '403':
  3037. $ref: '#/components/responses/Forbidden'
  3038. '404':
  3039. $ref: '#/components/responses/NotFound'
  3040. '500':
  3041. $ref: '#/components/responses/InternalServerError'
  3042. default:
  3043. $ref: '#/components/responses/DefaultResponse'
  3044. '/users/{username}/reset-password':
  3045. parameters:
  3046. - name: username
  3047. in: path
  3048. description: the username
  3049. required: true
  3050. schema:
  3051. type: string
  3052. post:
  3053. security: []
  3054. tags:
  3055. - users
  3056. summary: Reset the password
  3057. description: 'Set a new password using the code received via email'
  3058. operationId: user_reset_password
  3059. requestBody:
  3060. content:
  3061. application/json:
  3062. schema:
  3063. type: object
  3064. properties:
  3065. code:
  3066. type: string
  3067. password:
  3068. type: string
  3069. required: true
  3070. responses:
  3071. '200':
  3072. description: successful operation
  3073. content:
  3074. application/json:
  3075. schema:
  3076. $ref: '#/components/schemas/ApiResponse'
  3077. '400':
  3078. $ref: '#/components/responses/BadRequest'
  3079. '401':
  3080. $ref: '#/components/responses/Unauthorized'
  3081. '403':
  3082. $ref: '#/components/responses/Forbidden'
  3083. '404':
  3084. $ref: '#/components/responses/NotFound'
  3085. '500':
  3086. $ref: '#/components/responses/InternalServerError'
  3087. default:
  3088. $ref: '#/components/responses/DefaultResponse'
  3089. /status:
  3090. get:
  3091. tags:
  3092. - maintenance
  3093. summary: Get status
  3094. description: Retrieves the status of the active services
  3095. operationId: get_status
  3096. responses:
  3097. '200':
  3098. description: successful operation
  3099. content:
  3100. application/json:
  3101. schema:
  3102. $ref: '#/components/schemas/ServicesStatus'
  3103. '400':
  3104. $ref: '#/components/responses/BadRequest'
  3105. '401':
  3106. $ref: '#/components/responses/Unauthorized'
  3107. '403':
  3108. $ref: '#/components/responses/Forbidden'
  3109. '500':
  3110. $ref: '#/components/responses/InternalServerError'
  3111. default:
  3112. $ref: '#/components/responses/DefaultResponse'
  3113. /dumpdata:
  3114. get:
  3115. tags:
  3116. - maintenance
  3117. summary: Dump data
  3118. description: 'Backups data as data provider independent JSON. The backup can be saved in a local file on the server, to avoid exposing sensitive data over the network, or returned as response body. The output of dumpdata can be used as input for loaddata'
  3119. operationId: dumpdata
  3120. parameters:
  3121. - in: query
  3122. name: output-file
  3123. schema:
  3124. type: string
  3125. description: Path for the file to write the JSON serialized data to. This path is relative to the configured "backups_path". If this file already exists it will be overwritten. To return the backup as response body set `output_data` to true instead.
  3126. - in: query
  3127. name: output-data
  3128. schema:
  3129. type: integer
  3130. enum:
  3131. - 0
  3132. - 1
  3133. description: |
  3134. output data:
  3135. * `0` or any other value != 1, the backup will be saved to a file on the server, `output_file` is required
  3136. * `1` the backup will be returned as response body
  3137. - in: query
  3138. name: indent
  3139. schema:
  3140. type: integer
  3141. enum:
  3142. - 0
  3143. - 1
  3144. description: |
  3145. indent:
  3146. * `0` no indentation. This is the default
  3147. * `1` format the output JSON
  3148. responses:
  3149. '200':
  3150. description: successful operation
  3151. content:
  3152. application/json:
  3153. schema:
  3154. oneOf:
  3155. - $ref: '#/components/schemas/ApiResponse'
  3156. - $ref: '#/components/schemas/BackupData'
  3157. '400':
  3158. $ref: '#/components/responses/BadRequest'
  3159. '401':
  3160. $ref: '#/components/responses/Unauthorized'
  3161. '403':
  3162. $ref: '#/components/responses/Forbidden'
  3163. '500':
  3164. $ref: '#/components/responses/InternalServerError'
  3165. default:
  3166. $ref: '#/components/responses/DefaultResponse'
  3167. /loaddata:
  3168. parameters:
  3169. - in: query
  3170. name: scan-quota
  3171. schema:
  3172. type: integer
  3173. enum:
  3174. - 0
  3175. - 1
  3176. - 2
  3177. description: |
  3178. Quota scan:
  3179. * `0` no quota scan is done, the imported users/folders will have used_quota_size and used_quota_files = 0 or the existing values if they already exists. This is the default
  3180. * `1` scan quota
  3181. * `2` scan quota if the user has quota restrictions
  3182. required: false
  3183. - in: query
  3184. name: mode
  3185. schema:
  3186. type: integer
  3187. enum:
  3188. - 0
  3189. - 1
  3190. - 2
  3191. description: |
  3192. Mode:
  3193. * `0` New objects are added, existing ones are updated. This is the default
  3194. * `1` New objects are added, existing ones are not modified
  3195. * `2` New objects are added, existing ones are updated and connected users are disconnected and so forced to use the new configuration
  3196. get:
  3197. tags:
  3198. - maintenance
  3199. summary: Load data from path
  3200. description: 'Restores SFTPGo data from a JSON backup file on the server. Objects will be restored one by one and the restore is stopped if a object cannot be added or updated, so it could happen a partial restore'
  3201. operationId: loaddata_from_file
  3202. parameters:
  3203. - in: query
  3204. name: input-file
  3205. schema:
  3206. type: string
  3207. required: true
  3208. description: Path for the file to read the JSON serialized data from. This can be an absolute path or a path relative to the configured "backups_path". The max allowed file size is 10MB
  3209. responses:
  3210. '200':
  3211. description: successful operation
  3212. content:
  3213. application/json:
  3214. schema:
  3215. $ref: '#/components/schemas/ApiResponse'
  3216. example:
  3217. message: Data restored
  3218. '400':
  3219. $ref: '#/components/responses/BadRequest'
  3220. '401':
  3221. $ref: '#/components/responses/Unauthorized'
  3222. '403':
  3223. $ref: '#/components/responses/Forbidden'
  3224. '500':
  3225. $ref: '#/components/responses/InternalServerError'
  3226. default:
  3227. $ref: '#/components/responses/DefaultResponse'
  3228. post:
  3229. tags:
  3230. - maintenance
  3231. summary: Load data
  3232. description: 'Restores SFTPGo data from a JSON backup. Objects will be restored one by one and the restore is stopped if a object cannot be added or updated, so it could happen a partial restore'
  3233. operationId: loaddata_from_request_body
  3234. requestBody:
  3235. required: true
  3236. content:
  3237. application/json:
  3238. schema:
  3239. $ref: '#/components/schemas/BackupData'
  3240. responses:
  3241. '200':
  3242. description: successful operation
  3243. content:
  3244. application/json:
  3245. schema:
  3246. $ref: '#/components/schemas/ApiResponse'
  3247. example:
  3248. message: Data restored
  3249. '400':
  3250. $ref: '#/components/responses/BadRequest'
  3251. '401':
  3252. $ref: '#/components/responses/Unauthorized'
  3253. '403':
  3254. $ref: '#/components/responses/Forbidden'
  3255. '500':
  3256. $ref: '#/components/responses/InternalServerError'
  3257. default:
  3258. $ref: '#/components/responses/DefaultResponse'
  3259. /user/changepwd:
  3260. put:
  3261. security:
  3262. - BearerAuth: []
  3263. tags:
  3264. - user APIs
  3265. summary: Change user password
  3266. description: Changes the password for the logged in user
  3267. operationId: change_user_password
  3268. requestBody:
  3269. required: true
  3270. content:
  3271. application/json:
  3272. schema:
  3273. $ref: '#/components/schemas/PwdChange'
  3274. responses:
  3275. '200':
  3276. description: successful operation
  3277. content:
  3278. application/json:
  3279. schema:
  3280. $ref: '#/components/schemas/ApiResponse'
  3281. '401':
  3282. $ref: '#/components/responses/Unauthorized'
  3283. '403':
  3284. $ref: '#/components/responses/Forbidden'
  3285. '500':
  3286. $ref: '#/components/responses/InternalServerError'
  3287. default:
  3288. $ref: '#/components/responses/DefaultResponse'
  3289. /user/profile:
  3290. get:
  3291. security:
  3292. - BearerAuth: []
  3293. tags:
  3294. - user APIs
  3295. summary: Get user profile
  3296. description: 'Returns the profile for the logged in user'
  3297. operationId: get_user_profile
  3298. responses:
  3299. '200':
  3300. description: successful operation
  3301. content:
  3302. application/json:
  3303. schema:
  3304. $ref: '#/components/schemas/UserProfile'
  3305. '401':
  3306. $ref: '#/components/responses/Unauthorized'
  3307. '403':
  3308. $ref: '#/components/responses/Forbidden'
  3309. '500':
  3310. $ref: '#/components/responses/InternalServerError'
  3311. default:
  3312. $ref: '#/components/responses/DefaultResponse'
  3313. put:
  3314. security:
  3315. - BearerAuth: []
  3316. tags:
  3317. - user APIs
  3318. summary: Update user profile
  3319. description: 'Allows to update the profile for the logged in user'
  3320. operationId: update_user_profile
  3321. requestBody:
  3322. required: true
  3323. content:
  3324. application/json:
  3325. schema:
  3326. $ref: '#/components/schemas/UserProfile'
  3327. responses:
  3328. '200':
  3329. description: successful operation
  3330. content:
  3331. application/json:
  3332. schema:
  3333. $ref: '#/components/schemas/ApiResponse'
  3334. '400':
  3335. $ref: '#/components/responses/BadRequest'
  3336. '401':
  3337. $ref: '#/components/responses/Unauthorized'
  3338. '403':
  3339. $ref: '#/components/responses/Forbidden'
  3340. '500':
  3341. $ref: '#/components/responses/InternalServerError'
  3342. default:
  3343. $ref: '#/components/responses/DefaultResponse'
  3344. /user/2fa/recoverycodes:
  3345. get:
  3346. security:
  3347. - BearerAuth: []
  3348. tags:
  3349. - user APIs
  3350. summary: Get recovery codes
  3351. description: 'Returns the recovery codes for the logged in user. Recovery codes can be used if the user loses access to their second factor auth device. Recovery codes are returned unencrypted'
  3352. operationId: get_user_recovery_codes
  3353. responses:
  3354. '200':
  3355. description: successful operation
  3356. content:
  3357. application/json:
  3358. schema:
  3359. type: array
  3360. items:
  3361. $ref: '#/components/schemas/RecoveryCode'
  3362. '401':
  3363. $ref: '#/components/responses/Unauthorized'
  3364. '403':
  3365. $ref: '#/components/responses/Forbidden'
  3366. '500':
  3367. $ref: '#/components/responses/InternalServerError'
  3368. default:
  3369. $ref: '#/components/responses/DefaultResponse'
  3370. post:
  3371. security:
  3372. - BearerAuth: []
  3373. tags:
  3374. - user APIs
  3375. summary: Generate recovery codes
  3376. description: 'Generates new recovery codes for the logged in user. Generating new recovery codes you automatically invalidate old ones'
  3377. operationId: generate_user_recovery_codes
  3378. responses:
  3379. '200':
  3380. description: successful operation
  3381. content:
  3382. application/json:
  3383. schema:
  3384. type: array
  3385. items:
  3386. type: string
  3387. '400':
  3388. $ref: '#/components/responses/BadRequest'
  3389. '401':
  3390. $ref: '#/components/responses/Unauthorized'
  3391. '403':
  3392. $ref: '#/components/responses/Forbidden'
  3393. '500':
  3394. $ref: '#/components/responses/InternalServerError'
  3395. default:
  3396. $ref: '#/components/responses/DefaultResponse'
  3397. /user/totp/configs:
  3398. get:
  3399. security:
  3400. - BearerAuth: []
  3401. tags:
  3402. - user APIs
  3403. summary: Get available TOTP configuration
  3404. description: Returns the available TOTP configurations for the logged in user
  3405. operationId: get_user_totp_configs
  3406. responses:
  3407. '200':
  3408. description: successful operation
  3409. content:
  3410. application/json:
  3411. schema:
  3412. type: array
  3413. items:
  3414. $ref: '#/components/schemas/TOTPConfig'
  3415. '401':
  3416. $ref: '#/components/responses/Unauthorized'
  3417. '403':
  3418. $ref: '#/components/responses/Forbidden'
  3419. '500':
  3420. $ref: '#/components/responses/InternalServerError'
  3421. default:
  3422. $ref: '#/components/responses/DefaultResponse'
  3423. /user/totp/generate:
  3424. post:
  3425. security:
  3426. - BearerAuth: []
  3427. tags:
  3428. - user APIs
  3429. summary: Generate a new TOTP secret
  3430. description: 'Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in user'
  3431. operationId: generate_user_totp_secret
  3432. requestBody:
  3433. required: true
  3434. content:
  3435. application/json:
  3436. schema:
  3437. type: object
  3438. properties:
  3439. config_name:
  3440. type: string
  3441. description: 'name of the configuration to use to generate the secret'
  3442. responses:
  3443. '200':
  3444. description: successful operation
  3445. content:
  3446. application/json:
  3447. schema:
  3448. type: object
  3449. properties:
  3450. config_name:
  3451. type: string
  3452. issuer:
  3453. type: string
  3454. secret:
  3455. type: string
  3456. qr_code:
  3457. type: string
  3458. format: byte
  3459. description: 'QR code png encoded as BASE64'
  3460. '400':
  3461. $ref: '#/components/responses/BadRequest'
  3462. '401':
  3463. $ref: '#/components/responses/Unauthorized'
  3464. '403':
  3465. $ref: '#/components/responses/Forbidden'
  3466. '500':
  3467. $ref: '#/components/responses/InternalServerError'
  3468. default:
  3469. $ref: '#/components/responses/DefaultResponse'
  3470. /user/totp/validate:
  3471. post:
  3472. security:
  3473. - BearerAuth: []
  3474. tags:
  3475. - user APIs
  3476. summary: Validate a one time authentication code
  3477. description: 'Checks if the given authentication code can be validated using the specified secret and config name'
  3478. operationId: validate_user_totp_secret
  3479. requestBody:
  3480. required: true
  3481. content:
  3482. application/json:
  3483. schema:
  3484. type: object
  3485. properties:
  3486. config_name:
  3487. type: string
  3488. description: 'name of the configuration to use to validate the passcode'
  3489. passcode:
  3490. type: string
  3491. description: 'passcode to validate'
  3492. secret:
  3493. type: string
  3494. description: 'secret to use to validate the passcode'
  3495. responses:
  3496. '200':
  3497. description: successful operation
  3498. content:
  3499. application/json:
  3500. schema:
  3501. $ref: '#/components/schemas/ApiResponse'
  3502. example:
  3503. message: Passcode successfully validated
  3504. '400':
  3505. $ref: '#/components/responses/BadRequest'
  3506. '401':
  3507. $ref: '#/components/responses/Unauthorized'
  3508. '403':
  3509. $ref: '#/components/responses/Forbidden'
  3510. '500':
  3511. $ref: '#/components/responses/InternalServerError'
  3512. default:
  3513. $ref: '#/components/responses/DefaultResponse'
  3514. /user/totp/save:
  3515. post:
  3516. security:
  3517. - BearerAuth: []
  3518. tags:
  3519. - user APIs
  3520. summary: Save a TOTP config
  3521. description: 'Saves the specified TOTP config for the logged in user'
  3522. operationId: save_user_totp_config
  3523. requestBody:
  3524. required: true
  3525. content:
  3526. application/json:
  3527. schema:
  3528. $ref: '#/components/schemas/UserTOTPConfig'
  3529. responses:
  3530. '200':
  3531. description: successful operation
  3532. content:
  3533. application/json:
  3534. schema:
  3535. $ref: '#/components/schemas/ApiResponse'
  3536. example:
  3537. message: TOTP configuration saved
  3538. '400':
  3539. $ref: '#/components/responses/BadRequest'
  3540. '401':
  3541. $ref: '#/components/responses/Unauthorized'
  3542. '403':
  3543. $ref: '#/components/responses/Forbidden'
  3544. '500':
  3545. $ref: '#/components/responses/InternalServerError'
  3546. default:
  3547. $ref: '#/components/responses/DefaultResponse'
  3548. /user/shares:
  3549. get:
  3550. tags:
  3551. - user APIs
  3552. summary: List user shares
  3553. description: Returns the share for the logged in user
  3554. operationId: get_user_shares
  3555. parameters:
  3556. - in: query
  3557. name: offset
  3558. schema:
  3559. type: integer
  3560. minimum: 0
  3561. default: 0
  3562. required: false
  3563. - in: query
  3564. name: limit
  3565. schema:
  3566. type: integer
  3567. minimum: 1
  3568. maximum: 500
  3569. default: 100
  3570. required: false
  3571. description: 'The maximum number of items to return. Max value is 500, default is 100'
  3572. - in: query
  3573. name: order
  3574. required: false
  3575. description: Ordering shares by ID. Default ASC
  3576. schema:
  3577. type: string
  3578. enum:
  3579. - ASC
  3580. - DESC
  3581. example: ASC
  3582. responses:
  3583. '200':
  3584. description: successful operation
  3585. content:
  3586. application/json:
  3587. schema:
  3588. type: array
  3589. items:
  3590. $ref: '#/components/schemas/Share'
  3591. '400':
  3592. $ref: '#/components/responses/BadRequest'
  3593. '401':
  3594. $ref: '#/components/responses/Unauthorized'
  3595. '403':
  3596. $ref: '#/components/responses/Forbidden'
  3597. '500':
  3598. $ref: '#/components/responses/InternalServerError'
  3599. default:
  3600. $ref: '#/components/responses/DefaultResponse'
  3601. post:
  3602. tags:
  3603. - user APIs
  3604. summary: Add a share
  3605. operationId: add_share
  3606. description: 'Adds a new share. The share id will be auto-generated'
  3607. requestBody:
  3608. required: true
  3609. content:
  3610. application/json:
  3611. schema:
  3612. $ref: '#/components/schemas/Share'
  3613. responses:
  3614. '201':
  3615. description: successful operation
  3616. headers:
  3617. X-Object-ID:
  3618. schema:
  3619. type: string
  3620. description: ID for the new created share
  3621. Location:
  3622. schema:
  3623. type: string
  3624. description: URL to retrieve the details for the new created share
  3625. content:
  3626. application/json:
  3627. schema:
  3628. $ref: '#/components/schemas/ApiResponse'
  3629. '400':
  3630. $ref: '#/components/responses/BadRequest'
  3631. '401':
  3632. $ref: '#/components/responses/Unauthorized'
  3633. '403':
  3634. $ref: '#/components/responses/Forbidden'
  3635. '500':
  3636. $ref: '#/components/responses/InternalServerError'
  3637. default:
  3638. $ref: '#/components/responses/DefaultResponse'
  3639. '/user/shares/{id}':
  3640. parameters:
  3641. - name: id
  3642. in: path
  3643. description: the share id
  3644. required: true
  3645. schema:
  3646. type: string
  3647. get:
  3648. tags:
  3649. - user APIs
  3650. summary: Get share by id
  3651. description: Returns a share by id for the logged in user
  3652. operationId: get_user_share_by_id
  3653. responses:
  3654. '200':
  3655. description: successful operation
  3656. content:
  3657. application/json:
  3658. schema:
  3659. $ref: '#/components/schemas/Share'
  3660. '400':
  3661. $ref: '#/components/responses/BadRequest'
  3662. '401':
  3663. $ref: '#/components/responses/Unauthorized'
  3664. '403':
  3665. $ref: '#/components/responses/Forbidden'
  3666. '404':
  3667. $ref: '#/components/responses/NotFound'
  3668. '500':
  3669. $ref: '#/components/responses/InternalServerError'
  3670. default:
  3671. $ref: '#/components/responses/DefaultResponse'
  3672. put:
  3673. tags:
  3674. - user APIs
  3675. summary: Update share
  3676. description: 'Updates an existing share belonging to the logged in user'
  3677. operationId: update_user_share
  3678. requestBody:
  3679. required: true
  3680. content:
  3681. application/json:
  3682. schema:
  3683. $ref: '#/components/schemas/Share'
  3684. responses:
  3685. '200':
  3686. description: successful operation
  3687. content:
  3688. application/json:
  3689. schema:
  3690. $ref: '#/components/schemas/ApiResponse'
  3691. example:
  3692. message: Share updated
  3693. '400':
  3694. $ref: '#/components/responses/BadRequest'
  3695. '401':
  3696. $ref: '#/components/responses/Unauthorized'
  3697. '403':
  3698. $ref: '#/components/responses/Forbidden'
  3699. '404':
  3700. $ref: '#/components/responses/NotFound'
  3701. '500':
  3702. $ref: '#/components/responses/InternalServerError'
  3703. default:
  3704. $ref: '#/components/responses/DefaultResponse'
  3705. delete:
  3706. tags:
  3707. - user APIs
  3708. summary: Delete share
  3709. description: 'Deletes an existing share belonging to the logged in user'
  3710. operationId: delete_user_share
  3711. responses:
  3712. '200':
  3713. description: successful operation
  3714. content:
  3715. application/json:
  3716. schema:
  3717. $ref: '#/components/schemas/ApiResponse'
  3718. example:
  3719. message: Share deleted
  3720. '400':
  3721. $ref: '#/components/responses/BadRequest'
  3722. '401':
  3723. $ref: '#/components/responses/Unauthorized'
  3724. '403':
  3725. $ref: '#/components/responses/Forbidden'
  3726. '404':
  3727. $ref: '#/components/responses/NotFound'
  3728. '500':
  3729. $ref: '#/components/responses/InternalServerError'
  3730. default:
  3731. $ref: '#/components/responses/DefaultResponse'
  3732. /user/dirs:
  3733. get:
  3734. tags:
  3735. - user APIs
  3736. summary: Read directory contents
  3737. description: Returns the contents of the specified directory for the logged in user
  3738. operationId: get_user_dir_contents
  3739. parameters:
  3740. - in: query
  3741. name: path
  3742. description: Path to the folder to read. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir". If empty or missing the user's start directory is assumed. If relative, the user's start directory is used as the base
  3743. schema:
  3744. type: string
  3745. responses:
  3746. '200':
  3747. description: successful operation
  3748. content:
  3749. application/json:
  3750. schema:
  3751. type: array
  3752. items:
  3753. $ref: '#/components/schemas/DirEntry'
  3754. '400':
  3755. $ref: '#/components/responses/BadRequest'
  3756. '401':
  3757. $ref: '#/components/responses/Unauthorized'
  3758. '403':
  3759. $ref: '#/components/responses/Forbidden'
  3760. '500':
  3761. $ref: '#/components/responses/InternalServerError'
  3762. default:
  3763. $ref: '#/components/responses/DefaultResponse'
  3764. post:
  3765. tags:
  3766. - user APIs
  3767. summary: Create a directory
  3768. description: Create a directory for the logged in user
  3769. operationId: create_user_dir
  3770. parameters:
  3771. - in: query
  3772. name: path
  3773. description: Path to the folder to create. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir"
  3774. schema:
  3775. type: string
  3776. required: true
  3777. - in: query
  3778. name: mkdir_parents
  3779. description: Create parent directories if they do not exist?
  3780. schema:
  3781. type: boolean
  3782. required: false
  3783. responses:
  3784. '201':
  3785. description: successful operation
  3786. content:
  3787. application/json:
  3788. schema:
  3789. type: array
  3790. items:
  3791. $ref: '#/components/schemas/ApiResponse'
  3792. '400':
  3793. $ref: '#/components/responses/BadRequest'
  3794. '401':
  3795. $ref: '#/components/responses/Unauthorized'
  3796. '403':
  3797. $ref: '#/components/responses/Forbidden'
  3798. '500':
  3799. $ref: '#/components/responses/InternalServerError'
  3800. default:
  3801. $ref: '#/components/responses/DefaultResponse'
  3802. patch:
  3803. tags:
  3804. - user APIs
  3805. summary: Rename a directory
  3806. description: Rename a directory for the logged in user. The rename is allowed for empty directory or for non empty local directories, with no virtual folders inside
  3807. operationId: rename_user_dir
  3808. parameters:
  3809. - in: query
  3810. name: path
  3811. description: Path to the folder to rename. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir"
  3812. schema:
  3813. type: string
  3814. required: true
  3815. - in: query
  3816. name: target
  3817. description: New name. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir"
  3818. schema:
  3819. type: string
  3820. required: true
  3821. responses:
  3822. '200':
  3823. description: successful operation
  3824. content:
  3825. application/json:
  3826. schema:
  3827. type: array
  3828. items:
  3829. $ref: '#/components/schemas/ApiResponse'
  3830. '400':
  3831. $ref: '#/components/responses/BadRequest'
  3832. '401':
  3833. $ref: '#/components/responses/Unauthorized'
  3834. '403':
  3835. $ref: '#/components/responses/Forbidden'
  3836. '500':
  3837. $ref: '#/components/responses/InternalServerError'
  3838. default:
  3839. $ref: '#/components/responses/DefaultResponse'
  3840. delete:
  3841. tags:
  3842. - user APIs
  3843. summary: Delete a directory
  3844. description: Delete a directory for the logged in user. Only empty directories can be deleted
  3845. operationId: delete_user_dir
  3846. parameters:
  3847. - in: query
  3848. name: path
  3849. description: Path to the folder to delete. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir"
  3850. schema:
  3851. type: string
  3852. required: true
  3853. responses:
  3854. '200':
  3855. description: successful operation
  3856. content:
  3857. application/json:
  3858. schema:
  3859. type: array
  3860. items:
  3861. $ref: '#/components/schemas/ApiResponse'
  3862. '400':
  3863. $ref: '#/components/responses/BadRequest'
  3864. '401':
  3865. $ref: '#/components/responses/Unauthorized'
  3866. '403':
  3867. $ref: '#/components/responses/Forbidden'
  3868. '500':
  3869. $ref: '#/components/responses/InternalServerError'
  3870. default:
  3871. $ref: '#/components/responses/DefaultResponse'
  3872. /user/files:
  3873. get:
  3874. tags:
  3875. - user APIs
  3876. summary: Download a single file
  3877. description: Returns the file contents as response body
  3878. operationId: download_user_file
  3879. parameters:
  3880. - in: query
  3881. name: path
  3882. required: true
  3883. description: Path to the file to download. It must be URL encoded, for example the path "my dir/àdir/file.txt" must be sent as "my%20dir%2F%C3%A0dir%2Ffile.txt"
  3884. schema:
  3885. type: string
  3886. - in: query
  3887. name: inline
  3888. required: false
  3889. description: 'If set, the response will not have the Content-Disposition header set to `attachment`'
  3890. schema:
  3891. type: string
  3892. responses:
  3893. '200':
  3894. description: successful operation
  3895. content:
  3896. '*/*':
  3897. schema:
  3898. type: string
  3899. format: binary
  3900. '206':
  3901. description: successful operation
  3902. content:
  3903. '*/*':
  3904. schema:
  3905. type: string
  3906. format: binary
  3907. '400':
  3908. $ref: '#/components/responses/BadRequest'
  3909. '401':
  3910. $ref: '#/components/responses/Unauthorized'
  3911. '403':
  3912. $ref: '#/components/responses/Forbidden'
  3913. '500':
  3914. $ref: '#/components/responses/InternalServerError'
  3915. default:
  3916. $ref: '#/components/responses/DefaultResponse'
  3917. post:
  3918. tags:
  3919. - user APIs
  3920. summary: Upload files
  3921. description: Upload one or more files for the logged in user
  3922. operationId: create_user_files
  3923. parameters:
  3924. - in: query
  3925. name: path
  3926. description: Parent directory for the uploaded files. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir". If empty or missing the root path is assumed. If a file with the same name already exists, it will be overwritten
  3927. schema:
  3928. type: string
  3929. - in: query
  3930. name: mkdir_parents
  3931. description: Create parent directories if they do not exist?
  3932. schema:
  3933. type: boolean
  3934. required: false
  3935. requestBody:
  3936. content:
  3937. multipart/form-data:
  3938. schema:
  3939. type: object
  3940. properties:
  3941. filenames:
  3942. type: array
  3943. items:
  3944. type: string
  3945. format: binary
  3946. minItems: 1
  3947. uniqueItems: true
  3948. required: true
  3949. responses:
  3950. '201':
  3951. description: successful operation
  3952. content:
  3953. application/json:
  3954. schema:
  3955. type: array
  3956. items:
  3957. $ref: '#/components/schemas/ApiResponse'
  3958. '400':
  3959. $ref: '#/components/responses/BadRequest'
  3960. '401':
  3961. $ref: '#/components/responses/Unauthorized'
  3962. '403':
  3963. $ref: '#/components/responses/Forbidden'
  3964. '413':
  3965. $ref: '#/components/responses/RequestEntityTooLarge'
  3966. '500':
  3967. $ref: '#/components/responses/InternalServerError'
  3968. default:
  3969. $ref: '#/components/responses/DefaultResponse'
  3970. patch:
  3971. tags:
  3972. - user APIs
  3973. summary: Rename a file
  3974. description: Rename a file for the logged in user
  3975. operationId: rename_user_file
  3976. parameters:
  3977. - in: query
  3978. name: path
  3979. description: Path to the file to rename. It must be URL encoded
  3980. schema:
  3981. type: string
  3982. required: true
  3983. - in: query
  3984. name: target
  3985. description: New name. It must be URL encoded
  3986. schema:
  3987. type: string
  3988. required: true
  3989. responses:
  3990. '200':
  3991. description: successful operation
  3992. content:
  3993. application/json:
  3994. schema:
  3995. type: array
  3996. items:
  3997. $ref: '#/components/schemas/ApiResponse'
  3998. '400':
  3999. $ref: '#/components/responses/BadRequest'
  4000. '401':
  4001. $ref: '#/components/responses/Unauthorized'
  4002. '403':
  4003. $ref: '#/components/responses/Forbidden'
  4004. '500':
  4005. $ref: '#/components/responses/InternalServerError'
  4006. default:
  4007. $ref: '#/components/responses/DefaultResponse'
  4008. delete:
  4009. tags:
  4010. - user APIs
  4011. summary: Delete a file
  4012. description: Delete a file for the logged in user.
  4013. operationId: delete_user_file
  4014. parameters:
  4015. - in: query
  4016. name: path
  4017. description: Path to the file to delete. It must be URL encoded
  4018. schema:
  4019. type: string
  4020. required: true
  4021. responses:
  4022. '200':
  4023. description: successful operation
  4024. content:
  4025. application/json:
  4026. schema:
  4027. type: array
  4028. items:
  4029. $ref: '#/components/schemas/ApiResponse'
  4030. '400':
  4031. $ref: '#/components/responses/BadRequest'
  4032. '401':
  4033. $ref: '#/components/responses/Unauthorized'
  4034. '403':
  4035. $ref: '#/components/responses/Forbidden'
  4036. '500':
  4037. $ref: '#/components/responses/InternalServerError'
  4038. default:
  4039. $ref: '#/components/responses/DefaultResponse'
  4040. /user/files/upload:
  4041. post:
  4042. tags:
  4043. - user APIs
  4044. summary: Upload a single file
  4045. description: 'Upload a single file for the logged in user to an existing directory. This API does not use multipart/form-data and so no temporary files are created server side but only a single file can be uploaded as POST body'
  4046. operationId: create_user_file
  4047. parameters:
  4048. - in: query
  4049. name: path
  4050. description: Full file path. It must be path encoded, for example the path "my dir/àdir/file.txt" must be sent as "my%20dir%2F%C3%A0dir%2Ffile.txt". The parent directory must exist. If a file with the same name already exists, it will be overwritten
  4051. schema:
  4052. type: string
  4053. required: true
  4054. - in: query
  4055. name: mkdir_parents
  4056. description: Create parent directories if they do not exist?
  4057. schema:
  4058. type: boolean
  4059. required: false
  4060. - in: header
  4061. name: X-SFTPGO-MTIME
  4062. schema:
  4063. type: integer
  4064. description: File modification time as unix timestamp in milliseconds
  4065. requestBody:
  4066. content:
  4067. application/*:
  4068. schema:
  4069. type: string
  4070. format: binary
  4071. text/*:
  4072. schema:
  4073. type: string
  4074. format: binary
  4075. image/*:
  4076. schema:
  4077. type: string
  4078. format: binary
  4079. audio/*:
  4080. schema:
  4081. type: string
  4082. format: binary
  4083. video/*:
  4084. schema:
  4085. type: string
  4086. format: binary
  4087. required: true
  4088. responses:
  4089. '201':
  4090. description: successful operation
  4091. content:
  4092. application/json:
  4093. schema:
  4094. type: array
  4095. items:
  4096. $ref: '#/components/schemas/ApiResponse'
  4097. '400':
  4098. $ref: '#/components/responses/BadRequest'
  4099. '401':
  4100. $ref: '#/components/responses/Unauthorized'
  4101. '403':
  4102. $ref: '#/components/responses/Forbidden'
  4103. '413':
  4104. $ref: '#/components/responses/RequestEntityTooLarge'
  4105. '500':
  4106. $ref: '#/components/responses/InternalServerError'
  4107. default:
  4108. $ref: '#/components/responses/DefaultResponse'
  4109. /user/files/metadata:
  4110. patch:
  4111. tags:
  4112. - user APIs
  4113. summary: Set metadata for a file/directory
  4114. description: 'Set supported metadata attributes for the specified file or directory'
  4115. operationId: setprops_user_file
  4116. parameters:
  4117. - in: query
  4118. name: path
  4119. description: Full file/directory path. It must be URL encoded, for example the path "my dir/àdir/file.txt" must be sent as "my%20dir%2F%C3%A0dir%2Ffile.txt"
  4120. schema:
  4121. type: string
  4122. required: true
  4123. requestBody:
  4124. content:
  4125. application/json:
  4126. schema:
  4127. type: object
  4128. properties:
  4129. modification_time:
  4130. type: integer
  4131. description: File modification time as unix timestamp in milliseconds
  4132. required: true
  4133. responses:
  4134. '200':
  4135. description: successful operation
  4136. content:
  4137. application/json:
  4138. schema:
  4139. type: array
  4140. items:
  4141. $ref: '#/components/schemas/ApiResponse'
  4142. '400':
  4143. $ref: '#/components/responses/BadRequest'
  4144. '401':
  4145. $ref: '#/components/responses/Unauthorized'
  4146. '403':
  4147. $ref: '#/components/responses/Forbidden'
  4148. '413':
  4149. $ref: '#/components/responses/RequestEntityTooLarge'
  4150. '500':
  4151. $ref: '#/components/responses/InternalServerError'
  4152. default:
  4153. $ref: '#/components/responses/DefaultResponse'
  4154. /user/streamzip:
  4155. post:
  4156. tags:
  4157. - user APIs
  4158. summary: Download multiple files and folders as a single zip file
  4159. description: A zip file, containing the specified files and folders, will be generated on the fly and returned as response body. Only folders and regular files will be included in the zip
  4160. operationId: streamzip
  4161. requestBody:
  4162. required: true
  4163. content:
  4164. application/json:
  4165. schema:
  4166. type: array
  4167. items:
  4168. type: string
  4169. description: Absolute file or folder path
  4170. responses:
  4171. '200':
  4172. description: successful operation
  4173. content:
  4174. 'application/zip':
  4175. schema:
  4176. type: string
  4177. format: binary
  4178. '400':
  4179. $ref: '#/components/responses/BadRequest'
  4180. '401':
  4181. $ref: '#/components/responses/Unauthorized'
  4182. '403':
  4183. $ref: '#/components/responses/Forbidden'
  4184. '500':
  4185. $ref: '#/components/responses/InternalServerError'
  4186. default:
  4187. $ref: '#/components/responses/DefaultResponse'
  4188. components:
  4189. responses:
  4190. BadRequest:
  4191. description: Bad Request
  4192. content:
  4193. application/json:
  4194. schema:
  4195. $ref: '#/components/schemas/ApiResponse'
  4196. Unauthorized:
  4197. description: Unauthorized
  4198. content:
  4199. application/json:
  4200. schema:
  4201. $ref: '#/components/schemas/ApiResponse'
  4202. Forbidden:
  4203. description: Forbidden
  4204. content:
  4205. application/json:
  4206. schema:
  4207. $ref: '#/components/schemas/ApiResponse'
  4208. NotFound:
  4209. description: Not Found
  4210. content:
  4211. application/json:
  4212. schema:
  4213. $ref: '#/components/schemas/ApiResponse'
  4214. Conflict:
  4215. description: Conflict
  4216. content:
  4217. application/json:
  4218. schema:
  4219. $ref: '#/components/schemas/ApiResponse'
  4220. RequestEntityTooLarge:
  4221. description: Request Entity Too Large, max allowed size exceeded
  4222. content:
  4223. application/json:
  4224. schema:
  4225. $ref: '#/components/schemas/ApiResponse'
  4226. InternalServerError:
  4227. description: Internal Server Error
  4228. content:
  4229. application/json:
  4230. schema:
  4231. $ref: '#/components/schemas/ApiResponse'
  4232. DefaultResponse:
  4233. description: Unexpected Error
  4234. content:
  4235. application/json:
  4236. schema:
  4237. $ref: '#/components/schemas/ApiResponse'
  4238. schemas:
  4239. Permission:
  4240. type: string
  4241. enum:
  4242. - '*'
  4243. - list
  4244. - download
  4245. - upload
  4246. - overwrite
  4247. - delete
  4248. - delete_files
  4249. - delete_dirs
  4250. - rename
  4251. - rename_files
  4252. - rename_dirs
  4253. - create_dirs
  4254. - create_symlinks
  4255. - chmod
  4256. - chown
  4257. - chtimes
  4258. description: |
  4259. Permissions:
  4260. * `*` - all permissions are granted
  4261. * `list` - list items is allowed
  4262. * `download` - download files is allowed
  4263. * `upload` - upload files is allowed
  4264. * `overwrite` - overwrite an existing file, while uploading, is allowed. upload permission is required to allow file overwrite
  4265. * `delete` - delete files or directories is allowed
  4266. * `delete_files` - delete files is allowed
  4267. * `delete_dirs` - delete directories is allowed
  4268. * `rename` - rename files or directories is allowed
  4269. * `rename_files` - rename files is allowed
  4270. * `rename_dirs` - rename directories is allowed
  4271. * `create_dirs` - create directories is allowed
  4272. * `create_symlinks` - create links is allowed
  4273. * `chmod` changing file or directory permissions is allowed
  4274. * `chown` changing file or directory owner and group is allowed
  4275. * `chtimes` changing file or directory access and modification time is allowed
  4276. AdminPermissions:
  4277. type: string
  4278. enum:
  4279. - '*'
  4280. - add_users
  4281. - edit_users
  4282. - del_users
  4283. - view_users
  4284. - view_conns
  4285. - close_conns
  4286. - view_status
  4287. - manage_admins
  4288. - manage_apikeys
  4289. - quota_scans
  4290. - manage_system
  4291. - manage_defender
  4292. - view_defender
  4293. - retention_checks
  4294. - metadata_checks
  4295. - view_events
  4296. - manage_event_rules
  4297. description: |
  4298. Admin permissions:
  4299. * `*` - all permissions are granted
  4300. * `add_users` - add new users is allowed
  4301. * `edit_users` - change existing users is allowed
  4302. * `del_users` - remove users is allowed
  4303. * `view_users` - list users is allowed
  4304. * `view_conns` - list active connections is allowed
  4305. * `close_conns` - close active connections is allowed
  4306. * `view_status` - view the server status is allowed
  4307. * `manage_admins` - manage other admins is allowed
  4308. * `manage_apikeys` - manage API keys is allowed
  4309. * `quota_scans` - view and start quota scans is allowed
  4310. * `manage_system` - backups and restores are allowed
  4311. * `manage_defender` - remove ip from the dynamic blocklist is allowed
  4312. * `view_defender` - list the dynamic blocklist is allowed
  4313. * `retention_checks` - view and start retention checks is allowed
  4314. * `metadata_checks` - view and start metadata checks is allowed
  4315. * `view_events` - view and search filesystem and provider events is allowed
  4316. * `manage_event_rules` - manage event actions and rules is allowed
  4317. FsProviders:
  4318. type: integer
  4319. enum:
  4320. - 0
  4321. - 1
  4322. - 2
  4323. - 3
  4324. - 4
  4325. - 5
  4326. - 6
  4327. description: |
  4328. Filesystem providers:
  4329. * `0` - Local filesystem
  4330. * `1` - S3 Compatible Object Storage
  4331. * `2` - Google Cloud Storage
  4332. * `3` - Azure Blob Storage
  4333. * `4` - Local filesystem encrypted
  4334. * `5` - SFTP
  4335. * `6` - HTTP filesystem
  4336. EventActionTypes:
  4337. type: integer
  4338. enum:
  4339. - 1
  4340. - 2
  4341. - 3
  4342. - 4
  4343. - 5
  4344. - 6
  4345. - 7
  4346. - 8
  4347. - 9
  4348. description: |
  4349. Supported event action types:
  4350. * `1` - HTTP
  4351. * `2` - Command
  4352. * `3` - Email
  4353. * `4` - Backup
  4354. * `5` - User quota reset
  4355. * `6` - Folder quota reset
  4356. * `7` - Transfer quota reset
  4357. * `8` - Data retention check
  4358. * `9` - Filesystem
  4359. FilesystemActionTypes:
  4360. type: integer
  4361. enum:
  4362. - 1
  4363. - 2
  4364. - 3
  4365. - 4
  4366. description: |
  4367. Supported filesystem action types:
  4368. * `1` - Rename
  4369. * `2` - Delete
  4370. * `3` - Mkdis
  4371. * `4` - Exist
  4372. EventTriggerTypes:
  4373. type: integer
  4374. enum:
  4375. - 1
  4376. - 2
  4377. - 3
  4378. - 4
  4379. - 5
  4380. description: |
  4381. Supported event trigger types:
  4382. * `1` - Filesystem event
  4383. * `2` - Provider event
  4384. * `3` - Schedule
  4385. * `4` - IP blocked
  4386. * `5` - Certificate renewal
  4387. LoginMethods:
  4388. type: string
  4389. enum:
  4390. - publickey
  4391. - password
  4392. - password-over-SSH
  4393. - keyboard-interactive
  4394. - publickey+password
  4395. - publickey+keyboard-interactive
  4396. - TLSCertificate
  4397. - TLSCertificate+password
  4398. description: |
  4399. Available login methods. To enable multi-step authentication you have to allow only multi-step login methods
  4400. * `publickey`
  4401. * `password`, password for all the supported protocols
  4402. * `password-over-SSH`, password over SSH protocol (SSH/SFTP/SCP)
  4403. * `keyboard-interactive`
  4404. * `publickey+password` - multi-step auth: public key and password
  4405. * `publickey+keyboard-interactive` - multi-step auth: public key and keyboard interactive
  4406. * `TLSCertificate`
  4407. * `TLSCertificate+password` - multi-step auth: TLS client certificate and password
  4408. SupportedProtocols:
  4409. type: string
  4410. enum:
  4411. - SSH
  4412. - FTP
  4413. - DAV
  4414. - HTTP
  4415. description: |
  4416. Protocols:
  4417. * `SSH` - includes both SFTP and SSH commands
  4418. * `FTP` - plain FTP and FTPES/FTPS
  4419. * `DAV` - WebDAV over HTTP/HTTPS
  4420. * `HTTP` - WebClient/REST API
  4421. MFAProtocols:
  4422. type: string
  4423. enum:
  4424. - SSH
  4425. - FTP
  4426. - HTTP
  4427. description: |
  4428. Protocols:
  4429. * `SSH` - includes both SFTP and SSH commands
  4430. * `FTP` - plain FTP and FTPES/FTPS
  4431. * `HTTP` - WebClient/REST API
  4432. EventProtocols:
  4433. type: string
  4434. enum:
  4435. - SSH
  4436. - SFTP
  4437. - SCP
  4438. - FTP
  4439. - DAV
  4440. - HTTP
  4441. - HTTPShare
  4442. - DataRetention
  4443. - OIDC
  4444. description: |
  4445. Protocols:
  4446. * `SSH` - SSH commands
  4447. * `SFTP` - SFTP protocol
  4448. * `FTP` - plain FTP and FTPES/FTPS
  4449. * `DAV` - WebDAV
  4450. * `HTTP` - WebClient/REST API
  4451. * `HTTPShare` - the event is generated in a public share
  4452. * `DataRetention` - the event is generated by a data retention check
  4453. * `OIDC` - OpenID Connect
  4454. WebClientOptions:
  4455. type: string
  4456. enum:
  4457. - publickey-change-disabled
  4458. - write-disabled
  4459. - mfa-disabled
  4460. - password-change-disabled
  4461. - api-key-auth-change-disabled
  4462. - info-change-disabled
  4463. - shares-disabled
  4464. - password-reset-disabled
  4465. - shares-without-password-disabled
  4466. description: |
  4467. Options:
  4468. * `publickey-change-disabled` - changing SSH public keys is not allowed
  4469. * `write-disabled` - upload, rename, delete are not allowed even if the user has permissions for these actions
  4470. * `mfa-disabled` - enabling multi-factor authentication is not allowed. This option cannot be set if the user has MFA already enabled
  4471. * `password-change-disabled` - changing password is not allowed
  4472. * `api-key-auth-change-disabled` - enabling/disabling API key authentication is not allowed
  4473. * `info-change-disabled` - changing info such as email and description is not allowed
  4474. * `shares-disabled` - sharing files and directories with external users is not allowed
  4475. * `password-reset-disabled` - resetting the password is not allowed
  4476. * `shares-without-password-disabled` - creating shares without password protection is not allowed
  4477. RetentionCheckNotification:
  4478. type: string
  4479. enum:
  4480. - Hook
  4481. - Email
  4482. description: |
  4483. Options:
  4484. * `Hook` - notify result using the defined hook. A "data_retention_hook" must be defined in your configuration file for this to work
  4485. * `Email` - notify results by email. The admin starting the retention check must have an associated email address and the SMTP server must be configured for this to work
  4486. APIKeyScope:
  4487. type: integer
  4488. enum:
  4489. - 1
  4490. - 2
  4491. description: |
  4492. Options:
  4493. * `1` - admin scope. The API key will be used to impersonate an SFTPGo admin
  4494. * `2` - user scope. The API key will be used to impersonate an SFTPGo user
  4495. ShareScope:
  4496. type: integer
  4497. enum:
  4498. - 1
  4499. - 2
  4500. description: |
  4501. Options:
  4502. * `1` - read scope
  4503. * `2` - write scope
  4504. TOTPHMacAlgo:
  4505. type: string
  4506. enum:
  4507. - sha1
  4508. - sha256
  4509. - sha512
  4510. description: 'Supported HMAC algorithms for Time-based one time passwords'
  4511. UserType:
  4512. type: string
  4513. enum:
  4514. - ''
  4515. - LDAPUser
  4516. - OSUser
  4517. description: This is an hint for authentication plugins. It is ignored when using SFTPGo internal authentication
  4518. FsEventStatus:
  4519. type: integer
  4520. enum:
  4521. - 1
  4522. - 2
  4523. - 3
  4524. description: >
  4525. Event status:
  4526. * `1` - no error
  4527. * `2` - generic error
  4528. * `3` - quota exceeded error
  4529. FsEventAction:
  4530. type: string
  4531. enum:
  4532. - download
  4533. - pre-upload
  4534. - upload
  4535. - delete
  4536. - rename
  4537. - mkdir
  4538. - rmdir
  4539. - ssh_cmd
  4540. ProviderEventAction:
  4541. type: string
  4542. enum:
  4543. - add
  4544. - update
  4545. - delete
  4546. ProviderEventObjectType:
  4547. type: string
  4548. enum:
  4549. - user
  4550. - folder
  4551. - group
  4552. - admin
  4553. - api_key
  4554. - share
  4555. - event_action
  4556. - event_rule
  4557. SSHAuthentications:
  4558. type: string
  4559. enum:
  4560. - publickey
  4561. - password
  4562. - keyboard-interactive
  4563. - publickey+password
  4564. - publickey+keyboard-interactive
  4565. TLSVersions:
  4566. type: integer
  4567. enum:
  4568. - 12
  4569. - 13
  4570. description: >
  4571. TLS version:
  4572. * `12` - TLS 1.2
  4573. * `13` - TLS 1.3
  4574. TOTPConfig:
  4575. type: object
  4576. properties:
  4577. name:
  4578. type: string
  4579. issuer:
  4580. type: string
  4581. algo:
  4582. $ref: '#/components/schemas/TOTPHMacAlgo'
  4583. RecoveryCode:
  4584. type: object
  4585. properties:
  4586. secret:
  4587. $ref: '#/components/schemas/Secret'
  4588. used:
  4589. type: boolean
  4590. description: 'Recovery codes to use if the user loses access to their second factor auth device. Each code can only be used once, you should use these codes to login and disable or reset 2FA for your account'
  4591. BaseTOTPConfig:
  4592. type: object
  4593. properties:
  4594. enabled:
  4595. type: boolean
  4596. config_name:
  4597. type: string
  4598. description: 'This name must be defined within the "totp" section of the SFTPGo configuration file. You will be unable to save a user/admin referencing a missing config_name'
  4599. secret:
  4600. $ref: '#/components/schemas/Secret'
  4601. AdminTOTPConfig:
  4602. allOf:
  4603. - $ref: '#/components/schemas/BaseTOTPConfig'
  4604. UserTOTPConfig:
  4605. allOf:
  4606. - $ref: '#/components/schemas/BaseTOTPConfig'
  4607. - type: object
  4608. properties:
  4609. protocols:
  4610. type: array
  4611. items:
  4612. $ref: '#/components/schemas/MFAProtocols'
  4613. description: 'TOTP will be required for the specified protocols. SSH protocol (SFTP/SCP/SSH commands) will ask for the TOTP passcode if the client uses keyboard interactive authentication. FTP has no standard way to support two factor authentication, if you enable the FTP support, you have to add the TOTP passcode after the password. For example if your password is "password" and your one time passcode is "123456" you have to use "password123456" as password. WebDAV is not supported since each single request must be authenticated and a passcode cannot be reused.'
  4614. PatternsFilter:
  4615. type: object
  4616. properties:
  4617. path:
  4618. type: string
  4619. description: 'exposed virtual path, if no other specific filter is defined, the filter applies for sub directories too. For example if filters are defined for the paths "/" and "/sub" then the filters for "/" are applied for any file outside the "/sub" directory'
  4620. allowed_patterns:
  4621. type: array
  4622. items:
  4623. type: string
  4624. description: 'list of, case insensitive, allowed shell like patterns.'
  4625. example:
  4626. - '*.jpg'
  4627. - a*b?.png
  4628. denied_patterns:
  4629. type: array
  4630. items:
  4631. type: string
  4632. description: 'list of, case insensitive, denied shell like patterns. Denied patterns are evaluated before the allowed ones'
  4633. example:
  4634. - '*.zip'
  4635. deny_policy:
  4636. type: integer
  4637. enum:
  4638. - 0
  4639. - 1
  4640. description: |
  4641. Deny policies
  4642. * `0` - default policy. Denied files/directories matching the filters are visible in directory listing but cannot be uploaded/downloaded/overwritten/renamed
  4643. * `1` - deny policy hide. This policy applies the same restrictions as the default one and denied files/directories matching the filters will also be hidden in directory listing. This mode may cause performance issues for large directories
  4644. HooksFilter:
  4645. type: object
  4646. properties:
  4647. external_auth_disabled:
  4648. type: boolean
  4649. example: false
  4650. description: If true, the external auth hook, if defined, will not be executed
  4651. pre_login_disabled:
  4652. type: boolean
  4653. example: false
  4654. description: If true, the pre-login hook, if defined, will not be executed
  4655. check_password_disabled:
  4656. type: boolean
  4657. example: false
  4658. description: If true, the check password hook, if defined, will not be executed
  4659. description: User specific hook overrides
  4660. BandwidthLimit:
  4661. type: object
  4662. properties:
  4663. sources:
  4664. type: array
  4665. items:
  4666. type: string
  4667. description: 'Source networks in CIDR notation as defined in RFC 4632 and RFC 4291 for example `192.0.2.0/24` or `2001:db8::/32`. The limit applies if the defined networks contain the client IP'
  4668. upload_bandwidth:
  4669. type: integer
  4670. format: int32
  4671. description: 'Maximum upload bandwidth as KB/s, 0 means unlimited'
  4672. download_bandwidth:
  4673. type: integer
  4674. format: int32
  4675. description: 'Maximum download bandwidth as KB/s, 0 means unlimited'
  4676. DataTransferLimit:
  4677. type: object
  4678. properties:
  4679. sources:
  4680. type: array
  4681. items:
  4682. type: string
  4683. description: 'Source networks in CIDR notation as defined in RFC 4632 and RFC 4291 for example `192.0.2.0/24` or `2001:db8::/32`. The limit applies if the defined networks contain the client IP'
  4684. upload_data_transfer:
  4685. type: integer
  4686. description: 'Maximum data transfer allowed for uploads as MB. 0 means no limit'
  4687. download_data_transfer:
  4688. type: integer
  4689. description: 'Maximum data transfer allowed for downloads as MB. 0 means no limit'
  4690. total_data_transfer:
  4691. type: integer
  4692. description: 'Maximum total data transfer as MB. 0 means unlimited. You can set a total data transfer instead of the individual values for uploads and downloads'
  4693. BaseUserFilters:
  4694. type: object
  4695. properties:
  4696. allowed_ip:
  4697. type: array
  4698. items:
  4699. type: string
  4700. description: 'only clients connecting from these IP/Mask are allowed. IP/Mask must be in CIDR notation as defined in RFC 4632 and RFC 4291, for example "192.0.2.0/24" or "2001:db8::/32"'
  4701. example:
  4702. - 192.0.2.0/24
  4703. - '2001:db8::/32'
  4704. denied_ip:
  4705. type: array
  4706. items:
  4707. type: string
  4708. description: clients connecting from these IP/Mask are not allowed. Denied rules are evaluated before allowed ones
  4709. example:
  4710. - 172.16.0.0/16
  4711. denied_login_methods:
  4712. type: array
  4713. items:
  4714. $ref: '#/components/schemas/LoginMethods'
  4715. description: if null or empty any available login method is allowed
  4716. denied_protocols:
  4717. type: array
  4718. items:
  4719. $ref: '#/components/schemas/SupportedProtocols'
  4720. description: if null or empty any available protocol is allowed
  4721. file_patterns:
  4722. type: array
  4723. items:
  4724. $ref: '#/components/schemas/PatternsFilter'
  4725. description: 'filters based on shell like file patterns. These restrictions do not apply to files listing for performance reasons, so a denied file cannot be downloaded/overwritten/renamed but it will still be in the list of files. Please note that these restrictions can be easily bypassed'
  4726. max_upload_file_size:
  4727. type: integer
  4728. format: int64
  4729. description: 'maximum allowed size, as bytes, for a single file upload. The upload will be aborted if/when the size of the file being sent exceeds this limit. 0 means unlimited. This restriction does not apply for SSH system commands such as `git` and `rsync`'
  4730. tls_username:
  4731. type: string
  4732. enum:
  4733. - None
  4734. - CommonName
  4735. description: 'defines the TLS certificate field to use as username. For FTP clients it must match the name provided using the "USER" command. For WebDAV, if no username is provided, the CN will be used as username. For WebDAV clients it must match the implicit or provided username. Ignored if mutual TLS is disabled'
  4736. hooks:
  4737. $ref: '#/components/schemas/HooksFilter'
  4738. disable_fs_checks:
  4739. type: boolean
  4740. example: false
  4741. description: Disable checks for existence and automatic creation of home directory and virtual folders. SFTPGo requires that the user's home directory, virtual folder root, and intermediate paths to virtual folders exist to work properly. If you already know that the required directories exist, disabling these checks will speed up login. You could, for example, disable these checks after the first login
  4742. web_client:
  4743. type: array
  4744. items:
  4745. $ref: '#/components/schemas/WebClientOptions'
  4746. description: WebClient/user REST API related configuration options
  4747. allow_api_key_auth:
  4748. type: boolean
  4749. description: 'API key authentication allows to impersonate this user with an API key'
  4750. user_type:
  4751. $ref: '#/components/schemas/UserType'
  4752. bandwidth_limits:
  4753. type: array
  4754. items:
  4755. $ref: '#/components/schemas/BandwidthLimit'
  4756. data_transfer_limits:
  4757. type: array
  4758. items:
  4759. $ref: '#/components/schemas/DataTransferLimit'
  4760. external_auth_cache_time:
  4761. type: integer
  4762. description: 'Defines the cache time, in seconds, for users authenticated using an external auth hook. 0 means no cache'
  4763. start_directory:
  4764. type: string
  4765. description: 'Specifies an alternate starting directory. If not set, the default is "/". This option is supported for SFTP/SCP, FTP and HTTP (WebClient/REST API) protocols. Relative paths will use this directory as base.'
  4766. 2fa_protocols:
  4767. type: array
  4768. items:
  4769. $ref: '#/components/schemas/MFAProtocols'
  4770. description: 'Defines protocols that require two factor authentication'
  4771. ftp_security:
  4772. type: integer
  4773. enum:
  4774. - 0
  4775. - 1
  4776. description: 'Set to `1` to require TLS for both data and control connection. his setting is useful if you want to allow both encrypted and plain text FTP sessions globally and then you want to require encrypted sessions on a per-user basis. It has no effect if TLS is already required for all users in the configuration file.'
  4777. is_anonymous:
  4778. type: boolean
  4779. description: 'If enabled the user can login with any password or no password at all. Anonymous users are supported for FTP and WebDAV protocols and permissions will be automatically set to "list" and "download" (read only)'
  4780. default_shares_expiration:
  4781. type: integer
  4782. description: 'Defines the default expiration for newly created shares as number of days. 0 means no expiration'
  4783. description: Additional user options
  4784. UserFilters:
  4785. allOf:
  4786. - $ref: '#/components/schemas/BaseUserFilters'
  4787. - type: object
  4788. properties:
  4789. totp_config:
  4790. $ref: '#/components/schemas/UserTOTPConfig'
  4791. recovery_codes:
  4792. type: array
  4793. items:
  4794. $ref: '#/components/schemas/RecoveryCode'
  4795. Secret:
  4796. type: object
  4797. properties:
  4798. status:
  4799. type: string
  4800. enum:
  4801. - Plain
  4802. - AES-256-GCM
  4803. - Secretbox
  4804. - GCP
  4805. - AWS
  4806. - VaultTransit
  4807. - AzureKeyVault
  4808. - Redacted
  4809. description: 'Set to "Plain" to add or update an existing secret, set to "Redacted" to preserve the existing value'
  4810. payload:
  4811. type: string
  4812. key:
  4813. type: string
  4814. additional_data:
  4815. type: string
  4816. mode:
  4817. type: integer
  4818. description: 1 means encrypted using a master key
  4819. description: The secret is encrypted before saving, so to set a new secret you must provide a payload and set the status to "Plain". The encryption key and additional data will be generated automatically. If you set the status to "Redacted" the existing secret will be preserved
  4820. S3Config:
  4821. type: object
  4822. properties:
  4823. bucket:
  4824. type: string
  4825. minLength: 1
  4826. region:
  4827. type: string
  4828. minLength: 1
  4829. access_key:
  4830. type: string
  4831. access_secret:
  4832. $ref: '#/components/schemas/Secret'
  4833. role_arn:
  4834. type: string
  4835. description: 'Optional IAM Role ARN to assume'
  4836. endpoint:
  4837. type: string
  4838. description: optional endpoint
  4839. storage_class:
  4840. type: string
  4841. acl:
  4842. type: string
  4843. description: 'The canned ACL to apply to uploaded objects. Leave empty to use the default ACL. For more information and available ACLs, see here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl'
  4844. upload_part_size:
  4845. type: integer
  4846. description: 'the buffer size (in MB) to use for multipart uploads. The minimum allowed part size is 5MB, and if this value is set to zero, the default value (5MB) for the AWS SDK will be used. The minimum allowed value is 5.'
  4847. upload_concurrency:
  4848. type: integer
  4849. description: 'the number of parts to upload in parallel. If this value is set to zero, the default value (5) will be used'
  4850. upload_part_max_time:
  4851. type: integer
  4852. description: 'the maximum time allowed, in seconds, to upload a single chunk (the chunk size is defined via "upload_part_size"). 0 means no timeout'
  4853. download_part_size:
  4854. type: integer
  4855. description: 'the buffer size (in MB) to use for multipart downloads. The minimum allowed part size is 5MB, and if this value is set to zero, the default value (5MB) for the AWS SDK will be used. The minimum allowed value is 5. Ignored for partial downloads'
  4856. download_concurrency:
  4857. type: integer
  4858. description: 'the number of parts to download in parallel. If this value is set to zero, the default value (5) will be used. Ignored for partial downloads'
  4859. download_part_max_time:
  4860. type: integer
  4861. description: 'the maximum time allowed, in seconds, to download a single chunk (the chunk size is defined via "download_part_size"). 0 means no timeout. Ignored for partial downloads.'
  4862. force_path_style:
  4863. type: boolean
  4864. description: 'Set this to "true" to force the request to use path-style addressing, i.e., "http://s3.amazonaws.com/BUCKET/KEY". By default, the S3 client will use virtual hosted bucket addressing when possible ("http://BUCKET.s3.amazonaws.com/KEY")'
  4865. key_prefix:
  4866. type: string
  4867. description: 'key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with "/" and must end with "/". If empty the whole bucket contents will be available'
  4868. example: folder/subfolder/
  4869. description: S3 Compatible Object Storage configuration details
  4870. GCSConfig:
  4871. type: object
  4872. properties:
  4873. bucket:
  4874. type: string
  4875. minLength: 1
  4876. credentials:
  4877. $ref: '#/components/schemas/Secret'
  4878. automatic_credentials:
  4879. type: integer
  4880. enum:
  4881. - 0
  4882. - 1
  4883. description: |
  4884. Automatic credentials:
  4885. * `0` - disabled, explicit credentials, using a JSON credentials file, must be provided. This is the default value if the field is null
  4886. * `1` - enabled, we try to use the Application Default Credentials (ADC) strategy to find your application's credentials
  4887. storage_class:
  4888. type: string
  4889. acl:
  4890. type: string
  4891. description: 'The ACL to apply to uploaded objects. Leave empty to use the default ACL. For more information and available ACLs, refer to the JSON API here: https://cloud.google.com/storage/docs/access-control/lists#predefined-acl'
  4892. key_prefix:
  4893. type: string
  4894. description: 'key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with "/" and must end with "/". If empty the whole bucket contents will be available'
  4895. example: folder/subfolder/
  4896. description: 'Google Cloud Storage configuration details. The "credentials" field must be populated only when adding/updating a user. It will be always omitted, since there are sensitive data, when you search/get users'
  4897. AzureBlobFsConfig:
  4898. type: object
  4899. properties:
  4900. container:
  4901. type: string
  4902. account_name:
  4903. type: string
  4904. description: 'Storage Account Name, leave blank to use SAS URL'
  4905. account_key:
  4906. $ref: '#/components/schemas/Secret'
  4907. sas_url:
  4908. $ref: '#/components/schemas/Secret'
  4909. endpoint:
  4910. type: string
  4911. description: 'optional endpoint. Default is "blob.core.windows.net". If you use the emulator the endpoint must include the protocol, for example "http://127.0.0.1:10000"'
  4912. upload_part_size:
  4913. type: integer
  4914. description: 'the buffer size (in MB) to use for multipart uploads. If this value is set to zero, the default value (5MB) will be used.'
  4915. upload_concurrency:
  4916. type: integer
  4917. description: 'the number of parts to upload in parallel. If this value is set to zero, the default value (5) will be used'
  4918. download_part_size:
  4919. type: integer
  4920. description: 'the buffer size (in MB) to use for multipart downloads. If this value is set to zero, the default value (5MB) will be used.'
  4921. download_concurrency:
  4922. type: integer
  4923. description: 'the number of parts to download in parallel. If this value is set to zero, the default value (5) will be used'
  4924. access_tier:
  4925. type: string
  4926. enum:
  4927. - ''
  4928. - Archive
  4929. - Hot
  4930. - Cool
  4931. key_prefix:
  4932. type: string
  4933. description: 'key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with "/" and must end with "/". If empty the whole container contents will be available'
  4934. example: folder/subfolder/
  4935. use_emulator:
  4936. type: boolean
  4937. description: Azure Blob Storage configuration details
  4938. CryptFsConfig:
  4939. type: object
  4940. properties:
  4941. passphrase:
  4942. $ref: '#/components/schemas/Secret'
  4943. description: Crypt filesystem configuration details
  4944. SFTPFsConfig:
  4945. type: object
  4946. properties:
  4947. endpoint:
  4948. type: string
  4949. description: 'remote SFTP endpoint as host:port'
  4950. username:
  4951. type: string
  4952. description: you can specify a password or private key or both. In the latter case the private key will be tried first.
  4953. password:
  4954. $ref: '#/components/schemas/Secret'
  4955. private_key:
  4956. $ref: '#/components/schemas/Secret'
  4957. key_passphrase:
  4958. $ref: '#/components/schemas/Secret'
  4959. fingerprints:
  4960. type: array
  4961. items:
  4962. type: string
  4963. description: 'SHA256 fingerprints to use for host key verification. If you don''t provide any fingerprint the remote host key will not be verified, this is a security risk'
  4964. prefix:
  4965. type: string
  4966. description: Specifying a prefix you can restrict all operations to a given path within the remote SFTP server.
  4967. disable_concurrent_reads:
  4968. type: boolean
  4969. description: Concurrent reads are safe to use and disabling them will degrade performance. Some servers automatically delete files once they are downloaded. Using concurrent reads is problematic with such servers.
  4970. buffer_size:
  4971. type: integer
  4972. minimum: 0
  4973. maximum: 16
  4974. example: 2
  4975. description: The size of the buffer (in MB) to use for transfers. By enabling buffering, the reads and writes, from/to the remote SFTP server, are split in multiple concurrent requests and this allows data to be transferred at a faster rate, over high latency networks, by overlapping round-trip times. With buffering enabled, resuming uploads is not supported and a file cannot be opened for both reading and writing at the same time. 0 means disabled.
  4976. equality_check_mode:
  4977. type: integer
  4978. enum:
  4979. - 0
  4980. - 1
  4981. description: |
  4982. Defines how to check if this config points to the same server as another config. If different configs point to the same server the renaming between the fs configs is allowed:
  4983. * `0` username and endpoint must match. This is the default
  4984. * `1` only the endpoint must match
  4985. HTTPFsConfig:
  4986. type: object
  4987. properties:
  4988. endpoint:
  4989. type: string
  4990. description: 'HTTP/S endpoint URL. SFTPGo will use this URL as base, for example for the `stat` API, SFTPGo will add `/stat/{name}`'
  4991. username:
  4992. type: string
  4993. password:
  4994. $ref: '#/components/schemas/Secret'
  4995. api_key:
  4996. $ref: '#/components/schemas/Secret'
  4997. skip_tls_verify:
  4998. type: boolean
  4999. equality_check_mode:
  5000. type: integer
  5001. enum:
  5002. - 0
  5003. - 1
  5004. description: |
  5005. Defines how to check if this config points to the same server as another config. If different configs point to the same server the renaming between the fs configs is allowed:
  5006. * `0` username and endpoint must match. This is the default
  5007. * `1` only the endpoint must match
  5008. FilesystemConfig:
  5009. type: object
  5010. properties:
  5011. provider:
  5012. $ref: '#/components/schemas/FsProviders'
  5013. s3config:
  5014. $ref: '#/components/schemas/S3Config'
  5015. gcsconfig:
  5016. $ref: '#/components/schemas/GCSConfig'
  5017. azblobconfig:
  5018. $ref: '#/components/schemas/AzureBlobFsConfig'
  5019. cryptconfig:
  5020. $ref: '#/components/schemas/CryptFsConfig'
  5021. sftpconfig:
  5022. $ref: '#/components/schemas/SFTPFsConfig'
  5023. httpconfig:
  5024. $ref: '#/components/schemas/HTTPFsConfig'
  5025. description: Storage filesystem details
  5026. BaseVirtualFolder:
  5027. type: object
  5028. properties:
  5029. id:
  5030. type: integer
  5031. format: int32
  5032. minimum: 1
  5033. name:
  5034. type: string
  5035. description: unique name for this virtual folder
  5036. mapped_path:
  5037. type: string
  5038. description: absolute filesystem path to use as virtual folder
  5039. description:
  5040. type: string
  5041. description: optional description
  5042. used_quota_size:
  5043. type: integer
  5044. format: int64
  5045. used_quota_files:
  5046. type: integer
  5047. format: int32
  5048. last_quota_update:
  5049. type: integer
  5050. format: int64
  5051. description: Last quota update as unix timestamp in milliseconds
  5052. users:
  5053. type: array
  5054. items:
  5055. type: string
  5056. description: list of usernames associated with this virtual folder
  5057. filesystem:
  5058. $ref: '#/components/schemas/FilesystemConfig'
  5059. description: 'Defines the filesystem for the virtual folder and the used quota limits. The same folder can be shared among multiple users and each user can have different quota limits or a different virtual path.'
  5060. VirtualFolder:
  5061. allOf:
  5062. - $ref: '#/components/schemas/BaseVirtualFolder'
  5063. - type: object
  5064. properties:
  5065. virtual_path:
  5066. type: string
  5067. quota_size:
  5068. type: integer
  5069. format: int64
  5070. description: 'Quota as size in bytes. 0 means unlimited, -1 means included in user quota. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed'
  5071. quota_files:
  5072. type: integer
  5073. format: int32
  5074. description: 'Quota as number of files. 0 means unlimited, , -1 means included in user quota. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed'
  5075. required:
  5076. - virtual_path
  5077. description: 'A virtual folder is a mapping between a SFTPGo virtual path and a filesystem path outside the user home directory. The specified paths must be absolute and the virtual path cannot be "/", it must be a sub directory. The parent directory for the specified virtual path must exist. SFTPGo will try to automatically create any missing parent directory for the configured virtual folders at user login.'
  5078. User:
  5079. type: object
  5080. properties:
  5081. id:
  5082. type: integer
  5083. format: int32
  5084. minimum: 1
  5085. status:
  5086. type: integer
  5087. enum:
  5088. - 0
  5089. - 1
  5090. description: |
  5091. status:
  5092. * `0` user is disabled, login is not allowed
  5093. * `1` user is enabled
  5094. username:
  5095. type: string
  5096. description: username is unique
  5097. email:
  5098. type: string
  5099. format: email
  5100. description:
  5101. type: string
  5102. description: 'optional description, for example the user full name'
  5103. expiration_date:
  5104. type: integer
  5105. format: int64
  5106. description: expiration date as unix timestamp in milliseconds. An expired account cannot login. 0 means no expiration
  5107. password:
  5108. type: string
  5109. format: password
  5110. description: password or public key/SSH user certificate are mandatory. If the password has no known hashing algo prefix it will be stored, by default, using bcrypt, argon2id is supported too. You can send a password hashed as bcrypt ($2a$ prefix), argon2id, pbkdf2 or unix crypt and it will be stored as is. For security reasons this field is omitted when you search/get users
  5111. public_keys:
  5112. type: array
  5113. items:
  5114. type: string
  5115. example: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEUWwDwEWhTbF0MqAsp/oXK1HR2cElhM8oo1uVmL3ZeDKDiTm4ljMr92wfTgIGDqIoxmVqgYIkAOAhuykAVWBzc= user@host
  5116. description: Public keys in OpenSSH format. A password or at least one public key/SSH user certificate are mandatory.
  5117. home_dir:
  5118. type: string
  5119. description: path to the user home directory. The user cannot upload or download files outside this directory. SFTPGo tries to automatically create this folder if missing. Must be an absolute path
  5120. virtual_folders:
  5121. type: array
  5122. items:
  5123. $ref: '#/components/schemas/VirtualFolder'
  5124. description: mapping between virtual SFTPGo paths and virtual folders. If one or more of the specified folders are not inside the dataprovider they will be automatically created. You have to create the folder on the filesystem yourself
  5125. uid:
  5126. type: integer
  5127. format: int32
  5128. minimum: 0
  5129. maximum: 2147483647
  5130. description: 'if you run SFTPGo as root user, the created files and directories will be assigned to this uid. 0 means no change, the owner will be the user that runs SFTPGo. Ignored on windows'
  5131. gid:
  5132. type: integer
  5133. format: int32
  5134. minimum: 0
  5135. maximum: 2147483647
  5136. description: 'if you run SFTPGo as root user, the created files and directories will be assigned to this gid. 0 means no change, the group will be the one of the user that runs SFTPGo. Ignored on windows'
  5137. max_sessions:
  5138. type: integer
  5139. format: int32
  5140. description: Limit the sessions that a user can open. 0 means unlimited
  5141. quota_size:
  5142. type: integer
  5143. format: int64
  5144. description: Quota as size in bytes. 0 means unlimited. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed
  5145. quota_files:
  5146. type: integer
  5147. format: int32
  5148. description: Quota as number of files. 0 means unlimited. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed
  5149. permissions:
  5150. type: object
  5151. additionalProperties:
  5152. type: array
  5153. items:
  5154. $ref: '#/components/schemas/Permission'
  5155. minItems: 1
  5156. minProperties: 1
  5157. description: 'hash map with directory as key and an array of permissions as value. Directories must be absolute paths, permissions for root directory ("/") are required'
  5158. example:
  5159. /:
  5160. - '*'
  5161. /somedir:
  5162. - list
  5163. - download
  5164. used_quota_size:
  5165. type: integer
  5166. format: int64
  5167. used_quota_files:
  5168. type: integer
  5169. format: int32
  5170. last_quota_update:
  5171. type: integer
  5172. format: int64
  5173. description: Last quota update as unix timestamp in milliseconds
  5174. upload_bandwidth:
  5175. type: integer
  5176. description: 'Maximum upload bandwidth as KB/s, 0 means unlimited'
  5177. download_bandwidth:
  5178. type: integer
  5179. description: 'Maximum download bandwidth as KB/s, 0 means unlimited'
  5180. upload_data_transfer:
  5181. type: integer
  5182. description: 'Maximum data transfer allowed for uploads as MB. 0 means no limit'
  5183. download_data_transfer:
  5184. type: integer
  5185. description: 'Maximum data transfer allowed for downloads as MB. 0 means no limit'
  5186. total_data_transfer:
  5187. type: integer
  5188. description: 'Maximum total data transfer as MB. 0 means unlimited. You can set a total data transfer instead of the individual values for uploads and downloads'
  5189. used_upload_data_transfer:
  5190. type: integer
  5191. description: 'Uploaded size, as bytes, since the last reset'
  5192. used_download_data_transfer:
  5193. type: integer
  5194. description: 'Downloaded size, as bytes, since the last reset'
  5195. created_at:
  5196. type: integer
  5197. format: int64
  5198. description: 'creation time as unix timestamp in milliseconds. It will be 0 for users created before v2.2.0'
  5199. updated_at:
  5200. type: integer
  5201. format: int64
  5202. description: last update time as unix timestamp in milliseconds
  5203. last_login:
  5204. type: integer
  5205. format: int64
  5206. description: Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes
  5207. first_download:
  5208. type: integer
  5209. format: int64
  5210. description: first download time as unix timestamp in milliseconds
  5211. first_upload:
  5212. type: integer
  5213. format: int64
  5214. description: first upload time as unix timestamp in milliseconds
  5215. filters:
  5216. $ref: '#/components/schemas/UserFilters'
  5217. filesystem:
  5218. $ref: '#/components/schemas/FilesystemConfig'
  5219. additional_info:
  5220. type: string
  5221. description: Free form text field for external systems
  5222. groups:
  5223. type: array
  5224. items:
  5225. $ref: '#/components/schemas/GroupMapping'
  5226. oidc_custom_fields:
  5227. type: object
  5228. additionalProperties: true
  5229. description: 'This field is passed to the pre-login hook if custom OIDC token fields have been configured. Field values can be of any type (this is a free form object) and depend on the type of the configured OIDC token fields'
  5230. AdminFilters:
  5231. type: object
  5232. properties:
  5233. allow_list:
  5234. type: array
  5235. items:
  5236. type: string
  5237. description: 'only clients connecting from these IP/Mask are allowed. IP/Mask must be in CIDR notation as defined in RFC 4632 and RFC 4291, for example "192.0.2.0/24" or "2001:db8::/32"'
  5238. example:
  5239. - 192.0.2.0/24
  5240. - '2001:db8::/32'
  5241. allow_api_key_auth:
  5242. type: boolean
  5243. description: 'API key auth allows to impersonate this administrator with an API key'
  5244. totp_config:
  5245. $ref: '#/components/schemas/AdminTOTPConfig'
  5246. recovery_codes:
  5247. type: array
  5248. items:
  5249. $ref: '#/components/schemas/RecoveryCode'
  5250. Admin:
  5251. type: object
  5252. properties:
  5253. id:
  5254. type: integer
  5255. format: int32
  5256. minimum: 1
  5257. status:
  5258. type: integer
  5259. enum:
  5260. - 0
  5261. - 1
  5262. description: |
  5263. status:
  5264. * `0` user is disabled, login is not allowed
  5265. * `1` user is enabled
  5266. username:
  5267. type: string
  5268. description: username is unique
  5269. description:
  5270. type: string
  5271. description: 'optional description, for example the admin full name'
  5272. password:
  5273. type: string
  5274. format: password
  5275. description: Admin password. For security reasons this field is omitted when you search/get admins
  5276. email:
  5277. type: string
  5278. format: email
  5279. permissions:
  5280. type: array
  5281. items:
  5282. $ref: '#/components/schemas/AdminPermissions'
  5283. filters:
  5284. $ref: '#/components/schemas/AdminFilters'
  5285. additional_info:
  5286. type: string
  5287. description: Free form text field
  5288. groups:
  5289. type: array
  5290. items:
  5291. $ref: '#/components/schemas/AdminGroupMapping'
  5292. description: 'Groups automatically selected for new users created by this admin. The admin will still be able to choose different groups. These settings are only used for this admin UI and they will be ignored in REST API/hooks.'
  5293. created_at:
  5294. type: integer
  5295. format: int64
  5296. description: 'creation time as unix timestamp in milliseconds. It will be 0 for admins created before v2.2.0'
  5297. updated_at:
  5298. type: integer
  5299. format: int64
  5300. description: last update time as unix timestamp in milliseconds
  5301. last_login:
  5302. type: integer
  5303. format: int64
  5304. description: Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes
  5305. AdminProfile:
  5306. type: object
  5307. properties:
  5308. email:
  5309. type: string
  5310. format: email
  5311. description:
  5312. type: string
  5313. allow_api_key_auth:
  5314. type: boolean
  5315. description: 'If enabled, you can impersonate this admin, in REST API, using an API key. If disabled admin credentials are required for impersonation'
  5316. UserProfile:
  5317. type: object
  5318. properties:
  5319. email:
  5320. type: string
  5321. format: email
  5322. description:
  5323. type: string
  5324. allow_api_key_auth:
  5325. type: boolean
  5326. description: 'If enabled, you can impersonate this user, in REST API, using an API key. If disabled user credentials are required for impersonation'
  5327. public_keys:
  5328. type: array
  5329. items:
  5330. type: string
  5331. example: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEUWwDwEWhTbF0MqAsp/oXK1HR2cElhM8oo1uVmL3ZeDKDiTm4ljMr92wfTgIGDqIoxmVqgYIkAOAhuykAVWBzc= user@host
  5332. description: Public keys in OpenSSH format
  5333. APIKey:
  5334. type: object
  5335. properties:
  5336. id:
  5337. type: string
  5338. description: unique key identifier
  5339. name:
  5340. type: string
  5341. description: User friendly key name
  5342. key:
  5343. type: string
  5344. format: password
  5345. description: We store the hash of the key. This is just like a password. For security reasons this field is omitted when you search/get API keys
  5346. scope:
  5347. $ref: '#/components/schemas/APIKeyScope'
  5348. created_at:
  5349. type: integer
  5350. format: int64
  5351. description: creation time as unix timestamp in milliseconds
  5352. updated_at:
  5353. type: integer
  5354. format: int64
  5355. description: last update time as unix timestamp in milliseconds
  5356. last_use_at:
  5357. type: integer
  5358. format: int64
  5359. description: last use time as unix timestamp in milliseconds. It is saved at most once every 10 minutes
  5360. expires_at:
  5361. type: integer
  5362. format: int64
  5363. description: expiration time as unix timestamp in milliseconds
  5364. description:
  5365. type: string
  5366. description: optional description
  5367. user:
  5368. type: string
  5369. description: username associated with this API key. If empty and the scope is "user scope" the key can impersonate any user
  5370. admin:
  5371. type: string
  5372. description: admin associated with this API key. If empty and the scope is "admin scope" the key can impersonate any admin
  5373. QuotaUsage:
  5374. type: object
  5375. properties:
  5376. used_quota_size:
  5377. type: integer
  5378. format: int64
  5379. used_quota_files:
  5380. type: integer
  5381. format: int32
  5382. TransferQuotaUsage:
  5383. type: object
  5384. properties:
  5385. used_upload_data_transfer:
  5386. type: integer
  5387. format: int64
  5388. description: 'The value must be specified as bytes'
  5389. used_download_data_transfer:
  5390. type: integer
  5391. format: int64
  5392. description: 'The value must be specified as bytes'
  5393. Transfer:
  5394. type: object
  5395. properties:
  5396. operation_type:
  5397. type: string
  5398. enum:
  5399. - upload
  5400. - download
  5401. description: |
  5402. Operations:
  5403. * `upload`
  5404. * `download`
  5405. path:
  5406. type: string
  5407. description: file path for the upload/download
  5408. start_time:
  5409. type: integer
  5410. format: int64
  5411. description: start time as unix timestamp in milliseconds
  5412. size:
  5413. type: integer
  5414. format: int64
  5415. description: bytes transferred
  5416. ConnectionStatus:
  5417. type: object
  5418. properties:
  5419. username:
  5420. type: string
  5421. description: connected username
  5422. connection_id:
  5423. type: string
  5424. description: unique connection identifier
  5425. client_version:
  5426. type: string
  5427. description: client version
  5428. remote_address:
  5429. type: string
  5430. description: Remote address for the connected client
  5431. connection_time:
  5432. type: integer
  5433. format: int64
  5434. description: connection time as unix timestamp in milliseconds
  5435. command:
  5436. type: string
  5437. description: Last SSH/FTP command or WebDAV method
  5438. last_activity:
  5439. type: integer
  5440. format: int64
  5441. description: last client activity as unix timestamp in milliseconds
  5442. protocol:
  5443. type: string
  5444. enum:
  5445. - SFTP
  5446. - SCP
  5447. - SSH
  5448. - FTP
  5449. - DAV
  5450. active_transfers:
  5451. type: array
  5452. items:
  5453. $ref: '#/components/schemas/Transfer'
  5454. FolderRetention:
  5455. type: object
  5456. properties:
  5457. path:
  5458. type: string
  5459. description: 'exposed virtual directory path, if no other specific retention is defined, the retention applies for sub directories too. For example if retention is defined for the paths "/" and "/sub" then the retention for "/" is applied for any file outside the "/sub" directory'
  5460. example: '/'
  5461. retention:
  5462. type: integer
  5463. description: retention time in hours. All the files with a modification time older than the defined value will be deleted. 0 means exclude this path
  5464. example: 24
  5465. delete_empty_dirs:
  5466. type: boolean
  5467. description: if enabled, empty directories will be deleted
  5468. ignore_user_permissions:
  5469. type: boolean
  5470. description: 'if enabled, files will be deleted even if the user does not have the delete permission. The default is "false" which means that files will be skipped if the user does not have permission to delete them. File patterns filters will always be silently ignored'
  5471. RetentionCheck:
  5472. type: object
  5473. properties:
  5474. username:
  5475. type: string
  5476. description: username to which the retention check refers
  5477. folders:
  5478. type: array
  5479. items:
  5480. $ref: '#/components/schemas/FolderRetention'
  5481. start_time:
  5482. type: integer
  5483. format: int64
  5484. description: check start time as unix timestamp in milliseconds
  5485. notifications:
  5486. type: array
  5487. items:
  5488. $ref: '#/components/schemas/RetentionCheckNotification'
  5489. email:
  5490. type: string
  5491. format: email
  5492. description: 'if the notification method is set to "Email", this is the e-mail address that receives the retention check report. This field is automatically set to the email address associated with the administrator starting the check'
  5493. MetadataCheck:
  5494. type: object
  5495. properties:
  5496. username:
  5497. type: string
  5498. description: username to which the check refers
  5499. start_time:
  5500. type: integer
  5501. format: int64
  5502. description: check start time as unix timestamp in milliseconds
  5503. QuotaScan:
  5504. type: object
  5505. properties:
  5506. username:
  5507. type: string
  5508. description: username to which the quota scan refers
  5509. start_time:
  5510. type: integer
  5511. format: int64
  5512. description: scan start time as unix timestamp in milliseconds
  5513. FolderQuotaScan:
  5514. type: object
  5515. properties:
  5516. name:
  5517. type: string
  5518. description: folder name to which the quota scan refers
  5519. start_time:
  5520. type: integer
  5521. format: int64
  5522. description: scan start time as unix timestamp in milliseconds
  5523. DefenderEntry:
  5524. type: object
  5525. properties:
  5526. id:
  5527. type: string
  5528. ip:
  5529. type: string
  5530. score:
  5531. type: integer
  5532. description: the score increases whenever a violation is detected, such as an attempt to log in using an incorrect password or invalid username. If the score exceeds the configured threshold, the IP is banned. Omitted for banned IPs
  5533. ban_time:
  5534. type: string
  5535. format: date-time
  5536. description: date time until the IP is banned. For already banned hosts, the ban time is increased each time a new violation is detected. Omitted if the IP is not banned
  5537. SSHHostKey:
  5538. type: object
  5539. properties:
  5540. path:
  5541. type: string
  5542. fingerprint:
  5543. type: string
  5544. SSHBinding:
  5545. type: object
  5546. properties:
  5547. address:
  5548. type: string
  5549. description: TCP address the server listen on
  5550. port:
  5551. type: integer
  5552. description: the port used for serving requests
  5553. apply_proxy_config:
  5554. type: boolean
  5555. description: 'apply the proxy configuration, if any'
  5556. WebDAVBinding:
  5557. type: object
  5558. properties:
  5559. address:
  5560. type: string
  5561. description: TCP address the server listen on
  5562. port:
  5563. type: integer
  5564. description: the port used for serving requests
  5565. enable_https:
  5566. type: boolean
  5567. min_tls_version:
  5568. $ref: '#/components/schemas/TLSVersions'
  5569. client_auth_type:
  5570. type: integer
  5571. description: 1 means that client certificate authentication is required in addition to HTTP basic authentication
  5572. tls_cipher_suites:
  5573. type: array
  5574. items:
  5575. type: string
  5576. description: 'List of supported cipher suites for TLS version 1.2. If empty a default list of secure cipher suites is used, with a preference order based on hardware performance'
  5577. prefix:
  5578. type: string
  5579. description: 'Prefix for WebDAV resources, if empty WebDAV resources will be available at the `/` URI'
  5580. proxy_allowed:
  5581. type: array
  5582. items:
  5583. type: string
  5584. description: 'List of IP addresses and IP ranges allowed to set proxy headers'
  5585. PassiveIPOverride:
  5586. type: object
  5587. properties:
  5588. networks:
  5589. type: array
  5590. items:
  5591. type: string
  5592. ip:
  5593. type: string
  5594. FTPDBinding:
  5595. type: object
  5596. properties:
  5597. address:
  5598. type: string
  5599. description: TCP address the server listen on
  5600. port:
  5601. type: integer
  5602. description: the port used for serving requests
  5603. apply_proxy_config:
  5604. type: boolean
  5605. description: 'apply the proxy configuration, if any'
  5606. tls_mode:
  5607. type: integer
  5608. enum:
  5609. - 0
  5610. - 1
  5611. - 2
  5612. description: |
  5613. TLS mode:
  5614. * `0` - clear or explicit TLS
  5615. * `1` - explicit TLS required
  5616. * `2` - implicit TLS
  5617. min_tls_version:
  5618. $ref: '#/components/schemas/TLSVersions'
  5619. force_passive_ip:
  5620. type: string
  5621. description: External IP address to expose for passive connections
  5622. passive_ip_overrides:
  5623. type: array
  5624. items:
  5625. $ref: '#/components/schemas/PassiveIPOverride'
  5626. client_auth_type:
  5627. type: integer
  5628. description: 1 means that client certificate authentication is required in addition to FTP authentication
  5629. tls_cipher_suites:
  5630. type: array
  5631. items:
  5632. type: string
  5633. description: 'List of supported cipher suites for TLS version 1.2. If empty a default list of secure cipher suites is used, with a preference order based on hardware performance'
  5634. passive_connections_security:
  5635. type: integer
  5636. enum:
  5637. - 0
  5638. - 1
  5639. description: |
  5640. Active connections security:
  5641. * `0` - require matching peer IP addresses of control and data connection
  5642. * `1` - disable any checks
  5643. active_connections_security:
  5644. type: integer
  5645. enum:
  5646. - 0
  5647. - 1
  5648. description: |
  5649. Active connections security:
  5650. * `0` - require matching peer IP addresses of control and data connection
  5651. * `1` - disable any checks
  5652. debug:
  5653. type: boolean
  5654. description: 'If enabled any FTP command will be logged'
  5655. SSHServiceStatus:
  5656. type: object
  5657. properties:
  5658. is_active:
  5659. type: boolean
  5660. bindings:
  5661. type: array
  5662. items:
  5663. $ref: '#/components/schemas/SSHBinding'
  5664. nullable: true
  5665. host_keys:
  5666. type: array
  5667. items:
  5668. $ref: '#/components/schemas/SSHHostKey'
  5669. nullable: true
  5670. ssh_commands:
  5671. type: array
  5672. items:
  5673. type: string
  5674. authentications:
  5675. type: array
  5676. items:
  5677. $ref: '#/components/schemas/SSHAuthentications'
  5678. FTPPassivePortRange:
  5679. type: object
  5680. properties:
  5681. start:
  5682. type: integer
  5683. end:
  5684. type: integer
  5685. FTPServiceStatus:
  5686. type: object
  5687. properties:
  5688. is_active:
  5689. type: boolean
  5690. bindings:
  5691. type: array
  5692. items:
  5693. $ref: '#/components/schemas/FTPDBinding'
  5694. nullable: true
  5695. passive_port_range:
  5696. $ref: '#/components/schemas/FTPPassivePortRange'
  5697. WebDAVServiceStatus:
  5698. type: object
  5699. properties:
  5700. is_active:
  5701. type: boolean
  5702. bindings:
  5703. type: array
  5704. items:
  5705. $ref: '#/components/schemas/WebDAVBinding'
  5706. nullable: true
  5707. DataProviderStatus:
  5708. type: object
  5709. properties:
  5710. is_active:
  5711. type: boolean
  5712. driver:
  5713. type: string
  5714. error:
  5715. type: string
  5716. MFAStatus:
  5717. type: object
  5718. properties:
  5719. is_active:
  5720. type: boolean
  5721. totp_configs:
  5722. type: array
  5723. items:
  5724. $ref: '#/components/schemas/TOTPConfig'
  5725. ServicesStatus:
  5726. type: object
  5727. properties:
  5728. ssh:
  5729. $ref: '#/components/schemas/SSHServiceStatus'
  5730. ftp:
  5731. $ref: '#/components/schemas/FTPServiceStatus'
  5732. webdav:
  5733. $ref: '#/components/schemas/WebDAVServiceStatus'
  5734. data_provider:
  5735. $ref: '#/components/schemas/DataProviderStatus'
  5736. defender:
  5737. type: object
  5738. properties:
  5739. is_active:
  5740. type: boolean
  5741. mfa:
  5742. $ref: '#/components/schemas/MFAStatus'
  5743. Share:
  5744. type: object
  5745. properties:
  5746. id:
  5747. type: string
  5748. description: auto-generated unique share identifier
  5749. name:
  5750. type: string
  5751. description:
  5752. type: string
  5753. description: optional description
  5754. scope:
  5755. $ref: '#/components/schemas/ShareScope'
  5756. paths:
  5757. type: array
  5758. items:
  5759. type: string
  5760. description: 'paths to files or directories, for share scope write this array must contain exactly one directory. Paths will not be validated on save so you can also create them after creating the share'
  5761. example:
  5762. - '/dir1'
  5763. - '/dir2/file.txt'
  5764. - '/dir3/subdir'
  5765. username:
  5766. type: string
  5767. created_at:
  5768. type: integer
  5769. format: int64
  5770. description: 'creation time as unix timestamp in milliseconds'
  5771. updated_at:
  5772. type: integer
  5773. format: int64
  5774. description: 'last update time as unix timestamp in milliseconds'
  5775. last_use_at:
  5776. type: integer
  5777. format: int64
  5778. description: last use time as unix timestamp in milliseconds
  5779. expires_at:
  5780. type: integer
  5781. format: int64
  5782. description: 'optional share expiration, as unix timestamp in milliseconds. 0 means no expiration'
  5783. password:
  5784. type: string
  5785. description: 'optional password to protect the share. The special value "[**redacted**]" means that a password has been set, you can use this value if you want to preserve the current password when you update a share'
  5786. max_tokens:
  5787. type: integer
  5788. description: 'maximum allowed access tokens. 0 means no limit'
  5789. used_tokens:
  5790. type: integer
  5791. allow_from:
  5792. type: array
  5793. items:
  5794. type: string
  5795. description: 'Limit the share availability to these IP/Mask. IP/Mask must be in CIDR notation as defined in RFC 4632 and RFC 4291, for example "192.0.2.0/24" or "2001:db8::/32". An empty list means no restrictions'
  5796. example:
  5797. - 192.0.2.0/24
  5798. - '2001:db8::/32'
  5799. GroupUserSettings:
  5800. type: object
  5801. properties:
  5802. home_dir:
  5803. type: string
  5804. max_sessions:
  5805. type: integer
  5806. format: int32
  5807. quota_size:
  5808. type: integer
  5809. format: int64
  5810. quota_files:
  5811. type: integer
  5812. format: int32
  5813. permissions:
  5814. type: object
  5815. additionalProperties:
  5816. type: array
  5817. items:
  5818. $ref: '#/components/schemas/Permission'
  5819. minItems: 1
  5820. minProperties: 1
  5821. description: 'hash map with directory as key and an array of permissions as value. Directories must be absolute paths, permissions for root directory ("/") are required'
  5822. example:
  5823. /:
  5824. - '*'
  5825. /somedir:
  5826. - list
  5827. - download
  5828. upload_bandwidth:
  5829. type: integer
  5830. description: 'Maximum upload bandwidth as KB/s'
  5831. download_bandwidth:
  5832. type: integer
  5833. description: 'Maximum download bandwidth as KB/s'
  5834. upload_data_transfer:
  5835. type: integer
  5836. description: 'Maximum data transfer allowed for uploads as MB'
  5837. download_data_transfer:
  5838. type: integer
  5839. description: 'Maximum data transfer allowed for downloads as MB'
  5840. total_data_transfer:
  5841. type: integer
  5842. description: 'Maximum total data transfer as MB'
  5843. filters:
  5844. $ref: '#/components/schemas/BaseUserFilters'
  5845. Group:
  5846. type: object
  5847. properties:
  5848. id:
  5849. type: integer
  5850. format: int32
  5851. minimum: 1
  5852. name:
  5853. type: string
  5854. description: name is unique
  5855. description:
  5856. type: string
  5857. description: 'optional description'
  5858. created_at:
  5859. type: integer
  5860. format: int64
  5861. description: creation time as unix timestamp in milliseconds
  5862. updated_at:
  5863. type: integer
  5864. format: int64
  5865. description: last update time as unix timestamp in milliseconds
  5866. user_settings:
  5867. $ref: '#/components/schemas/GroupUserSettings'
  5868. virtual_folders:
  5869. type: array
  5870. items:
  5871. $ref: '#/components/schemas/VirtualFolder'
  5872. description: mapping between virtual SFTPGo paths and folders
  5873. users:
  5874. type: array
  5875. items:
  5876. type: string
  5877. description: list of usernames associated with this group
  5878. admins:
  5879. type: array
  5880. items:
  5881. type: string
  5882. description: list of admins usernames associated with this group
  5883. GroupMapping:
  5884. type: object
  5885. properties:
  5886. name:
  5887. type: string
  5888. description: group name
  5889. type:
  5890. enum:
  5891. - 1
  5892. - 2
  5893. - 3
  5894. description: |
  5895. Group type:
  5896. * `1` - Primary group
  5897. * `2` - Secondary group
  5898. * `3` - Membership only, no settings are inherited from this group type
  5899. AdminGroupMappingOptions:
  5900. type: object
  5901. properties:
  5902. add_to_users_as:
  5903. enum:
  5904. - 0
  5905. - 1
  5906. - 2
  5907. description: |
  5908. Add to new users as:
  5909. * `0` - the admin's group will be added as membership group for new users
  5910. * `1` - the admin's group will be added as primary group for new users
  5911. * `2` - the admin's group will be added as secondary group for new users
  5912. AdminGroupMapping:
  5913. type: object
  5914. properties:
  5915. name:
  5916. type: string
  5917. description: group name
  5918. options:
  5919. $ref: '#/components/schemas/AdminGroupMappingOptions'
  5920. BackupData:
  5921. type: object
  5922. properties:
  5923. users:
  5924. type: array
  5925. items:
  5926. $ref: '#/components/schemas/User'
  5927. folders:
  5928. type: array
  5929. items:
  5930. $ref: '#/components/schemas/BaseVirtualFolder'
  5931. groups:
  5932. type: array
  5933. items:
  5934. $ref: '#/components/schemas/Group'
  5935. admins:
  5936. type: array
  5937. items:
  5938. $ref: '#/components/schemas/Admin'
  5939. api_keys:
  5940. type: array
  5941. items:
  5942. $ref: '#/components/schemas/APIKey'
  5943. shares:
  5944. type: array
  5945. items:
  5946. $ref: '#/components/schemas/Share'
  5947. version:
  5948. type: integer
  5949. PwdChange:
  5950. type: object
  5951. properties:
  5952. current_password:
  5953. type: string
  5954. new_password:
  5955. type: string
  5956. DirEntry:
  5957. type: object
  5958. properties:
  5959. name:
  5960. type: string
  5961. description: name of the file (or subdirectory) described by the entry. This name is the final element of the path (the base name), not the entire path
  5962. size:
  5963. type: integer
  5964. format: int64
  5965. description: file size, omitted for folders and non regular files
  5966. mode:
  5967. type: integer
  5968. description: |
  5969. File mode and permission bits. More details here: https://golang.org/pkg/io/fs/#FileMode.
  5970. Let's see some examples:
  5971. - for a directory mode&2147483648 != 0
  5972. - for a symlink mode&134217728 != 0
  5973. - for a regular file mode&2401763328 == 0
  5974. last_modified:
  5975. type: string
  5976. format: date-time
  5977. FsEvent:
  5978. type: object
  5979. properties:
  5980. id:
  5981. type: string
  5982. timestamp:
  5983. type: integer
  5984. format: int64
  5985. description: 'unix timestamp in nanoseconds'
  5986. action:
  5987. $ref: '#/components/schemas/FsEventAction'
  5988. username:
  5989. type: string
  5990. fs_path:
  5991. type: string
  5992. fs_target_path:
  5993. type: string
  5994. virtual_path:
  5995. type: string
  5996. virtual_target_path:
  5997. type: string
  5998. ssh_cmd:
  5999. type: string
  6000. file_size:
  6001. type: integer
  6002. format: int64
  6003. status:
  6004. $ref: '#/components/schemas/FsEventStatus'
  6005. protocol:
  6006. $ref: '#/components/schemas/EventProtocols'
  6007. ip:
  6008. type: string
  6009. session_id:
  6010. type: string
  6011. fs_provider:
  6012. $ref: '#/components/schemas/FsProviders'
  6013. bucket:
  6014. type: string
  6015. endpoint:
  6016. type: string
  6017. open_flags:
  6018. type: string
  6019. instance_id:
  6020. type: string
  6021. ProviderEvent:
  6022. type: object
  6023. properties:
  6024. id:
  6025. type: string
  6026. timestamp:
  6027. type: integer
  6028. format: int64
  6029. description: 'unix timestamp in nanoseconds'
  6030. action:
  6031. $ref: '#/components/schemas/ProviderEventAction'
  6032. username:
  6033. type: string
  6034. ip:
  6035. type: string
  6036. object_type:
  6037. $ref: '#/components/schemas/ProviderEventObjectType'
  6038. object_name:
  6039. type: string
  6040. instance_id:
  6041. type: string
  6042. KeyValue:
  6043. type: object
  6044. properties:
  6045. key:
  6046. type: string
  6047. value:
  6048. type: string
  6049. HTTPPart:
  6050. type: object
  6051. properties:
  6052. name:
  6053. type: string
  6054. headers:
  6055. type: array
  6056. items:
  6057. $ref: '#/components/schemas/KeyValue'
  6058. description: 'Additional headers. Content-Disposition header is automatically set. Content-Type header is automatically detect for files to attach'
  6059. filepath:
  6060. type: string
  6061. description: 'path to the file to be sent as an attachment'
  6062. body:
  6063. type: string
  6064. EventActionHTTPConfig:
  6065. type: object
  6066. properties:
  6067. endpoint:
  6068. type: string
  6069. description: HTTP endpoint
  6070. example: https://example.com
  6071. username:
  6072. type: string
  6073. password:
  6074. $ref: '#/components/schemas/Secret'
  6075. headers:
  6076. type: array
  6077. items:
  6078. $ref: '#/components/schemas/KeyValue'
  6079. description: headers to add
  6080. timeout:
  6081. type: integer
  6082. minimum: 1
  6083. maximum: 180
  6084. description: 'Ignored for multipart requests with files as attachments'
  6085. skip_tls_verify:
  6086. type: boolean
  6087. description: 'if enabled the HTTP client accepts any TLS certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks. This should be used only for testing.'
  6088. method:
  6089. type: string
  6090. enum:
  6091. - GET
  6092. - POST
  6093. - PUT
  6094. query_parameters:
  6095. type: array
  6096. items:
  6097. $ref: '#/components/schemas/KeyValue'
  6098. body:
  6099. type: string
  6100. description: HTTP POST/PUT body
  6101. parts:
  6102. type: array
  6103. items:
  6104. $ref: '#/components/schemas/HTTPPart'
  6105. description: 'Multipart requests allow to combine one or more sets of data into a single body. For each part, you can set a file path or a body as text. Placeholders are supported in file path, body, header values.'
  6106. EventActionCommandConfig:
  6107. type: object
  6108. properties:
  6109. cmd:
  6110. type: string
  6111. description: absolute path to the command to execute
  6112. args:
  6113. type: array
  6114. items:
  6115. type: string
  6116. description: 'command line arguments'
  6117. timeout:
  6118. type: integer
  6119. minimum: 1
  6120. maximum: 120
  6121. env_vars:
  6122. type: array
  6123. items:
  6124. $ref: '#/components/schemas/KeyValue'
  6125. EventActionEmailConfig:
  6126. type: object
  6127. properties:
  6128. recipients:
  6129. type: array
  6130. items:
  6131. type: string
  6132. subject:
  6133. type: string
  6134. body:
  6135. type: string
  6136. attachments:
  6137. type: array
  6138. items:
  6139. type: string
  6140. description: 'list of file paths to attach. The total size is limited to 10 MB'
  6141. EventActionDataRetentionConfig:
  6142. type: object
  6143. properties:
  6144. folders:
  6145. type: array
  6146. items:
  6147. $ref: '#/components/schemas/FolderRetention'
  6148. EventActionFilesystemConfig:
  6149. type: object
  6150. properties:
  6151. type:
  6152. $ref: '#/components/schemas/FilesystemActionTypes'
  6153. renames:
  6154. type: array
  6155. items:
  6156. $ref: '#/components/schemas/KeyValue'
  6157. mkdirs:
  6158. type: array
  6159. items:
  6160. type: string
  6161. deletes:
  6162. type: array
  6163. items:
  6164. type: string
  6165. exist:
  6166. type: array
  6167. items:
  6168. type: string
  6169. BaseEventActionOptions:
  6170. type: object
  6171. properties:
  6172. http_config:
  6173. $ref: '#/components/schemas/EventActionHTTPConfig'
  6174. cmd_config:
  6175. $ref: '#/components/schemas/EventActionCommandConfig'
  6176. email_config:
  6177. $ref: '#/components/schemas/EventActionEmailConfig'
  6178. retention_config:
  6179. $ref: '#/components/schemas/EventActionDataRetentionConfig'
  6180. fs_config:
  6181. $ref: '#/components/schemas/EventActionFilesystemConfig'
  6182. BaseEventAction:
  6183. type: object
  6184. properties:
  6185. id:
  6186. type: integer
  6187. format: int32
  6188. minimum: 1
  6189. name:
  6190. type: string
  6191. description: unique name
  6192. description:
  6193. type: string
  6194. description: optional description
  6195. type:
  6196. $ref: '#/components/schemas/EventActionTypes'
  6197. options:
  6198. $ref: '#/components/schemas/BaseEventActionOptions'
  6199. rules:
  6200. type: array
  6201. items:
  6202. type: string
  6203. description: list of event rules names associated with this action
  6204. EventActionOptions:
  6205. type: object
  6206. properties:
  6207. is_failure_action:
  6208. type: boolean
  6209. stop_on_failure:
  6210. type: boolean
  6211. execute_sync:
  6212. type: boolean
  6213. EventAction:
  6214. allOf:
  6215. - $ref: '#/components/schemas/BaseEventAction'
  6216. - type: object
  6217. properties:
  6218. order:
  6219. type: integer
  6220. description: execution order
  6221. relation_options:
  6222. $ref: '#/components/schemas/EventActionOptions'
  6223. EventActionMinimal:
  6224. type: object
  6225. properties:
  6226. name:
  6227. type: string
  6228. order:
  6229. type: integer
  6230. description: execution order
  6231. relation_options:
  6232. $ref: '#/components/schemas/EventActionOptions'
  6233. ConditionPattern:
  6234. type: object
  6235. properties:
  6236. pattern:
  6237. type: string
  6238. inverse_match:
  6239. type: boolean
  6240. ConditionOptions:
  6241. type: object
  6242. properties:
  6243. names:
  6244. type: array
  6245. items:
  6246. $ref: '#/components/schemas/ConditionPattern'
  6247. group_names:
  6248. type: array
  6249. items:
  6250. $ref: '#/components/schemas/ConditionPattern'
  6251. fs_paths:
  6252. type: array
  6253. items:
  6254. $ref: '#/components/schemas/ConditionPattern'
  6255. protocols:
  6256. type: array
  6257. items:
  6258. type: string
  6259. enum:
  6260. - SFTP
  6261. - SCP
  6262. - SSH
  6263. - FTP
  6264. - DAV
  6265. - HTTP
  6266. - HTTPShare
  6267. - OIDC
  6268. provider_objects:
  6269. type: array
  6270. items:
  6271. type: string
  6272. enum:
  6273. - user
  6274. - group
  6275. - admin
  6276. - api_key
  6277. - share
  6278. - event_action
  6279. - event_rule
  6280. min_size:
  6281. type: integer
  6282. format: int64
  6283. max_size:
  6284. type: integer
  6285. format: int64
  6286. concurrent_execution:
  6287. type: boolean
  6288. description: allow concurrent execution from multiple nodes
  6289. Schedule:
  6290. type: object
  6291. properties:
  6292. hour:
  6293. type: string
  6294. day_of_week:
  6295. type: string
  6296. day_of_month:
  6297. type: string
  6298. month:
  6299. type: string
  6300. EventConditions:
  6301. type: object
  6302. properties:
  6303. fs_events:
  6304. type: array
  6305. items:
  6306. type: string
  6307. enum:
  6308. - upload
  6309. - download
  6310. - delete
  6311. - rename
  6312. - mkdir
  6313. - rmdir
  6314. - ssh_cmd
  6315. provider_events:
  6316. type: array
  6317. items:
  6318. type: string
  6319. enum:
  6320. - add
  6321. - update
  6322. - delete
  6323. schedules:
  6324. type: array
  6325. items:
  6326. $ref: '#/components/schemas/Schedule'
  6327. options:
  6328. $ref: '#/components/schemas/ConditionOptions'
  6329. BaseEventRule:
  6330. type: object
  6331. properties:
  6332. id:
  6333. type: integer
  6334. format: int32
  6335. minimum: 1
  6336. name:
  6337. type: string
  6338. description: unique name
  6339. description:
  6340. type: string
  6341. description: optional description
  6342. created_at:
  6343. type: integer
  6344. format: int64
  6345. description: creation time as unix timestamp in milliseconds
  6346. updated_at:
  6347. type: integer
  6348. format: int64
  6349. description: last update time as unix timestamp in millisecond
  6350. trigger:
  6351. $ref: '#/components/schemas/EventTriggerTypes'
  6352. conditions:
  6353. $ref: '#/components/schemas/EventConditions'
  6354. EventRule:
  6355. allOf:
  6356. - $ref: '#/components/schemas/BaseEventRule'
  6357. - type: object
  6358. properties:
  6359. actions:
  6360. type: array
  6361. items:
  6362. $ref: '#/components/schemas/EventAction'
  6363. EventRuleMinimal:
  6364. allOf:
  6365. - $ref: '#/components/schemas/BaseEventRule'
  6366. - type: object
  6367. properties:
  6368. actions:
  6369. type: array
  6370. items:
  6371. $ref: '#/components/schemas/EventActionMinimal'
  6372. ApiResponse:
  6373. type: object
  6374. properties:
  6375. message:
  6376. type: string
  6377. description: 'message, can be empty'
  6378. error:
  6379. type: string
  6380. description: error description if any
  6381. VersionInfo:
  6382. type: object
  6383. properties:
  6384. version:
  6385. type: string
  6386. build_date:
  6387. type: string
  6388. commit_hash:
  6389. type: string
  6390. features:
  6391. type: array
  6392. items:
  6393. type: string
  6394. description: 'Features for the current build. Available features are `portable`, `bolt`, `mysql`, `sqlite`, `pgsql`, `s3`, `gcs`, `metrics`. If a feature is available it has a `+` prefix, otherwise a `-` prefix'
  6395. Token:
  6396. type: object
  6397. properties:
  6398. access_token:
  6399. type: string
  6400. expires_at:
  6401. type: string
  6402. format: date-time
  6403. securitySchemes:
  6404. BasicAuth:
  6405. type: http
  6406. scheme: basic
  6407. BearerAuth:
  6408. type: http
  6409. scheme: bearer
  6410. bearerFormat: JWT
  6411. APIKeyAuth:
  6412. type: apiKey
  6413. in: header
  6414. name: X-SFTPGO-API-KEY
  6415. description: 'API key to use for authentication. API key authentication is intrinsically less secure than using a short lived JWT token. You should prefer API key authentication only for machine-to-machine communications in trusted environments. If no admin/user is associated to the provided key you need to add ".username" at the end of the key. For example if your API key is "6ajKLwswLccVBGpZGv596G.ySAXc8vtp9hMiwAuaLtzof" and you want to impersonate the admin with username "myadmin" you have to use "6ajKLwswLccVBGpZGv596G.ySAXc8vtp9hMiwAuaLtzof.myadmin" as API key. When using API key authentication you cannot manage API keys, update the impersonated admin, change password or public keys for the impersonated user.'