openapi.yaml 248 KB

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