openapi.yaml 239 KB

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