openapi.yaml 245 KB

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