openapi.yaml 205 KB

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