openapi.yaml 229 KB

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