openapi.yaml 248 KB

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