openapi.yaml 247 KB

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