openapi.yaml 247 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455
  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: IP Lists
  10. - name: defender
  11. - name: quota
  12. - name: folders
  13. - name: groups
  14. - name: roles
  15. - name: users
  16. - name: data retention
  17. - name: events
  18. - name: metadata
  19. - name: user APIs
  20. - name: public shares
  21. - name: event manager
  22. info:
  23. title: SFTPGo
  24. description: |
  25. SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well.
  26. 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.
  27. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one.
  28. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user.
  29. 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.
  30. 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.
  31. 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.
  32. version: 2.6.5
  33. contact:
  34. name: API support
  35. url: 'https://github.com/drakkan/sftpgo'
  36. license:
  37. name: AGPL-3.0-only
  38. url: 'https://www.gnu.org/licenses/agpl-3.0.en.html'
  39. servers:
  40. - url: /api/v2
  41. security:
  42. - BearerAuth: []
  43. - APIKeyAuth: []
  44. paths:
  45. /healthz:
  46. get:
  47. security: []
  48. servers:
  49. - url: /
  50. tags:
  51. - healthcheck
  52. summary: health check
  53. description: This endpoint can be used to check if the application is running and responding to requests
  54. operationId: healthz
  55. responses:
  56. '200':
  57. description: successful operation
  58. content:
  59. text/plain; charset=utf-8:
  60. schema:
  61. type: string
  62. example: ok
  63. /shares/{id}:
  64. parameters:
  65. - name: id
  66. in: path
  67. description: the share id
  68. required: true
  69. schema:
  70. type: string
  71. get:
  72. security:
  73. - BasicAuth: []
  74. tags:
  75. - public shares
  76. summary: Download shared files and folders as a single zip file
  77. 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
  78. operationId: get_share
  79. parameters:
  80. - in: query
  81. name: compress
  82. schema:
  83. type: boolean
  84. default: true
  85. required: false
  86. responses:
  87. '200':
  88. description: successful operation
  89. content:
  90. '*/*':
  91. schema:
  92. type: string
  93. format: binary
  94. '400':
  95. $ref: '#/components/responses/BadRequest'
  96. '401':
  97. $ref: '#/components/responses/Unauthorized'
  98. '403':
  99. $ref: '#/components/responses/Forbidden'
  100. '500':
  101. $ref: '#/components/responses/InternalServerError'
  102. default:
  103. $ref: '#/components/responses/DefaultResponse'
  104. post:
  105. security:
  106. - BasicAuth: []
  107. tags:
  108. - public shares
  109. summary: Upload one or more files to the shared path
  110. description: The share must be defined with the write scope and the associated user must have the upload permission
  111. operationId: upload_to_share
  112. requestBody:
  113. content:
  114. multipart/form-data:
  115. schema:
  116. type: object
  117. properties:
  118. filenames:
  119. type: array
  120. items:
  121. type: string
  122. format: binary
  123. minItems: 1
  124. uniqueItems: true
  125. required: true
  126. responses:
  127. '201':
  128. description: successful operation
  129. content:
  130. application/json:
  131. schema:
  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. $ref: '#/components/schemas/ApiResponse'
  297. '400':
  298. $ref: '#/components/responses/BadRequest'
  299. '401':
  300. $ref: '#/components/responses/Unauthorized'
  301. '403':
  302. $ref: '#/components/responses/Forbidden'
  303. '413':
  304. $ref: '#/components/responses/RequestEntityTooLarge'
  305. '500':
  306. $ref: '#/components/responses/InternalServerError'
  307. default:
  308. $ref: '#/components/responses/DefaultResponse'
  309. /token:
  310. get:
  311. security:
  312. - BasicAuth: []
  313. tags:
  314. - token
  315. summary: Get a new admin access token
  316. description: Returns an access token and its expiration
  317. operationId: get_token
  318. parameters:
  319. - in: header
  320. name: X-SFTPGO-OTP
  321. schema:
  322. type: string
  323. required: false
  324. description: 'If you have 2FA configured for the admin attempting to log in you need to set the authentication code using this header parameter'
  325. responses:
  326. '200':
  327. description: successful operation
  328. content:
  329. application/json:
  330. schema:
  331. $ref: '#/components/schemas/Token'
  332. '401':
  333. $ref: '#/components/responses/Unauthorized'
  334. '403':
  335. $ref: '#/components/responses/Forbidden'
  336. '500':
  337. $ref: '#/components/responses/InternalServerError'
  338. default:
  339. $ref: '#/components/responses/DefaultResponse'
  340. /logout:
  341. get:
  342. security:
  343. - BearerAuth: []
  344. tags:
  345. - token
  346. summary: Invalidate an admin access token
  347. description: Allows to invalidate an admin token before its expiration
  348. operationId: logout
  349. responses:
  350. '200':
  351. description: successful operation
  352. content:
  353. application/json:
  354. schema:
  355. $ref: '#/components/schemas/ApiResponse'
  356. '401':
  357. $ref: '#/components/responses/Unauthorized'
  358. '403':
  359. $ref: '#/components/responses/Forbidden'
  360. '500':
  361. $ref: '#/components/responses/InternalServerError'
  362. default:
  363. $ref: '#/components/responses/DefaultResponse'
  364. /user/token:
  365. get:
  366. security:
  367. - BasicAuth: []
  368. tags:
  369. - token
  370. summary: Get a new user access token
  371. description: Returns an access token and its expiration
  372. operationId: get_user_token
  373. parameters:
  374. - in: header
  375. name: X-SFTPGO-OTP
  376. schema:
  377. type: string
  378. required: false
  379. 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'
  380. responses:
  381. '200':
  382. description: successful operation
  383. content:
  384. application/json:
  385. schema:
  386. $ref: '#/components/schemas/Token'
  387. '401':
  388. $ref: '#/components/responses/Unauthorized'
  389. '403':
  390. $ref: '#/components/responses/Forbidden'
  391. '500':
  392. $ref: '#/components/responses/InternalServerError'
  393. default:
  394. $ref: '#/components/responses/DefaultResponse'
  395. /user/logout:
  396. get:
  397. security:
  398. - BearerAuth: []
  399. tags:
  400. - token
  401. summary: Invalidate a user access token
  402. description: Allows to invalidate a client token before its expiration
  403. operationId: client_logout
  404. responses:
  405. '200':
  406. description: successful operation
  407. content:
  408. application/json:
  409. schema:
  410. $ref: '#/components/schemas/ApiResponse'
  411. '401':
  412. $ref: '#/components/responses/Unauthorized'
  413. '403':
  414. $ref: '#/components/responses/Forbidden'
  415. '500':
  416. $ref: '#/components/responses/InternalServerError'
  417. default:
  418. $ref: '#/components/responses/DefaultResponse'
  419. /version:
  420. get:
  421. tags:
  422. - maintenance
  423. summary: Get version details
  424. description: 'Returns version details such as the version number, build date, commit hash and enabled features'
  425. operationId: get_version
  426. responses:
  427. '200':
  428. description: successful operation
  429. content:
  430. application/json:
  431. schema:
  432. $ref: '#/components/schemas/VersionInfo'
  433. '401':
  434. $ref: '#/components/responses/Unauthorized'
  435. '403':
  436. $ref: '#/components/responses/Forbidden'
  437. '500':
  438. $ref: '#/components/responses/InternalServerError'
  439. default:
  440. $ref: '#/components/responses/DefaultResponse'
  441. /admin/changepwd:
  442. put:
  443. security:
  444. - BearerAuth: []
  445. tags:
  446. - admins
  447. summary: Change admin password
  448. description: Changes the password for the logged in admin
  449. operationId: change_admin_password
  450. requestBody:
  451. required: true
  452. content:
  453. application/json:
  454. schema:
  455. $ref: '#/components/schemas/PwdChange'
  456. responses:
  457. '200':
  458. description: successful operation
  459. content:
  460. application/json:
  461. schema:
  462. $ref: '#/components/schemas/ApiResponse'
  463. '401':
  464. $ref: '#/components/responses/Unauthorized'
  465. '403':
  466. $ref: '#/components/responses/Forbidden'
  467. '500':
  468. $ref: '#/components/responses/InternalServerError'
  469. default:
  470. $ref: '#/components/responses/DefaultResponse'
  471. /admin/profile:
  472. get:
  473. security:
  474. - BearerAuth: []
  475. tags:
  476. - admins
  477. summary: Get admin profile
  478. description: 'Returns the profile for the logged in admin'
  479. operationId: get_admin_profile
  480. responses:
  481. '200':
  482. description: successful operation
  483. content:
  484. application/json:
  485. schema:
  486. $ref: '#/components/schemas/AdminProfile'
  487. '401':
  488. $ref: '#/components/responses/Unauthorized'
  489. '403':
  490. $ref: '#/components/responses/Forbidden'
  491. '500':
  492. $ref: '#/components/responses/InternalServerError'
  493. default:
  494. $ref: '#/components/responses/DefaultResponse'
  495. put:
  496. security:
  497. - BearerAuth: []
  498. tags:
  499. - admins
  500. summary: Update admin profile
  501. description: 'Allows to update the profile for the logged in admin'
  502. operationId: update_admin_profile
  503. requestBody:
  504. required: true
  505. content:
  506. application/json:
  507. schema:
  508. $ref: '#/components/schemas/AdminProfile'
  509. responses:
  510. '200':
  511. description: successful operation
  512. content:
  513. application/json:
  514. schema:
  515. $ref: '#/components/schemas/ApiResponse'
  516. '400':
  517. $ref: '#/components/responses/BadRequest'
  518. '401':
  519. $ref: '#/components/responses/Unauthorized'
  520. '403':
  521. $ref: '#/components/responses/Forbidden'
  522. '500':
  523. $ref: '#/components/responses/InternalServerError'
  524. default:
  525. $ref: '#/components/responses/DefaultResponse'
  526. /admin/2fa/recoverycodes:
  527. get:
  528. security:
  529. - BearerAuth: []
  530. tags:
  531. - admins
  532. summary: Get recovery codes
  533. 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'
  534. operationId: get_admin_recovery_codes
  535. responses:
  536. '200':
  537. description: successful operation
  538. content:
  539. application/json:
  540. schema:
  541. type: array
  542. items:
  543. $ref: '#/components/schemas/RecoveryCode'
  544. '401':
  545. $ref: '#/components/responses/Unauthorized'
  546. '403':
  547. $ref: '#/components/responses/Forbidden'
  548. '500':
  549. $ref: '#/components/responses/InternalServerError'
  550. default:
  551. $ref: '#/components/responses/DefaultResponse'
  552. post:
  553. security:
  554. - BearerAuth: []
  555. tags:
  556. - admins
  557. summary: Generate recovery codes
  558. description: 'Generates new recovery codes for the logged in admin. Generating new recovery codes you automatically invalidate old ones'
  559. operationId: generate_admin_recovery_codes
  560. responses:
  561. '200':
  562. description: successful operation
  563. content:
  564. application/json:
  565. schema:
  566. type: array
  567. items:
  568. type: string
  569. '400':
  570. $ref: '#/components/responses/BadRequest'
  571. '401':
  572. $ref: '#/components/responses/Unauthorized'
  573. '403':
  574. $ref: '#/components/responses/Forbidden'
  575. '500':
  576. $ref: '#/components/responses/InternalServerError'
  577. default:
  578. $ref: '#/components/responses/DefaultResponse'
  579. /admin/totp/configs:
  580. get:
  581. security:
  582. - BearerAuth: []
  583. tags:
  584. - admins
  585. summary: Get available TOTP configuration
  586. description: Returns the available TOTP configurations for the logged in admin
  587. operationId: get_admin_totp_configs
  588. responses:
  589. '200':
  590. description: successful operation
  591. content:
  592. application/json:
  593. schema:
  594. type: array
  595. items:
  596. $ref: '#/components/schemas/TOTPConfig'
  597. '401':
  598. $ref: '#/components/responses/Unauthorized'
  599. '403':
  600. $ref: '#/components/responses/Forbidden'
  601. '500':
  602. $ref: '#/components/responses/InternalServerError'
  603. default:
  604. $ref: '#/components/responses/DefaultResponse'
  605. /admin/totp/generate:
  606. post:
  607. security:
  608. - BearerAuth: []
  609. tags:
  610. - admins
  611. summary: Generate a new TOTP secret
  612. description: 'Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in admin'
  613. operationId: generate_admin_totp_secret
  614. requestBody:
  615. required: true
  616. content:
  617. application/json:
  618. schema:
  619. type: object
  620. properties:
  621. config_name:
  622. type: string
  623. description: 'name of the configuration to use to generate the secret'
  624. responses:
  625. '200':
  626. description: successful operation
  627. content:
  628. application/json:
  629. schema:
  630. type: object
  631. properties:
  632. config_name:
  633. type: string
  634. issuer:
  635. type: string
  636. secret:
  637. type: string
  638. url:
  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. /iplists/{type}:
  790. parameters:
  791. - name: type
  792. in: path
  793. description: IP list type
  794. required: true
  795. schema:
  796. $ref: '#/components/schemas/IPListType'
  797. get:
  798. tags:
  799. - IP Lists
  800. summary: Get IP list entries
  801. description: Returns an array with one or more IP list entry
  802. operationId: get_ip_list_entries
  803. parameters:
  804. - in: query
  805. name: filter
  806. schema:
  807. type: string
  808. description: restrict results to ipornet matching or starting with this filter
  809. - in: query
  810. name: from
  811. schema:
  812. type: string
  813. description: ipornet to start from
  814. required: false
  815. - in: query
  816. name: limit
  817. schema:
  818. type: integer
  819. minimum: 1
  820. maximum: 500
  821. default: 100
  822. required: false
  823. description: 'The maximum number of items to return. Max value is 500, default is 100'
  824. - in: query
  825. name: order
  826. required: false
  827. description: Ordering entries by ipornet field. Default ASC
  828. schema:
  829. type: string
  830. enum:
  831. - ASC
  832. - DESC
  833. example: ASC
  834. responses:
  835. '200':
  836. description: successful operation
  837. content:
  838. application/json:
  839. schema:
  840. type: array
  841. items:
  842. $ref: '#/components/schemas/IPListEntry'
  843. '400':
  844. $ref: '#/components/responses/BadRequest'
  845. '401':
  846. $ref: '#/components/responses/Unauthorized'
  847. '403':
  848. $ref: '#/components/responses/Forbidden'
  849. '500':
  850. $ref: '#/components/responses/InternalServerError'
  851. default:
  852. $ref: '#/components/responses/DefaultResponse'
  853. post:
  854. tags:
  855. - IP Lists
  856. summary: Add a new IP list entry
  857. description: Add an IP address or a CIDR network to a supported list
  858. operationId: add_ip_list_entry
  859. requestBody:
  860. required: true
  861. content:
  862. application/json:
  863. schema:
  864. $ref: '#/components/schemas/IPListEntry'
  865. responses:
  866. '201':
  867. description: successful operation
  868. headers:
  869. Location:
  870. schema:
  871. type: string
  872. description: 'URI of the newly created object'
  873. content:
  874. application/json:
  875. schema:
  876. $ref: '#/components/schemas/ApiResponse'
  877. example:
  878. message: Entry added
  879. '400':
  880. $ref: '#/components/responses/BadRequest'
  881. '401':
  882. $ref: '#/components/responses/Unauthorized'
  883. '403':
  884. $ref: '#/components/responses/Forbidden'
  885. '500':
  886. $ref: '#/components/responses/InternalServerError'
  887. default:
  888. $ref: '#/components/responses/DefaultResponse'
  889. /iplists/{type}/{ipornet}:
  890. parameters:
  891. - name: type
  892. in: path
  893. description: IP list type
  894. required: true
  895. schema:
  896. $ref: '#/components/schemas/IPListType'
  897. - name: ipornet
  898. in: path
  899. required: true
  900. schema:
  901. type: string
  902. get:
  903. tags:
  904. - IP Lists
  905. summary: Find entry by ipornet
  906. description: Returns the entry with the given ipornet if it exists.
  907. operationId: get_ip_list_by_ipornet
  908. responses:
  909. '200':
  910. description: successful operation
  911. content:
  912. application/json:
  913. schema:
  914. $ref: '#/components/schemas/IPListEntry'
  915. '400':
  916. $ref: '#/components/responses/BadRequest'
  917. '401':
  918. $ref: '#/components/responses/Unauthorized'
  919. '403':
  920. $ref: '#/components/responses/Forbidden'
  921. '404':
  922. $ref: '#/components/responses/NotFound'
  923. '500':
  924. $ref: '#/components/responses/InternalServerError'
  925. default:
  926. $ref: '#/components/responses/DefaultResponse'
  927. put:
  928. tags:
  929. - IP Lists
  930. summary: Update IP list entry
  931. description: Updates an existing IP list entry
  932. operationId: update_ip_list_entry
  933. requestBody:
  934. required: true
  935. content:
  936. application/json:
  937. schema:
  938. $ref: '#/components/schemas/IPListEntry'
  939. responses:
  940. '200':
  941. description: successful operation
  942. content:
  943. application/json:
  944. schema:
  945. $ref: '#/components/schemas/ApiResponse'
  946. example:
  947. message: Entry updated
  948. '400':
  949. $ref: '#/components/responses/BadRequest'
  950. '401':
  951. $ref: '#/components/responses/Unauthorized'
  952. '403':
  953. $ref: '#/components/responses/Forbidden'
  954. '404':
  955. $ref: '#/components/responses/NotFound'
  956. '500':
  957. $ref: '#/components/responses/InternalServerError'
  958. default:
  959. $ref: '#/components/responses/DefaultResponse'
  960. delete:
  961. tags:
  962. - IP Lists
  963. summary: Delete IP list entry
  964. description: Deletes an existing IP list entry
  965. operationId: delete_ip_list_entry
  966. responses:
  967. '200':
  968. description: successful operation
  969. content:
  970. application/json:
  971. schema:
  972. $ref: '#/components/schemas/ApiResponse'
  973. example:
  974. message: Entry deleted
  975. '400':
  976. $ref: '#/components/responses/BadRequest'
  977. '401':
  978. $ref: '#/components/responses/Unauthorized'
  979. '403':
  980. $ref: '#/components/responses/Forbidden'
  981. '404':
  982. $ref: '#/components/responses/NotFound'
  983. '500':
  984. $ref: '#/components/responses/InternalServerError'
  985. default:
  986. $ref: '#/components/responses/DefaultResponse'
  987. /defender/hosts:
  988. get:
  989. tags:
  990. - defender
  991. summary: Get hosts
  992. description: Returns hosts that are banned or for which some violations have been detected
  993. operationId: get_defender_hosts
  994. responses:
  995. '200':
  996. description: successful operation
  997. content:
  998. application/json:
  999. schema:
  1000. type: array
  1001. items:
  1002. $ref: '#/components/schemas/DefenderEntry'
  1003. '401':
  1004. $ref: '#/components/responses/Unauthorized'
  1005. '403':
  1006. $ref: '#/components/responses/Forbidden'
  1007. '404':
  1008. $ref: '#/components/responses/NotFound'
  1009. '500':
  1010. $ref: '#/components/responses/InternalServerError'
  1011. default:
  1012. $ref: '#/components/responses/DefaultResponse'
  1013. /defender/hosts/{id}:
  1014. parameters:
  1015. - name: id
  1016. in: path
  1017. description: host id
  1018. required: true
  1019. schema:
  1020. type: string
  1021. get:
  1022. tags:
  1023. - defender
  1024. summary: Get host by id
  1025. description: Returns the host with the given id, if it exists
  1026. operationId: get_defender_host_by_id
  1027. responses:
  1028. '200':
  1029. description: successful operation
  1030. content:
  1031. application/json:
  1032. schema:
  1033. $ref: '#/components/schemas/DefenderEntry'
  1034. '401':
  1035. $ref: '#/components/responses/Unauthorized'
  1036. '403':
  1037. $ref: '#/components/responses/Forbidden'
  1038. '404':
  1039. $ref: '#/components/responses/NotFound'
  1040. '500':
  1041. $ref: '#/components/responses/InternalServerError'
  1042. default:
  1043. $ref: '#/components/responses/DefaultResponse'
  1044. delete:
  1045. tags:
  1046. - defender
  1047. summary: Removes a host from the defender lists
  1048. description: Unbans the specified host or clears its violations
  1049. operationId: delete_defender_host_by_id
  1050. responses:
  1051. '200':
  1052. description: successful operation
  1053. content:
  1054. application/json:
  1055. schema:
  1056. $ref: '#/components/schemas/ApiResponse'
  1057. '401':
  1058. $ref: '#/components/responses/Unauthorized'
  1059. '403':
  1060. $ref: '#/components/responses/Forbidden'
  1061. '404':
  1062. $ref: '#/components/responses/NotFound'
  1063. '500':
  1064. $ref: '#/components/responses/InternalServerError'
  1065. default:
  1066. $ref: '#/components/responses/DefaultResponse'
  1067. /retention/users/checks:
  1068. get:
  1069. tags:
  1070. - data retention
  1071. summary: Get retention checks
  1072. description: Returns the active retention checks
  1073. operationId: get_users_retention_checks
  1074. responses:
  1075. '200':
  1076. description: successful operation
  1077. content:
  1078. application/json:
  1079. schema:
  1080. type: array
  1081. items:
  1082. $ref: '#/components/schemas/RetentionCheck'
  1083. '401':
  1084. $ref: '#/components/responses/Unauthorized'
  1085. '403':
  1086. $ref: '#/components/responses/Forbidden'
  1087. '500':
  1088. $ref: '#/components/responses/InternalServerError'
  1089. default:
  1090. $ref: '#/components/responses/DefaultResponse'
  1091. /retention/users/{username}/check:
  1092. parameters:
  1093. - name: username
  1094. in: path
  1095. description: the username
  1096. required: true
  1097. schema:
  1098. type: string
  1099. - name: notifications
  1100. in: query
  1101. description: 'specify how to notify results'
  1102. explode: false
  1103. schema:
  1104. type: array
  1105. items:
  1106. $ref: '#/components/schemas/RetentionCheckNotification'
  1107. post:
  1108. tags:
  1109. - data retention
  1110. summary: Start a retention check
  1111. 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'
  1112. operationId: start_user_retention_check
  1113. requestBody:
  1114. required: true
  1115. description: 'Defines virtual paths to check and their retention time in hours'
  1116. content:
  1117. application/json:
  1118. schema:
  1119. type: array
  1120. items:
  1121. $ref: '#/components/schemas/FolderRetention'
  1122. responses:
  1123. '202':
  1124. description: successful operation
  1125. content:
  1126. application/json:
  1127. schema:
  1128. $ref: '#/components/schemas/ApiResponse'
  1129. example:
  1130. message: Check started
  1131. '400':
  1132. $ref: '#/components/responses/BadRequest'
  1133. '401':
  1134. $ref: '#/components/responses/Unauthorized'
  1135. '403':
  1136. $ref: '#/components/responses/Forbidden'
  1137. '404':
  1138. $ref: '#/components/responses/NotFound'
  1139. '409':
  1140. $ref: '#/components/responses/Conflict'
  1141. '500':
  1142. $ref: '#/components/responses/InternalServerError'
  1143. default:
  1144. $ref: '#/components/responses/DefaultResponse'
  1145. /quotas/users/scans:
  1146. get:
  1147. tags:
  1148. - quota
  1149. summary: Get active user quota scans
  1150. description: Returns the active user quota scans
  1151. operationId: get_users_quota_scans
  1152. responses:
  1153. '200':
  1154. description: successful operation
  1155. content:
  1156. application/json:
  1157. schema:
  1158. type: array
  1159. items:
  1160. $ref: '#/components/schemas/QuotaScan'
  1161. '401':
  1162. $ref: '#/components/responses/Unauthorized'
  1163. '403':
  1164. $ref: '#/components/responses/Forbidden'
  1165. '500':
  1166. $ref: '#/components/responses/InternalServerError'
  1167. default:
  1168. $ref: '#/components/responses/DefaultResponse'
  1169. /quotas/users/{username}/scan:
  1170. parameters:
  1171. - name: username
  1172. in: path
  1173. description: the username
  1174. required: true
  1175. schema:
  1176. type: string
  1177. post:
  1178. tags:
  1179. - quota
  1180. summary: Start a user quota scan
  1181. 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
  1182. operationId: start_user_quota_scan
  1183. responses:
  1184. '202':
  1185. description: successful operation
  1186. content:
  1187. application/json:
  1188. schema:
  1189. $ref: '#/components/schemas/ApiResponse'
  1190. example:
  1191. message: Scan started
  1192. '400':
  1193. $ref: '#/components/responses/BadRequest'
  1194. '401':
  1195. $ref: '#/components/responses/Unauthorized'
  1196. '403':
  1197. $ref: '#/components/responses/Forbidden'
  1198. '404':
  1199. $ref: '#/components/responses/NotFound'
  1200. '409':
  1201. $ref: '#/components/responses/Conflict'
  1202. '500':
  1203. $ref: '#/components/responses/InternalServerError'
  1204. default:
  1205. $ref: '#/components/responses/DefaultResponse'
  1206. /quotas/users/{username}/usage:
  1207. parameters:
  1208. - name: username
  1209. in: path
  1210. description: the username
  1211. required: true
  1212. schema:
  1213. type: string
  1214. - in: query
  1215. name: mode
  1216. required: false
  1217. description: the update mode specifies if the given quota usage values should be added or replace the current ones
  1218. schema:
  1219. type: string
  1220. enum:
  1221. - add
  1222. - reset
  1223. description: |
  1224. Update type:
  1225. * `add` - add the specified quota limits to the current used ones
  1226. * `reset` - reset the values to the specified ones. This is the default
  1227. example: reset
  1228. put:
  1229. tags:
  1230. - quota
  1231. summary: Update disk quota usage limits
  1232. description: Sets the current used quota limits for the given user
  1233. operationId: user_quota_update_usage
  1234. requestBody:
  1235. required: true
  1236. 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'
  1237. content:
  1238. application/json:
  1239. schema:
  1240. $ref: '#/components/schemas/QuotaUsage'
  1241. responses:
  1242. '200':
  1243. description: successful operation
  1244. content:
  1245. application/json:
  1246. schema:
  1247. $ref: '#/components/schemas/ApiResponse'
  1248. example:
  1249. message: Quota updated
  1250. '400':
  1251. $ref: '#/components/responses/BadRequest'
  1252. '401':
  1253. $ref: '#/components/responses/Unauthorized'
  1254. '403':
  1255. $ref: '#/components/responses/Forbidden'
  1256. '404':
  1257. $ref: '#/components/responses/NotFound'
  1258. '409':
  1259. $ref: '#/components/responses/Conflict'
  1260. '500':
  1261. $ref: '#/components/responses/InternalServerError'
  1262. default:
  1263. $ref: '#/components/responses/DefaultResponse'
  1264. /quotas/users/{username}/transfer-usage:
  1265. parameters:
  1266. - name: username
  1267. in: path
  1268. description: the username
  1269. required: true
  1270. schema:
  1271. type: string
  1272. - in: query
  1273. name: mode
  1274. required: false
  1275. description: the update mode specifies if the given quota usage values should be added or replace the current ones
  1276. schema:
  1277. type: string
  1278. enum:
  1279. - add
  1280. - reset
  1281. description: |
  1282. Update type:
  1283. * `add` - add the specified quota limits to the current used ones
  1284. * `reset` - reset the values to the specified ones. This is the default
  1285. example: reset
  1286. put:
  1287. tags:
  1288. - quota
  1289. summary: Update transfer quota usage limits
  1290. description: Sets the current used transfer quota limits for the given user
  1291. operationId: user_transfer_quota_update_usage
  1292. requestBody:
  1293. required: true
  1294. 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'
  1295. content:
  1296. application/json:
  1297. schema:
  1298. $ref: '#/components/schemas/TransferQuotaUsage'
  1299. responses:
  1300. '200':
  1301. description: successful operation
  1302. content:
  1303. application/json:
  1304. schema:
  1305. $ref: '#/components/schemas/ApiResponse'
  1306. example:
  1307. message: Quota updated
  1308. '400':
  1309. $ref: '#/components/responses/BadRequest'
  1310. '401':
  1311. $ref: '#/components/responses/Unauthorized'
  1312. '403':
  1313. $ref: '#/components/responses/Forbidden'
  1314. '404':
  1315. $ref: '#/components/responses/NotFound'
  1316. '409':
  1317. $ref: '#/components/responses/Conflict'
  1318. '500':
  1319. $ref: '#/components/responses/InternalServerError'
  1320. default:
  1321. $ref: '#/components/responses/DefaultResponse'
  1322. /quotas/folders/scans:
  1323. get:
  1324. tags:
  1325. - quota
  1326. summary: Get active folder quota scans
  1327. description: Returns the active folder quota scans
  1328. operationId: get_folders_quota_scans
  1329. responses:
  1330. '200':
  1331. description: successful operation
  1332. content:
  1333. application/json:
  1334. schema:
  1335. type: array
  1336. items:
  1337. $ref: '#/components/schemas/FolderQuotaScan'
  1338. '401':
  1339. $ref: '#/components/responses/Unauthorized'
  1340. '403':
  1341. $ref: '#/components/responses/Forbidden'
  1342. '500':
  1343. $ref: '#/components/responses/InternalServerError'
  1344. default:
  1345. $ref: '#/components/responses/DefaultResponse'
  1346. /quotas/folders/{name}/scan:
  1347. parameters:
  1348. - name: name
  1349. in: path
  1350. description: folder name
  1351. required: true
  1352. schema:
  1353. type: string
  1354. post:
  1355. tags:
  1356. - quota
  1357. summary: Start a folder quota scan
  1358. 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
  1359. operationId: start_folder_quota_scan
  1360. responses:
  1361. '202':
  1362. description: successful operation
  1363. content:
  1364. application/json:
  1365. schema:
  1366. $ref: '#/components/schemas/ApiResponse'
  1367. example:
  1368. message: Scan started
  1369. '400':
  1370. $ref: '#/components/responses/BadRequest'
  1371. '401':
  1372. $ref: '#/components/responses/Unauthorized'
  1373. '403':
  1374. $ref: '#/components/responses/Forbidden'
  1375. '404':
  1376. $ref: '#/components/responses/NotFound'
  1377. '409':
  1378. $ref: '#/components/responses/Conflict'
  1379. '500':
  1380. $ref: '#/components/responses/InternalServerError'
  1381. default:
  1382. $ref: '#/components/responses/DefaultResponse'
  1383. /quotas/folders/{name}/usage:
  1384. parameters:
  1385. - name: name
  1386. in: path
  1387. description: folder name
  1388. required: true
  1389. schema:
  1390. type: string
  1391. - in: query
  1392. name: mode
  1393. required: false
  1394. description: the update mode specifies if the given quota usage values should be added or replace the current ones
  1395. schema:
  1396. type: string
  1397. enum:
  1398. - add
  1399. - reset
  1400. description: |
  1401. Update type:
  1402. * `add` - add the specified quota limits to the current used ones
  1403. * `reset` - reset the values to the specified ones. This is the default
  1404. example: reset
  1405. put:
  1406. tags:
  1407. - quota
  1408. summary: Update folder quota usage limits
  1409. description: Sets the current used quota limits for the given folder
  1410. operationId: folder_quota_update_usage
  1411. parameters:
  1412. - in: query
  1413. name: mode
  1414. required: false
  1415. description: the update mode specifies if the given quota usage values should be added or replace the current ones
  1416. schema:
  1417. type: string
  1418. enum:
  1419. - add
  1420. - reset
  1421. description: |
  1422. Update type:
  1423. * `add` - add the specified quota limits to the current used ones
  1424. * `reset` - reset the values to the specified ones. This is the default
  1425. example: reset
  1426. requestBody:
  1427. required: true
  1428. 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'
  1429. content:
  1430. application/json:
  1431. schema:
  1432. $ref: '#/components/schemas/QuotaUsage'
  1433. responses:
  1434. '200':
  1435. description: successful operation
  1436. content:
  1437. application/json:
  1438. schema:
  1439. $ref: '#/components/schemas/ApiResponse'
  1440. example:
  1441. message: Quota updated
  1442. '400':
  1443. $ref: '#/components/responses/BadRequest'
  1444. '401':
  1445. $ref: '#/components/responses/Unauthorized'
  1446. '403':
  1447. $ref: '#/components/responses/Forbidden'
  1448. '404':
  1449. $ref: '#/components/responses/NotFound'
  1450. '409':
  1451. $ref: '#/components/responses/Conflict'
  1452. '500':
  1453. $ref: '#/components/responses/InternalServerError'
  1454. default:
  1455. $ref: '#/components/responses/DefaultResponse'
  1456. /folders:
  1457. get:
  1458. tags:
  1459. - folders
  1460. summary: Get folders
  1461. description: Returns an array with one or more folders
  1462. operationId: get_folders
  1463. parameters:
  1464. - in: query
  1465. name: offset
  1466. schema:
  1467. type: integer
  1468. minimum: 0
  1469. default: 0
  1470. required: false
  1471. - in: query
  1472. name: limit
  1473. schema:
  1474. type: integer
  1475. minimum: 1
  1476. maximum: 500
  1477. default: 100
  1478. required: false
  1479. description: 'The maximum number of items to return. Max value is 500, default is 100'
  1480. - in: query
  1481. name: order
  1482. required: false
  1483. description: Ordering folders by name. Default ASC
  1484. schema:
  1485. type: string
  1486. enum:
  1487. - ASC
  1488. - DESC
  1489. example: ASC
  1490. responses:
  1491. '200':
  1492. description: successful operation
  1493. content:
  1494. application/json:
  1495. schema:
  1496. type: array
  1497. items:
  1498. $ref: '#/components/schemas/BaseVirtualFolder'
  1499. '400':
  1500. $ref: '#/components/responses/BadRequest'
  1501. '401':
  1502. $ref: '#/components/responses/Unauthorized'
  1503. '403':
  1504. $ref: '#/components/responses/Forbidden'
  1505. '500':
  1506. $ref: '#/components/responses/InternalServerError'
  1507. default:
  1508. $ref: '#/components/responses/DefaultResponse'
  1509. post:
  1510. tags:
  1511. - folders
  1512. summary: Add folder
  1513. operationId: add_folder
  1514. description: Adds a new folder. A quota scan is required to update the used files/size
  1515. parameters:
  1516. - in: query
  1517. name: confidential_data
  1518. schema:
  1519. type: integer
  1520. description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.'
  1521. requestBody:
  1522. required: true
  1523. content:
  1524. application/json:
  1525. schema:
  1526. $ref: '#/components/schemas/BaseVirtualFolder'
  1527. responses:
  1528. '201':
  1529. description: successful operation
  1530. headers:
  1531. Location:
  1532. schema:
  1533. type: string
  1534. description: 'URI of the newly created object'
  1535. content:
  1536. application/json:
  1537. schema:
  1538. $ref: '#/components/schemas/BaseVirtualFolder'
  1539. '400':
  1540. $ref: '#/components/responses/BadRequest'
  1541. '401':
  1542. $ref: '#/components/responses/Unauthorized'
  1543. '403':
  1544. $ref: '#/components/responses/Forbidden'
  1545. '500':
  1546. $ref: '#/components/responses/InternalServerError'
  1547. default:
  1548. $ref: '#/components/responses/DefaultResponse'
  1549. '/folders/{name}':
  1550. parameters:
  1551. - name: name
  1552. in: path
  1553. description: folder name
  1554. required: true
  1555. schema:
  1556. type: string
  1557. get:
  1558. tags:
  1559. - folders
  1560. summary: Find folders by name
  1561. description: Returns the folder with the given name if it exists.
  1562. operationId: get_folder_by_name
  1563. parameters:
  1564. - in: query
  1565. name: confidential_data
  1566. schema:
  1567. type: integer
  1568. description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.'
  1569. responses:
  1570. '200':
  1571. description: successful operation
  1572. content:
  1573. application/json:
  1574. schema:
  1575. $ref: '#/components/schemas/BaseVirtualFolder'
  1576. '400':
  1577. $ref: '#/components/responses/BadRequest'
  1578. '401':
  1579. $ref: '#/components/responses/Unauthorized'
  1580. '403':
  1581. $ref: '#/components/responses/Forbidden'
  1582. '404':
  1583. $ref: '#/components/responses/NotFound'
  1584. '500':
  1585. $ref: '#/components/responses/InternalServerError'
  1586. default:
  1587. $ref: '#/components/responses/DefaultResponse'
  1588. put:
  1589. tags:
  1590. - folders
  1591. summary: Update folder
  1592. description: Updates an existing folder
  1593. operationId: update_folder
  1594. requestBody:
  1595. required: true
  1596. content:
  1597. application/json:
  1598. schema:
  1599. $ref: '#/components/schemas/BaseVirtualFolder'
  1600. responses:
  1601. '200':
  1602. description: successful operation
  1603. content:
  1604. application/json:
  1605. schema:
  1606. $ref: '#/components/schemas/ApiResponse'
  1607. example:
  1608. message: Folder updated
  1609. '400':
  1610. $ref: '#/components/responses/BadRequest'
  1611. '401':
  1612. $ref: '#/components/responses/Unauthorized'
  1613. '403':
  1614. $ref: '#/components/responses/Forbidden'
  1615. '404':
  1616. $ref: '#/components/responses/NotFound'
  1617. '500':
  1618. $ref: '#/components/responses/InternalServerError'
  1619. default:
  1620. $ref: '#/components/responses/DefaultResponse'
  1621. delete:
  1622. tags:
  1623. - folders
  1624. summary: Delete folder
  1625. description: Deletes an existing folder
  1626. operationId: delete_folder
  1627. responses:
  1628. '200':
  1629. description: successful operation
  1630. content:
  1631. application/json:
  1632. schema:
  1633. $ref: '#/components/schemas/ApiResponse'
  1634. example:
  1635. message: User deleted
  1636. '400':
  1637. $ref: '#/components/responses/BadRequest'
  1638. '401':
  1639. $ref: '#/components/responses/Unauthorized'
  1640. '403':
  1641. $ref: '#/components/responses/Forbidden'
  1642. '404':
  1643. $ref: '#/components/responses/NotFound'
  1644. '500':
  1645. $ref: '#/components/responses/InternalServerError'
  1646. default:
  1647. $ref: '#/components/responses/DefaultResponse'
  1648. /groups:
  1649. get:
  1650. tags:
  1651. - groups
  1652. summary: Get groups
  1653. description: Returns an array with one or more groups
  1654. operationId: get_groups
  1655. parameters:
  1656. - in: query
  1657. name: offset
  1658. schema:
  1659. type: integer
  1660. minimum: 0
  1661. default: 0
  1662. required: false
  1663. - in: query
  1664. name: limit
  1665. schema:
  1666. type: integer
  1667. minimum: 1
  1668. maximum: 500
  1669. default: 100
  1670. required: false
  1671. description: 'The maximum number of items to return. Max value is 500, default is 100'
  1672. - in: query
  1673. name: order
  1674. required: false
  1675. description: Ordering groups by name. Default ASC
  1676. schema:
  1677. type: string
  1678. enum:
  1679. - ASC
  1680. - DESC
  1681. example: ASC
  1682. responses:
  1683. '200':
  1684. description: successful operation
  1685. content:
  1686. application/json:
  1687. schema:
  1688. type: array
  1689. items:
  1690. $ref: '#/components/schemas/Group'
  1691. '400':
  1692. $ref: '#/components/responses/BadRequest'
  1693. '401':
  1694. $ref: '#/components/responses/Unauthorized'
  1695. '403':
  1696. $ref: '#/components/responses/Forbidden'
  1697. '500':
  1698. $ref: '#/components/responses/InternalServerError'
  1699. default:
  1700. $ref: '#/components/responses/DefaultResponse'
  1701. post:
  1702. tags:
  1703. - groups
  1704. summary: Add group
  1705. operationId: add_group
  1706. description: Adds a new group
  1707. parameters:
  1708. - in: query
  1709. name: confidential_data
  1710. schema:
  1711. type: integer
  1712. description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.'
  1713. requestBody:
  1714. required: true
  1715. content:
  1716. application/json:
  1717. schema:
  1718. $ref: '#/components/schemas/Group'
  1719. responses:
  1720. '201':
  1721. description: successful operation
  1722. headers:
  1723. Location:
  1724. schema:
  1725. type: string
  1726. description: 'URI of the newly created object'
  1727. content:
  1728. application/json:
  1729. schema:
  1730. $ref: '#/components/schemas/Group'
  1731. '400':
  1732. $ref: '#/components/responses/BadRequest'
  1733. '401':
  1734. $ref: '#/components/responses/Unauthorized'
  1735. '403':
  1736. $ref: '#/components/responses/Forbidden'
  1737. '500':
  1738. $ref: '#/components/responses/InternalServerError'
  1739. default:
  1740. $ref: '#/components/responses/DefaultResponse'
  1741. '/groups/{name}':
  1742. parameters:
  1743. - name: name
  1744. in: path
  1745. description: group name
  1746. required: true
  1747. schema:
  1748. type: string
  1749. get:
  1750. tags:
  1751. - groups
  1752. summary: Find groups by name
  1753. description: Returns the group with the given name if it exists.
  1754. operationId: get_group_by_name
  1755. parameters:
  1756. - in: query
  1757. name: confidential_data
  1758. schema:
  1759. type: integer
  1760. description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.'
  1761. responses:
  1762. '200':
  1763. description: successful operation
  1764. content:
  1765. application/json:
  1766. schema:
  1767. $ref: '#/components/schemas/Group'
  1768. '400':
  1769. $ref: '#/components/responses/BadRequest'
  1770. '401':
  1771. $ref: '#/components/responses/Unauthorized'
  1772. '403':
  1773. $ref: '#/components/responses/Forbidden'
  1774. '404':
  1775. $ref: '#/components/responses/NotFound'
  1776. '500':
  1777. $ref: '#/components/responses/InternalServerError'
  1778. default:
  1779. $ref: '#/components/responses/DefaultResponse'
  1780. put:
  1781. tags:
  1782. - groups
  1783. summary: Update group
  1784. description: Updates an existing group
  1785. operationId: update_group
  1786. requestBody:
  1787. required: true
  1788. content:
  1789. application/json:
  1790. schema:
  1791. $ref: '#/components/schemas/Group'
  1792. responses:
  1793. '200':
  1794. description: successful operation
  1795. content:
  1796. application/json:
  1797. schema:
  1798. $ref: '#/components/schemas/ApiResponse'
  1799. example:
  1800. message: Group updated
  1801. '400':
  1802. $ref: '#/components/responses/BadRequest'
  1803. '401':
  1804. $ref: '#/components/responses/Unauthorized'
  1805. '403':
  1806. $ref: '#/components/responses/Forbidden'
  1807. '404':
  1808. $ref: '#/components/responses/NotFound'
  1809. '500':
  1810. $ref: '#/components/responses/InternalServerError'
  1811. default:
  1812. $ref: '#/components/responses/DefaultResponse'
  1813. delete:
  1814. tags:
  1815. - groups
  1816. summary: Delete group
  1817. description: Deletes an existing group
  1818. operationId: delete_group
  1819. responses:
  1820. '200':
  1821. description: successful operation
  1822. content:
  1823. application/json:
  1824. schema:
  1825. $ref: '#/components/schemas/ApiResponse'
  1826. example:
  1827. message: Group deleted
  1828. '400':
  1829. $ref: '#/components/responses/BadRequest'
  1830. '401':
  1831. $ref: '#/components/responses/Unauthorized'
  1832. '403':
  1833. $ref: '#/components/responses/Forbidden'
  1834. '404':
  1835. $ref: '#/components/responses/NotFound'
  1836. '500':
  1837. $ref: '#/components/responses/InternalServerError'
  1838. default:
  1839. $ref: '#/components/responses/DefaultResponse'
  1840. /roles:
  1841. get:
  1842. tags:
  1843. - roles
  1844. summary: Get roles
  1845. description: Returns an array with one or more roles
  1846. operationId: get_roles
  1847. parameters:
  1848. - in: query
  1849. name: offset
  1850. schema:
  1851. type: integer
  1852. minimum: 0
  1853. default: 0
  1854. required: false
  1855. - in: query
  1856. name: limit
  1857. schema:
  1858. type: integer
  1859. minimum: 1
  1860. maximum: 500
  1861. default: 100
  1862. required: false
  1863. description: 'The maximum number of items to return. Max value is 500, default is 100'
  1864. - in: query
  1865. name: order
  1866. required: false
  1867. description: Ordering groups by name. Default ASC
  1868. schema:
  1869. type: string
  1870. enum:
  1871. - ASC
  1872. - DESC
  1873. example: ASC
  1874. responses:
  1875. '200':
  1876. description: successful operation
  1877. content:
  1878. application/json:
  1879. schema:
  1880. type: array
  1881. items:
  1882. $ref: '#/components/schemas/Role'
  1883. '400':
  1884. $ref: '#/components/responses/BadRequest'
  1885. '401':
  1886. $ref: '#/components/responses/Unauthorized'
  1887. '403':
  1888. $ref: '#/components/responses/Forbidden'
  1889. '500':
  1890. $ref: '#/components/responses/InternalServerError'
  1891. default:
  1892. $ref: '#/components/responses/DefaultResponse'
  1893. post:
  1894. tags:
  1895. - roles
  1896. summary: Add role
  1897. operationId: add_role
  1898. description: Adds a new role
  1899. requestBody:
  1900. required: true
  1901. content:
  1902. application/json:
  1903. schema:
  1904. $ref: '#/components/schemas/Role'
  1905. responses:
  1906. '201':
  1907. description: successful operation
  1908. headers:
  1909. Location:
  1910. schema:
  1911. type: string
  1912. description: 'URI of the newly created object'
  1913. content:
  1914. application/json:
  1915. schema:
  1916. $ref: '#/components/schemas/Role'
  1917. '400':
  1918. $ref: '#/components/responses/BadRequest'
  1919. '401':
  1920. $ref: '#/components/responses/Unauthorized'
  1921. '403':
  1922. $ref: '#/components/responses/Forbidden'
  1923. '500':
  1924. $ref: '#/components/responses/InternalServerError'
  1925. default:
  1926. $ref: '#/components/responses/DefaultResponse'
  1927. '/roles/{name}':
  1928. parameters:
  1929. - name: name
  1930. in: path
  1931. description: role name
  1932. required: true
  1933. schema:
  1934. type: string
  1935. get:
  1936. tags:
  1937. - roles
  1938. summary: Find roles by name
  1939. description: Returns the role with the given name if it exists.
  1940. operationId: get_role_by_name
  1941. responses:
  1942. '200':
  1943. description: successful operation
  1944. content:
  1945. application/json:
  1946. schema:
  1947. $ref: '#/components/schemas/Role'
  1948. '400':
  1949. $ref: '#/components/responses/BadRequest'
  1950. '401':
  1951. $ref: '#/components/responses/Unauthorized'
  1952. '403':
  1953. $ref: '#/components/responses/Forbidden'
  1954. '404':
  1955. $ref: '#/components/responses/NotFound'
  1956. '500':
  1957. $ref: '#/components/responses/InternalServerError'
  1958. default:
  1959. $ref: '#/components/responses/DefaultResponse'
  1960. put:
  1961. tags:
  1962. - roles
  1963. summary: Update role
  1964. description: Updates an existing role
  1965. operationId: update_role
  1966. requestBody:
  1967. required: true
  1968. content:
  1969. application/json:
  1970. schema:
  1971. $ref: '#/components/schemas/Role'
  1972. responses:
  1973. '200':
  1974. description: successful operation
  1975. content:
  1976. application/json:
  1977. schema:
  1978. $ref: '#/components/schemas/ApiResponse'
  1979. example:
  1980. message: Group updated
  1981. '400':
  1982. $ref: '#/components/responses/BadRequest'
  1983. '401':
  1984. $ref: '#/components/responses/Unauthorized'
  1985. '403':
  1986. $ref: '#/components/responses/Forbidden'
  1987. '404':
  1988. $ref: '#/components/responses/NotFound'
  1989. '500':
  1990. $ref: '#/components/responses/InternalServerError'
  1991. default:
  1992. $ref: '#/components/responses/DefaultResponse'
  1993. delete:
  1994. tags:
  1995. - roles
  1996. summary: Delete role
  1997. description: Deletes an existing role
  1998. operationId: delete_role
  1999. responses:
  2000. '200':
  2001. description: successful operation
  2002. content:
  2003. application/json:
  2004. schema:
  2005. $ref: '#/components/schemas/ApiResponse'
  2006. example:
  2007. message: Group deleted
  2008. '400':
  2009. $ref: '#/components/responses/BadRequest'
  2010. '401':
  2011. $ref: '#/components/responses/Unauthorized'
  2012. '403':
  2013. $ref: '#/components/responses/Forbidden'
  2014. '404':
  2015. $ref: '#/components/responses/NotFound'
  2016. '500':
  2017. $ref: '#/components/responses/InternalServerError'
  2018. default:
  2019. $ref: '#/components/responses/DefaultResponse'
  2020. /eventactions:
  2021. get:
  2022. tags:
  2023. - event manager
  2024. summary: Get event actions
  2025. description: Returns an array with one or more event actions
  2026. operationId: get_event_actons
  2027. parameters:
  2028. - in: query
  2029. name: offset
  2030. schema:
  2031. type: integer
  2032. minimum: 0
  2033. default: 0
  2034. required: false
  2035. - in: query
  2036. name: limit
  2037. schema:
  2038. type: integer
  2039. minimum: 1
  2040. maximum: 500
  2041. default: 100
  2042. required: false
  2043. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2044. - in: query
  2045. name: order
  2046. required: false
  2047. description: Ordering actions by name. Default ASC
  2048. schema:
  2049. type: string
  2050. enum:
  2051. - ASC
  2052. - DESC
  2053. example: ASC
  2054. responses:
  2055. '200':
  2056. description: successful operation
  2057. content:
  2058. application/json:
  2059. schema:
  2060. type: array
  2061. items:
  2062. $ref: '#/components/schemas/BaseEventAction'
  2063. '400':
  2064. $ref: '#/components/responses/BadRequest'
  2065. '401':
  2066. $ref: '#/components/responses/Unauthorized'
  2067. '403':
  2068. $ref: '#/components/responses/Forbidden'
  2069. '500':
  2070. $ref: '#/components/responses/InternalServerError'
  2071. default:
  2072. $ref: '#/components/responses/DefaultResponse'
  2073. post:
  2074. tags:
  2075. - event manager
  2076. summary: Add event action
  2077. operationId: add_event_action
  2078. description: Adds a new event actions
  2079. parameters:
  2080. - in: query
  2081. name: confidential_data
  2082. schema:
  2083. type: integer
  2084. description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.'
  2085. requestBody:
  2086. required: true
  2087. content:
  2088. application/json:
  2089. schema:
  2090. $ref: '#/components/schemas/BaseEventAction'
  2091. responses:
  2092. '201':
  2093. description: successful operation
  2094. headers:
  2095. Location:
  2096. schema:
  2097. type: string
  2098. description: 'URI of the newly created object'
  2099. content:
  2100. application/json:
  2101. schema:
  2102. $ref: '#/components/schemas/BaseEventAction'
  2103. '400':
  2104. $ref: '#/components/responses/BadRequest'
  2105. '401':
  2106. $ref: '#/components/responses/Unauthorized'
  2107. '403':
  2108. $ref: '#/components/responses/Forbidden'
  2109. '500':
  2110. $ref: '#/components/responses/InternalServerError'
  2111. default:
  2112. $ref: '#/components/responses/DefaultResponse'
  2113. '/eventactions/{name}':
  2114. parameters:
  2115. - name: name
  2116. in: path
  2117. description: action name
  2118. required: true
  2119. schema:
  2120. type: string
  2121. get:
  2122. tags:
  2123. - event manager
  2124. summary: Find event actions by name
  2125. description: Returns the event action with the given name if it exists.
  2126. operationId: get_event_action_by_name
  2127. parameters:
  2128. - in: query
  2129. name: confidential_data
  2130. schema:
  2131. type: integer
  2132. description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.'
  2133. responses:
  2134. '200':
  2135. description: successful operation
  2136. content:
  2137. application/json:
  2138. schema:
  2139. $ref: '#/components/schemas/BaseEventAction'
  2140. '400':
  2141. $ref: '#/components/responses/BadRequest'
  2142. '401':
  2143. $ref: '#/components/responses/Unauthorized'
  2144. '403':
  2145. $ref: '#/components/responses/Forbidden'
  2146. '404':
  2147. $ref: '#/components/responses/NotFound'
  2148. '500':
  2149. $ref: '#/components/responses/InternalServerError'
  2150. default:
  2151. $ref: '#/components/responses/DefaultResponse'
  2152. put:
  2153. tags:
  2154. - event manager
  2155. summary: Update event action
  2156. description: Updates an existing event action
  2157. operationId: update_event_action
  2158. requestBody:
  2159. required: true
  2160. content:
  2161. application/json:
  2162. schema:
  2163. $ref: '#/components/schemas/BaseEventAction'
  2164. responses:
  2165. '200':
  2166. description: successful operation
  2167. content:
  2168. application/json:
  2169. schema:
  2170. $ref: '#/components/schemas/ApiResponse'
  2171. example:
  2172. message: Event action updated
  2173. '400':
  2174. $ref: '#/components/responses/BadRequest'
  2175. '401':
  2176. $ref: '#/components/responses/Unauthorized'
  2177. '403':
  2178. $ref: '#/components/responses/Forbidden'
  2179. '404':
  2180. $ref: '#/components/responses/NotFound'
  2181. '500':
  2182. $ref: '#/components/responses/InternalServerError'
  2183. default:
  2184. $ref: '#/components/responses/DefaultResponse'
  2185. delete:
  2186. tags:
  2187. - event manager
  2188. summary: Delete event action
  2189. description: Deletes an existing event action
  2190. operationId: delete_event_action
  2191. responses:
  2192. '200':
  2193. description: successful operation
  2194. content:
  2195. application/json:
  2196. schema:
  2197. $ref: '#/components/schemas/ApiResponse'
  2198. example:
  2199. message: Event action deleted
  2200. '400':
  2201. $ref: '#/components/responses/BadRequest'
  2202. '401':
  2203. $ref: '#/components/responses/Unauthorized'
  2204. '403':
  2205. $ref: '#/components/responses/Forbidden'
  2206. '404':
  2207. $ref: '#/components/responses/NotFound'
  2208. '500':
  2209. $ref: '#/components/responses/InternalServerError'
  2210. default:
  2211. $ref: '#/components/responses/DefaultResponse'
  2212. /eventrules:
  2213. get:
  2214. tags:
  2215. - event manager
  2216. summary: Get event rules
  2217. description: Returns an array with one or more event rules
  2218. operationId: get_event_rules
  2219. parameters:
  2220. - in: query
  2221. name: offset
  2222. schema:
  2223. type: integer
  2224. minimum: 0
  2225. default: 0
  2226. required: false
  2227. - in: query
  2228. name: limit
  2229. schema:
  2230. type: integer
  2231. minimum: 1
  2232. maximum: 500
  2233. default: 100
  2234. required: false
  2235. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2236. - in: query
  2237. name: order
  2238. required: false
  2239. description: Ordering rules by name. Default ASC
  2240. schema:
  2241. type: string
  2242. enum:
  2243. - ASC
  2244. - DESC
  2245. example: ASC
  2246. responses:
  2247. '200':
  2248. description: successful operation
  2249. content:
  2250. application/json:
  2251. schema:
  2252. type: array
  2253. items:
  2254. $ref: '#/components/schemas/EventRule'
  2255. '400':
  2256. $ref: '#/components/responses/BadRequest'
  2257. '401':
  2258. $ref: '#/components/responses/Unauthorized'
  2259. '403':
  2260. $ref: '#/components/responses/Forbidden'
  2261. '500':
  2262. $ref: '#/components/responses/InternalServerError'
  2263. default:
  2264. $ref: '#/components/responses/DefaultResponse'
  2265. post:
  2266. tags:
  2267. - event manager
  2268. summary: Add event rule
  2269. operationId: add_event_rule
  2270. description: Adds a new event rule
  2271. parameters:
  2272. - in: query
  2273. name: confidential_data
  2274. schema:
  2275. type: integer
  2276. description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.'
  2277. requestBody:
  2278. required: true
  2279. content:
  2280. application/json:
  2281. schema:
  2282. $ref: '#/components/schemas/EventRuleMinimal'
  2283. responses:
  2284. '201':
  2285. description: successful operation
  2286. headers:
  2287. Location:
  2288. schema:
  2289. type: string
  2290. description: 'URI of the newly created object'
  2291. content:
  2292. application/json:
  2293. schema:
  2294. $ref: '#/components/schemas/EventRule'
  2295. '400':
  2296. $ref: '#/components/responses/BadRequest'
  2297. '401':
  2298. $ref: '#/components/responses/Unauthorized'
  2299. '403':
  2300. $ref: '#/components/responses/Forbidden'
  2301. '500':
  2302. $ref: '#/components/responses/InternalServerError'
  2303. default:
  2304. $ref: '#/components/responses/DefaultResponse'
  2305. '/eventrules/{name}':
  2306. parameters:
  2307. - name: name
  2308. in: path
  2309. description: rule name
  2310. required: true
  2311. schema:
  2312. type: string
  2313. get:
  2314. tags:
  2315. - event manager
  2316. summary: Find event rules by name
  2317. description: Returns the event rule with the given name if it exists.
  2318. operationId: get_event_rile_by_name
  2319. parameters:
  2320. - in: query
  2321. name: confidential_data
  2322. schema:
  2323. type: integer
  2324. description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.'
  2325. responses:
  2326. '200':
  2327. description: successful operation
  2328. content:
  2329. application/json:
  2330. schema:
  2331. $ref: '#/components/schemas/EventRule'
  2332. '400':
  2333. $ref: '#/components/responses/BadRequest'
  2334. '401':
  2335. $ref: '#/components/responses/Unauthorized'
  2336. '403':
  2337. $ref: '#/components/responses/Forbidden'
  2338. '404':
  2339. $ref: '#/components/responses/NotFound'
  2340. '500':
  2341. $ref: '#/components/responses/InternalServerError'
  2342. default:
  2343. $ref: '#/components/responses/DefaultResponse'
  2344. put:
  2345. tags:
  2346. - event manager
  2347. summary: Update event rule
  2348. description: Updates an existing event rule
  2349. operationId: update_event_rule
  2350. requestBody:
  2351. required: true
  2352. content:
  2353. application/json:
  2354. schema:
  2355. $ref: '#/components/schemas/EventRuleMinimal'
  2356. responses:
  2357. '200':
  2358. description: successful operation
  2359. content:
  2360. application/json:
  2361. schema:
  2362. $ref: '#/components/schemas/ApiResponse'
  2363. example:
  2364. message: Event rules updated
  2365. '400':
  2366. $ref: '#/components/responses/BadRequest'
  2367. '401':
  2368. $ref: '#/components/responses/Unauthorized'
  2369. '403':
  2370. $ref: '#/components/responses/Forbidden'
  2371. '404':
  2372. $ref: '#/components/responses/NotFound'
  2373. '500':
  2374. $ref: '#/components/responses/InternalServerError'
  2375. default:
  2376. $ref: '#/components/responses/DefaultResponse'
  2377. delete:
  2378. tags:
  2379. - event manager
  2380. summary: Delete event rule
  2381. description: Deletes an existing event rule
  2382. operationId: delete_event_rule
  2383. responses:
  2384. '200':
  2385. description: successful operation
  2386. content:
  2387. application/json:
  2388. schema:
  2389. $ref: '#/components/schemas/ApiResponse'
  2390. example:
  2391. message: Event rules deleted
  2392. '400':
  2393. $ref: '#/components/responses/BadRequest'
  2394. '401':
  2395. $ref: '#/components/responses/Unauthorized'
  2396. '403':
  2397. $ref: '#/components/responses/Forbidden'
  2398. '404':
  2399. $ref: '#/components/responses/NotFound'
  2400. '500':
  2401. $ref: '#/components/responses/InternalServerError'
  2402. default:
  2403. $ref: '#/components/responses/DefaultResponse'
  2404. '/eventrules/run/{name}':
  2405. parameters:
  2406. - name: name
  2407. in: path
  2408. description: on-demand rule name
  2409. required: true
  2410. schema:
  2411. type: string
  2412. post:
  2413. tags:
  2414. - event manager
  2415. summary: Run an on-demand event rule
  2416. description: The rule's actions will run in background. SFTPGo will not monitor any concurrency and such. If you want to be notified at the end of the execution please add an appropriate action
  2417. operationId: run_event_rule
  2418. responses:
  2419. '202':
  2420. description: successful operation
  2421. content:
  2422. application/json:
  2423. schema:
  2424. $ref: '#/components/schemas/ApiResponse'
  2425. example:
  2426. message: Event rule started
  2427. '400':
  2428. $ref: '#/components/responses/BadRequest'
  2429. '401':
  2430. $ref: '#/components/responses/Unauthorized'
  2431. '403':
  2432. $ref: '#/components/responses/Forbidden'
  2433. '404':
  2434. $ref: '#/components/responses/NotFound'
  2435. '500':
  2436. $ref: '#/components/responses/InternalServerError'
  2437. default:
  2438. $ref: '#/components/responses/DefaultResponse'
  2439. /events/fs:
  2440. get:
  2441. tags:
  2442. - events
  2443. summary: Get filesystem events
  2444. 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'
  2445. operationId: get_fs_events
  2446. parameters:
  2447. - in: query
  2448. name: start_timestamp
  2449. schema:
  2450. type: integer
  2451. format: int64
  2452. minimum: 0
  2453. default: 0
  2454. required: false
  2455. 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'
  2456. - in: query
  2457. name: end_timestamp
  2458. schema:
  2459. type: integer
  2460. format: int64
  2461. minimum: 0
  2462. default: 0
  2463. required: false
  2464. 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'
  2465. - in: query
  2466. name: actions
  2467. schema:
  2468. type: array
  2469. items:
  2470. $ref: '#/components/schemas/FsEventAction'
  2471. description: 'the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated'
  2472. explode: false
  2473. required: false
  2474. - in: query
  2475. name: username
  2476. schema:
  2477. type: string
  2478. description: 'the event username must be the same as the one specified. Empty or missing means omit this filter'
  2479. required: false
  2480. - in: query
  2481. name: ip
  2482. schema:
  2483. type: string
  2484. description: 'the event IP must be the same as the one specified. Empty or missing means omit this filter'
  2485. required: false
  2486. - in: query
  2487. name: ssh_cmd
  2488. schema:
  2489. type: string
  2490. description: 'the event SSH command must be the same as the one specified. Empty or missing means omit this filter'
  2491. required: false
  2492. - in: query
  2493. name: fs_provider
  2494. schema:
  2495. $ref: '#/components/schemas/FsProviders'
  2496. description: 'the event filesystem provider must be the same as the one specified. Empty or missing means omit this filter'
  2497. required: false
  2498. - in: query
  2499. name: bucket
  2500. schema:
  2501. type: string
  2502. description: 'the bucket must be the same as the one specified. Empty or missing means omit this filter'
  2503. required: false
  2504. - in: query
  2505. name: endpoint
  2506. schema:
  2507. type: string
  2508. description: 'the endpoint must be the same as the one specified. Empty or missing means omit this filter'
  2509. required: false
  2510. - in: query
  2511. name: protocols
  2512. schema:
  2513. type: array
  2514. items:
  2515. $ref: '#/components/schemas/EventProtocols'
  2516. description: 'the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2517. explode: false
  2518. required: false
  2519. - in: query
  2520. name: statuses
  2521. schema:
  2522. type: array
  2523. items:
  2524. $ref: '#/components/schemas/FsEventStatus'
  2525. description: 'the event status must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2526. explode: false
  2527. required: false
  2528. - in: query
  2529. name: instance_ids
  2530. schema:
  2531. type: array
  2532. items:
  2533. type: string
  2534. description: 'the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2535. explode: false
  2536. required: false
  2537. - in: query
  2538. name: from_id
  2539. schema:
  2540. type: string
  2541. description: 'the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter.'
  2542. required: false
  2543. - in: query
  2544. name: role
  2545. schema:
  2546. type: string
  2547. description: 'User role. Empty or missing means omit this filter. Ignored if the admin has a role'
  2548. required: false
  2549. - in: query
  2550. name: csv_export
  2551. schema:
  2552. type: boolean
  2553. default: false
  2554. required: false
  2555. description: 'If enabled, events are exported as a CSV file'
  2556. - in: query
  2557. name: limit
  2558. schema:
  2559. type: integer
  2560. minimum: 1
  2561. maximum: 1000
  2562. default: 100
  2563. required: false
  2564. description: 'The maximum number of items to return. Max value is 1000, default is 100'
  2565. - in: query
  2566. name: order
  2567. required: false
  2568. description: Ordering events by timestamp. Default DESC
  2569. schema:
  2570. type: string
  2571. enum:
  2572. - ASC
  2573. - DESC
  2574. example: DESC
  2575. responses:
  2576. '200':
  2577. description: successful operation
  2578. content:
  2579. application/json:
  2580. schema:
  2581. type: array
  2582. items:
  2583. $ref: '#/components/schemas/FsEvent'
  2584. text/csv:
  2585. schema:
  2586. type: string
  2587. '400':
  2588. $ref: '#/components/responses/BadRequest'
  2589. '401':
  2590. $ref: '#/components/responses/Unauthorized'
  2591. '403':
  2592. $ref: '#/components/responses/Forbidden'
  2593. '500':
  2594. $ref: '#/components/responses/InternalServerError'
  2595. default:
  2596. $ref: '#/components/responses/DefaultResponse'
  2597. /events/provider:
  2598. get:
  2599. tags:
  2600. - events
  2601. summary: Get provider events
  2602. 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'
  2603. operationId: get_provider_events
  2604. parameters:
  2605. - in: query
  2606. name: start_timestamp
  2607. schema:
  2608. type: integer
  2609. format: int64
  2610. minimum: 0
  2611. default: 0
  2612. required: false
  2613. 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'
  2614. - in: query
  2615. name: end_timestamp
  2616. schema:
  2617. type: integer
  2618. format: int64
  2619. minimum: 0
  2620. default: 0
  2621. required: false
  2622. 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'
  2623. - in: query
  2624. name: actions
  2625. schema:
  2626. type: array
  2627. items:
  2628. $ref: '#/components/schemas/ProviderEventAction'
  2629. description: 'the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated'
  2630. explode: false
  2631. required: false
  2632. - in: query
  2633. name: username
  2634. schema:
  2635. type: string
  2636. description: 'the event username must be the same as the one specified. Empty or missing means omit this filter'
  2637. required: false
  2638. - in: query
  2639. name: ip
  2640. schema:
  2641. type: string
  2642. description: 'the event IP must be the same as the one specified. Empty or missing means omit this filter'
  2643. required: false
  2644. - in: query
  2645. name: object_name
  2646. schema:
  2647. type: string
  2648. description: 'the event object name must be the same as the one specified. Empty or missing means omit this filter'
  2649. required: false
  2650. - in: query
  2651. name: object_types
  2652. schema:
  2653. type: array
  2654. items:
  2655. $ref: '#/components/schemas/ProviderEventObjectType'
  2656. description: 'the event object type must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2657. explode: false
  2658. required: false
  2659. - in: query
  2660. name: instance_ids
  2661. schema:
  2662. type: array
  2663. items:
  2664. type: string
  2665. description: 'the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2666. explode: false
  2667. required: false
  2668. - in: query
  2669. name: from_id
  2670. schema:
  2671. type: string
  2672. description: 'the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter.'
  2673. required: false
  2674. - in: query
  2675. name: role
  2676. schema:
  2677. type: string
  2678. description: 'Admin role. Empty or missing means omit this filter. Ignored if the admin has a role'
  2679. required: false
  2680. - in: query
  2681. name: csv_export
  2682. schema:
  2683. type: boolean
  2684. default: false
  2685. required: false
  2686. description: 'If enabled, events are exported as a CSV file'
  2687. - in: query
  2688. name: omit_object_data
  2689. schema:
  2690. type: boolean
  2691. default: false
  2692. required: false
  2693. description: 'If enabled, returned events will not contain the `object_data` field'
  2694. - in: query
  2695. name: limit
  2696. schema:
  2697. type: integer
  2698. minimum: 1
  2699. maximum: 1000
  2700. default: 100
  2701. required: false
  2702. description: 'The maximum number of items to return. Max value is 1000, default is 100'
  2703. - in: query
  2704. name: order
  2705. required: false
  2706. description: Ordering events by timestamp. Default DESC
  2707. schema:
  2708. type: string
  2709. enum:
  2710. - ASC
  2711. - DESC
  2712. example: DESC
  2713. responses:
  2714. '200':
  2715. description: successful operation
  2716. content:
  2717. application/json:
  2718. schema:
  2719. type: array
  2720. items:
  2721. $ref: '#/components/schemas/ProviderEvent'
  2722. text/csv:
  2723. schema:
  2724. type: string
  2725. '400':
  2726. $ref: '#/components/responses/BadRequest'
  2727. '401':
  2728. $ref: '#/components/responses/Unauthorized'
  2729. '403':
  2730. $ref: '#/components/responses/Forbidden'
  2731. '500':
  2732. $ref: '#/components/responses/InternalServerError'
  2733. default:
  2734. $ref: '#/components/responses/DefaultResponse'
  2735. /events/log:
  2736. get:
  2737. tags:
  2738. - events
  2739. summary: Get log events
  2740. description: 'Returns an array with one or more log events applying the specified filters. This API is only available if you configure an "eventsearcher" plugin'
  2741. operationId: get_log_events
  2742. parameters:
  2743. - in: query
  2744. name: start_timestamp
  2745. schema:
  2746. type: integer
  2747. format: int64
  2748. minimum: 0
  2749. default: 0
  2750. required: false
  2751. 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'
  2752. - in: query
  2753. name: end_timestamp
  2754. schema:
  2755. type: integer
  2756. format: int64
  2757. minimum: 0
  2758. default: 0
  2759. required: false
  2760. 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'
  2761. - in: query
  2762. name: events
  2763. schema:
  2764. type: array
  2765. items:
  2766. $ref: '#/components/schemas/LogEventType'
  2767. description: 'the log events must be included among those specified. Empty or missing means omit this filter. Events must be specified comma separated'
  2768. explode: false
  2769. required: false
  2770. - in: query
  2771. name: username
  2772. schema:
  2773. type: string
  2774. description: 'the event username must be the same as the one specified. Empty or missing means omit this filter'
  2775. required: false
  2776. - in: query
  2777. name: ip
  2778. schema:
  2779. type: string
  2780. description: 'the event IP must be the same as the one specified. Empty or missing means omit this filter'
  2781. required: false
  2782. - in: query
  2783. name: protocols
  2784. schema:
  2785. type: array
  2786. items:
  2787. $ref: '#/components/schemas/EventProtocols'
  2788. description: 'the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2789. explode: false
  2790. required: false
  2791. - in: query
  2792. name: instance_ids
  2793. schema:
  2794. type: array
  2795. items:
  2796. type: string
  2797. description: 'the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2798. explode: false
  2799. required: false
  2800. - in: query
  2801. name: from_id
  2802. schema:
  2803. type: string
  2804. description: 'the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter.'
  2805. required: false
  2806. - in: query
  2807. name: role
  2808. schema:
  2809. type: string
  2810. description: 'User role. Empty or missing means omit this filter. Ignored if the admin has a role'
  2811. required: false
  2812. - in: query
  2813. name: csv_export
  2814. schema:
  2815. type: boolean
  2816. default: false
  2817. required: false
  2818. description: 'If enabled, events are exported as a CSV file'
  2819. - in: query
  2820. name: limit
  2821. schema:
  2822. type: integer
  2823. minimum: 1
  2824. maximum: 1000
  2825. default: 100
  2826. required: false
  2827. description: 'The maximum number of items to return. Max value is 1000, default is 100'
  2828. - in: query
  2829. name: order
  2830. required: false
  2831. description: Ordering events by timestamp. Default DESC
  2832. schema:
  2833. type: string
  2834. enum:
  2835. - ASC
  2836. - DESC
  2837. example: DESC
  2838. responses:
  2839. '200':
  2840. description: successful operation
  2841. content:
  2842. application/json:
  2843. schema:
  2844. type: array
  2845. items:
  2846. $ref: '#/components/schemas/LogEvent'
  2847. text/csv:
  2848. schema:
  2849. type: string
  2850. '400':
  2851. $ref: '#/components/responses/BadRequest'
  2852. '401':
  2853. $ref: '#/components/responses/Unauthorized'
  2854. '403':
  2855. $ref: '#/components/responses/Forbidden'
  2856. '500':
  2857. $ref: '#/components/responses/InternalServerError'
  2858. default:
  2859. $ref: '#/components/responses/DefaultResponse'
  2860. /apikeys:
  2861. get:
  2862. security:
  2863. - BearerAuth: []
  2864. tags:
  2865. - API keys
  2866. summary: Get API keys
  2867. description: Returns an array with one or more API keys. For security reasons hashed keys are omitted in the response
  2868. operationId: get_api_keys
  2869. parameters:
  2870. - in: query
  2871. name: offset
  2872. schema:
  2873. type: integer
  2874. minimum: 0
  2875. default: 0
  2876. required: false
  2877. - in: query
  2878. name: limit
  2879. schema:
  2880. type: integer
  2881. minimum: 1
  2882. maximum: 500
  2883. default: 100
  2884. required: false
  2885. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2886. - in: query
  2887. name: order
  2888. required: false
  2889. description: Ordering API keys by id. Default ASC
  2890. schema:
  2891. type: string
  2892. enum:
  2893. - ASC
  2894. - DESC
  2895. example: ASC
  2896. responses:
  2897. '200':
  2898. description: successful operation
  2899. content:
  2900. application/json:
  2901. schema:
  2902. type: array
  2903. items:
  2904. $ref: '#/components/schemas/APIKey'
  2905. '400':
  2906. $ref: '#/components/responses/BadRequest'
  2907. '401':
  2908. $ref: '#/components/responses/Unauthorized'
  2909. '403':
  2910. $ref: '#/components/responses/Forbidden'
  2911. '500':
  2912. $ref: '#/components/responses/InternalServerError'
  2913. default:
  2914. $ref: '#/components/responses/DefaultResponse'
  2915. post:
  2916. security:
  2917. - BearerAuth: []
  2918. tags:
  2919. - API keys
  2920. summary: Add API key
  2921. description: Adds a new API key
  2922. operationId: add_api_key
  2923. requestBody:
  2924. required: true
  2925. content:
  2926. application/json:
  2927. schema:
  2928. $ref: '#/components/schemas/APIKey'
  2929. responses:
  2930. '201':
  2931. description: successful operation
  2932. headers:
  2933. X-Object-ID:
  2934. schema:
  2935. type: string
  2936. description: ID for the new created API key
  2937. Location:
  2938. schema:
  2939. type: string
  2940. description: URI to retrieve the details for the new created API key
  2941. content:
  2942. application/json:
  2943. schema:
  2944. type: object
  2945. properties:
  2946. mesage:
  2947. type: string
  2948. example: 'API key created. This is the only time the API key is visible, please save it.'
  2949. key:
  2950. type: string
  2951. description: 'generated API key'
  2952. '400':
  2953. $ref: '#/components/responses/BadRequest'
  2954. '401':
  2955. $ref: '#/components/responses/Unauthorized'
  2956. '403':
  2957. $ref: '#/components/responses/Forbidden'
  2958. '500':
  2959. $ref: '#/components/responses/InternalServerError'
  2960. default:
  2961. $ref: '#/components/responses/DefaultResponse'
  2962. '/apikeys/{id}':
  2963. parameters:
  2964. - name: id
  2965. in: path
  2966. description: the key id
  2967. required: true
  2968. schema:
  2969. type: string
  2970. get:
  2971. security:
  2972. - BearerAuth: []
  2973. tags:
  2974. - API keys
  2975. summary: Find API key by id
  2976. description: Returns the API key with the given id, if it exists. For security reasons the hashed key is omitted in the response
  2977. operationId: get_api_key_by_id
  2978. responses:
  2979. '200':
  2980. description: successful operation
  2981. content:
  2982. application/json:
  2983. schema:
  2984. $ref: '#/components/schemas/APIKey'
  2985. '400':
  2986. $ref: '#/components/responses/BadRequest'
  2987. '401':
  2988. $ref: '#/components/responses/Unauthorized'
  2989. '403':
  2990. $ref: '#/components/responses/Forbidden'
  2991. '404':
  2992. $ref: '#/components/responses/NotFound'
  2993. '500':
  2994. $ref: '#/components/responses/InternalServerError'
  2995. default:
  2996. $ref: '#/components/responses/DefaultResponse'
  2997. put:
  2998. security:
  2999. - BearerAuth: []
  3000. tags:
  3001. - API keys
  3002. summary: Update API key
  3003. description: Updates an existing API key. You cannot update the key itself, the creation date and the last use
  3004. operationId: update_api_key
  3005. requestBody:
  3006. required: true
  3007. content:
  3008. application/json:
  3009. schema:
  3010. $ref: '#/components/schemas/APIKey'
  3011. responses:
  3012. '200':
  3013. description: successful operation
  3014. content:
  3015. application/json:
  3016. schema:
  3017. $ref: '#/components/schemas/ApiResponse'
  3018. example:
  3019. message: API key updated
  3020. '400':
  3021. $ref: '#/components/responses/BadRequest'
  3022. '401':
  3023. $ref: '#/components/responses/Unauthorized'
  3024. '403':
  3025. $ref: '#/components/responses/Forbidden'
  3026. '404':
  3027. $ref: '#/components/responses/NotFound'
  3028. '500':
  3029. $ref: '#/components/responses/InternalServerError'
  3030. default:
  3031. $ref: '#/components/responses/DefaultResponse'
  3032. delete:
  3033. security:
  3034. - BearerAuth: []
  3035. tags:
  3036. - API keys
  3037. summary: Delete API key
  3038. description: Deletes an existing API key
  3039. operationId: delete_api_key
  3040. responses:
  3041. '200':
  3042. description: successful operation
  3043. content:
  3044. application/json:
  3045. schema:
  3046. $ref: '#/components/schemas/ApiResponse'
  3047. example:
  3048. message: Admin deleted
  3049. '400':
  3050. $ref: '#/components/responses/BadRequest'
  3051. '401':
  3052. $ref: '#/components/responses/Unauthorized'
  3053. '403':
  3054. $ref: '#/components/responses/Forbidden'
  3055. '404':
  3056. $ref: '#/components/responses/NotFound'
  3057. '500':
  3058. $ref: '#/components/responses/InternalServerError'
  3059. default:
  3060. $ref: '#/components/responses/DefaultResponse'
  3061. /admins:
  3062. get:
  3063. tags:
  3064. - admins
  3065. summary: Get admins
  3066. description: Returns an array with one or more admins. For security reasons hashed passwords are omitted in the response
  3067. operationId: get_admins
  3068. parameters:
  3069. - in: query
  3070. name: offset
  3071. schema:
  3072. type: integer
  3073. minimum: 0
  3074. default: 0
  3075. required: false
  3076. - in: query
  3077. name: limit
  3078. schema:
  3079. type: integer
  3080. minimum: 1
  3081. maximum: 500
  3082. default: 100
  3083. required: false
  3084. description: 'The maximum number of items to return. Max value is 500, default is 100'
  3085. - in: query
  3086. name: order
  3087. required: false
  3088. description: Ordering admins by username. Default ASC
  3089. schema:
  3090. type: string
  3091. enum:
  3092. - ASC
  3093. - DESC
  3094. example: ASC
  3095. responses:
  3096. '200':
  3097. description: successful operation
  3098. content:
  3099. application/json:
  3100. schema:
  3101. type: array
  3102. items:
  3103. $ref: '#/components/schemas/Admin'
  3104. '400':
  3105. $ref: '#/components/responses/BadRequest'
  3106. '401':
  3107. $ref: '#/components/responses/Unauthorized'
  3108. '403':
  3109. $ref: '#/components/responses/Forbidden'
  3110. '500':
  3111. $ref: '#/components/responses/InternalServerError'
  3112. default:
  3113. $ref: '#/components/responses/DefaultResponse'
  3114. post:
  3115. tags:
  3116. - admins
  3117. summary: Add admin
  3118. description: 'Adds a new admin. Recovery codes and TOTP configuration cannot be set using this API: each admin must use the specific APIs'
  3119. operationId: add_admin
  3120. requestBody:
  3121. required: true
  3122. content:
  3123. application/json:
  3124. schema:
  3125. $ref: '#/components/schemas/Admin'
  3126. responses:
  3127. '201':
  3128. description: successful operation
  3129. headers:
  3130. Location:
  3131. schema:
  3132. type: string
  3133. description: 'URI of the newly created object'
  3134. content:
  3135. application/json:
  3136. schema:
  3137. $ref: '#/components/schemas/Admin'
  3138. '400':
  3139. $ref: '#/components/responses/BadRequest'
  3140. '401':
  3141. $ref: '#/components/responses/Unauthorized'
  3142. '403':
  3143. $ref: '#/components/responses/Forbidden'
  3144. '500':
  3145. $ref: '#/components/responses/InternalServerError'
  3146. default:
  3147. $ref: '#/components/responses/DefaultResponse'
  3148. '/admins/{username}':
  3149. parameters:
  3150. - name: username
  3151. in: path
  3152. description: the admin username
  3153. required: true
  3154. schema:
  3155. type: string
  3156. get:
  3157. tags:
  3158. - admins
  3159. summary: Find admins by username
  3160. description: 'Returns the admin with the given username, if it exists. For security reasons the hashed password is omitted in the response'
  3161. operationId: get_admin_by_username
  3162. responses:
  3163. '200':
  3164. description: successful operation
  3165. content:
  3166. application/json:
  3167. schema:
  3168. $ref: '#/components/schemas/Admin'
  3169. '400':
  3170. $ref: '#/components/responses/BadRequest'
  3171. '401':
  3172. $ref: '#/components/responses/Unauthorized'
  3173. '403':
  3174. $ref: '#/components/responses/Forbidden'
  3175. '404':
  3176. $ref: '#/components/responses/NotFound'
  3177. '500':
  3178. $ref: '#/components/responses/InternalServerError'
  3179. default:
  3180. $ref: '#/components/responses/DefaultResponse'
  3181. put:
  3182. tags:
  3183. - admins
  3184. summary: Update admin
  3185. 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'
  3186. operationId: update_admin
  3187. requestBody:
  3188. required: true
  3189. content:
  3190. application/json:
  3191. schema:
  3192. $ref: '#/components/schemas/Admin'
  3193. responses:
  3194. '200':
  3195. description: successful operation
  3196. content:
  3197. application/json:
  3198. schema:
  3199. $ref: '#/components/schemas/ApiResponse'
  3200. example:
  3201. message: Admin updated
  3202. '400':
  3203. $ref: '#/components/responses/BadRequest'
  3204. '401':
  3205. $ref: '#/components/responses/Unauthorized'
  3206. '403':
  3207. $ref: '#/components/responses/Forbidden'
  3208. '404':
  3209. $ref: '#/components/responses/NotFound'
  3210. '500':
  3211. $ref: '#/components/responses/InternalServerError'
  3212. default:
  3213. $ref: '#/components/responses/DefaultResponse'
  3214. delete:
  3215. tags:
  3216. - admins
  3217. summary: Delete admin
  3218. description: Deletes an existing admin
  3219. operationId: delete_admin
  3220. responses:
  3221. '200':
  3222. description: successful operation
  3223. content:
  3224. application/json:
  3225. schema:
  3226. $ref: '#/components/schemas/ApiResponse'
  3227. example:
  3228. message: Admin deleted
  3229. '400':
  3230. $ref: '#/components/responses/BadRequest'
  3231. '401':
  3232. $ref: '#/components/responses/Unauthorized'
  3233. '403':
  3234. $ref: '#/components/responses/Forbidden'
  3235. '404':
  3236. $ref: '#/components/responses/NotFound'
  3237. '500':
  3238. $ref: '#/components/responses/InternalServerError'
  3239. default:
  3240. $ref: '#/components/responses/DefaultResponse'
  3241. '/admins/{username}/2fa/disable':
  3242. parameters:
  3243. - name: username
  3244. in: path
  3245. description: the admin username
  3246. required: true
  3247. schema:
  3248. type: string
  3249. put:
  3250. tags:
  3251. - admins
  3252. summary: Disable second factor authentication
  3253. 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'
  3254. operationId: disable_admin_2fa
  3255. responses:
  3256. '200':
  3257. description: successful operation
  3258. content:
  3259. application/json:
  3260. schema:
  3261. $ref: '#/components/schemas/ApiResponse'
  3262. example:
  3263. message: 2FA disabled
  3264. '400':
  3265. $ref: '#/components/responses/BadRequest'
  3266. '401':
  3267. $ref: '#/components/responses/Unauthorized'
  3268. '403':
  3269. $ref: '#/components/responses/Forbidden'
  3270. '404':
  3271. $ref: '#/components/responses/NotFound'
  3272. '500':
  3273. $ref: '#/components/responses/InternalServerError'
  3274. default:
  3275. $ref: '#/components/responses/DefaultResponse'
  3276. '/admins/{username}/forgot-password':
  3277. parameters:
  3278. - name: username
  3279. in: path
  3280. description: the admin username
  3281. required: true
  3282. schema:
  3283. type: string
  3284. post:
  3285. security: []
  3286. tags:
  3287. - admins
  3288. summary: Send a password reset code by email
  3289. 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'
  3290. operationId: admin_forgot_password
  3291. responses:
  3292. '200':
  3293. description: successful operation
  3294. content:
  3295. application/json:
  3296. schema:
  3297. $ref: '#/components/schemas/ApiResponse'
  3298. '400':
  3299. $ref: '#/components/responses/BadRequest'
  3300. '401':
  3301. $ref: '#/components/responses/Unauthorized'
  3302. '403':
  3303. $ref: '#/components/responses/Forbidden'
  3304. '404':
  3305. $ref: '#/components/responses/NotFound'
  3306. '500':
  3307. $ref: '#/components/responses/InternalServerError'
  3308. default:
  3309. $ref: '#/components/responses/DefaultResponse'
  3310. '/admins/{username}/reset-password':
  3311. parameters:
  3312. - name: username
  3313. in: path
  3314. description: the admin username
  3315. required: true
  3316. schema:
  3317. type: string
  3318. post:
  3319. security: []
  3320. tags:
  3321. - admins
  3322. summary: Reset the password
  3323. description: 'Set a new password using the code received via email'
  3324. operationId: admin_reset_password
  3325. requestBody:
  3326. content:
  3327. application/json:
  3328. schema:
  3329. type: object
  3330. properties:
  3331. code:
  3332. type: string
  3333. password:
  3334. type: string
  3335. required: true
  3336. responses:
  3337. '200':
  3338. description: successful operation
  3339. content:
  3340. application/json:
  3341. schema:
  3342. $ref: '#/components/schemas/ApiResponse'
  3343. '400':
  3344. $ref: '#/components/responses/BadRequest'
  3345. '401':
  3346. $ref: '#/components/responses/Unauthorized'
  3347. '403':
  3348. $ref: '#/components/responses/Forbidden'
  3349. '404':
  3350. $ref: '#/components/responses/NotFound'
  3351. '500':
  3352. $ref: '#/components/responses/InternalServerError'
  3353. default:
  3354. $ref: '#/components/responses/DefaultResponse'
  3355. /users:
  3356. get:
  3357. tags:
  3358. - users
  3359. summary: Get users
  3360. description: Returns an array with one or more users. For security reasons hashed passwords are omitted in the response
  3361. operationId: get_users
  3362. parameters:
  3363. - in: query
  3364. name: offset
  3365. schema:
  3366. type: integer
  3367. minimum: 0
  3368. default: 0
  3369. required: false
  3370. - in: query
  3371. name: limit
  3372. schema:
  3373. type: integer
  3374. minimum: 1
  3375. maximum: 500
  3376. default: 100
  3377. required: false
  3378. description: 'The maximum number of items to return. Max value is 500, default is 100'
  3379. - in: query
  3380. name: order
  3381. required: false
  3382. description: Ordering users by username. Default ASC
  3383. schema:
  3384. type: string
  3385. enum:
  3386. - ASC
  3387. - DESC
  3388. example: ASC
  3389. responses:
  3390. '200':
  3391. description: successful operation
  3392. content:
  3393. application/json:
  3394. schema:
  3395. type: array
  3396. items:
  3397. $ref: '#/components/schemas/User'
  3398. '400':
  3399. $ref: '#/components/responses/BadRequest'
  3400. '401':
  3401. $ref: '#/components/responses/Unauthorized'
  3402. '403':
  3403. $ref: '#/components/responses/Forbidden'
  3404. '500':
  3405. $ref: '#/components/responses/InternalServerError'
  3406. default:
  3407. $ref: '#/components/responses/DefaultResponse'
  3408. post:
  3409. tags:
  3410. - users
  3411. summary: Add user
  3412. description: 'Adds a new user.Recovery codes and TOTP configuration cannot be set using this API: each user must use the specific APIs'
  3413. operationId: add_user
  3414. parameters:
  3415. - in: query
  3416. name: confidential_data
  3417. schema:
  3418. type: integer
  3419. description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.'
  3420. requestBody:
  3421. required: true
  3422. content:
  3423. application/json:
  3424. schema:
  3425. $ref: '#/components/schemas/User'
  3426. responses:
  3427. '201':
  3428. description: successful operation
  3429. headers:
  3430. Location:
  3431. schema:
  3432. type: string
  3433. description: 'URI of the newly created object'
  3434. content:
  3435. application/json:
  3436. schema:
  3437. $ref: '#/components/schemas/User'
  3438. '400':
  3439. $ref: '#/components/responses/BadRequest'
  3440. '401':
  3441. $ref: '#/components/responses/Unauthorized'
  3442. '403':
  3443. $ref: '#/components/responses/Forbidden'
  3444. '500':
  3445. $ref: '#/components/responses/InternalServerError'
  3446. default:
  3447. $ref: '#/components/responses/DefaultResponse'
  3448. '/users/{username}':
  3449. parameters:
  3450. - name: username
  3451. in: path
  3452. description: the username
  3453. required: true
  3454. schema:
  3455. type: string
  3456. get:
  3457. tags:
  3458. - users
  3459. summary: Find users by username
  3460. description: Returns the user with the given username if it exists. For security reasons the hashed password is omitted in the response
  3461. operationId: get_user_by_username
  3462. parameters:
  3463. - in: query
  3464. name: confidential_data
  3465. schema:
  3466. type: integer
  3467. description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.'
  3468. responses:
  3469. '200':
  3470. description: successful operation
  3471. content:
  3472. application/json:
  3473. schema:
  3474. $ref: '#/components/schemas/User'
  3475. '400':
  3476. $ref: '#/components/responses/BadRequest'
  3477. '401':
  3478. $ref: '#/components/responses/Unauthorized'
  3479. '403':
  3480. $ref: '#/components/responses/Forbidden'
  3481. '404':
  3482. $ref: '#/components/responses/NotFound'
  3483. '500':
  3484. $ref: '#/components/responses/InternalServerError'
  3485. default:
  3486. $ref: '#/components/responses/DefaultResponse'
  3487. put:
  3488. tags:
  3489. - users
  3490. summary: Update user
  3491. description: 'Updates an existing user and optionally disconnects it, if connected, to apply the new settings. The current password will be preserved if the password field is omitted in the request body. Recovery codes and TOTP configuration cannot be set/updated using this API: each user must use the specific APIs'
  3492. operationId: update_user
  3493. parameters:
  3494. - in: query
  3495. name: disconnect
  3496. schema:
  3497. type: integer
  3498. enum:
  3499. - 0
  3500. - 1
  3501. description: |
  3502. Disconnect:
  3503. * `0` The user will not be disconnected and it will continue to use the old configuration until connected. This is the default
  3504. * `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
  3505. requestBody:
  3506. required: true
  3507. content:
  3508. application/json:
  3509. schema:
  3510. $ref: '#/components/schemas/User'
  3511. responses:
  3512. '200':
  3513. description: successful operation
  3514. content:
  3515. application/json:
  3516. schema:
  3517. $ref: '#/components/schemas/ApiResponse'
  3518. example:
  3519. message: User updated
  3520. '400':
  3521. $ref: '#/components/responses/BadRequest'
  3522. '401':
  3523. $ref: '#/components/responses/Unauthorized'
  3524. '403':
  3525. $ref: '#/components/responses/Forbidden'
  3526. '404':
  3527. $ref: '#/components/responses/NotFound'
  3528. '500':
  3529. $ref: '#/components/responses/InternalServerError'
  3530. default:
  3531. $ref: '#/components/responses/DefaultResponse'
  3532. delete:
  3533. tags:
  3534. - users
  3535. summary: Delete user
  3536. description: Deletes an existing user
  3537. operationId: delete_user
  3538. responses:
  3539. '200':
  3540. description: successful operation
  3541. content:
  3542. application/json:
  3543. schema:
  3544. $ref: '#/components/schemas/ApiResponse'
  3545. example:
  3546. message: User deleted
  3547. '400':
  3548. $ref: '#/components/responses/BadRequest'
  3549. '401':
  3550. $ref: '#/components/responses/Unauthorized'
  3551. '403':
  3552. $ref: '#/components/responses/Forbidden'
  3553. '404':
  3554. $ref: '#/components/responses/NotFound'
  3555. '500':
  3556. $ref: '#/components/responses/InternalServerError'
  3557. default:
  3558. $ref: '#/components/responses/DefaultResponse'
  3559. '/users/{username}/2fa/disable':
  3560. parameters:
  3561. - name: username
  3562. in: path
  3563. description: the username
  3564. required: true
  3565. schema:
  3566. type: string
  3567. put:
  3568. tags:
  3569. - users
  3570. summary: Disable second factor authentication
  3571. 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'
  3572. operationId: disable_user_2fa
  3573. responses:
  3574. '200':
  3575. description: successful operation
  3576. content:
  3577. application/json:
  3578. schema:
  3579. $ref: '#/components/schemas/ApiResponse'
  3580. example:
  3581. message: 2FA disabled
  3582. '400':
  3583. $ref: '#/components/responses/BadRequest'
  3584. '401':
  3585. $ref: '#/components/responses/Unauthorized'
  3586. '403':
  3587. $ref: '#/components/responses/Forbidden'
  3588. '404':
  3589. $ref: '#/components/responses/NotFound'
  3590. '500':
  3591. $ref: '#/components/responses/InternalServerError'
  3592. default:
  3593. $ref: '#/components/responses/DefaultResponse'
  3594. '/users/{username}/forgot-password':
  3595. parameters:
  3596. - name: username
  3597. in: path
  3598. description: the username
  3599. required: true
  3600. schema:
  3601. type: string
  3602. post:
  3603. security: []
  3604. tags:
  3605. - users
  3606. summary: Send a password reset code by email
  3607. 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'
  3608. operationId: user_forgot_password
  3609. responses:
  3610. '200':
  3611. description: successful operation
  3612. content:
  3613. application/json:
  3614. schema:
  3615. $ref: '#/components/schemas/ApiResponse'
  3616. '400':
  3617. $ref: '#/components/responses/BadRequest'
  3618. '401':
  3619. $ref: '#/components/responses/Unauthorized'
  3620. '403':
  3621. $ref: '#/components/responses/Forbidden'
  3622. '404':
  3623. $ref: '#/components/responses/NotFound'
  3624. '500':
  3625. $ref: '#/components/responses/InternalServerError'
  3626. default:
  3627. $ref: '#/components/responses/DefaultResponse'
  3628. '/users/{username}/reset-password':
  3629. parameters:
  3630. - name: username
  3631. in: path
  3632. description: the username
  3633. required: true
  3634. schema:
  3635. type: string
  3636. post:
  3637. security: []
  3638. tags:
  3639. - users
  3640. summary: Reset the password
  3641. description: 'Set a new password using the code received via email'
  3642. operationId: user_reset_password
  3643. requestBody:
  3644. content:
  3645. application/json:
  3646. schema:
  3647. type: object
  3648. properties:
  3649. code:
  3650. type: string
  3651. password:
  3652. type: string
  3653. required: true
  3654. responses:
  3655. '200':
  3656. description: successful operation
  3657. content:
  3658. application/json:
  3659. schema:
  3660. $ref: '#/components/schemas/ApiResponse'
  3661. '400':
  3662. $ref: '#/components/responses/BadRequest'
  3663. '401':
  3664. $ref: '#/components/responses/Unauthorized'
  3665. '403':
  3666. $ref: '#/components/responses/Forbidden'
  3667. '404':
  3668. $ref: '#/components/responses/NotFound'
  3669. '500':
  3670. $ref: '#/components/responses/InternalServerError'
  3671. default:
  3672. $ref: '#/components/responses/DefaultResponse'
  3673. /status:
  3674. get:
  3675. tags:
  3676. - maintenance
  3677. summary: Get status
  3678. description: Retrieves the status of the active services
  3679. operationId: get_status
  3680. responses:
  3681. '200':
  3682. description: successful operation
  3683. content:
  3684. application/json:
  3685. schema:
  3686. $ref: '#/components/schemas/ServicesStatus'
  3687. '400':
  3688. $ref: '#/components/responses/BadRequest'
  3689. '401':
  3690. $ref: '#/components/responses/Unauthorized'
  3691. '403':
  3692. $ref: '#/components/responses/Forbidden'
  3693. '500':
  3694. $ref: '#/components/responses/InternalServerError'
  3695. default:
  3696. $ref: '#/components/responses/DefaultResponse'
  3697. /dumpdata:
  3698. get:
  3699. tags:
  3700. - maintenance
  3701. summary: Dump data
  3702. 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'
  3703. operationId: dumpdata
  3704. parameters:
  3705. - in: query
  3706. name: output-file
  3707. schema:
  3708. type: string
  3709. 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.
  3710. - in: query
  3711. name: output-data
  3712. schema:
  3713. type: integer
  3714. enum:
  3715. - 0
  3716. - 1
  3717. description: |
  3718. output data:
  3719. * `0` or any other value != 1, the backup will be saved to a file on the server, `output_file` is required
  3720. * `1` the backup will be returned as response body
  3721. - in: query
  3722. name: indent
  3723. schema:
  3724. type: integer
  3725. enum:
  3726. - 0
  3727. - 1
  3728. description: |
  3729. indent:
  3730. * `0` no indentation. This is the default
  3731. * `1` format the output JSON
  3732. - in: query
  3733. name: scopes
  3734. schema:
  3735. type: array
  3736. items:
  3737. $ref: '#/components/schemas/DumpDataScopes'
  3738. description: 'You can limit the dump contents to the specified scopes. Empty or missing means any supported scope. Scopes must be specified comma separated'
  3739. explode: false
  3740. required: false
  3741. responses:
  3742. '200':
  3743. description: successful operation
  3744. content:
  3745. application/json:
  3746. schema:
  3747. oneOf:
  3748. - $ref: '#/components/schemas/ApiResponse'
  3749. - $ref: '#/components/schemas/BackupData'
  3750. '400':
  3751. $ref: '#/components/responses/BadRequest'
  3752. '401':
  3753. $ref: '#/components/responses/Unauthorized'
  3754. '403':
  3755. $ref: '#/components/responses/Forbidden'
  3756. '500':
  3757. $ref: '#/components/responses/InternalServerError'
  3758. default:
  3759. $ref: '#/components/responses/DefaultResponse'
  3760. /loaddata:
  3761. parameters:
  3762. - in: query
  3763. name: scan-quota
  3764. schema:
  3765. type: integer
  3766. enum:
  3767. - 0
  3768. - 1
  3769. - 2
  3770. description: |
  3771. Quota scan:
  3772. * `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
  3773. * `1` scan quota
  3774. * `2` scan quota if the user has quota restrictions
  3775. required: false
  3776. - in: query
  3777. name: mode
  3778. schema:
  3779. type: integer
  3780. enum:
  3781. - 0
  3782. - 1
  3783. - 2
  3784. description: |
  3785. Mode:
  3786. * `0` New objects are added, existing ones are updated. This is the default
  3787. * `1` New objects are added, existing ones are not modified
  3788. * `2` New objects are added, existing ones are updated and connected users are disconnected and so forced to use the new configuration
  3789. get:
  3790. tags:
  3791. - maintenance
  3792. summary: Load data from path
  3793. 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'
  3794. operationId: loaddata_from_file
  3795. parameters:
  3796. - in: query
  3797. name: input-file
  3798. schema:
  3799. type: string
  3800. required: true
  3801. 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
  3802. responses:
  3803. '200':
  3804. description: successful operation
  3805. content:
  3806. application/json:
  3807. schema:
  3808. $ref: '#/components/schemas/ApiResponse'
  3809. example:
  3810. message: Data restored
  3811. '400':
  3812. $ref: '#/components/responses/BadRequest'
  3813. '401':
  3814. $ref: '#/components/responses/Unauthorized'
  3815. '403':
  3816. $ref: '#/components/responses/Forbidden'
  3817. '500':
  3818. $ref: '#/components/responses/InternalServerError'
  3819. default:
  3820. $ref: '#/components/responses/DefaultResponse'
  3821. post:
  3822. tags:
  3823. - maintenance
  3824. summary: Load data
  3825. 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'
  3826. operationId: loaddata_from_request_body
  3827. requestBody:
  3828. required: true
  3829. content:
  3830. application/json:
  3831. schema:
  3832. $ref: '#/components/schemas/BackupData'
  3833. responses:
  3834. '200':
  3835. description: successful operation
  3836. content:
  3837. application/json:
  3838. schema:
  3839. $ref: '#/components/schemas/ApiResponse'
  3840. example:
  3841. message: Data restored
  3842. '400':
  3843. $ref: '#/components/responses/BadRequest'
  3844. '401':
  3845. $ref: '#/components/responses/Unauthorized'
  3846. '403':
  3847. $ref: '#/components/responses/Forbidden'
  3848. '500':
  3849. $ref: '#/components/responses/InternalServerError'
  3850. default:
  3851. $ref: '#/components/responses/DefaultResponse'
  3852. /user/changepwd:
  3853. put:
  3854. security:
  3855. - BearerAuth: []
  3856. tags:
  3857. - user APIs
  3858. summary: Change user password
  3859. description: Changes the password for the logged in user
  3860. operationId: change_user_password
  3861. requestBody:
  3862. required: true
  3863. content:
  3864. application/json:
  3865. schema:
  3866. $ref: '#/components/schemas/PwdChange'
  3867. responses:
  3868. '200':
  3869. description: successful operation
  3870. content:
  3871. application/json:
  3872. schema:
  3873. $ref: '#/components/schemas/ApiResponse'
  3874. '401':
  3875. $ref: '#/components/responses/Unauthorized'
  3876. '403':
  3877. $ref: '#/components/responses/Forbidden'
  3878. '500':
  3879. $ref: '#/components/responses/InternalServerError'
  3880. default:
  3881. $ref: '#/components/responses/DefaultResponse'
  3882. /user/profile:
  3883. get:
  3884. security:
  3885. - BearerAuth: []
  3886. tags:
  3887. - user APIs
  3888. summary: Get user profile
  3889. description: 'Returns the profile for the logged in user'
  3890. operationId: get_user_profile
  3891. responses:
  3892. '200':
  3893. description: successful operation
  3894. content:
  3895. application/json:
  3896. schema:
  3897. $ref: '#/components/schemas/UserProfile'
  3898. '401':
  3899. $ref: '#/components/responses/Unauthorized'
  3900. '403':
  3901. $ref: '#/components/responses/Forbidden'
  3902. '500':
  3903. $ref: '#/components/responses/InternalServerError'
  3904. default:
  3905. $ref: '#/components/responses/DefaultResponse'
  3906. put:
  3907. security:
  3908. - BearerAuth: []
  3909. tags:
  3910. - user APIs
  3911. summary: Update user profile
  3912. description: 'Allows to update the profile for the logged in user'
  3913. operationId: update_user_profile
  3914. requestBody:
  3915. required: true
  3916. content:
  3917. application/json:
  3918. schema:
  3919. $ref: '#/components/schemas/UserProfile'
  3920. responses:
  3921. '200':
  3922. description: successful operation
  3923. content:
  3924. application/json:
  3925. schema:
  3926. $ref: '#/components/schemas/ApiResponse'
  3927. '400':
  3928. $ref: '#/components/responses/BadRequest'
  3929. '401':
  3930. $ref: '#/components/responses/Unauthorized'
  3931. '403':
  3932. $ref: '#/components/responses/Forbidden'
  3933. '500':
  3934. $ref: '#/components/responses/InternalServerError'
  3935. default:
  3936. $ref: '#/components/responses/DefaultResponse'
  3937. /user/2fa/recoverycodes:
  3938. get:
  3939. security:
  3940. - BearerAuth: []
  3941. tags:
  3942. - user APIs
  3943. summary: Get recovery codes
  3944. 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'
  3945. operationId: get_user_recovery_codes
  3946. responses:
  3947. '200':
  3948. description: successful operation
  3949. content:
  3950. application/json:
  3951. schema:
  3952. type: array
  3953. items:
  3954. $ref: '#/components/schemas/RecoveryCode'
  3955. '401':
  3956. $ref: '#/components/responses/Unauthorized'
  3957. '403':
  3958. $ref: '#/components/responses/Forbidden'
  3959. '500':
  3960. $ref: '#/components/responses/InternalServerError'
  3961. default:
  3962. $ref: '#/components/responses/DefaultResponse'
  3963. post:
  3964. security:
  3965. - BearerAuth: []
  3966. tags:
  3967. - user APIs
  3968. summary: Generate recovery codes
  3969. description: 'Generates new recovery codes for the logged in user. Generating new recovery codes you automatically invalidate old ones'
  3970. operationId: generate_user_recovery_codes
  3971. responses:
  3972. '200':
  3973. description: successful operation
  3974. content:
  3975. application/json:
  3976. schema:
  3977. type: array
  3978. items:
  3979. type: string
  3980. '400':
  3981. $ref: '#/components/responses/BadRequest'
  3982. '401':
  3983. $ref: '#/components/responses/Unauthorized'
  3984. '403':
  3985. $ref: '#/components/responses/Forbidden'
  3986. '500':
  3987. $ref: '#/components/responses/InternalServerError'
  3988. default:
  3989. $ref: '#/components/responses/DefaultResponse'
  3990. /user/totp/configs:
  3991. get:
  3992. security:
  3993. - BearerAuth: []
  3994. tags:
  3995. - user APIs
  3996. summary: Get available TOTP configuration
  3997. description: Returns the available TOTP configurations for the logged in user
  3998. operationId: get_user_totp_configs
  3999. responses:
  4000. '200':
  4001. description: successful operation
  4002. content:
  4003. application/json:
  4004. schema:
  4005. type: array
  4006. items:
  4007. $ref: '#/components/schemas/TOTPConfig'
  4008. '401':
  4009. $ref: '#/components/responses/Unauthorized'
  4010. '403':
  4011. $ref: '#/components/responses/Forbidden'
  4012. '500':
  4013. $ref: '#/components/responses/InternalServerError'
  4014. default:
  4015. $ref: '#/components/responses/DefaultResponse'
  4016. /user/totp/generate:
  4017. post:
  4018. security:
  4019. - BearerAuth: []
  4020. tags:
  4021. - user APIs
  4022. summary: Generate a new TOTP secret
  4023. description: 'Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in user'
  4024. operationId: generate_user_totp_secret
  4025. requestBody:
  4026. required: true
  4027. content:
  4028. application/json:
  4029. schema:
  4030. type: object
  4031. properties:
  4032. config_name:
  4033. type: string
  4034. description: 'name of the configuration to use to generate the secret'
  4035. responses:
  4036. '200':
  4037. description: successful operation
  4038. content:
  4039. application/json:
  4040. schema:
  4041. type: object
  4042. properties:
  4043. config_name:
  4044. type: string
  4045. issuer:
  4046. type: string
  4047. secret:
  4048. type: string
  4049. qr_code:
  4050. type: string
  4051. format: byte
  4052. description: 'QR code png encoded as BASE64'
  4053. '400':
  4054. $ref: '#/components/responses/BadRequest'
  4055. '401':
  4056. $ref: '#/components/responses/Unauthorized'
  4057. '403':
  4058. $ref: '#/components/responses/Forbidden'
  4059. '500':
  4060. $ref: '#/components/responses/InternalServerError'
  4061. default:
  4062. $ref: '#/components/responses/DefaultResponse'
  4063. /user/totp/validate:
  4064. post:
  4065. security:
  4066. - BearerAuth: []
  4067. tags:
  4068. - user APIs
  4069. summary: Validate a one time authentication code
  4070. description: 'Checks if the given authentication code can be validated using the specified secret and config name'
  4071. operationId: validate_user_totp_secret
  4072. requestBody:
  4073. required: true
  4074. content:
  4075. application/json:
  4076. schema:
  4077. type: object
  4078. properties:
  4079. config_name:
  4080. type: string
  4081. description: 'name of the configuration to use to validate the passcode'
  4082. passcode:
  4083. type: string
  4084. description: 'passcode to validate'
  4085. secret:
  4086. type: string
  4087. description: 'secret to use to validate the passcode'
  4088. responses:
  4089. '200':
  4090. description: successful operation
  4091. content:
  4092. application/json:
  4093. schema:
  4094. $ref: '#/components/schemas/ApiResponse'
  4095. example:
  4096. message: Passcode successfully validated
  4097. '400':
  4098. $ref: '#/components/responses/BadRequest'
  4099. '401':
  4100. $ref: '#/components/responses/Unauthorized'
  4101. '403':
  4102. $ref: '#/components/responses/Forbidden'
  4103. '500':
  4104. $ref: '#/components/responses/InternalServerError'
  4105. default:
  4106. $ref: '#/components/responses/DefaultResponse'
  4107. /user/totp/save:
  4108. post:
  4109. security:
  4110. - BearerAuth: []
  4111. tags:
  4112. - user APIs
  4113. summary: Save a TOTP config
  4114. description: 'Saves the specified TOTP config for the logged in user'
  4115. operationId: save_user_totp_config
  4116. requestBody:
  4117. required: true
  4118. content:
  4119. application/json:
  4120. schema:
  4121. $ref: '#/components/schemas/UserTOTPConfig'
  4122. responses:
  4123. '200':
  4124. description: successful operation
  4125. content:
  4126. application/json:
  4127. schema:
  4128. $ref: '#/components/schemas/ApiResponse'
  4129. example:
  4130. message: TOTP configuration saved
  4131. '400':
  4132. $ref: '#/components/responses/BadRequest'
  4133. '401':
  4134. $ref: '#/components/responses/Unauthorized'
  4135. '403':
  4136. $ref: '#/components/responses/Forbidden'
  4137. '500':
  4138. $ref: '#/components/responses/InternalServerError'
  4139. default:
  4140. $ref: '#/components/responses/DefaultResponse'
  4141. /user/shares:
  4142. get:
  4143. tags:
  4144. - user APIs
  4145. summary: List user shares
  4146. description: Returns the share for the logged in user
  4147. operationId: get_user_shares
  4148. parameters:
  4149. - in: query
  4150. name: offset
  4151. schema:
  4152. type: integer
  4153. minimum: 0
  4154. default: 0
  4155. required: false
  4156. - in: query
  4157. name: limit
  4158. schema:
  4159. type: integer
  4160. minimum: 1
  4161. maximum: 500
  4162. default: 100
  4163. required: false
  4164. description: 'The maximum number of items to return. Max value is 500, default is 100'
  4165. - in: query
  4166. name: order
  4167. required: false
  4168. description: Ordering shares by ID. Default ASC
  4169. schema:
  4170. type: string
  4171. enum:
  4172. - ASC
  4173. - DESC
  4174. example: ASC
  4175. responses:
  4176. '200':
  4177. description: successful operation
  4178. content:
  4179. application/json:
  4180. schema:
  4181. type: array
  4182. items:
  4183. $ref: '#/components/schemas/Share'
  4184. '400':
  4185. $ref: '#/components/responses/BadRequest'
  4186. '401':
  4187. $ref: '#/components/responses/Unauthorized'
  4188. '403':
  4189. $ref: '#/components/responses/Forbidden'
  4190. '500':
  4191. $ref: '#/components/responses/InternalServerError'
  4192. default:
  4193. $ref: '#/components/responses/DefaultResponse'
  4194. post:
  4195. tags:
  4196. - user APIs
  4197. summary: Add a share
  4198. operationId: add_share
  4199. description: 'Adds a new share. The share id will be auto-generated'
  4200. requestBody:
  4201. required: true
  4202. content:
  4203. application/json:
  4204. schema:
  4205. $ref: '#/components/schemas/Share'
  4206. responses:
  4207. '201':
  4208. description: successful operation
  4209. headers:
  4210. X-Object-ID:
  4211. schema:
  4212. type: string
  4213. description: ID for the new created share
  4214. Location:
  4215. schema:
  4216. type: string
  4217. description: URI to retrieve the details for the new created share
  4218. content:
  4219. application/json:
  4220. schema:
  4221. $ref: '#/components/schemas/ApiResponse'
  4222. '400':
  4223. $ref: '#/components/responses/BadRequest'
  4224. '401':
  4225. $ref: '#/components/responses/Unauthorized'
  4226. '403':
  4227. $ref: '#/components/responses/Forbidden'
  4228. '500':
  4229. $ref: '#/components/responses/InternalServerError'
  4230. default:
  4231. $ref: '#/components/responses/DefaultResponse'
  4232. '/user/shares/{id}':
  4233. parameters:
  4234. - name: id
  4235. in: path
  4236. description: the share id
  4237. required: true
  4238. schema:
  4239. type: string
  4240. get:
  4241. tags:
  4242. - user APIs
  4243. summary: Get share by id
  4244. description: Returns a share by id for the logged in user
  4245. operationId: get_user_share_by_id
  4246. responses:
  4247. '200':
  4248. description: successful operation
  4249. content:
  4250. application/json:
  4251. schema:
  4252. $ref: '#/components/schemas/Share'
  4253. '400':
  4254. $ref: '#/components/responses/BadRequest'
  4255. '401':
  4256. $ref: '#/components/responses/Unauthorized'
  4257. '403':
  4258. $ref: '#/components/responses/Forbidden'
  4259. '404':
  4260. $ref: '#/components/responses/NotFound'
  4261. '500':
  4262. $ref: '#/components/responses/InternalServerError'
  4263. default:
  4264. $ref: '#/components/responses/DefaultResponse'
  4265. put:
  4266. tags:
  4267. - user APIs
  4268. summary: Update share
  4269. description: 'Updates an existing share belonging to the logged in user'
  4270. operationId: update_user_share
  4271. requestBody:
  4272. required: true
  4273. content:
  4274. application/json:
  4275. schema:
  4276. $ref: '#/components/schemas/Share'
  4277. responses:
  4278. '200':
  4279. description: successful operation
  4280. content:
  4281. application/json:
  4282. schema:
  4283. $ref: '#/components/schemas/ApiResponse'
  4284. example:
  4285. message: Share updated
  4286. '400':
  4287. $ref: '#/components/responses/BadRequest'
  4288. '401':
  4289. $ref: '#/components/responses/Unauthorized'
  4290. '403':
  4291. $ref: '#/components/responses/Forbidden'
  4292. '404':
  4293. $ref: '#/components/responses/NotFound'
  4294. '500':
  4295. $ref: '#/components/responses/InternalServerError'
  4296. default:
  4297. $ref: '#/components/responses/DefaultResponse'
  4298. delete:
  4299. tags:
  4300. - user APIs
  4301. summary: Delete share
  4302. description: 'Deletes an existing share belonging to the logged in user'
  4303. operationId: delete_user_share
  4304. responses:
  4305. '200':
  4306. description: successful operation
  4307. content:
  4308. application/json:
  4309. schema:
  4310. $ref: '#/components/schemas/ApiResponse'
  4311. example:
  4312. message: Share deleted
  4313. '400':
  4314. $ref: '#/components/responses/BadRequest'
  4315. '401':
  4316. $ref: '#/components/responses/Unauthorized'
  4317. '403':
  4318. $ref: '#/components/responses/Forbidden'
  4319. '404':
  4320. $ref: '#/components/responses/NotFound'
  4321. '500':
  4322. $ref: '#/components/responses/InternalServerError'
  4323. default:
  4324. $ref: '#/components/responses/DefaultResponse'
  4325. /user/file-actions/copy:
  4326. parameters:
  4327. - in: query
  4328. name: path
  4329. description: Path to the file/folder to copy. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir"
  4330. schema:
  4331. type: string
  4332. required: true
  4333. - in: query
  4334. name: target
  4335. description: New name. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir"
  4336. schema:
  4337. type: string
  4338. required: true
  4339. post:
  4340. tags:
  4341. - user APIs
  4342. summary: 'Copy a file or a directory'
  4343. responses:
  4344. '200':
  4345. description: successful operation
  4346. content:
  4347. application/json:
  4348. schema:
  4349. $ref: '#/components/schemas/ApiResponse'
  4350. '400':
  4351. $ref: '#/components/responses/BadRequest'
  4352. '401':
  4353. $ref: '#/components/responses/Unauthorized'
  4354. '403':
  4355. $ref: '#/components/responses/Forbidden'
  4356. '500':
  4357. $ref: '#/components/responses/InternalServerError'
  4358. default:
  4359. $ref: '#/components/responses/DefaultResponse'
  4360. /user/file-actions/move:
  4361. parameters:
  4362. - in: query
  4363. name: path
  4364. description: Path to the file/folder to rename. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir"
  4365. schema:
  4366. type: string
  4367. required: true
  4368. - in: query
  4369. name: target
  4370. description: New name. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir"
  4371. schema:
  4372. type: string
  4373. required: true
  4374. post:
  4375. tags:
  4376. - user APIs
  4377. summary: 'Move (rename) a file or a directory'
  4378. responses:
  4379. '200':
  4380. description: successful operation
  4381. content:
  4382. application/json:
  4383. schema:
  4384. $ref: '#/components/schemas/ApiResponse'
  4385. '400':
  4386. $ref: '#/components/responses/BadRequest'
  4387. '401':
  4388. $ref: '#/components/responses/Unauthorized'
  4389. '403':
  4390. $ref: '#/components/responses/Forbidden'
  4391. '500':
  4392. $ref: '#/components/responses/InternalServerError'
  4393. default:
  4394. $ref: '#/components/responses/DefaultResponse'
  4395. /user/dirs:
  4396. get:
  4397. tags:
  4398. - user APIs
  4399. summary: Read directory contents
  4400. description: Returns the contents of the specified directory for the logged in user
  4401. operationId: get_user_dir_contents
  4402. parameters:
  4403. - in: query
  4404. name: path
  4405. 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
  4406. schema:
  4407. type: string
  4408. responses:
  4409. '200':
  4410. description: successful operation
  4411. content:
  4412. application/json:
  4413. schema:
  4414. type: array
  4415. items:
  4416. $ref: '#/components/schemas/DirEntry'
  4417. '400':
  4418. $ref: '#/components/responses/BadRequest'
  4419. '401':
  4420. $ref: '#/components/responses/Unauthorized'
  4421. '403':
  4422. $ref: '#/components/responses/Forbidden'
  4423. '500':
  4424. $ref: '#/components/responses/InternalServerError'
  4425. default:
  4426. $ref: '#/components/responses/DefaultResponse'
  4427. post:
  4428. tags:
  4429. - user APIs
  4430. summary: Create a directory
  4431. description: Create a directory for the logged in user
  4432. operationId: create_user_dir
  4433. parameters:
  4434. - in: query
  4435. name: path
  4436. 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"
  4437. schema:
  4438. type: string
  4439. required: true
  4440. - in: query
  4441. name: mkdir_parents
  4442. description: Create parent directories if they do not exist?
  4443. schema:
  4444. type: boolean
  4445. required: false
  4446. responses:
  4447. '201':
  4448. description: successful operation
  4449. content:
  4450. application/json:
  4451. schema:
  4452. $ref: '#/components/schemas/ApiResponse'
  4453. '400':
  4454. $ref: '#/components/responses/BadRequest'
  4455. '401':
  4456. $ref: '#/components/responses/Unauthorized'
  4457. '403':
  4458. $ref: '#/components/responses/Forbidden'
  4459. '500':
  4460. $ref: '#/components/responses/InternalServerError'
  4461. default:
  4462. $ref: '#/components/responses/DefaultResponse'
  4463. patch:
  4464. tags:
  4465. - user APIs
  4466. deprecated: true
  4467. summary: 'Rename a directory. Deprecated, use "file-actions/move"'
  4468. 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
  4469. operationId: rename_user_dir
  4470. parameters:
  4471. - in: query
  4472. name: path
  4473. 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"
  4474. schema:
  4475. type: string
  4476. required: true
  4477. - in: query
  4478. name: target
  4479. description: New name. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir"
  4480. schema:
  4481. type: string
  4482. required: true
  4483. responses:
  4484. '200':
  4485. description: successful operation
  4486. content:
  4487. application/json:
  4488. schema:
  4489. $ref: '#/components/schemas/ApiResponse'
  4490. '400':
  4491. $ref: '#/components/responses/BadRequest'
  4492. '401':
  4493. $ref: '#/components/responses/Unauthorized'
  4494. '403':
  4495. $ref: '#/components/responses/Forbidden'
  4496. '500':
  4497. $ref: '#/components/responses/InternalServerError'
  4498. default:
  4499. $ref: '#/components/responses/DefaultResponse'
  4500. delete:
  4501. tags:
  4502. - user APIs
  4503. summary: Delete a directory
  4504. description: Delete a directory and any children it contains for the logged in user
  4505. operationId: delete_user_dir
  4506. parameters:
  4507. - in: query
  4508. name: path
  4509. 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"
  4510. schema:
  4511. type: string
  4512. required: true
  4513. responses:
  4514. '200':
  4515. description: successful operation
  4516. content:
  4517. application/json:
  4518. schema:
  4519. $ref: '#/components/schemas/ApiResponse'
  4520. '400':
  4521. $ref: '#/components/responses/BadRequest'
  4522. '401':
  4523. $ref: '#/components/responses/Unauthorized'
  4524. '403':
  4525. $ref: '#/components/responses/Forbidden'
  4526. '500':
  4527. $ref: '#/components/responses/InternalServerError'
  4528. default:
  4529. $ref: '#/components/responses/DefaultResponse'
  4530. /user/files:
  4531. get:
  4532. tags:
  4533. - user APIs
  4534. summary: Download a single file
  4535. description: Returns the file contents as response body
  4536. operationId: download_user_file
  4537. parameters:
  4538. - in: query
  4539. name: path
  4540. required: true
  4541. 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"
  4542. schema:
  4543. type: string
  4544. - in: query
  4545. name: inline
  4546. required: false
  4547. description: 'If set, the response will not have the Content-Disposition header set to `attachment`'
  4548. schema:
  4549. type: string
  4550. responses:
  4551. '200':
  4552. description: successful operation
  4553. content:
  4554. '*/*':
  4555. schema:
  4556. type: string
  4557. format: binary
  4558. '206':
  4559. description: successful operation
  4560. content:
  4561. '*/*':
  4562. schema:
  4563. type: string
  4564. format: binary
  4565. '400':
  4566. $ref: '#/components/responses/BadRequest'
  4567. '401':
  4568. $ref: '#/components/responses/Unauthorized'
  4569. '403':
  4570. $ref: '#/components/responses/Forbidden'
  4571. '500':
  4572. $ref: '#/components/responses/InternalServerError'
  4573. default:
  4574. $ref: '#/components/responses/DefaultResponse'
  4575. post:
  4576. tags:
  4577. - user APIs
  4578. summary: Upload files
  4579. description: Upload one or more files for the logged in user
  4580. operationId: create_user_files
  4581. parameters:
  4582. - in: query
  4583. name: path
  4584. 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
  4585. schema:
  4586. type: string
  4587. - in: query
  4588. name: mkdir_parents
  4589. description: Create parent directories if they do not exist?
  4590. schema:
  4591. type: boolean
  4592. required: false
  4593. requestBody:
  4594. content:
  4595. multipart/form-data:
  4596. schema:
  4597. type: object
  4598. properties:
  4599. filenames:
  4600. type: array
  4601. items:
  4602. type: string
  4603. format: binary
  4604. minItems: 1
  4605. uniqueItems: true
  4606. required: true
  4607. responses:
  4608. '201':
  4609. description: successful operation
  4610. content:
  4611. application/json:
  4612. schema:
  4613. $ref: '#/components/schemas/ApiResponse'
  4614. '400':
  4615. $ref: '#/components/responses/BadRequest'
  4616. '401':
  4617. $ref: '#/components/responses/Unauthorized'
  4618. '403':
  4619. $ref: '#/components/responses/Forbidden'
  4620. '413':
  4621. $ref: '#/components/responses/RequestEntityTooLarge'
  4622. '500':
  4623. $ref: '#/components/responses/InternalServerError'
  4624. default:
  4625. $ref: '#/components/responses/DefaultResponse'
  4626. patch:
  4627. tags:
  4628. - user APIs
  4629. deprecated: true
  4630. summary: Rename a file
  4631. description: 'Rename a file for the logged in user. Deprecated, use "file-actions/move"'
  4632. operationId: rename_user_file
  4633. parameters:
  4634. - in: query
  4635. name: path
  4636. description: Path to the file to rename. It must be URL encoded
  4637. schema:
  4638. type: string
  4639. required: true
  4640. - in: query
  4641. name: target
  4642. description: New name. It must be URL encoded
  4643. schema:
  4644. type: string
  4645. required: true
  4646. responses:
  4647. '200':
  4648. description: successful operation
  4649. content:
  4650. application/json:
  4651. schema:
  4652. $ref: '#/components/schemas/ApiResponse'
  4653. '400':
  4654. $ref: '#/components/responses/BadRequest'
  4655. '401':
  4656. $ref: '#/components/responses/Unauthorized'
  4657. '403':
  4658. $ref: '#/components/responses/Forbidden'
  4659. '500':
  4660. $ref: '#/components/responses/InternalServerError'
  4661. default:
  4662. $ref: '#/components/responses/DefaultResponse'
  4663. delete:
  4664. tags:
  4665. - user APIs
  4666. summary: Delete a file
  4667. description: Delete a file for the logged in user.
  4668. operationId: delete_user_file
  4669. parameters:
  4670. - in: query
  4671. name: path
  4672. description: Path to the file to delete. It must be URL encoded
  4673. schema:
  4674. type: string
  4675. required: true
  4676. responses:
  4677. '200':
  4678. description: successful operation
  4679. content:
  4680. application/json:
  4681. schema:
  4682. $ref: '#/components/schemas/ApiResponse'
  4683. '400':
  4684. $ref: '#/components/responses/BadRequest'
  4685. '401':
  4686. $ref: '#/components/responses/Unauthorized'
  4687. '403':
  4688. $ref: '#/components/responses/Forbidden'
  4689. '500':
  4690. $ref: '#/components/responses/InternalServerError'
  4691. default:
  4692. $ref: '#/components/responses/DefaultResponse'
  4693. /user/files/upload:
  4694. post:
  4695. tags:
  4696. - user APIs
  4697. summary: Upload a single file
  4698. 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'
  4699. operationId: create_user_file
  4700. parameters:
  4701. - in: query
  4702. name: path
  4703. 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
  4704. schema:
  4705. type: string
  4706. required: true
  4707. - in: query
  4708. name: mkdir_parents
  4709. description: Create parent directories if they do not exist?
  4710. schema:
  4711. type: boolean
  4712. required: false
  4713. - in: header
  4714. name: X-SFTPGO-MTIME
  4715. schema:
  4716. type: integer
  4717. description: File modification time as unix timestamp in milliseconds
  4718. requestBody:
  4719. content:
  4720. application/*:
  4721. schema:
  4722. type: string
  4723. format: binary
  4724. text/*:
  4725. schema:
  4726. type: string
  4727. format: binary
  4728. image/*:
  4729. schema:
  4730. type: string
  4731. format: binary
  4732. audio/*:
  4733. schema:
  4734. type: string
  4735. format: binary
  4736. video/*:
  4737. schema:
  4738. type: string
  4739. format: binary
  4740. required: true
  4741. responses:
  4742. '201':
  4743. description: successful operation
  4744. content:
  4745. application/json:
  4746. schema:
  4747. $ref: '#/components/schemas/ApiResponse'
  4748. '400':
  4749. $ref: '#/components/responses/BadRequest'
  4750. '401':
  4751. $ref: '#/components/responses/Unauthorized'
  4752. '403':
  4753. $ref: '#/components/responses/Forbidden'
  4754. '413':
  4755. $ref: '#/components/responses/RequestEntityTooLarge'
  4756. '500':
  4757. $ref: '#/components/responses/InternalServerError'
  4758. default:
  4759. $ref: '#/components/responses/DefaultResponse'
  4760. /user/files/metadata:
  4761. patch:
  4762. tags:
  4763. - user APIs
  4764. summary: Set metadata for a file/directory
  4765. description: 'Set supported metadata attributes for the specified file or directory'
  4766. operationId: setprops_user_file
  4767. parameters:
  4768. - in: query
  4769. name: path
  4770. 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"
  4771. schema:
  4772. type: string
  4773. required: true
  4774. requestBody:
  4775. content:
  4776. application/json:
  4777. schema:
  4778. type: object
  4779. properties:
  4780. modification_time:
  4781. type: integer
  4782. description: File modification time as unix timestamp in milliseconds
  4783. required: true
  4784. responses:
  4785. '200':
  4786. description: successful operation
  4787. content:
  4788. application/json:
  4789. schema:
  4790. $ref: '#/components/schemas/ApiResponse'
  4791. '400':
  4792. $ref: '#/components/responses/BadRequest'
  4793. '401':
  4794. $ref: '#/components/responses/Unauthorized'
  4795. '403':
  4796. $ref: '#/components/responses/Forbidden'
  4797. '413':
  4798. $ref: '#/components/responses/RequestEntityTooLarge'
  4799. '500':
  4800. $ref: '#/components/responses/InternalServerError'
  4801. default:
  4802. $ref: '#/components/responses/DefaultResponse'
  4803. /user/streamzip:
  4804. post:
  4805. tags:
  4806. - user APIs
  4807. summary: Download multiple files and folders as a single zip file
  4808. 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
  4809. operationId: streamzip
  4810. requestBody:
  4811. required: true
  4812. content:
  4813. application/json:
  4814. schema:
  4815. type: array
  4816. items:
  4817. type: string
  4818. description: Absolute file or folder path
  4819. responses:
  4820. '200':
  4821. description: successful operation
  4822. content:
  4823. 'application/zip':
  4824. schema:
  4825. type: string
  4826. format: binary
  4827. '400':
  4828. $ref: '#/components/responses/BadRequest'
  4829. '401':
  4830. $ref: '#/components/responses/Unauthorized'
  4831. '403':
  4832. $ref: '#/components/responses/Forbidden'
  4833. '500':
  4834. $ref: '#/components/responses/InternalServerError'
  4835. default:
  4836. $ref: '#/components/responses/DefaultResponse'
  4837. components:
  4838. responses:
  4839. BadRequest:
  4840. description: Bad Request
  4841. content:
  4842. application/json:
  4843. schema:
  4844. $ref: '#/components/schemas/ApiResponse'
  4845. Unauthorized:
  4846. description: Unauthorized
  4847. content:
  4848. application/json:
  4849. schema:
  4850. $ref: '#/components/schemas/ApiResponse'
  4851. Forbidden:
  4852. description: Forbidden
  4853. content:
  4854. application/json:
  4855. schema:
  4856. $ref: '#/components/schemas/ApiResponse'
  4857. NotFound:
  4858. description: Not Found
  4859. content:
  4860. application/json:
  4861. schema:
  4862. $ref: '#/components/schemas/ApiResponse'
  4863. Conflict:
  4864. description: Conflict
  4865. content:
  4866. application/json:
  4867. schema:
  4868. $ref: '#/components/schemas/ApiResponse'
  4869. RequestEntityTooLarge:
  4870. description: Request Entity Too Large, max allowed size exceeded
  4871. content:
  4872. application/json:
  4873. schema:
  4874. $ref: '#/components/schemas/ApiResponse'
  4875. InternalServerError:
  4876. description: Internal Server Error
  4877. content:
  4878. application/json:
  4879. schema:
  4880. $ref: '#/components/schemas/ApiResponse'
  4881. DefaultResponse:
  4882. description: Unexpected Error
  4883. content:
  4884. application/json:
  4885. schema:
  4886. $ref: '#/components/schemas/ApiResponse'
  4887. schemas:
  4888. Permission:
  4889. type: string
  4890. enum:
  4891. - '*'
  4892. - list
  4893. - download
  4894. - upload
  4895. - overwrite
  4896. - delete
  4897. - delete_files
  4898. - delete_dirs
  4899. - rename
  4900. - rename_files
  4901. - rename_dirs
  4902. - create_dirs
  4903. - create_symlinks
  4904. - chmod
  4905. - chown
  4906. - chtimes
  4907. - copy
  4908. description: |
  4909. Permissions:
  4910. * `*` - all permissions are granted
  4911. * `list` - list items is allowed
  4912. * `download` - download files is allowed
  4913. * `upload` - upload files is allowed
  4914. * `overwrite` - overwrite an existing file, while uploading, is allowed. upload permission is required to allow file overwrite
  4915. * `delete` - delete files or directories is allowed
  4916. * `delete_files` - delete files is allowed
  4917. * `delete_dirs` - delete directories is allowed
  4918. * `rename` - rename files or directories is allowed
  4919. * `rename_files` - rename files is allowed
  4920. * `rename_dirs` - rename directories is allowed
  4921. * `create_dirs` - create directories is allowed
  4922. * `create_symlinks` - create links is allowed
  4923. * `chmod` changing file or directory permissions is allowed
  4924. * `chown` changing file or directory owner and group is allowed
  4925. * `chtimes` changing file or directory access and modification time is allowed
  4926. * `copy`, copying files or directories is allowed
  4927. AdminPermissions:
  4928. type: string
  4929. enum:
  4930. - '*'
  4931. - add_users
  4932. - edit_users
  4933. - del_users
  4934. - view_users
  4935. - view_conns
  4936. - close_conns
  4937. - view_status
  4938. - manage_folders
  4939. - manage_groups
  4940. - quota_scans
  4941. - manage_defender
  4942. - view_defender
  4943. - view_events
  4944. - disable_mfa
  4945. description: |
  4946. Admin permissions:
  4947. * `*` - super admin permissions are granted
  4948. * `add_users` - add new users is allowed
  4949. * `edit_users` - change existing users is allowed
  4950. * `del_users` - remove users is allowed
  4951. * `view_users` - list users is allowed
  4952. * `view_conns` - list active connections is allowed
  4953. * `close_conns` - close active connections is allowed
  4954. * `view_status` - view the server status is allowed
  4955. * `manage_folders` - manage folders is allowed
  4956. * `manage_groups` - manage groups is allowed
  4957. * `quota_scans` - view and start quota scans is allowed
  4958. * `manage_defender` - remove ip from the dynamic blocklist is allowed
  4959. * `view_defender` - list the dynamic blocklist is allowed
  4960. * `view_events` - view and search filesystem and provider events is allowed
  4961. * `disable_mfa` - allow to disable two-factor authentication for users and admins
  4962. FsProviders:
  4963. type: integer
  4964. enum:
  4965. - 0
  4966. - 1
  4967. - 2
  4968. - 3
  4969. - 4
  4970. - 5
  4971. - 6
  4972. description: |
  4973. Filesystem providers:
  4974. * `0` - Local filesystem
  4975. * `1` - S3 Compatible Object Storage
  4976. * `2` - Google Cloud Storage
  4977. * `3` - Azure Blob Storage
  4978. * `4` - Local filesystem encrypted
  4979. * `5` - SFTP
  4980. * `6` - HTTP filesystem
  4981. EventActionTypes:
  4982. type: integer
  4983. enum:
  4984. - 1
  4985. - 2
  4986. - 3
  4987. - 4
  4988. - 5
  4989. - 6
  4990. - 7
  4991. - 8
  4992. - 9
  4993. - 11
  4994. - 12
  4995. - 13
  4996. - 14
  4997. - 15
  4998. description: |
  4999. Supported event action types:
  5000. * `1` - HTTP
  5001. * `2` - Command
  5002. * `3` - Email
  5003. * `4` - Backup
  5004. * `5` - User quota reset
  5005. * `6` - Folder quota reset
  5006. * `7` - Transfer quota reset
  5007. * `8` - Data retention check
  5008. * `9` - Filesystem
  5009. * `11` - Password expiration check
  5010. * `12` - User expiration check
  5011. * `13` - Identity Provider account check
  5012. * `14` - User inactivity check
  5013. * `15` - Rotate log file
  5014. FilesystemActionTypes:
  5015. type: integer
  5016. enum:
  5017. - 1
  5018. - 2
  5019. - 3
  5020. - 4
  5021. - 5
  5022. - 6
  5023. description: |
  5024. Supported filesystem action types:
  5025. * `1` - Rename
  5026. * `2` - Delete
  5027. * `3` - Mkdis
  5028. * `4` - Exist
  5029. * `5` - Compress
  5030. * `6` - Copy
  5031. EventTriggerTypes:
  5032. type: integer
  5033. enum:
  5034. - 1
  5035. - 2
  5036. - 3
  5037. - 4
  5038. - 5
  5039. - 6
  5040. - 7
  5041. description: |
  5042. Supported event trigger types:
  5043. * `1` - Filesystem event
  5044. * `2` - Provider event
  5045. * `3` - Schedule
  5046. * `4` - IP blocked
  5047. * `5` - Certificate renewal
  5048. * `6` - On demand, like schedule but executed on demand
  5049. * `7` - Identity provider login
  5050. LoginMethods:
  5051. type: string
  5052. enum:
  5053. - publickey
  5054. - password
  5055. - password-over-SSH
  5056. - keyboard-interactive
  5057. - publickey+password
  5058. - publickey+keyboard-interactive
  5059. - TLSCertificate
  5060. - TLSCertificate+password
  5061. description: |
  5062. Available login methods. To enable multi-step authentication you have to allow only multi-step login methods
  5063. * `publickey`
  5064. * `password`, password for all the supported protocols
  5065. * `password-over-SSH`, password over SSH protocol (SSH/SFTP/SCP)
  5066. * `keyboard-interactive`
  5067. * `publickey+password` - multi-step auth: public key and password
  5068. * `publickey+keyboard-interactive` - multi-step auth: public key and keyboard interactive
  5069. * `TLSCertificate`
  5070. * `TLSCertificate+password` - multi-step auth: TLS client certificate and password
  5071. SupportedProtocols:
  5072. type: string
  5073. enum:
  5074. - SSH
  5075. - FTP
  5076. - DAV
  5077. - HTTP
  5078. description: |
  5079. Protocols:
  5080. * `SSH` - includes both SFTP and SSH commands
  5081. * `FTP` - plain FTP and FTPES/FTPS
  5082. * `DAV` - WebDAV over HTTP/HTTPS
  5083. * `HTTP` - WebClient/REST API
  5084. MFAProtocols:
  5085. type: string
  5086. enum:
  5087. - SSH
  5088. - FTP
  5089. - HTTP
  5090. description: |
  5091. Protocols:
  5092. * `SSH` - includes both SFTP and SSH commands
  5093. * `FTP` - plain FTP and FTPES/FTPS
  5094. * `HTTP` - WebClient/REST API
  5095. EventProtocols:
  5096. type: string
  5097. enum:
  5098. - SSH
  5099. - SFTP
  5100. - SCP
  5101. - FTP
  5102. - DAV
  5103. - HTTP
  5104. - HTTPShare
  5105. - DataRetention
  5106. - EventAction
  5107. - OIDC
  5108. description: |
  5109. Protocols:
  5110. * `SSH` - SSH commands
  5111. * `SFTP` - SFTP protocol
  5112. * `SCP` - SCP protocol
  5113. * `FTP` - plain FTP and FTPES/FTPS
  5114. * `DAV` - WebDAV
  5115. * `HTTP` - WebClient/REST API
  5116. * `HTTPShare` - the event is generated in a public share
  5117. * `DataRetention` - the event is generated by a data retention check
  5118. * `EventAction` - the event is generated by an EventManager action
  5119. * `OIDC` - OpenID Connect
  5120. WebClientOptions:
  5121. type: string
  5122. enum:
  5123. - publickey-change-disabled
  5124. - tls-cert-change-disabled
  5125. - write-disabled
  5126. - mfa-disabled
  5127. - password-change-disabled
  5128. - api-key-auth-change-disabled
  5129. - info-change-disabled
  5130. - shares-disabled
  5131. - password-reset-disabled
  5132. - shares-without-password-disabled
  5133. description: |
  5134. Options:
  5135. * `publickey-change-disabled` - changing SSH public keys is not allowed
  5136. * `tls-cert-change-disabled` - changing TLS certificates is not allowed
  5137. * `write-disabled` - upload, rename, delete are not allowed even if the user has permissions for these actions
  5138. * `mfa-disabled` - enabling multi-factor authentication is not allowed. This option cannot be set if the user has MFA already enabled
  5139. * `password-change-disabled` - changing password is not allowed
  5140. * `api-key-auth-change-disabled` - enabling/disabling API key authentication is not allowed
  5141. * `info-change-disabled` - changing info such as email and description is not allowed
  5142. * `shares-disabled` - sharing files and directories with external users is not allowed
  5143. * `password-reset-disabled` - resetting the password is not allowed
  5144. * `shares-without-password-disabled` - creating shares without password protection is not allowed
  5145. RetentionCheckNotification:
  5146. type: string
  5147. enum:
  5148. - Hook
  5149. - Email
  5150. description: |
  5151. Options:
  5152. * `Hook` - notify result using the defined hook. A "data_retention_hook" must be defined in your configuration file for this to work
  5153. * `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
  5154. APIKeyScope:
  5155. type: integer
  5156. enum:
  5157. - 1
  5158. - 2
  5159. description: |
  5160. Options:
  5161. * `1` - admin scope. The API key will be used to impersonate an SFTPGo admin
  5162. * `2` - user scope. The API key will be used to impersonate an SFTPGo user
  5163. ShareScope:
  5164. type: integer
  5165. enum:
  5166. - 1
  5167. - 2
  5168. description: |
  5169. Options:
  5170. * `1` - read scope
  5171. * `2` - write scope
  5172. TOTPHMacAlgo:
  5173. type: string
  5174. enum:
  5175. - sha1
  5176. - sha256
  5177. - sha512
  5178. description: 'Supported HMAC algorithms for Time-based one time passwords'
  5179. UserType:
  5180. type: string
  5181. enum:
  5182. - ''
  5183. - LDAPUser
  5184. - OSUser
  5185. description: This is an hint for authentication plugins. It is ignored when using SFTPGo internal authentication
  5186. DumpDataScopes:
  5187. type: string
  5188. enum:
  5189. - users
  5190. - folders
  5191. - groups
  5192. - admins
  5193. - api_keys
  5194. - shares
  5195. - actions
  5196. - rules
  5197. - roles
  5198. - ip_lists
  5199. - configs
  5200. LogEventType:
  5201. type: integer
  5202. enum:
  5203. - 1
  5204. - 2
  5205. - 3
  5206. - 4
  5207. - 5
  5208. description: >
  5209. Event status:
  5210. * `1` - Login failed
  5211. * `2` - Login failed non-existent user
  5212. * `3` - No login tried
  5213. * `4` - Algorithm negotiation failed
  5214. * `5` - Login succeeded
  5215. FsEventStatus:
  5216. type: integer
  5217. enum:
  5218. - 1
  5219. - 2
  5220. - 3
  5221. description: >
  5222. Event status:
  5223. * `1` - no error
  5224. * `2` - generic error
  5225. * `3` - quota exceeded error
  5226. FsEventAction:
  5227. type: string
  5228. enum:
  5229. - download
  5230. - upload
  5231. - first-upload
  5232. - first-download
  5233. - delete
  5234. - rename
  5235. - mkdir
  5236. - rmdir
  5237. - ssh_cmd
  5238. ProviderEventAction:
  5239. type: string
  5240. enum:
  5241. - add
  5242. - update
  5243. - delete
  5244. ProviderEventObjectType:
  5245. type: string
  5246. enum:
  5247. - user
  5248. - folder
  5249. - group
  5250. - admin
  5251. - api_key
  5252. - share
  5253. - event_action
  5254. - event_rule
  5255. - role
  5256. SSHAuthentications:
  5257. type: string
  5258. enum:
  5259. - publickey
  5260. - password
  5261. - keyboard-interactive
  5262. - publickey+password
  5263. - publickey+keyboard-interactive
  5264. TLSVersions:
  5265. type: integer
  5266. enum:
  5267. - 12
  5268. - 13
  5269. description: >
  5270. TLS version:
  5271. * `12` - TLS 1.2
  5272. * `13` - TLS 1.3
  5273. IPListType:
  5274. type: integer
  5275. enum:
  5276. - 1
  5277. - 2
  5278. - 3
  5279. description: >
  5280. IP List types:
  5281. * `1` - allow list
  5282. * `2` - defender
  5283. * `3` - rate limiter safe list
  5284. IPListMode:
  5285. type: integer
  5286. enum:
  5287. - 1
  5288. - 2
  5289. description: >
  5290. IP list modes
  5291. * `1` - allow
  5292. * `2` - deny, supported for defender list type only
  5293. TOTPConfig:
  5294. type: object
  5295. properties:
  5296. name:
  5297. type: string
  5298. issuer:
  5299. type: string
  5300. algo:
  5301. $ref: '#/components/schemas/TOTPHMacAlgo'
  5302. RecoveryCode:
  5303. type: object
  5304. properties:
  5305. secret:
  5306. $ref: '#/components/schemas/Secret'
  5307. used:
  5308. type: boolean
  5309. 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'
  5310. BaseTOTPConfig:
  5311. type: object
  5312. properties:
  5313. enabled:
  5314. type: boolean
  5315. config_name:
  5316. type: string
  5317. 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'
  5318. secret:
  5319. $ref: '#/components/schemas/Secret'
  5320. AdminTOTPConfig:
  5321. allOf:
  5322. - $ref: '#/components/schemas/BaseTOTPConfig'
  5323. UserTOTPConfig:
  5324. allOf:
  5325. - $ref: '#/components/schemas/BaseTOTPConfig'
  5326. - type: object
  5327. properties:
  5328. protocols:
  5329. type: array
  5330. items:
  5331. $ref: '#/components/schemas/MFAProtocols'
  5332. 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.'
  5333. PatternsFilter:
  5334. type: object
  5335. properties:
  5336. path:
  5337. type: string
  5338. description: 'virtual path as seen by users, 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'
  5339. allowed_patterns:
  5340. type: array
  5341. items:
  5342. type: string
  5343. description: 'list of, case insensitive, allowed shell like patterns. Allowed patterns are evaluated before the denied ones'
  5344. example:
  5345. - '*.jpg'
  5346. - a*b?.png
  5347. denied_patterns:
  5348. type: array
  5349. items:
  5350. type: string
  5351. description: 'list of, case insensitive, denied shell like patterns'
  5352. example:
  5353. - '*.zip'
  5354. deny_policy:
  5355. type: integer
  5356. enum:
  5357. - 0
  5358. - 1
  5359. description: |
  5360. Policies for denied patterns
  5361. * `0` - default policy. Denied files/directories matching the filters are visible in directory listing but cannot be uploaded/downloaded/overwritten/renamed
  5362. * `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
  5363. HooksFilter:
  5364. type: object
  5365. properties:
  5366. external_auth_disabled:
  5367. type: boolean
  5368. example: false
  5369. description: If true, the external auth hook, if defined, will not be executed
  5370. pre_login_disabled:
  5371. type: boolean
  5372. example: false
  5373. description: If true, the pre-login hook, if defined, will not be executed
  5374. check_password_disabled:
  5375. type: boolean
  5376. example: false
  5377. description: If true, the check password hook, if defined, will not be executed
  5378. description: User specific hook overrides
  5379. BandwidthLimit:
  5380. type: object
  5381. properties:
  5382. sources:
  5383. type: array
  5384. items:
  5385. type: string
  5386. 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'
  5387. upload_bandwidth:
  5388. type: integer
  5389. format: int32
  5390. description: 'Maximum upload bandwidth as KB/s, 0 means unlimited'
  5391. download_bandwidth:
  5392. type: integer
  5393. format: int32
  5394. description: 'Maximum download bandwidth as KB/s, 0 means unlimited'
  5395. TimePeriod:
  5396. type: object
  5397. properties:
  5398. day_of_week:
  5399. type: integer
  5400. enum:
  5401. - 0
  5402. - 1
  5403. - 2
  5404. - 3
  5405. - 4
  5406. - 5
  5407. - 6
  5408. description: Day of week, 0 Sunday, 6 Saturday
  5409. from:
  5410. type: string
  5411. description: Start time in HH:MM format
  5412. to:
  5413. type: string
  5414. description: End time in HH:MM format
  5415. BaseUserFilters:
  5416. type: object
  5417. properties:
  5418. allowed_ip:
  5419. type: array
  5420. items:
  5421. type: string
  5422. 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"'
  5423. example:
  5424. - 192.0.2.0/24
  5425. - '2001:db8::/32'
  5426. denied_ip:
  5427. type: array
  5428. items:
  5429. type: string
  5430. description: clients connecting from these IP/Mask are not allowed. Denied rules are evaluated before allowed ones
  5431. example:
  5432. - 172.16.0.0/16
  5433. denied_login_methods:
  5434. type: array
  5435. items:
  5436. $ref: '#/components/schemas/LoginMethods'
  5437. description: if null or empty any available login method is allowed
  5438. denied_protocols:
  5439. type: array
  5440. items:
  5441. $ref: '#/components/schemas/SupportedProtocols'
  5442. description: if null or empty any available protocol is allowed
  5443. file_patterns:
  5444. type: array
  5445. items:
  5446. $ref: '#/components/schemas/PatternsFilter'
  5447. 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'
  5448. max_upload_file_size:
  5449. type: integer
  5450. format: int64
  5451. 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`'
  5452. tls_username:
  5453. type: string
  5454. 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. Currently the only supported value is `CommonName`'
  5455. tls_certs:
  5456. type: array
  5457. items:
  5458. type: string
  5459. hooks:
  5460. $ref: '#/components/schemas/HooksFilter'
  5461. disable_fs_checks:
  5462. type: boolean
  5463. example: false
  5464. 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
  5465. web_client:
  5466. type: array
  5467. items:
  5468. $ref: '#/components/schemas/WebClientOptions'
  5469. description: WebClient/user REST API related configuration options
  5470. allow_api_key_auth:
  5471. type: boolean
  5472. description: 'API key authentication allows to impersonate this user with an API key'
  5473. user_type:
  5474. $ref: '#/components/schemas/UserType'
  5475. bandwidth_limits:
  5476. type: array
  5477. items:
  5478. $ref: '#/components/schemas/BandwidthLimit'
  5479. external_auth_cache_time:
  5480. type: integer
  5481. description: 'Defines the cache time, in seconds, for users authenticated using an external auth hook. 0 means no cache'
  5482. start_directory:
  5483. type: string
  5484. 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.'
  5485. two_factor_protocols:
  5486. type: array
  5487. items:
  5488. $ref: '#/components/schemas/MFAProtocols'
  5489. description: 'Defines protocols that require two factor authentication'
  5490. ftp_security:
  5491. type: integer
  5492. enum:
  5493. - 0
  5494. - 1
  5495. 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.'
  5496. is_anonymous:
  5497. type: boolean
  5498. 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)'
  5499. default_shares_expiration:
  5500. type: integer
  5501. description: 'Defines the default expiration for newly created shares as number of days. 0 means no expiration'
  5502. max_shares_expiration:
  5503. type: integer
  5504. description: 'Defines the maximum allowed expiration, as a number of days, when a user creates or updates a share. 0 means no expiration'
  5505. password_expiration:
  5506. type: integer
  5507. description: 'The password expires after the defined number of days. 0 means no expiration'
  5508. password_strength:
  5509. type: integer
  5510. description: 'Defines the minimum password strength. 0 means disabled, any password will be accepted. Values in the 50-70 range are suggested for common use cases'
  5511. access_time:
  5512. type: array
  5513. items:
  5514. $ref: '#/components/schemas/TimePeriod'
  5515. description: Additional user options
  5516. UserFilters:
  5517. allOf:
  5518. - $ref: '#/components/schemas/BaseUserFilters'
  5519. - type: object
  5520. properties:
  5521. require_password_change:
  5522. type: boolean
  5523. description: 'User must change password from WebClient/REST API at next login'
  5524. totp_config:
  5525. $ref: '#/components/schemas/UserTOTPConfig'
  5526. recovery_codes:
  5527. type: array
  5528. items:
  5529. $ref: '#/components/schemas/RecoveryCode'
  5530. Secret:
  5531. type: object
  5532. properties:
  5533. status:
  5534. type: string
  5535. enum:
  5536. - Plain
  5537. - AES-256-GCM
  5538. - Secretbox
  5539. - GCP
  5540. - AWS
  5541. - VaultTransit
  5542. - AzureKeyVault
  5543. - Redacted
  5544. description: 'Set to "Plain" to add or update an existing secret, set to "Redacted" to preserve the existing value'
  5545. payload:
  5546. type: string
  5547. key:
  5548. type: string
  5549. additional_data:
  5550. type: string
  5551. mode:
  5552. type: integer
  5553. description: 1 means encrypted using a master key
  5554. 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
  5555. S3Config:
  5556. type: object
  5557. properties:
  5558. bucket:
  5559. type: string
  5560. minLength: 1
  5561. region:
  5562. type: string
  5563. minLength: 1
  5564. access_key:
  5565. type: string
  5566. access_secret:
  5567. $ref: '#/components/schemas/Secret'
  5568. role_arn:
  5569. type: string
  5570. description: 'Optional IAM Role ARN to assume'
  5571. session_token:
  5572. type: string
  5573. description: 'Optional Session token that is a part of temporary security credentials provisioned by AWS STS'
  5574. endpoint:
  5575. type: string
  5576. description: optional endpoint
  5577. storage_class:
  5578. type: string
  5579. acl:
  5580. type: string
  5581. 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'
  5582. upload_part_size:
  5583. type: integer
  5584. 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.'
  5585. upload_concurrency:
  5586. type: integer
  5587. description: 'the number of parts to upload in parallel. If this value is set to zero, the default value (5) will be used'
  5588. upload_part_max_time:
  5589. type: integer
  5590. 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'
  5591. download_part_size:
  5592. type: integer
  5593. 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'
  5594. download_concurrency:
  5595. type: integer
  5596. 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'
  5597. download_part_max_time:
  5598. type: integer
  5599. 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.'
  5600. force_path_style:
  5601. type: boolean
  5602. 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")'
  5603. key_prefix:
  5604. type: string
  5605. 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'
  5606. example: folder/subfolder/
  5607. description: S3 Compatible Object Storage configuration details
  5608. GCSConfig:
  5609. type: object
  5610. properties:
  5611. bucket:
  5612. type: string
  5613. minLength: 1
  5614. credentials:
  5615. $ref: '#/components/schemas/Secret'
  5616. automatic_credentials:
  5617. type: integer
  5618. enum:
  5619. - 0
  5620. - 1
  5621. description: |
  5622. Automatic credentials:
  5623. * `0` - disabled, explicit credentials, using a JSON credentials file, must be provided. This is the default value if the field is null
  5624. * `1` - enabled, we try to use the Application Default Credentials (ADC) strategy to find your application's credentials
  5625. storage_class:
  5626. type: string
  5627. acl:
  5628. type: string
  5629. 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'
  5630. key_prefix:
  5631. type: string
  5632. 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'
  5633. example: folder/subfolder/
  5634. upload_part_size:
  5635. type: integer
  5636. description: 'The buffer size (in MB) to use for multipart uploads. The default value is 16MB. 0 means use the default'
  5637. upload_part_max_time:
  5638. type: integer
  5639. description: 'The maximum time allowed, in seconds, to upload a single chunk. The default value is 32. 0 means use the default'
  5640. 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'
  5641. AzureBlobFsConfig:
  5642. type: object
  5643. properties:
  5644. container:
  5645. type: string
  5646. account_name:
  5647. type: string
  5648. description: 'Storage Account Name, leave blank to use SAS URL'
  5649. account_key:
  5650. $ref: '#/components/schemas/Secret'
  5651. sas_url:
  5652. $ref: '#/components/schemas/Secret'
  5653. endpoint:
  5654. type: string
  5655. 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"'
  5656. upload_part_size:
  5657. type: integer
  5658. 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.'
  5659. upload_concurrency:
  5660. type: integer
  5661. description: 'the number of parts to upload in parallel. If this value is set to zero, the default value (5) will be used'
  5662. download_part_size:
  5663. type: integer
  5664. 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.'
  5665. download_concurrency:
  5666. type: integer
  5667. description: 'the number of parts to download in parallel. If this value is set to zero, the default value (5) will be used'
  5668. access_tier:
  5669. type: string
  5670. enum:
  5671. - ''
  5672. - Archive
  5673. - Hot
  5674. - Cool
  5675. key_prefix:
  5676. type: string
  5677. 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'
  5678. example: folder/subfolder/
  5679. use_emulator:
  5680. type: boolean
  5681. description: Azure Blob Storage configuration details
  5682. OSFsConfig:
  5683. type: object
  5684. properties:
  5685. read_buffer_size:
  5686. type: integer
  5687. minimum: 0
  5688. maximum: 10
  5689. description: "The read buffer size, as MB, to use for downloads. 0 means no buffering, that's fine in most use cases."
  5690. write_buffer_size:
  5691. type: integer
  5692. minimum: 0
  5693. maximum: 10
  5694. description: "The write buffer size, as MB, to use for uploads. 0 means no buffering, that's fine in most use cases."
  5695. CryptFsConfig:
  5696. type: object
  5697. properties:
  5698. passphrase:
  5699. $ref: '#/components/schemas/Secret'
  5700. read_buffer_size:
  5701. type: integer
  5702. minimum: 0
  5703. maximum: 10
  5704. description: "The read buffer size, as MB, to use for downloads. 0 means no buffering, that's fine in most use cases."
  5705. write_buffer_size:
  5706. type: integer
  5707. minimum: 0
  5708. maximum: 10
  5709. description: "The write buffer size, as MB, to use for uploads. 0 means no buffering, that's fine in most use cases."
  5710. description: Crypt filesystem configuration details
  5711. SFTPFsConfig:
  5712. type: object
  5713. properties:
  5714. endpoint:
  5715. type: string
  5716. description: 'remote SFTP endpoint as host:port'
  5717. username:
  5718. type: string
  5719. description: you can specify a password or private key or both. In the latter case the private key will be tried first.
  5720. password:
  5721. $ref: '#/components/schemas/Secret'
  5722. private_key:
  5723. $ref: '#/components/schemas/Secret'
  5724. key_passphrase:
  5725. $ref: '#/components/schemas/Secret'
  5726. fingerprints:
  5727. type: array
  5728. items:
  5729. type: string
  5730. 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'
  5731. prefix:
  5732. type: string
  5733. description: Specifying a prefix you can restrict all operations to a given path within the remote SFTP server.
  5734. disable_concurrent_reads:
  5735. type: boolean
  5736. 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.
  5737. buffer_size:
  5738. type: integer
  5739. minimum: 0
  5740. maximum: 16
  5741. example: 2
  5742. 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.
  5743. equality_check_mode:
  5744. type: integer
  5745. enum:
  5746. - 0
  5747. - 1
  5748. description: |
  5749. 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:
  5750. * `0` username and endpoint must match. This is the default
  5751. * `1` only the endpoint must match
  5752. HTTPFsConfig:
  5753. type: object
  5754. properties:
  5755. endpoint:
  5756. type: string
  5757. description: 'HTTP/S endpoint URL. SFTPGo will use this URL as base, for example for the `stat` API, SFTPGo will add `/stat/{name}`'
  5758. username:
  5759. type: string
  5760. password:
  5761. $ref: '#/components/schemas/Secret'
  5762. api_key:
  5763. $ref: '#/components/schemas/Secret'
  5764. skip_tls_verify:
  5765. type: boolean
  5766. equality_check_mode:
  5767. type: integer
  5768. enum:
  5769. - 0
  5770. - 1
  5771. description: |
  5772. 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:
  5773. * `0` username and endpoint must match. This is the default
  5774. * `1` only the endpoint must match
  5775. FilesystemConfig:
  5776. type: object
  5777. properties:
  5778. provider:
  5779. $ref: '#/components/schemas/FsProviders'
  5780. osconfig:
  5781. $ref: '#/components/schemas/OSFsConfig'
  5782. s3config:
  5783. $ref: '#/components/schemas/S3Config'
  5784. gcsconfig:
  5785. $ref: '#/components/schemas/GCSConfig'
  5786. azblobconfig:
  5787. $ref: '#/components/schemas/AzureBlobFsConfig'
  5788. cryptconfig:
  5789. $ref: '#/components/schemas/CryptFsConfig'
  5790. sftpconfig:
  5791. $ref: '#/components/schemas/SFTPFsConfig'
  5792. httpconfig:
  5793. $ref: '#/components/schemas/HTTPFsConfig'
  5794. description: Storage filesystem details
  5795. BaseVirtualFolder:
  5796. type: object
  5797. properties:
  5798. id:
  5799. type: integer
  5800. format: int32
  5801. minimum: 1
  5802. name:
  5803. type: string
  5804. description: unique name for this virtual folder
  5805. mapped_path:
  5806. type: string
  5807. description: absolute filesystem path to use as virtual folder
  5808. description:
  5809. type: string
  5810. description: optional description
  5811. used_quota_size:
  5812. type: integer
  5813. format: int64
  5814. used_quota_files:
  5815. type: integer
  5816. format: int32
  5817. last_quota_update:
  5818. type: integer
  5819. format: int64
  5820. description: Last quota update as unix timestamp in milliseconds
  5821. users:
  5822. type: array
  5823. items:
  5824. type: string
  5825. description: list of usernames associated with this virtual folder
  5826. filesystem:
  5827. $ref: '#/components/schemas/FilesystemConfig'
  5828. 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.'
  5829. VirtualFolder:
  5830. allOf:
  5831. - $ref: '#/components/schemas/BaseVirtualFolder'
  5832. - type: object
  5833. properties:
  5834. virtual_path:
  5835. type: string
  5836. quota_size:
  5837. type: integer
  5838. format: int64
  5839. 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'
  5840. quota_files:
  5841. type: integer
  5842. format: int32
  5843. 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'
  5844. required:
  5845. - virtual_path
  5846. 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.'
  5847. User:
  5848. type: object
  5849. properties:
  5850. id:
  5851. type: integer
  5852. format: int32
  5853. minimum: 1
  5854. status:
  5855. type: integer
  5856. enum:
  5857. - 0
  5858. - 1
  5859. description: |
  5860. status:
  5861. * `0` user is disabled, login is not allowed
  5862. * `1` user is enabled
  5863. username:
  5864. type: string
  5865. description: username is unique
  5866. email:
  5867. type: string
  5868. format: email
  5869. description:
  5870. type: string
  5871. description: 'optional description, for example the user full name'
  5872. expiration_date:
  5873. type: integer
  5874. format: int64
  5875. description: expiration date as unix timestamp in milliseconds. An expired account cannot login. 0 means no expiration
  5876. password:
  5877. type: string
  5878. format: password
  5879. description: 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
  5880. public_keys:
  5881. type: array
  5882. items:
  5883. type: string
  5884. example: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEUWwDwEWhTbF0MqAsp/oXK1HR2cElhM8oo1uVmL3ZeDKDiTm4ljMr92wfTgIGDqIoxmVqgYIkAOAhuykAVWBzc= user@host
  5885. description: Public keys in OpenSSH format.
  5886. has_password:
  5887. type: boolean
  5888. description: Indicates whether the password is set
  5889. home_dir:
  5890. type: string
  5891. 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
  5892. virtual_folders:
  5893. type: array
  5894. items:
  5895. $ref: '#/components/schemas/VirtualFolder'
  5896. description: mapping between virtual SFTPGo paths and virtual folders
  5897. uid:
  5898. type: integer
  5899. format: int32
  5900. minimum: 0
  5901. maximum: 2147483647
  5902. 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'
  5903. gid:
  5904. type: integer
  5905. format: int32
  5906. minimum: 0
  5907. maximum: 2147483647
  5908. 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'
  5909. max_sessions:
  5910. type: integer
  5911. format: int32
  5912. description: Limit the sessions that a user can open. 0 means unlimited
  5913. quota_size:
  5914. type: integer
  5915. format: int64
  5916. 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
  5917. quota_files:
  5918. type: integer
  5919. format: int32
  5920. 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
  5921. permissions:
  5922. type: object
  5923. additionalProperties:
  5924. type: array
  5925. items:
  5926. $ref: '#/components/schemas/Permission'
  5927. minItems: 1
  5928. minProperties: 1
  5929. 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'
  5930. example:
  5931. /:
  5932. - '*'
  5933. /somedir:
  5934. - list
  5935. - download
  5936. used_quota_size:
  5937. type: integer
  5938. format: int64
  5939. used_quota_files:
  5940. type: integer
  5941. format: int32
  5942. last_quota_update:
  5943. type: integer
  5944. format: int64
  5945. description: Last quota update as unix timestamp in milliseconds
  5946. upload_bandwidth:
  5947. type: integer
  5948. description: 'Maximum upload bandwidth as KB/s, 0 means unlimited'
  5949. download_bandwidth:
  5950. type: integer
  5951. description: 'Maximum download bandwidth as KB/s, 0 means unlimited'
  5952. upload_data_transfer:
  5953. type: integer
  5954. description: 'Maximum data transfer allowed for uploads as MB. 0 means no limit'
  5955. download_data_transfer:
  5956. type: integer
  5957. description: 'Maximum data transfer allowed for downloads as MB. 0 means no limit'
  5958. total_data_transfer:
  5959. type: integer
  5960. 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'
  5961. used_upload_data_transfer:
  5962. type: integer
  5963. description: 'Uploaded size, as bytes, since the last reset'
  5964. used_download_data_transfer:
  5965. type: integer
  5966. description: 'Downloaded size, as bytes, since the last reset'
  5967. created_at:
  5968. type: integer
  5969. format: int64
  5970. description: 'creation time as unix timestamp in milliseconds. It will be 0 for users created before v2.2.0'
  5971. updated_at:
  5972. type: integer
  5973. format: int64
  5974. description: last update time as unix timestamp in milliseconds
  5975. last_login:
  5976. type: integer
  5977. format: int64
  5978. description: Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes
  5979. first_download:
  5980. type: integer
  5981. format: int64
  5982. description: first download time as unix timestamp in milliseconds
  5983. first_upload:
  5984. type: integer
  5985. format: int64
  5986. description: first upload time as unix timestamp in milliseconds
  5987. last_password_change:
  5988. type: integer
  5989. format: int64
  5990. description: last password change time as unix timestamp in milliseconds
  5991. filters:
  5992. $ref: '#/components/schemas/UserFilters'
  5993. filesystem:
  5994. $ref: '#/components/schemas/FilesystemConfig'
  5995. additional_info:
  5996. type: string
  5997. description: Free form text field for external systems
  5998. groups:
  5999. type: array
  6000. items:
  6001. $ref: '#/components/schemas/GroupMapping'
  6002. oidc_custom_fields:
  6003. type: object
  6004. additionalProperties: true
  6005. 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'
  6006. role:
  6007. type: string
  6008. AdminPreferences:
  6009. type: object
  6010. properties:
  6011. hide_user_page_sections:
  6012. type: integer
  6013. description: 'Allow to hide some sections from the user page. These are not security settings and are not enforced server side in any way. They are only intended to simplify the user page in the WebAdmin UI. 1 means hide groups section, 2 means hide filesystem section, "users_base_dir" must be set in the config file otherwise this setting is ignored, 4 means hide virtual folders section, 8 means hide profile section, 16 means hide ACLs section, 32 means hide disk and bandwidth quota limits section, 64 means hide advanced settings section. The settings can be combined'
  6014. default_users_expiration:
  6015. type: integer
  6016. description: 'Defines the default expiration for newly created users as number of days. 0 means no expiration'
  6017. AdminFilters:
  6018. type: object
  6019. properties:
  6020. allow_list:
  6021. type: array
  6022. items:
  6023. type: string
  6024. 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"'
  6025. example:
  6026. - 192.0.2.0/24
  6027. - '2001:db8::/32'
  6028. allow_api_key_auth:
  6029. type: boolean
  6030. description: 'API key auth allows to impersonate this administrator with an API key'
  6031. require_two_factor:
  6032. type: boolean
  6033. require_password_change:
  6034. type: boolean
  6035. totp_config:
  6036. $ref: '#/components/schemas/AdminTOTPConfig'
  6037. recovery_codes:
  6038. type: array
  6039. items:
  6040. $ref: '#/components/schemas/RecoveryCode'
  6041. preferences:
  6042. $ref: '#/components/schemas/AdminPreferences'
  6043. Admin:
  6044. type: object
  6045. properties:
  6046. id:
  6047. type: integer
  6048. format: int32
  6049. minimum: 1
  6050. status:
  6051. type: integer
  6052. enum:
  6053. - 0
  6054. - 1
  6055. description: |
  6056. status:
  6057. * `0` user is disabled, login is not allowed
  6058. * `1` user is enabled
  6059. username:
  6060. type: string
  6061. description: username is unique
  6062. description:
  6063. type: string
  6064. description: 'optional description, for example the admin full name'
  6065. password:
  6066. type: string
  6067. format: password
  6068. description: Admin password. For security reasons this field is omitted when you search/get admins
  6069. email:
  6070. type: string
  6071. format: email
  6072. permissions:
  6073. type: array
  6074. items:
  6075. $ref: '#/components/schemas/AdminPermissions'
  6076. filters:
  6077. $ref: '#/components/schemas/AdminFilters'
  6078. additional_info:
  6079. type: string
  6080. description: Free form text field
  6081. groups:
  6082. type: array
  6083. items:
  6084. $ref: '#/components/schemas/AdminGroupMapping'
  6085. 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.'
  6086. created_at:
  6087. type: integer
  6088. format: int64
  6089. description: 'creation time as unix timestamp in milliseconds. It will be 0 for admins created before v2.2.0'
  6090. updated_at:
  6091. type: integer
  6092. format: int64
  6093. description: last update time as unix timestamp in milliseconds
  6094. last_login:
  6095. type: integer
  6096. format: int64
  6097. description: Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes
  6098. role:
  6099. type: string
  6100. description: 'If set the admin can only administer users with the same role. Role admins cannot have the "*" permission'
  6101. AdminProfile:
  6102. type: object
  6103. properties:
  6104. email:
  6105. type: string
  6106. format: email
  6107. description:
  6108. type: string
  6109. allow_api_key_auth:
  6110. type: boolean
  6111. description: 'If enabled, you can impersonate this admin, in REST API, using an API key. If disabled admin credentials are required for impersonation'
  6112. UserProfile:
  6113. type: object
  6114. properties:
  6115. email:
  6116. type: string
  6117. format: email
  6118. description:
  6119. type: string
  6120. allow_api_key_auth:
  6121. type: boolean
  6122. description: 'If enabled, you can impersonate this user, in REST API, using an API key. If disabled user credentials are required for impersonation'
  6123. public_keys:
  6124. type: array
  6125. items:
  6126. type: string
  6127. example: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEUWwDwEWhTbF0MqAsp/oXK1HR2cElhM8oo1uVmL3ZeDKDiTm4ljMr92wfTgIGDqIoxmVqgYIkAOAhuykAVWBzc= user@host
  6128. description: Public keys in OpenSSH format
  6129. APIKey:
  6130. type: object
  6131. properties:
  6132. id:
  6133. type: string
  6134. description: unique key identifier
  6135. name:
  6136. type: string
  6137. description: User friendly key name
  6138. key:
  6139. type: string
  6140. format: password
  6141. 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
  6142. scope:
  6143. $ref: '#/components/schemas/APIKeyScope'
  6144. created_at:
  6145. type: integer
  6146. format: int64
  6147. description: creation time as unix timestamp in milliseconds
  6148. updated_at:
  6149. type: integer
  6150. format: int64
  6151. description: last update time as unix timestamp in milliseconds
  6152. last_use_at:
  6153. type: integer
  6154. format: int64
  6155. description: last use time as unix timestamp in milliseconds. It is saved at most once every 10 minutes
  6156. expires_at:
  6157. type: integer
  6158. format: int64
  6159. description: expiration time as unix timestamp in milliseconds
  6160. description:
  6161. type: string
  6162. description: optional description
  6163. user:
  6164. type: string
  6165. description: username associated with this API key. If empty and the scope is "user scope" the key can impersonate any user
  6166. admin:
  6167. type: string
  6168. description: admin associated with this API key. If empty and the scope is "admin scope" the key can impersonate any admin
  6169. QuotaUsage:
  6170. type: object
  6171. properties:
  6172. used_quota_size:
  6173. type: integer
  6174. format: int64
  6175. used_quota_files:
  6176. type: integer
  6177. format: int32
  6178. TransferQuotaUsage:
  6179. type: object
  6180. properties:
  6181. used_upload_data_transfer:
  6182. type: integer
  6183. format: int64
  6184. description: 'The value must be specified as bytes'
  6185. used_download_data_transfer:
  6186. type: integer
  6187. format: int64
  6188. description: 'The value must be specified as bytes'
  6189. Transfer:
  6190. type: object
  6191. properties:
  6192. operation_type:
  6193. type: string
  6194. enum:
  6195. - upload
  6196. - download
  6197. description: |
  6198. Operations:
  6199. * `upload`
  6200. * `download`
  6201. path:
  6202. type: string
  6203. description: file path for the upload/download
  6204. start_time:
  6205. type: integer
  6206. format: int64
  6207. description: start time as unix timestamp in milliseconds
  6208. size:
  6209. type: integer
  6210. format: int64
  6211. description: bytes transferred
  6212. ConnectionStatus:
  6213. type: object
  6214. properties:
  6215. username:
  6216. type: string
  6217. description: connected username
  6218. connection_id:
  6219. type: string
  6220. description: unique connection identifier
  6221. client_version:
  6222. type: string
  6223. description: client version
  6224. remote_address:
  6225. type: string
  6226. description: Remote address for the connected client
  6227. connection_time:
  6228. type: integer
  6229. format: int64
  6230. description: connection time as unix timestamp in milliseconds
  6231. command:
  6232. type: string
  6233. description: Last SSH/FTP command or WebDAV method
  6234. last_activity:
  6235. type: integer
  6236. format: int64
  6237. description: last client activity as unix timestamp in milliseconds
  6238. protocol:
  6239. type: string
  6240. enum:
  6241. - SFTP
  6242. - SCP
  6243. - SSH
  6244. - FTP
  6245. - DAV
  6246. active_transfers:
  6247. type: array
  6248. items:
  6249. $ref: '#/components/schemas/Transfer'
  6250. node:
  6251. type: string
  6252. description: 'Node identifier, omitted for single node installations'
  6253. FolderRetention:
  6254. type: object
  6255. properties:
  6256. path:
  6257. type: string
  6258. description: 'virtual directory path as seen by users, 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'
  6259. example: '/'
  6260. retention:
  6261. type: integer
  6262. 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
  6263. example: 24
  6264. delete_empty_dirs:
  6265. type: boolean
  6266. description: if enabled, empty directories will be deleted
  6267. ignore_user_permissions:
  6268. type: boolean
  6269. 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'
  6270. RetentionCheck:
  6271. type: object
  6272. properties:
  6273. username:
  6274. type: string
  6275. description: username to which the retention check refers
  6276. folders:
  6277. type: array
  6278. items:
  6279. $ref: '#/components/schemas/FolderRetention'
  6280. start_time:
  6281. type: integer
  6282. format: int64
  6283. description: check start time as unix timestamp in milliseconds
  6284. notifications:
  6285. type: array
  6286. items:
  6287. $ref: '#/components/schemas/RetentionCheckNotification'
  6288. email:
  6289. type: string
  6290. format: email
  6291. 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'
  6292. QuotaScan:
  6293. type: object
  6294. properties:
  6295. username:
  6296. type: string
  6297. description: username to which the quota scan refers
  6298. start_time:
  6299. type: integer
  6300. format: int64
  6301. description: scan start time as unix timestamp in milliseconds
  6302. FolderQuotaScan:
  6303. type: object
  6304. properties:
  6305. name:
  6306. type: string
  6307. description: folder name to which the quota scan refers
  6308. start_time:
  6309. type: integer
  6310. format: int64
  6311. description: scan start time as unix timestamp in milliseconds
  6312. DefenderEntry:
  6313. type: object
  6314. properties:
  6315. id:
  6316. type: string
  6317. ip:
  6318. type: string
  6319. score:
  6320. type: integer
  6321. 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
  6322. ban_time:
  6323. type: string
  6324. format: date-time
  6325. 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
  6326. SSHHostKey:
  6327. type: object
  6328. properties:
  6329. path:
  6330. type: string
  6331. fingerprint:
  6332. type: string
  6333. algorithms:
  6334. type: array
  6335. items:
  6336. type: string
  6337. SSHBinding:
  6338. type: object
  6339. properties:
  6340. address:
  6341. type: string
  6342. description: TCP address the server listen on
  6343. port:
  6344. type: integer
  6345. description: the port used for serving requests
  6346. apply_proxy_config:
  6347. type: boolean
  6348. description: 'apply the proxy configuration, if any'
  6349. WebDAVBinding:
  6350. type: object
  6351. properties:
  6352. address:
  6353. type: string
  6354. description: TCP address the server listen on
  6355. port:
  6356. type: integer
  6357. description: the port used for serving requests
  6358. enable_https:
  6359. type: boolean
  6360. min_tls_version:
  6361. $ref: '#/components/schemas/TLSVersions'
  6362. client_auth_type:
  6363. type: integer
  6364. description: 1 means that client certificate authentication is required in addition to HTTP basic authentication
  6365. tls_cipher_suites:
  6366. type: array
  6367. items:
  6368. type: string
  6369. 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'
  6370. prefix:
  6371. type: string
  6372. description: 'Prefix for WebDAV resources, if empty WebDAV resources will be available at the `/` URI'
  6373. proxy_allowed:
  6374. type: array
  6375. items:
  6376. type: string
  6377. description: 'List of IP addresses and IP ranges allowed to set proxy headers'
  6378. PassiveIPOverride:
  6379. type: object
  6380. properties:
  6381. networks:
  6382. type: array
  6383. items:
  6384. type: string
  6385. ip:
  6386. type: string
  6387. FTPDBinding:
  6388. type: object
  6389. properties:
  6390. address:
  6391. type: string
  6392. description: TCP address the server listen on
  6393. port:
  6394. type: integer
  6395. description: the port used for serving requests
  6396. apply_proxy_config:
  6397. type: boolean
  6398. description: 'apply the proxy configuration, if any'
  6399. tls_mode:
  6400. type: integer
  6401. enum:
  6402. - 0
  6403. - 1
  6404. - 2
  6405. description: |
  6406. TLS mode:
  6407. * `0` - clear or explicit TLS
  6408. * `1` - explicit TLS required
  6409. * `2` - implicit TLS
  6410. min_tls_version:
  6411. $ref: '#/components/schemas/TLSVersions'
  6412. force_passive_ip:
  6413. type: string
  6414. description: External IP address for passive connections
  6415. passive_ip_overrides:
  6416. type: array
  6417. items:
  6418. $ref: '#/components/schemas/PassiveIPOverride'
  6419. client_auth_type:
  6420. type: integer
  6421. description: 1 means that client certificate authentication is required in addition to FTP authentication
  6422. tls_cipher_suites:
  6423. type: array
  6424. items:
  6425. type: string
  6426. 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'
  6427. passive_connections_security:
  6428. type: integer
  6429. enum:
  6430. - 0
  6431. - 1
  6432. description: |
  6433. Active connections security:
  6434. * `0` - require matching peer IP addresses of control and data connection
  6435. * `1` - disable any checks
  6436. active_connections_security:
  6437. type: integer
  6438. enum:
  6439. - 0
  6440. - 1
  6441. description: |
  6442. Active connections security:
  6443. * `0` - require matching peer IP addresses of control and data connection
  6444. * `1` - disable any checks
  6445. ignore_ascii_transfer_type:
  6446. type: integer
  6447. enum:
  6448. - 0
  6449. - 1
  6450. description: |
  6451. Ignore client requests to perform ASCII translations:
  6452. * `0` - ASCII translations are enabled
  6453. * `1` - ASCII translations are silently ignored
  6454. debug:
  6455. type: boolean
  6456. description: 'If enabled any FTP command will be logged'
  6457. SSHServiceStatus:
  6458. type: object
  6459. properties:
  6460. is_active:
  6461. type: boolean
  6462. bindings:
  6463. type: array
  6464. items:
  6465. $ref: '#/components/schemas/SSHBinding'
  6466. nullable: true
  6467. host_keys:
  6468. type: array
  6469. items:
  6470. $ref: '#/components/schemas/SSHHostKey'
  6471. nullable: true
  6472. ssh_commands:
  6473. type: array
  6474. items:
  6475. type: string
  6476. authentications:
  6477. type: array
  6478. items:
  6479. $ref: '#/components/schemas/SSHAuthentications'
  6480. public_key_algorithms:
  6481. type: array
  6482. items:
  6483. type: string
  6484. macs:
  6485. type: array
  6486. items:
  6487. type: string
  6488. kex_algorithms:
  6489. type: array
  6490. items:
  6491. type: string
  6492. ciphers:
  6493. type: array
  6494. items:
  6495. type: string
  6496. FTPPassivePortRange:
  6497. type: object
  6498. properties:
  6499. start:
  6500. type: integer
  6501. end:
  6502. type: integer
  6503. FTPServiceStatus:
  6504. type: object
  6505. properties:
  6506. is_active:
  6507. type: boolean
  6508. bindings:
  6509. type: array
  6510. items:
  6511. $ref: '#/components/schemas/FTPDBinding'
  6512. nullable: true
  6513. passive_port_range:
  6514. $ref: '#/components/schemas/FTPPassivePortRange'
  6515. WebDAVServiceStatus:
  6516. type: object
  6517. properties:
  6518. is_active:
  6519. type: boolean
  6520. bindings:
  6521. type: array
  6522. items:
  6523. $ref: '#/components/schemas/WebDAVBinding'
  6524. nullable: true
  6525. DataProviderStatus:
  6526. type: object
  6527. properties:
  6528. is_active:
  6529. type: boolean
  6530. driver:
  6531. type: string
  6532. error:
  6533. type: string
  6534. MFAStatus:
  6535. type: object
  6536. properties:
  6537. is_active:
  6538. type: boolean
  6539. totp_configs:
  6540. type: array
  6541. items:
  6542. $ref: '#/components/schemas/TOTPConfig'
  6543. ServicesStatus:
  6544. type: object
  6545. properties:
  6546. ssh:
  6547. $ref: '#/components/schemas/SSHServiceStatus'
  6548. ftp:
  6549. $ref: '#/components/schemas/FTPServiceStatus'
  6550. webdav:
  6551. $ref: '#/components/schemas/WebDAVServiceStatus'
  6552. data_provider:
  6553. $ref: '#/components/schemas/DataProviderStatus'
  6554. defender:
  6555. type: object
  6556. properties:
  6557. is_active:
  6558. type: boolean
  6559. mfa:
  6560. $ref: '#/components/schemas/MFAStatus'
  6561. allow_list:
  6562. type: object
  6563. properties:
  6564. is_active:
  6565. type: boolean
  6566. rate_limiters:
  6567. type: object
  6568. properties:
  6569. is_active:
  6570. type: boolean
  6571. protocols:
  6572. type: array
  6573. items:
  6574. type: string
  6575. example: SSH
  6576. Share:
  6577. type: object
  6578. properties:
  6579. id:
  6580. type: string
  6581. description: auto-generated unique share identifier
  6582. name:
  6583. type: string
  6584. description:
  6585. type: string
  6586. description: optional description
  6587. scope:
  6588. $ref: '#/components/schemas/ShareScope'
  6589. paths:
  6590. type: array
  6591. items:
  6592. type: string
  6593. 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'
  6594. example:
  6595. - '/dir1'
  6596. - '/dir2/file.txt'
  6597. - '/dir3/subdir'
  6598. username:
  6599. type: string
  6600. created_at:
  6601. type: integer
  6602. format: int64
  6603. description: 'creation time as unix timestamp in milliseconds'
  6604. updated_at:
  6605. type: integer
  6606. format: int64
  6607. description: 'last update time as unix timestamp in milliseconds'
  6608. last_use_at:
  6609. type: integer
  6610. format: int64
  6611. description: last use time as unix timestamp in milliseconds
  6612. expires_at:
  6613. type: integer
  6614. format: int64
  6615. description: 'optional share expiration, as unix timestamp in milliseconds. 0 means no expiration'
  6616. password:
  6617. type: string
  6618. 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'
  6619. max_tokens:
  6620. type: integer
  6621. description: 'maximum allowed access tokens. 0 means no limit'
  6622. used_tokens:
  6623. type: integer
  6624. allow_from:
  6625. type: array
  6626. items:
  6627. type: string
  6628. 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'
  6629. example:
  6630. - 192.0.2.0/24
  6631. - '2001:db8::/32'
  6632. GroupUserSettings:
  6633. type: object
  6634. properties:
  6635. home_dir:
  6636. type: string
  6637. max_sessions:
  6638. type: integer
  6639. format: int32
  6640. quota_size:
  6641. type: integer
  6642. format: int64
  6643. quota_files:
  6644. type: integer
  6645. format: int32
  6646. permissions:
  6647. type: object
  6648. additionalProperties:
  6649. type: array
  6650. items:
  6651. $ref: '#/components/schemas/Permission'
  6652. minItems: 1
  6653. minProperties: 1
  6654. 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'
  6655. example:
  6656. /:
  6657. - '*'
  6658. /somedir:
  6659. - list
  6660. - download
  6661. upload_bandwidth:
  6662. type: integer
  6663. description: 'Maximum upload bandwidth as KB/s'
  6664. download_bandwidth:
  6665. type: integer
  6666. description: 'Maximum download bandwidth as KB/s'
  6667. upload_data_transfer:
  6668. type: integer
  6669. description: 'Maximum data transfer allowed for uploads as MB'
  6670. download_data_transfer:
  6671. type: integer
  6672. description: 'Maximum data transfer allowed for downloads as MB'
  6673. total_data_transfer:
  6674. type: integer
  6675. description: 'Maximum total data transfer as MB'
  6676. expires_in:
  6677. type: integer
  6678. description: 'Account expiration in number of days from creation. 0 means no expiration'
  6679. filters:
  6680. $ref: '#/components/schemas/BaseUserFilters'
  6681. filesystem:
  6682. $ref: '#/components/schemas/FilesystemConfig'
  6683. Role:
  6684. type: object
  6685. properties:
  6686. id:
  6687. type: integer
  6688. format: int32
  6689. minimum: 1
  6690. name:
  6691. type: string
  6692. description: name is unique
  6693. description:
  6694. type: string
  6695. description: 'optional description'
  6696. created_at:
  6697. type: integer
  6698. format: int64
  6699. description: creation time as unix timestamp in milliseconds
  6700. updated_at:
  6701. type: integer
  6702. format: int64
  6703. description: last update time as unix timestamp in milliseconds
  6704. users:
  6705. type: array
  6706. items:
  6707. type: string
  6708. description: list of usernames associated with this group
  6709. admins:
  6710. type: array
  6711. items:
  6712. type: string
  6713. description: list of admins usernames associated with this group
  6714. Group:
  6715. type: object
  6716. properties:
  6717. id:
  6718. type: integer
  6719. format: int32
  6720. minimum: 1
  6721. name:
  6722. type: string
  6723. description: name is unique
  6724. description:
  6725. type: string
  6726. description: 'optional description'
  6727. created_at:
  6728. type: integer
  6729. format: int64
  6730. description: creation time as unix timestamp in milliseconds
  6731. updated_at:
  6732. type: integer
  6733. format: int64
  6734. description: last update time as unix timestamp in milliseconds
  6735. user_settings:
  6736. $ref: '#/components/schemas/GroupUserSettings'
  6737. virtual_folders:
  6738. type: array
  6739. items:
  6740. $ref: '#/components/schemas/VirtualFolder'
  6741. description: mapping between virtual SFTPGo paths and folders
  6742. users:
  6743. type: array
  6744. items:
  6745. type: string
  6746. description: list of usernames associated with this group
  6747. admins:
  6748. type: array
  6749. items:
  6750. type: string
  6751. description: list of admins usernames associated with this group
  6752. GroupMapping:
  6753. type: object
  6754. properties:
  6755. name:
  6756. type: string
  6757. description: group name
  6758. type:
  6759. enum:
  6760. - 1
  6761. - 2
  6762. - 3
  6763. description: |
  6764. Group type:
  6765. * `1` - Primary group
  6766. * `2` - Secondary group
  6767. * `3` - Membership only, no settings are inherited from this group type
  6768. AdminGroupMappingOptions:
  6769. type: object
  6770. properties:
  6771. add_to_users_as:
  6772. enum:
  6773. - 0
  6774. - 1
  6775. - 2
  6776. description: |
  6777. Add to new users as:
  6778. * `0` - the admin's group will be added as membership group for new users
  6779. * `1` - the admin's group will be added as primary group for new users
  6780. * `2` - the admin's group will be added as secondary group for new users
  6781. AdminGroupMapping:
  6782. type: object
  6783. properties:
  6784. name:
  6785. type: string
  6786. description: group name
  6787. options:
  6788. $ref: '#/components/schemas/AdminGroupMappingOptions'
  6789. BackupData:
  6790. type: object
  6791. properties:
  6792. users:
  6793. type: array
  6794. items:
  6795. $ref: '#/components/schemas/User'
  6796. folders:
  6797. type: array
  6798. items:
  6799. $ref: '#/components/schemas/BaseVirtualFolder'
  6800. groups:
  6801. type: array
  6802. items:
  6803. $ref: '#/components/schemas/Group'
  6804. admins:
  6805. type: array
  6806. items:
  6807. $ref: '#/components/schemas/Admin'
  6808. api_keys:
  6809. type: array
  6810. items:
  6811. $ref: '#/components/schemas/APIKey'
  6812. shares:
  6813. type: array
  6814. items:
  6815. $ref: '#/components/schemas/Share'
  6816. event_actions:
  6817. type: array
  6818. items:
  6819. $ref: '#/components/schemas/EventAction'
  6820. event_rules:
  6821. type: array
  6822. items:
  6823. $ref: '#/components/schemas/EventRule'
  6824. roles:
  6825. type: array
  6826. items:
  6827. $ref: '#/components/schemas/Role'
  6828. version:
  6829. type: integer
  6830. PwdChange:
  6831. type: object
  6832. properties:
  6833. current_password:
  6834. type: string
  6835. new_password:
  6836. type: string
  6837. DirEntry:
  6838. type: object
  6839. properties:
  6840. name:
  6841. type: string
  6842. 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
  6843. size:
  6844. type: integer
  6845. format: int64
  6846. description: file size, omitted for folders and non regular files
  6847. mode:
  6848. type: integer
  6849. description: |
  6850. File mode and permission bits. More details here: https://golang.org/pkg/io/fs/#FileMode.
  6851. Let's see some examples:
  6852. - for a directory mode&2147483648 != 0
  6853. - for a symlink mode&134217728 != 0
  6854. - for a regular file mode&2401763328 == 0
  6855. last_modified:
  6856. type: string
  6857. format: date-time
  6858. FsEvent:
  6859. type: object
  6860. properties:
  6861. id:
  6862. type: string
  6863. timestamp:
  6864. type: integer
  6865. format: int64
  6866. description: 'unix timestamp in nanoseconds'
  6867. action:
  6868. $ref: '#/components/schemas/FsEventAction'
  6869. username:
  6870. type: string
  6871. fs_path:
  6872. type: string
  6873. fs_target_path:
  6874. type: string
  6875. virtual_path:
  6876. type: string
  6877. virtual_target_path:
  6878. type: string
  6879. ssh_cmd:
  6880. type: string
  6881. file_size:
  6882. type: integer
  6883. format: int64
  6884. elapsed:
  6885. type: integer
  6886. format: int64
  6887. description: elapsed time as milliseconds
  6888. status:
  6889. $ref: '#/components/schemas/FsEventStatus'
  6890. protocol:
  6891. $ref: '#/components/schemas/EventProtocols'
  6892. ip:
  6893. type: string
  6894. session_id:
  6895. type: string
  6896. fs_provider:
  6897. $ref: '#/components/schemas/FsProviders'
  6898. bucket:
  6899. type: string
  6900. endpoint:
  6901. type: string
  6902. open_flags:
  6903. type: string
  6904. role:
  6905. type: string
  6906. instance_id:
  6907. type: string
  6908. ProviderEvent:
  6909. type: object
  6910. properties:
  6911. id:
  6912. type: string
  6913. timestamp:
  6914. type: integer
  6915. format: int64
  6916. description: 'unix timestamp in nanoseconds'
  6917. action:
  6918. $ref: '#/components/schemas/ProviderEventAction'
  6919. username:
  6920. type: string
  6921. ip:
  6922. type: string
  6923. object_type:
  6924. $ref: '#/components/schemas/ProviderEventObjectType'
  6925. object_name:
  6926. type: string
  6927. object_data:
  6928. type: string
  6929. format: byte
  6930. description: 'base64 of the JSON serialized object with sensitive fields removed'
  6931. role:
  6932. type: string
  6933. instance_id:
  6934. type: string
  6935. LogEvent:
  6936. type: object
  6937. properties:
  6938. id:
  6939. type: string
  6940. timestamp:
  6941. type: integer
  6942. format: int64
  6943. description: 'unix timestamp in nanoseconds'
  6944. event:
  6945. $ref: '#/components/schemas/LogEventType'
  6946. protocol:
  6947. $ref: '#/components/schemas/EventProtocols'
  6948. username:
  6949. type: string
  6950. ip:
  6951. type: string
  6952. message:
  6953. type: string
  6954. role:
  6955. type: string
  6956. instance_id:
  6957. type: string
  6958. KeyValue:
  6959. type: object
  6960. properties:
  6961. key:
  6962. type: string
  6963. value:
  6964. type: string
  6965. HTTPPart:
  6966. type: object
  6967. properties:
  6968. name:
  6969. type: string
  6970. headers:
  6971. type: array
  6972. items:
  6973. $ref: '#/components/schemas/KeyValue'
  6974. description: 'Additional headers. Content-Disposition header is automatically set. Content-Type header is automatically detect for files to attach'
  6975. filepath:
  6976. type: string
  6977. description: 'path to the file to be sent as an attachment'
  6978. body:
  6979. type: string
  6980. EventActionHTTPConfig:
  6981. type: object
  6982. properties:
  6983. endpoint:
  6984. type: string
  6985. description: HTTP endpoint
  6986. example: https://example.com
  6987. username:
  6988. type: string
  6989. password:
  6990. $ref: '#/components/schemas/Secret'
  6991. headers:
  6992. type: array
  6993. items:
  6994. $ref: '#/components/schemas/KeyValue'
  6995. description: headers to add
  6996. timeout:
  6997. type: integer
  6998. minimum: 1
  6999. maximum: 180
  7000. description: 'Ignored for multipart requests with files as attachments'
  7001. skip_tls_verify:
  7002. type: boolean
  7003. 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.'
  7004. method:
  7005. type: string
  7006. enum:
  7007. - GET
  7008. - POST
  7009. - PUT
  7010. - DELETE
  7011. query_parameters:
  7012. type: array
  7013. items:
  7014. $ref: '#/components/schemas/KeyValue'
  7015. body:
  7016. type: string
  7017. description: HTTP POST/PUT body
  7018. parts:
  7019. type: array
  7020. items:
  7021. $ref: '#/components/schemas/HTTPPart'
  7022. 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.'
  7023. EventActionCommandConfig:
  7024. type: object
  7025. properties:
  7026. cmd:
  7027. type: string
  7028. description: absolute path to the command to execute
  7029. args:
  7030. type: array
  7031. items:
  7032. type: string
  7033. description: 'command line arguments'
  7034. timeout:
  7035. type: integer
  7036. minimum: 1
  7037. maximum: 120
  7038. env_vars:
  7039. type: array
  7040. items:
  7041. $ref: '#/components/schemas/KeyValue'
  7042. EventActionEmailConfig:
  7043. type: object
  7044. properties:
  7045. recipients:
  7046. type: array
  7047. items:
  7048. type: string
  7049. bcc:
  7050. type: array
  7051. items:
  7052. type: string
  7053. subject:
  7054. type: string
  7055. body:
  7056. type: string
  7057. content_type:
  7058. type: integer
  7059. enum:
  7060. - 0
  7061. - 1
  7062. description: |
  7063. Content type:
  7064. * `0` text/plain
  7065. * `1` text/html
  7066. attachments:
  7067. type: array
  7068. items:
  7069. type: string
  7070. description: 'list of file paths to attach. The total size is limited to 10 MB'
  7071. EventActionDataRetentionConfig:
  7072. type: object
  7073. properties:
  7074. folders:
  7075. type: array
  7076. items:
  7077. $ref: '#/components/schemas/FolderRetention'
  7078. EventActionFsCompress:
  7079. type: object
  7080. properties:
  7081. name:
  7082. type: string
  7083. description: 'Full path to the (zip) archive to create. The parent dir must exist'
  7084. paths:
  7085. type: array
  7086. items:
  7087. type: string
  7088. description: 'paths to add the archive'
  7089. EventActionFilesystemConfig:
  7090. type: object
  7091. properties:
  7092. type:
  7093. $ref: '#/components/schemas/FilesystemActionTypes'
  7094. renames:
  7095. type: array
  7096. items:
  7097. $ref: '#/components/schemas/KeyValue'
  7098. mkdirs:
  7099. type: array
  7100. items:
  7101. type: string
  7102. deletes:
  7103. type: array
  7104. items:
  7105. type: string
  7106. exist:
  7107. type: array
  7108. items:
  7109. type: string
  7110. copy:
  7111. type: array
  7112. items:
  7113. $ref: '#/components/schemas/KeyValue'
  7114. compress:
  7115. $ref: '#/components/schemas/EventActionFsCompress'
  7116. EventActionPasswordExpiration:
  7117. type: object
  7118. properties:
  7119. threshold:
  7120. type: integer
  7121. description: 'An email notification will be generated for users whose password expires in a number of days less than or equal to this threshold'
  7122. EventActionUserInactivity:
  7123. type: object
  7124. properties:
  7125. disable_threshold:
  7126. type: integer
  7127. description: 'Inactivity threshold, in days, before disabling the account'
  7128. delete_threshold:
  7129. type: integer
  7130. description: 'Inactivity threshold, in days, before deleting the account'
  7131. EventActionIDPAccountCheck:
  7132. type: object
  7133. properties:
  7134. mode:
  7135. type: integer
  7136. enum:
  7137. - 0
  7138. - 1
  7139. description: |
  7140. Account check mode:
  7141. * `0` Create or update the account
  7142. * `1` Create the account if it doesn't exist
  7143. template_user:
  7144. type: string
  7145. description: 'SFTPGo user template in JSON format'
  7146. template_admin:
  7147. type: string
  7148. description: 'SFTPGo admin template in JSON format'
  7149. BaseEventActionOptions:
  7150. type: object
  7151. properties:
  7152. http_config:
  7153. $ref: '#/components/schemas/EventActionHTTPConfig'
  7154. cmd_config:
  7155. $ref: '#/components/schemas/EventActionCommandConfig'
  7156. email_config:
  7157. $ref: '#/components/schemas/EventActionEmailConfig'
  7158. retention_config:
  7159. $ref: '#/components/schemas/EventActionDataRetentionConfig'
  7160. fs_config:
  7161. $ref: '#/components/schemas/EventActionFilesystemConfig'
  7162. pwd_expiration_config:
  7163. $ref: '#/components/schemas/EventActionPasswordExpiration'
  7164. user_inactivity_config:
  7165. $ref: '#/components/schemas/EventActionUserInactivity'
  7166. idp_config:
  7167. $ref: '#/components/schemas/EventActionIDPAccountCheck'
  7168. BaseEventAction:
  7169. type: object
  7170. properties:
  7171. id:
  7172. type: integer
  7173. format: int32
  7174. minimum: 1
  7175. name:
  7176. type: string
  7177. description: unique name
  7178. description:
  7179. type: string
  7180. description: optional description
  7181. type:
  7182. $ref: '#/components/schemas/EventActionTypes'
  7183. options:
  7184. $ref: '#/components/schemas/BaseEventActionOptions'
  7185. rules:
  7186. type: array
  7187. items:
  7188. type: string
  7189. description: list of event rules names associated with this action
  7190. EventActionOptions:
  7191. type: object
  7192. properties:
  7193. is_failure_action:
  7194. type: boolean
  7195. stop_on_failure:
  7196. type: boolean
  7197. execute_sync:
  7198. type: boolean
  7199. EventAction:
  7200. allOf:
  7201. - $ref: '#/components/schemas/BaseEventAction'
  7202. - type: object
  7203. properties:
  7204. order:
  7205. type: integer
  7206. description: execution order
  7207. relation_options:
  7208. $ref: '#/components/schemas/EventActionOptions'
  7209. EventActionMinimal:
  7210. type: object
  7211. properties:
  7212. name:
  7213. type: string
  7214. order:
  7215. type: integer
  7216. description: execution order
  7217. relation_options:
  7218. $ref: '#/components/schemas/EventActionOptions'
  7219. ConditionPattern:
  7220. type: object
  7221. properties:
  7222. pattern:
  7223. type: string
  7224. inverse_match:
  7225. type: boolean
  7226. ConditionOptions:
  7227. type: object
  7228. properties:
  7229. names:
  7230. type: array
  7231. items:
  7232. $ref: '#/components/schemas/ConditionPattern'
  7233. group_names:
  7234. type: array
  7235. items:
  7236. $ref: '#/components/schemas/ConditionPattern'
  7237. role_names:
  7238. type: array
  7239. items:
  7240. $ref: '#/components/schemas/ConditionPattern'
  7241. fs_paths:
  7242. type: array
  7243. items:
  7244. $ref: '#/components/schemas/ConditionPattern'
  7245. protocols:
  7246. type: array
  7247. items:
  7248. type: string
  7249. enum:
  7250. - SFTP
  7251. - SCP
  7252. - SSH
  7253. - FTP
  7254. - DAV
  7255. - HTTP
  7256. - HTTPShare
  7257. - OIDC
  7258. provider_objects:
  7259. type: array
  7260. items:
  7261. type: string
  7262. enum:
  7263. - user
  7264. - group
  7265. - admin
  7266. - api_key
  7267. - share
  7268. - event_action
  7269. - event_rule
  7270. min_size:
  7271. type: integer
  7272. format: int64
  7273. max_size:
  7274. type: integer
  7275. format: int64
  7276. concurrent_execution:
  7277. type: boolean
  7278. description: allow concurrent execution from multiple nodes
  7279. Schedule:
  7280. type: object
  7281. properties:
  7282. hour:
  7283. type: string
  7284. day_of_week:
  7285. type: string
  7286. day_of_month:
  7287. type: string
  7288. month:
  7289. type: string
  7290. EventConditions:
  7291. type: object
  7292. properties:
  7293. fs_events:
  7294. type: array
  7295. items:
  7296. type: string
  7297. enum:
  7298. - upload
  7299. - download
  7300. - delete
  7301. - rename
  7302. - mkdir
  7303. - rmdir
  7304. - copy
  7305. - ssh_cmd
  7306. - pre-upload
  7307. - pre-download
  7308. - pre-delete
  7309. - first-upload
  7310. - first-download
  7311. provider_events:
  7312. type: array
  7313. items:
  7314. type: string
  7315. enum:
  7316. - add
  7317. - update
  7318. - delete
  7319. schedules:
  7320. type: array
  7321. items:
  7322. $ref: '#/components/schemas/Schedule'
  7323. idp_login_event:
  7324. type: integer
  7325. enum:
  7326. - 0
  7327. - 1
  7328. - 2
  7329. description: |
  7330. IDP login events:
  7331. - `0` any login event
  7332. - `1` user login event
  7333. - `2` admin login event
  7334. options:
  7335. $ref: '#/components/schemas/ConditionOptions'
  7336. BaseEventRule:
  7337. type: object
  7338. properties:
  7339. id:
  7340. type: integer
  7341. format: int32
  7342. minimum: 1
  7343. name:
  7344. type: string
  7345. description: unique name
  7346. status:
  7347. type: integer
  7348. enum:
  7349. - 0
  7350. - 1
  7351. description: |
  7352. status:
  7353. * `0` disabled
  7354. * `1` enabled
  7355. description:
  7356. type: string
  7357. description: optional description
  7358. created_at:
  7359. type: integer
  7360. format: int64
  7361. description: creation time as unix timestamp in milliseconds
  7362. updated_at:
  7363. type: integer
  7364. format: int64
  7365. description: last update time as unix timestamp in millisecond
  7366. trigger:
  7367. $ref: '#/components/schemas/EventTriggerTypes'
  7368. conditions:
  7369. $ref: '#/components/schemas/EventConditions'
  7370. EventRule:
  7371. allOf:
  7372. - $ref: '#/components/schemas/BaseEventRule'
  7373. - type: object
  7374. properties:
  7375. actions:
  7376. type: array
  7377. items:
  7378. $ref: '#/components/schemas/EventAction'
  7379. EventRuleMinimal:
  7380. allOf:
  7381. - $ref: '#/components/schemas/BaseEventRule'
  7382. - type: object
  7383. properties:
  7384. actions:
  7385. type: array
  7386. items:
  7387. $ref: '#/components/schemas/EventActionMinimal'
  7388. IPListEntry:
  7389. type: object
  7390. properties:
  7391. ipornet:
  7392. type: string
  7393. description: IP address or network in CIDR format, for example `192.168.1.2/32`, `192.168.0.0/24`, `2001:db8::/32`
  7394. description:
  7395. type: string
  7396. description: optional description
  7397. type:
  7398. $ref: '#/components/schemas/IPListType'
  7399. mode:
  7400. $ref: '#/components/schemas/IPListMode'
  7401. protocols:
  7402. type: integer
  7403. description: Defines the protocol the entry applies to. `0` means all the supported protocols, 1 SSH, 2 FTP, 4 WebDAV, 8 HTTP. Protocols can be combined, for example 3 means SSH and FTP
  7404. created_at:
  7405. type: integer
  7406. format: int64
  7407. description: creation time as unix timestamp in milliseconds
  7408. updated_at:
  7409. type: integer
  7410. format: int64
  7411. description: last update time as unix timestamp in millisecond
  7412. ApiResponse:
  7413. type: object
  7414. properties:
  7415. message:
  7416. type: string
  7417. description: 'message, can be empty'
  7418. error:
  7419. type: string
  7420. description: error description if any
  7421. VersionInfo:
  7422. type: object
  7423. properties:
  7424. version:
  7425. type: string
  7426. build_date:
  7427. type: string
  7428. commit_hash:
  7429. type: string
  7430. features:
  7431. type: array
  7432. items:
  7433. type: string
  7434. description: 'Features for the current build. Available features are `portable`, `bolt`, `mysql`, `sqlite`, `pgsql`, `s3`, `gcs`, `azblob`, `metrics`, `unixcrypt`. If a feature is available it has a `+` prefix, otherwise a `-` prefix'
  7435. Token:
  7436. type: object
  7437. properties:
  7438. access_token:
  7439. type: string
  7440. expires_at:
  7441. type: string
  7442. format: date-time
  7443. securitySchemes:
  7444. BasicAuth:
  7445. type: http
  7446. scheme: basic
  7447. BearerAuth:
  7448. type: http
  7449. scheme: bearer
  7450. bearerFormat: JWT
  7451. APIKeyAuth:
  7452. type: apiKey
  7453. in: header
  7454. name: X-SFTPGO-API-KEY
  7455. 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.'