openapi.yaml 216 KB

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