openapi.yaml 246 KB

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