openapi.yaml 223 KB

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