openapi.yaml 246 KB

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