openapi.yaml 220 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655
  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.1-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: limit
  2304. schema:
  2305. type: integer
  2306. minimum: 1
  2307. maximum: 1000
  2308. default: 100
  2309. required: false
  2310. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2311. - in: query
  2312. name: order
  2313. required: false
  2314. description: Ordering events by timestamp. Default DESC
  2315. schema:
  2316. type: string
  2317. enum:
  2318. - ASC
  2319. - DESC
  2320. example: DESC
  2321. responses:
  2322. '200':
  2323. description: successful operation
  2324. content:
  2325. application/json:
  2326. schema:
  2327. type: array
  2328. items:
  2329. $ref: '#/components/schemas/FsEvent'
  2330. '400':
  2331. $ref: '#/components/responses/BadRequest'
  2332. '401':
  2333. $ref: '#/components/responses/Unauthorized'
  2334. '403':
  2335. $ref: '#/components/responses/Forbidden'
  2336. '500':
  2337. $ref: '#/components/responses/InternalServerError'
  2338. default:
  2339. $ref: '#/components/responses/DefaultResponse'
  2340. /events/provider:
  2341. get:
  2342. tags:
  2343. - events
  2344. summary: Get provider events
  2345. 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'
  2346. operationId: get_provider_events
  2347. parameters:
  2348. - in: query
  2349. name: start_timestamp
  2350. schema:
  2351. type: integer
  2352. format: int64
  2353. minimum: 0
  2354. default: 0
  2355. required: false
  2356. 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'
  2357. - in: query
  2358. name: end_timestamp
  2359. schema:
  2360. type: integer
  2361. format: int64
  2362. minimum: 0
  2363. default: 0
  2364. required: false
  2365. 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'
  2366. - in: query
  2367. name: actions
  2368. schema:
  2369. type: array
  2370. items:
  2371. $ref: '#/components/schemas/ProviderEventAction'
  2372. description: 'the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated'
  2373. explode: false
  2374. required: false
  2375. - in: query
  2376. name: username
  2377. schema:
  2378. type: string
  2379. description: 'the event username must be the same as the one specified. Empty or missing means omit this filter'
  2380. required: false
  2381. - in: query
  2382. name: ip
  2383. schema:
  2384. type: string
  2385. description: 'the event IP must be the same as the one specified. Empty or missing means omit this filter'
  2386. required: false
  2387. - in: query
  2388. name: object_name
  2389. schema:
  2390. type: string
  2391. description: 'the event object name must be the same as the one specified. Empty or missing means omit this filter'
  2392. required: false
  2393. - in: query
  2394. name: object_types
  2395. schema:
  2396. type: array
  2397. items:
  2398. $ref: '#/components/schemas/ProviderEventObjectType'
  2399. description: 'the event object type must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2400. explode: false
  2401. required: false
  2402. - in: query
  2403. name: instance_ids
  2404. schema:
  2405. type: array
  2406. items:
  2407. type: string
  2408. description: 'the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated'
  2409. explode: false
  2410. required: false
  2411. - in: query
  2412. name: exclude_ids
  2413. schema:
  2414. type: array
  2415. items:
  2416. type: string
  2417. 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'
  2418. explode: false
  2419. required: false
  2420. - in: query
  2421. name: limit
  2422. schema:
  2423. type: integer
  2424. minimum: 1
  2425. maximum: 1000
  2426. default: 100
  2427. required: false
  2428. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2429. - in: query
  2430. name: order
  2431. required: false
  2432. description: Ordering events by timestamp. Default DESC
  2433. schema:
  2434. type: string
  2435. enum:
  2436. - ASC
  2437. - DESC
  2438. example: DESC
  2439. responses:
  2440. '200':
  2441. description: successful operation
  2442. content:
  2443. application/json:
  2444. schema:
  2445. type: array
  2446. items:
  2447. $ref: '#/components/schemas/ProviderEvent'
  2448. '400':
  2449. $ref: '#/components/responses/BadRequest'
  2450. '401':
  2451. $ref: '#/components/responses/Unauthorized'
  2452. '403':
  2453. $ref: '#/components/responses/Forbidden'
  2454. '500':
  2455. $ref: '#/components/responses/InternalServerError'
  2456. default:
  2457. $ref: '#/components/responses/DefaultResponse'
  2458. /apikeys:
  2459. get:
  2460. security:
  2461. - BearerAuth: []
  2462. tags:
  2463. - API keys
  2464. summary: Get API keys
  2465. description: Returns an array with one or more API keys. For security reasons hashed keys are omitted in the response
  2466. operationId: get_api_keys
  2467. parameters:
  2468. - in: query
  2469. name: offset
  2470. schema:
  2471. type: integer
  2472. minimum: 0
  2473. default: 0
  2474. required: false
  2475. - in: query
  2476. name: limit
  2477. schema:
  2478. type: integer
  2479. minimum: 1
  2480. maximum: 500
  2481. default: 100
  2482. required: false
  2483. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2484. - in: query
  2485. name: order
  2486. required: false
  2487. description: Ordering API keys by id. Default ASC
  2488. schema:
  2489. type: string
  2490. enum:
  2491. - ASC
  2492. - DESC
  2493. example: ASC
  2494. responses:
  2495. '200':
  2496. description: successful operation
  2497. content:
  2498. application/json:
  2499. schema:
  2500. type: array
  2501. items:
  2502. $ref: '#/components/schemas/APIKey'
  2503. '400':
  2504. $ref: '#/components/responses/BadRequest'
  2505. '401':
  2506. $ref: '#/components/responses/Unauthorized'
  2507. '403':
  2508. $ref: '#/components/responses/Forbidden'
  2509. '500':
  2510. $ref: '#/components/responses/InternalServerError'
  2511. default:
  2512. $ref: '#/components/responses/DefaultResponse'
  2513. post:
  2514. security:
  2515. - BearerAuth: []
  2516. tags:
  2517. - API keys
  2518. summary: Add API key
  2519. description: Adds a new API key
  2520. operationId: add_api_key
  2521. requestBody:
  2522. required: true
  2523. content:
  2524. application/json:
  2525. schema:
  2526. $ref: '#/components/schemas/APIKey'
  2527. responses:
  2528. '201':
  2529. description: successful operation
  2530. headers:
  2531. X-Object-ID:
  2532. schema:
  2533. type: string
  2534. description: ID for the new created API key
  2535. Location:
  2536. schema:
  2537. type: string
  2538. description: URL to retrieve the details for the new created API key
  2539. content:
  2540. application/json:
  2541. schema:
  2542. type: object
  2543. properties:
  2544. mesage:
  2545. type: string
  2546. example: 'API key created. This is the only time the API key is visible, please save it.'
  2547. key:
  2548. type: string
  2549. description: 'generated API key'
  2550. '400':
  2551. $ref: '#/components/responses/BadRequest'
  2552. '401':
  2553. $ref: '#/components/responses/Unauthorized'
  2554. '403':
  2555. $ref: '#/components/responses/Forbidden'
  2556. '500':
  2557. $ref: '#/components/responses/InternalServerError'
  2558. default:
  2559. $ref: '#/components/responses/DefaultResponse'
  2560. '/apikeys/{id}':
  2561. parameters:
  2562. - name: id
  2563. in: path
  2564. description: the key id
  2565. required: true
  2566. schema:
  2567. type: string
  2568. get:
  2569. security:
  2570. - BearerAuth: []
  2571. tags:
  2572. - API keys
  2573. summary: Find API key by id
  2574. description: Returns the API key with the given id, if it exists. For security reasons the hashed key is omitted in the response
  2575. operationId: get_api_key_by_id
  2576. responses:
  2577. '200':
  2578. description: successful operation
  2579. content:
  2580. application/json:
  2581. schema:
  2582. $ref: '#/components/schemas/APIKey'
  2583. '400':
  2584. $ref: '#/components/responses/BadRequest'
  2585. '401':
  2586. $ref: '#/components/responses/Unauthorized'
  2587. '403':
  2588. $ref: '#/components/responses/Forbidden'
  2589. '404':
  2590. $ref: '#/components/responses/NotFound'
  2591. '500':
  2592. $ref: '#/components/responses/InternalServerError'
  2593. default:
  2594. $ref: '#/components/responses/DefaultResponse'
  2595. put:
  2596. security:
  2597. - BearerAuth: []
  2598. tags:
  2599. - API keys
  2600. summary: Update API key
  2601. description: Updates an existing API key. You cannot update the key itself, the creation date and the last use
  2602. operationId: update_api_key
  2603. requestBody:
  2604. required: true
  2605. content:
  2606. application/json:
  2607. schema:
  2608. $ref: '#/components/schemas/APIKey'
  2609. responses:
  2610. '200':
  2611. description: successful operation
  2612. content:
  2613. application/json:
  2614. schema:
  2615. $ref: '#/components/schemas/ApiResponse'
  2616. example:
  2617. message: API key updated
  2618. '400':
  2619. $ref: '#/components/responses/BadRequest'
  2620. '401':
  2621. $ref: '#/components/responses/Unauthorized'
  2622. '403':
  2623. $ref: '#/components/responses/Forbidden'
  2624. '404':
  2625. $ref: '#/components/responses/NotFound'
  2626. '500':
  2627. $ref: '#/components/responses/InternalServerError'
  2628. default:
  2629. $ref: '#/components/responses/DefaultResponse'
  2630. delete:
  2631. security:
  2632. - BearerAuth: []
  2633. tags:
  2634. - API keys
  2635. summary: Delete API key
  2636. description: Deletes an existing API key
  2637. operationId: delete_api_key
  2638. responses:
  2639. '200':
  2640. description: successful operation
  2641. content:
  2642. application/json:
  2643. schema:
  2644. $ref: '#/components/schemas/ApiResponse'
  2645. example:
  2646. message: Admin deleted
  2647. '400':
  2648. $ref: '#/components/responses/BadRequest'
  2649. '401':
  2650. $ref: '#/components/responses/Unauthorized'
  2651. '403':
  2652. $ref: '#/components/responses/Forbidden'
  2653. '404':
  2654. $ref: '#/components/responses/NotFound'
  2655. '500':
  2656. $ref: '#/components/responses/InternalServerError'
  2657. default:
  2658. $ref: '#/components/responses/DefaultResponse'
  2659. /admins:
  2660. get:
  2661. tags:
  2662. - admins
  2663. summary: Get admins
  2664. description: Returns an array with one or more admins. For security reasons hashed passwords are omitted in the response
  2665. operationId: get_admins
  2666. parameters:
  2667. - in: query
  2668. name: offset
  2669. schema:
  2670. type: integer
  2671. minimum: 0
  2672. default: 0
  2673. required: false
  2674. - in: query
  2675. name: limit
  2676. schema:
  2677. type: integer
  2678. minimum: 1
  2679. maximum: 500
  2680. default: 100
  2681. required: false
  2682. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2683. - in: query
  2684. name: order
  2685. required: false
  2686. description: Ordering admins by username. Default ASC
  2687. schema:
  2688. type: string
  2689. enum:
  2690. - ASC
  2691. - DESC
  2692. example: ASC
  2693. responses:
  2694. '200':
  2695. description: successful operation
  2696. content:
  2697. application/json:
  2698. schema:
  2699. type: array
  2700. items:
  2701. $ref: '#/components/schemas/Admin'
  2702. '400':
  2703. $ref: '#/components/responses/BadRequest'
  2704. '401':
  2705. $ref: '#/components/responses/Unauthorized'
  2706. '403':
  2707. $ref: '#/components/responses/Forbidden'
  2708. '500':
  2709. $ref: '#/components/responses/InternalServerError'
  2710. default:
  2711. $ref: '#/components/responses/DefaultResponse'
  2712. post:
  2713. tags:
  2714. - admins
  2715. summary: Add admin
  2716. description: 'Adds a new admin. Recovery codes and TOTP configuration cannot be set using this API: each admin must use the specific APIs'
  2717. operationId: add_admin
  2718. requestBody:
  2719. required: true
  2720. content:
  2721. application/json:
  2722. schema:
  2723. $ref: '#/components/schemas/Admin'
  2724. responses:
  2725. '201':
  2726. description: successful operation
  2727. content:
  2728. application/json:
  2729. schema:
  2730. $ref: '#/components/schemas/Admin'
  2731. '400':
  2732. $ref: '#/components/responses/BadRequest'
  2733. '401':
  2734. $ref: '#/components/responses/Unauthorized'
  2735. '403':
  2736. $ref: '#/components/responses/Forbidden'
  2737. '500':
  2738. $ref: '#/components/responses/InternalServerError'
  2739. default:
  2740. $ref: '#/components/responses/DefaultResponse'
  2741. '/admins/{username}':
  2742. parameters:
  2743. - name: username
  2744. in: path
  2745. description: the admin username
  2746. required: true
  2747. schema:
  2748. type: string
  2749. get:
  2750. tags:
  2751. - admins
  2752. summary: Find admins by username
  2753. description: 'Returns the admin with the given username, if it exists. For security reasons the hashed password is omitted in the response'
  2754. operationId: get_admin_by_username
  2755. responses:
  2756. '200':
  2757. description: successful operation
  2758. content:
  2759. application/json:
  2760. schema:
  2761. $ref: '#/components/schemas/Admin'
  2762. '400':
  2763. $ref: '#/components/responses/BadRequest'
  2764. '401':
  2765. $ref: '#/components/responses/Unauthorized'
  2766. '403':
  2767. $ref: '#/components/responses/Forbidden'
  2768. '404':
  2769. $ref: '#/components/responses/NotFound'
  2770. '500':
  2771. $ref: '#/components/responses/InternalServerError'
  2772. default:
  2773. $ref: '#/components/responses/DefaultResponse'
  2774. put:
  2775. tags:
  2776. - admins
  2777. summary: Update admin
  2778. 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'
  2779. operationId: update_admin
  2780. requestBody:
  2781. required: true
  2782. content:
  2783. application/json:
  2784. schema:
  2785. $ref: '#/components/schemas/Admin'
  2786. responses:
  2787. '200':
  2788. description: successful operation
  2789. content:
  2790. application/json:
  2791. schema:
  2792. $ref: '#/components/schemas/ApiResponse'
  2793. example:
  2794. message: Admin updated
  2795. '400':
  2796. $ref: '#/components/responses/BadRequest'
  2797. '401':
  2798. $ref: '#/components/responses/Unauthorized'
  2799. '403':
  2800. $ref: '#/components/responses/Forbidden'
  2801. '404':
  2802. $ref: '#/components/responses/NotFound'
  2803. '500':
  2804. $ref: '#/components/responses/InternalServerError'
  2805. default:
  2806. $ref: '#/components/responses/DefaultResponse'
  2807. delete:
  2808. tags:
  2809. - admins
  2810. summary: Delete admin
  2811. description: Deletes an existing admin
  2812. operationId: delete_admin
  2813. responses:
  2814. '200':
  2815. description: successful operation
  2816. content:
  2817. application/json:
  2818. schema:
  2819. $ref: '#/components/schemas/ApiResponse'
  2820. example:
  2821. message: Admin deleted
  2822. '400':
  2823. $ref: '#/components/responses/BadRequest'
  2824. '401':
  2825. $ref: '#/components/responses/Unauthorized'
  2826. '403':
  2827. $ref: '#/components/responses/Forbidden'
  2828. '404':
  2829. $ref: '#/components/responses/NotFound'
  2830. '500':
  2831. $ref: '#/components/responses/InternalServerError'
  2832. default:
  2833. $ref: '#/components/responses/DefaultResponse'
  2834. '/admins/{username}/2fa/disable':
  2835. parameters:
  2836. - name: username
  2837. in: path
  2838. description: the admin username
  2839. required: true
  2840. schema:
  2841. type: string
  2842. put:
  2843. tags:
  2844. - admins
  2845. summary: Disable second factor authentication
  2846. 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'
  2847. operationId: disable_admin_2fa
  2848. responses:
  2849. '200':
  2850. description: successful operation
  2851. content:
  2852. application/json:
  2853. schema:
  2854. $ref: '#/components/schemas/ApiResponse'
  2855. example:
  2856. message: 2FA disabled
  2857. '400':
  2858. $ref: '#/components/responses/BadRequest'
  2859. '401':
  2860. $ref: '#/components/responses/Unauthorized'
  2861. '403':
  2862. $ref: '#/components/responses/Forbidden'
  2863. '404':
  2864. $ref: '#/components/responses/NotFound'
  2865. '500':
  2866. $ref: '#/components/responses/InternalServerError'
  2867. default:
  2868. $ref: '#/components/responses/DefaultResponse'
  2869. '/admins/{username}/forgot-password':
  2870. parameters:
  2871. - name: username
  2872. in: path
  2873. description: the admin username
  2874. required: true
  2875. schema:
  2876. type: string
  2877. post:
  2878. security: []
  2879. tags:
  2880. - admins
  2881. summary: Send a password reset code by email
  2882. 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'
  2883. operationId: admin_forgot_password
  2884. responses:
  2885. '200':
  2886. description: successful operation
  2887. content:
  2888. application/json:
  2889. schema:
  2890. $ref: '#/components/schemas/ApiResponse'
  2891. '400':
  2892. $ref: '#/components/responses/BadRequest'
  2893. '401':
  2894. $ref: '#/components/responses/Unauthorized'
  2895. '403':
  2896. $ref: '#/components/responses/Forbidden'
  2897. '404':
  2898. $ref: '#/components/responses/NotFound'
  2899. '500':
  2900. $ref: '#/components/responses/InternalServerError'
  2901. default:
  2902. $ref: '#/components/responses/DefaultResponse'
  2903. '/admins/{username}/reset-password':
  2904. parameters:
  2905. - name: username
  2906. in: path
  2907. description: the admin username
  2908. required: true
  2909. schema:
  2910. type: string
  2911. post:
  2912. security: []
  2913. tags:
  2914. - admins
  2915. summary: Reset the password
  2916. description: 'Set a new password using the code received via email'
  2917. operationId: admin_reset_password
  2918. requestBody:
  2919. content:
  2920. application/json:
  2921. schema:
  2922. type: object
  2923. properties:
  2924. code:
  2925. type: string
  2926. password:
  2927. type: string
  2928. required: true
  2929. responses:
  2930. '200':
  2931. description: successful operation
  2932. content:
  2933. application/json:
  2934. schema:
  2935. $ref: '#/components/schemas/ApiResponse'
  2936. '400':
  2937. $ref: '#/components/responses/BadRequest'
  2938. '401':
  2939. $ref: '#/components/responses/Unauthorized'
  2940. '403':
  2941. $ref: '#/components/responses/Forbidden'
  2942. '404':
  2943. $ref: '#/components/responses/NotFound'
  2944. '500':
  2945. $ref: '#/components/responses/InternalServerError'
  2946. default:
  2947. $ref: '#/components/responses/DefaultResponse'
  2948. /users:
  2949. get:
  2950. tags:
  2951. - users
  2952. summary: Get users
  2953. description: Returns an array with one or more users. For security reasons hashed passwords are omitted in the response
  2954. operationId: get_users
  2955. parameters:
  2956. - in: query
  2957. name: offset
  2958. schema:
  2959. type: integer
  2960. minimum: 0
  2961. default: 0
  2962. required: false
  2963. - in: query
  2964. name: limit
  2965. schema:
  2966. type: integer
  2967. minimum: 1
  2968. maximum: 500
  2969. default: 100
  2970. required: false
  2971. description: 'The maximum number of items to return. Max value is 500, default is 100'
  2972. - in: query
  2973. name: order
  2974. required: false
  2975. description: Ordering users by username. Default ASC
  2976. schema:
  2977. type: string
  2978. enum:
  2979. - ASC
  2980. - DESC
  2981. example: ASC
  2982. responses:
  2983. '200':
  2984. description: successful operation
  2985. content:
  2986. application/json:
  2987. schema:
  2988. type: array
  2989. items:
  2990. $ref: '#/components/schemas/User'
  2991. '400':
  2992. $ref: '#/components/responses/BadRequest'
  2993. '401':
  2994. $ref: '#/components/responses/Unauthorized'
  2995. '403':
  2996. $ref: '#/components/responses/Forbidden'
  2997. '500':
  2998. $ref: '#/components/responses/InternalServerError'
  2999. default:
  3000. $ref: '#/components/responses/DefaultResponse'
  3001. post:
  3002. tags:
  3003. - users
  3004. summary: Add user
  3005. description: 'Adds a new user.Recovery codes and TOTP configuration cannot be set using this API: each user must use the specific APIs'
  3006. operationId: add_user
  3007. requestBody:
  3008. required: true
  3009. content:
  3010. application/json:
  3011. schema:
  3012. $ref: '#/components/schemas/User'
  3013. responses:
  3014. '201':
  3015. description: successful operation
  3016. content:
  3017. application/json:
  3018. schema:
  3019. $ref: '#/components/schemas/User'
  3020. '400':
  3021. $ref: '#/components/responses/BadRequest'
  3022. '401':
  3023. $ref: '#/components/responses/Unauthorized'
  3024. '403':
  3025. $ref: '#/components/responses/Forbidden'
  3026. '500':
  3027. $ref: '#/components/responses/InternalServerError'
  3028. default:
  3029. $ref: '#/components/responses/DefaultResponse'
  3030. '/users/{username}':
  3031. parameters:
  3032. - name: username
  3033. in: path
  3034. description: the username
  3035. required: true
  3036. schema:
  3037. type: string
  3038. get:
  3039. tags:
  3040. - users
  3041. summary: Find users by username
  3042. description: Returns the user with the given username if it exists. For security reasons the hashed password is omitted in the response
  3043. operationId: get_user_by_username
  3044. responses:
  3045. '200':
  3046. description: successful operation
  3047. content:
  3048. application/json:
  3049. schema:
  3050. $ref: '#/components/schemas/User'
  3051. '400':
  3052. $ref: '#/components/responses/BadRequest'
  3053. '401':
  3054. $ref: '#/components/responses/Unauthorized'
  3055. '403':
  3056. $ref: '#/components/responses/Forbidden'
  3057. '404':
  3058. $ref: '#/components/responses/NotFound'
  3059. '500':
  3060. $ref: '#/components/responses/InternalServerError'
  3061. default:
  3062. $ref: '#/components/responses/DefaultResponse'
  3063. put:
  3064. tags:
  3065. - users
  3066. summary: Update user
  3067. 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'
  3068. operationId: update_user
  3069. parameters:
  3070. - in: query
  3071. name: disconnect
  3072. schema:
  3073. type: integer
  3074. enum:
  3075. - 0
  3076. - 1
  3077. description: |
  3078. Disconnect:
  3079. * `0` The user will not be disconnected and it will continue to use the old configuration until connected. This is the default
  3080. * `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
  3081. requestBody:
  3082. required: true
  3083. content:
  3084. application/json:
  3085. schema:
  3086. $ref: '#/components/schemas/User'
  3087. responses:
  3088. '200':
  3089. description: successful operation
  3090. content:
  3091. application/json:
  3092. schema:
  3093. $ref: '#/components/schemas/ApiResponse'
  3094. example:
  3095. message: User updated
  3096. '400':
  3097. $ref: '#/components/responses/BadRequest'
  3098. '401':
  3099. $ref: '#/components/responses/Unauthorized'
  3100. '403':
  3101. $ref: '#/components/responses/Forbidden'
  3102. '404':
  3103. $ref: '#/components/responses/NotFound'
  3104. '500':
  3105. $ref: '#/components/responses/InternalServerError'
  3106. default:
  3107. $ref: '#/components/responses/DefaultResponse'
  3108. delete:
  3109. tags:
  3110. - users
  3111. summary: Delete user
  3112. description: Deletes an existing user
  3113. operationId: delete_user
  3114. responses:
  3115. '200':
  3116. description: successful operation
  3117. content:
  3118. application/json:
  3119. schema:
  3120. $ref: '#/components/schemas/ApiResponse'
  3121. example:
  3122. message: User deleted
  3123. '400':
  3124. $ref: '#/components/responses/BadRequest'
  3125. '401':
  3126. $ref: '#/components/responses/Unauthorized'
  3127. '403':
  3128. $ref: '#/components/responses/Forbidden'
  3129. '404':
  3130. $ref: '#/components/responses/NotFound'
  3131. '500':
  3132. $ref: '#/components/responses/InternalServerError'
  3133. default:
  3134. $ref: '#/components/responses/DefaultResponse'
  3135. '/users/{username}/2fa/disable':
  3136. parameters:
  3137. - name: username
  3138. in: path
  3139. description: the username
  3140. required: true
  3141. schema:
  3142. type: string
  3143. put:
  3144. tags:
  3145. - users
  3146. summary: Disable second factor authentication
  3147. 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'
  3148. operationId: disable_user_2fa
  3149. responses:
  3150. '200':
  3151. description: successful operation
  3152. content:
  3153. application/json:
  3154. schema:
  3155. $ref: '#/components/schemas/ApiResponse'
  3156. example:
  3157. message: 2FA disabled
  3158. '400':
  3159. $ref: '#/components/responses/BadRequest'
  3160. '401':
  3161. $ref: '#/components/responses/Unauthorized'
  3162. '403':
  3163. $ref: '#/components/responses/Forbidden'
  3164. '404':
  3165. $ref: '#/components/responses/NotFound'
  3166. '500':
  3167. $ref: '#/components/responses/InternalServerError'
  3168. default:
  3169. $ref: '#/components/responses/DefaultResponse'
  3170. '/users/{username}/forgot-password':
  3171. parameters:
  3172. - name: username
  3173. in: path
  3174. description: the username
  3175. required: true
  3176. schema:
  3177. type: string
  3178. post:
  3179. security: []
  3180. tags:
  3181. - users
  3182. summary: Send a password reset code by email
  3183. 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'
  3184. operationId: user_forgot_password
  3185. responses:
  3186. '200':
  3187. description: successful operation
  3188. content:
  3189. application/json:
  3190. schema:
  3191. $ref: '#/components/schemas/ApiResponse'
  3192. '400':
  3193. $ref: '#/components/responses/BadRequest'
  3194. '401':
  3195. $ref: '#/components/responses/Unauthorized'
  3196. '403':
  3197. $ref: '#/components/responses/Forbidden'
  3198. '404':
  3199. $ref: '#/components/responses/NotFound'
  3200. '500':
  3201. $ref: '#/components/responses/InternalServerError'
  3202. default:
  3203. $ref: '#/components/responses/DefaultResponse'
  3204. '/users/{username}/reset-password':
  3205. parameters:
  3206. - name: username
  3207. in: path
  3208. description: the username
  3209. required: true
  3210. schema:
  3211. type: string
  3212. post:
  3213. security: []
  3214. tags:
  3215. - users
  3216. summary: Reset the password
  3217. description: 'Set a new password using the code received via email'
  3218. operationId: user_reset_password
  3219. requestBody:
  3220. content:
  3221. application/json:
  3222. schema:
  3223. type: object
  3224. properties:
  3225. code:
  3226. type: string
  3227. password:
  3228. type: string
  3229. required: true
  3230. responses:
  3231. '200':
  3232. description: successful operation
  3233. content:
  3234. application/json:
  3235. schema:
  3236. $ref: '#/components/schemas/ApiResponse'
  3237. '400':
  3238. $ref: '#/components/responses/BadRequest'
  3239. '401':
  3240. $ref: '#/components/responses/Unauthorized'
  3241. '403':
  3242. $ref: '#/components/responses/Forbidden'
  3243. '404':
  3244. $ref: '#/components/responses/NotFound'
  3245. '500':
  3246. $ref: '#/components/responses/InternalServerError'
  3247. default:
  3248. $ref: '#/components/responses/DefaultResponse'
  3249. /status:
  3250. get:
  3251. tags:
  3252. - maintenance
  3253. summary: Get status
  3254. description: Retrieves the status of the active services
  3255. operationId: get_status
  3256. responses:
  3257. '200':
  3258. description: successful operation
  3259. content:
  3260. application/json:
  3261. schema:
  3262. $ref: '#/components/schemas/ServicesStatus'
  3263. '400':
  3264. $ref: '#/components/responses/BadRequest'
  3265. '401':
  3266. $ref: '#/components/responses/Unauthorized'
  3267. '403':
  3268. $ref: '#/components/responses/Forbidden'
  3269. '500':
  3270. $ref: '#/components/responses/InternalServerError'
  3271. default:
  3272. $ref: '#/components/responses/DefaultResponse'
  3273. /dumpdata:
  3274. get:
  3275. tags:
  3276. - maintenance
  3277. summary: Dump data
  3278. 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'
  3279. operationId: dumpdata
  3280. parameters:
  3281. - in: query
  3282. name: output-file
  3283. schema:
  3284. type: string
  3285. 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.
  3286. - in: query
  3287. name: output-data
  3288. schema:
  3289. type: integer
  3290. enum:
  3291. - 0
  3292. - 1
  3293. description: |
  3294. output data:
  3295. * `0` or any other value != 1, the backup will be saved to a file on the server, `output_file` is required
  3296. * `1` the backup will be returned as response body
  3297. - in: query
  3298. name: indent
  3299. schema:
  3300. type: integer
  3301. enum:
  3302. - 0
  3303. - 1
  3304. description: |
  3305. indent:
  3306. * `0` no indentation. This is the default
  3307. * `1` format the output JSON
  3308. responses:
  3309. '200':
  3310. description: successful operation
  3311. content:
  3312. application/json:
  3313. schema:
  3314. oneOf:
  3315. - $ref: '#/components/schemas/ApiResponse'
  3316. - $ref: '#/components/schemas/BackupData'
  3317. '400':
  3318. $ref: '#/components/responses/BadRequest'
  3319. '401':
  3320. $ref: '#/components/responses/Unauthorized'
  3321. '403':
  3322. $ref: '#/components/responses/Forbidden'
  3323. '500':
  3324. $ref: '#/components/responses/InternalServerError'
  3325. default:
  3326. $ref: '#/components/responses/DefaultResponse'
  3327. /loaddata:
  3328. parameters:
  3329. - in: query
  3330. name: scan-quota
  3331. schema:
  3332. type: integer
  3333. enum:
  3334. - 0
  3335. - 1
  3336. - 2
  3337. description: |
  3338. Quota scan:
  3339. * `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
  3340. * `1` scan quota
  3341. * `2` scan quota if the user has quota restrictions
  3342. required: false
  3343. - in: query
  3344. name: mode
  3345. schema:
  3346. type: integer
  3347. enum:
  3348. - 0
  3349. - 1
  3350. - 2
  3351. description: |
  3352. Mode:
  3353. * `0` New objects are added, existing ones are updated. This is the default
  3354. * `1` New objects are added, existing ones are not modified
  3355. * `2` New objects are added, existing ones are updated and connected users are disconnected and so forced to use the new configuration
  3356. get:
  3357. tags:
  3358. - maintenance
  3359. summary: Load data from path
  3360. 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'
  3361. operationId: loaddata_from_file
  3362. parameters:
  3363. - in: query
  3364. name: input-file
  3365. schema:
  3366. type: string
  3367. required: true
  3368. 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
  3369. responses:
  3370. '200':
  3371. description: successful operation
  3372. content:
  3373. application/json:
  3374. schema:
  3375. $ref: '#/components/schemas/ApiResponse'
  3376. example:
  3377. message: Data restored
  3378. '400':
  3379. $ref: '#/components/responses/BadRequest'
  3380. '401':
  3381. $ref: '#/components/responses/Unauthorized'
  3382. '403':
  3383. $ref: '#/components/responses/Forbidden'
  3384. '500':
  3385. $ref: '#/components/responses/InternalServerError'
  3386. default:
  3387. $ref: '#/components/responses/DefaultResponse'
  3388. post:
  3389. tags:
  3390. - maintenance
  3391. summary: Load data
  3392. 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'
  3393. operationId: loaddata_from_request_body
  3394. requestBody:
  3395. required: true
  3396. content:
  3397. application/json:
  3398. schema:
  3399. $ref: '#/components/schemas/BackupData'
  3400. responses:
  3401. '200':
  3402. description: successful operation
  3403. content:
  3404. application/json:
  3405. schema:
  3406. $ref: '#/components/schemas/ApiResponse'
  3407. example:
  3408. message: Data restored
  3409. '400':
  3410. $ref: '#/components/responses/BadRequest'
  3411. '401':
  3412. $ref: '#/components/responses/Unauthorized'
  3413. '403':
  3414. $ref: '#/components/responses/Forbidden'
  3415. '500':
  3416. $ref: '#/components/responses/InternalServerError'
  3417. default:
  3418. $ref: '#/components/responses/DefaultResponse'
  3419. /user/changepwd:
  3420. put:
  3421. security:
  3422. - BearerAuth: []
  3423. tags:
  3424. - user APIs
  3425. summary: Change user password
  3426. description: Changes the password for the logged in user
  3427. operationId: change_user_password
  3428. requestBody:
  3429. required: true
  3430. content:
  3431. application/json:
  3432. schema:
  3433. $ref: '#/components/schemas/PwdChange'
  3434. responses:
  3435. '200':
  3436. description: successful operation
  3437. content:
  3438. application/json:
  3439. schema:
  3440. $ref: '#/components/schemas/ApiResponse'
  3441. '401':
  3442. $ref: '#/components/responses/Unauthorized'
  3443. '403':
  3444. $ref: '#/components/responses/Forbidden'
  3445. '500':
  3446. $ref: '#/components/responses/InternalServerError'
  3447. default:
  3448. $ref: '#/components/responses/DefaultResponse'
  3449. /user/profile:
  3450. get:
  3451. security:
  3452. - BearerAuth: []
  3453. tags:
  3454. - user APIs
  3455. summary: Get user profile
  3456. description: 'Returns the profile for the logged in user'
  3457. operationId: get_user_profile
  3458. responses:
  3459. '200':
  3460. description: successful operation
  3461. content:
  3462. application/json:
  3463. schema:
  3464. $ref: '#/components/schemas/UserProfile'
  3465. '401':
  3466. $ref: '#/components/responses/Unauthorized'
  3467. '403':
  3468. $ref: '#/components/responses/Forbidden'
  3469. '500':
  3470. $ref: '#/components/responses/InternalServerError'
  3471. default:
  3472. $ref: '#/components/responses/DefaultResponse'
  3473. put:
  3474. security:
  3475. - BearerAuth: []
  3476. tags:
  3477. - user APIs
  3478. summary: Update user profile
  3479. description: 'Allows to update the profile for the logged in user'
  3480. operationId: update_user_profile
  3481. requestBody:
  3482. required: true
  3483. content:
  3484. application/json:
  3485. schema:
  3486. $ref: '#/components/schemas/UserProfile'
  3487. responses:
  3488. '200':
  3489. description: successful operation
  3490. content:
  3491. application/json:
  3492. schema:
  3493. $ref: '#/components/schemas/ApiResponse'
  3494. '400':
  3495. $ref: '#/components/responses/BadRequest'
  3496. '401':
  3497. $ref: '#/components/responses/Unauthorized'
  3498. '403':
  3499. $ref: '#/components/responses/Forbidden'
  3500. '500':
  3501. $ref: '#/components/responses/InternalServerError'
  3502. default:
  3503. $ref: '#/components/responses/DefaultResponse'
  3504. /user/2fa/recoverycodes:
  3505. get:
  3506. security:
  3507. - BearerAuth: []
  3508. tags:
  3509. - user APIs
  3510. summary: Get recovery codes
  3511. 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'
  3512. operationId: get_user_recovery_codes
  3513. responses:
  3514. '200':
  3515. description: successful operation
  3516. content:
  3517. application/json:
  3518. schema:
  3519. type: array
  3520. items:
  3521. $ref: '#/components/schemas/RecoveryCode'
  3522. '401':
  3523. $ref: '#/components/responses/Unauthorized'
  3524. '403':
  3525. $ref: '#/components/responses/Forbidden'
  3526. '500':
  3527. $ref: '#/components/responses/InternalServerError'
  3528. default:
  3529. $ref: '#/components/responses/DefaultResponse'
  3530. post:
  3531. security:
  3532. - BearerAuth: []
  3533. tags:
  3534. - user APIs
  3535. summary: Generate recovery codes
  3536. description: 'Generates new recovery codes for the logged in user. Generating new recovery codes you automatically invalidate old ones'
  3537. operationId: generate_user_recovery_codes
  3538. responses:
  3539. '200':
  3540. description: successful operation
  3541. content:
  3542. application/json:
  3543. schema:
  3544. type: array
  3545. items:
  3546. type: string
  3547. '400':
  3548. $ref: '#/components/responses/BadRequest'
  3549. '401':
  3550. $ref: '#/components/responses/Unauthorized'
  3551. '403':
  3552. $ref: '#/components/responses/Forbidden'
  3553. '500':
  3554. $ref: '#/components/responses/InternalServerError'
  3555. default:
  3556. $ref: '#/components/responses/DefaultResponse'
  3557. /user/totp/configs:
  3558. get:
  3559. security:
  3560. - BearerAuth: []
  3561. tags:
  3562. - user APIs
  3563. summary: Get available TOTP configuration
  3564. description: Returns the available TOTP configurations for the logged in user
  3565. operationId: get_user_totp_configs
  3566. responses:
  3567. '200':
  3568. description: successful operation
  3569. content:
  3570. application/json:
  3571. schema:
  3572. type: array
  3573. items:
  3574. $ref: '#/components/schemas/TOTPConfig'
  3575. '401':
  3576. $ref: '#/components/responses/Unauthorized'
  3577. '403':
  3578. $ref: '#/components/responses/Forbidden'
  3579. '500':
  3580. $ref: '#/components/responses/InternalServerError'
  3581. default:
  3582. $ref: '#/components/responses/DefaultResponse'
  3583. /user/totp/generate:
  3584. post:
  3585. security:
  3586. - BearerAuth: []
  3587. tags:
  3588. - user APIs
  3589. summary: Generate a new TOTP secret
  3590. description: 'Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in user'
  3591. operationId: generate_user_totp_secret
  3592. requestBody:
  3593. required: true
  3594. content:
  3595. application/json:
  3596. schema:
  3597. type: object
  3598. properties:
  3599. config_name:
  3600. type: string
  3601. description: 'name of the configuration to use to generate the secret'
  3602. responses:
  3603. '200':
  3604. description: successful operation
  3605. content:
  3606. application/json:
  3607. schema:
  3608. type: object
  3609. properties:
  3610. config_name:
  3611. type: string
  3612. issuer:
  3613. type: string
  3614. secret:
  3615. type: string
  3616. qr_code:
  3617. type: string
  3618. format: byte
  3619. description: 'QR code png encoded as BASE64'
  3620. '400':
  3621. $ref: '#/components/responses/BadRequest'
  3622. '401':
  3623. $ref: '#/components/responses/Unauthorized'
  3624. '403':
  3625. $ref: '#/components/responses/Forbidden'
  3626. '500':
  3627. $ref: '#/components/responses/InternalServerError'
  3628. default:
  3629. $ref: '#/components/responses/DefaultResponse'
  3630. /user/totp/validate:
  3631. post:
  3632. security:
  3633. - BearerAuth: []
  3634. tags:
  3635. - user APIs
  3636. summary: Validate a one time authentication code
  3637. description: 'Checks if the given authentication code can be validated using the specified secret and config name'
  3638. operationId: validate_user_totp_secret
  3639. requestBody:
  3640. required: true
  3641. content:
  3642. application/json:
  3643. schema:
  3644. type: object
  3645. properties:
  3646. config_name:
  3647. type: string
  3648. description: 'name of the configuration to use to validate the passcode'
  3649. passcode:
  3650. type: string
  3651. description: 'passcode to validate'
  3652. secret:
  3653. type: string
  3654. description: 'secret to use to validate the passcode'
  3655. responses:
  3656. '200':
  3657. description: successful operation
  3658. content:
  3659. application/json:
  3660. schema:
  3661. $ref: '#/components/schemas/ApiResponse'
  3662. example:
  3663. message: Passcode successfully validated
  3664. '400':
  3665. $ref: '#/components/responses/BadRequest'
  3666. '401':
  3667. $ref: '#/components/responses/Unauthorized'
  3668. '403':
  3669. $ref: '#/components/responses/Forbidden'
  3670. '500':
  3671. $ref: '#/components/responses/InternalServerError'
  3672. default:
  3673. $ref: '#/components/responses/DefaultResponse'
  3674. /user/totp/save:
  3675. post:
  3676. security:
  3677. - BearerAuth: []
  3678. tags:
  3679. - user APIs
  3680. summary: Save a TOTP config
  3681. description: 'Saves the specified TOTP config for the logged in user'
  3682. operationId: save_user_totp_config
  3683. requestBody:
  3684. required: true
  3685. content:
  3686. application/json:
  3687. schema:
  3688. $ref: '#/components/schemas/UserTOTPConfig'
  3689. responses:
  3690. '200':
  3691. description: successful operation
  3692. content:
  3693. application/json:
  3694. schema:
  3695. $ref: '#/components/schemas/ApiResponse'
  3696. example:
  3697. message: TOTP configuration saved
  3698. '400':
  3699. $ref: '#/components/responses/BadRequest'
  3700. '401':
  3701. $ref: '#/components/responses/Unauthorized'
  3702. '403':
  3703. $ref: '#/components/responses/Forbidden'
  3704. '500':
  3705. $ref: '#/components/responses/InternalServerError'
  3706. default:
  3707. $ref: '#/components/responses/DefaultResponse'
  3708. /user/shares:
  3709. get:
  3710. tags:
  3711. - user APIs
  3712. summary: List user shares
  3713. description: Returns the share for the logged in user
  3714. operationId: get_user_shares
  3715. parameters:
  3716. - in: query
  3717. name: offset
  3718. schema:
  3719. type: integer
  3720. minimum: 0
  3721. default: 0
  3722. required: false
  3723. - in: query
  3724. name: limit
  3725. schema:
  3726. type: integer
  3727. minimum: 1
  3728. maximum: 500
  3729. default: 100
  3730. required: false
  3731. description: 'The maximum number of items to return. Max value is 500, default is 100'
  3732. - in: query
  3733. name: order
  3734. required: false
  3735. description: Ordering shares by ID. Default ASC
  3736. schema:
  3737. type: string
  3738. enum:
  3739. - ASC
  3740. - DESC
  3741. example: ASC
  3742. responses:
  3743. '200':
  3744. description: successful operation
  3745. content:
  3746. application/json:
  3747. schema:
  3748. type: array
  3749. items:
  3750. $ref: '#/components/schemas/Share'
  3751. '400':
  3752. $ref: '#/components/responses/BadRequest'
  3753. '401':
  3754. $ref: '#/components/responses/Unauthorized'
  3755. '403':
  3756. $ref: '#/components/responses/Forbidden'
  3757. '500':
  3758. $ref: '#/components/responses/InternalServerError'
  3759. default:
  3760. $ref: '#/components/responses/DefaultResponse'
  3761. post:
  3762. tags:
  3763. - user APIs
  3764. summary: Add a share
  3765. operationId: add_share
  3766. description: 'Adds a new share. The share id will be auto-generated'
  3767. requestBody:
  3768. required: true
  3769. content:
  3770. application/json:
  3771. schema:
  3772. $ref: '#/components/schemas/Share'
  3773. responses:
  3774. '201':
  3775. description: successful operation
  3776. headers:
  3777. X-Object-ID:
  3778. schema:
  3779. type: string
  3780. description: ID for the new created share
  3781. Location:
  3782. schema:
  3783. type: string
  3784. description: URL to retrieve the details for the new created share
  3785. content:
  3786. application/json:
  3787. schema:
  3788. $ref: '#/components/schemas/ApiResponse'
  3789. '400':
  3790. $ref: '#/components/responses/BadRequest'
  3791. '401':
  3792. $ref: '#/components/responses/Unauthorized'
  3793. '403':
  3794. $ref: '#/components/responses/Forbidden'
  3795. '500':
  3796. $ref: '#/components/responses/InternalServerError'
  3797. default:
  3798. $ref: '#/components/responses/DefaultResponse'
  3799. '/user/shares/{id}':
  3800. parameters:
  3801. - name: id
  3802. in: path
  3803. description: the share id
  3804. required: true
  3805. schema:
  3806. type: string
  3807. get:
  3808. tags:
  3809. - user APIs
  3810. summary: Get share by id
  3811. description: Returns a share by id for the logged in user
  3812. operationId: get_user_share_by_id
  3813. responses:
  3814. '200':
  3815. description: successful operation
  3816. content:
  3817. application/json:
  3818. schema:
  3819. $ref: '#/components/schemas/Share'
  3820. '400':
  3821. $ref: '#/components/responses/BadRequest'
  3822. '401':
  3823. $ref: '#/components/responses/Unauthorized'
  3824. '403':
  3825. $ref: '#/components/responses/Forbidden'
  3826. '404':
  3827. $ref: '#/components/responses/NotFound'
  3828. '500':
  3829. $ref: '#/components/responses/InternalServerError'
  3830. default:
  3831. $ref: '#/components/responses/DefaultResponse'
  3832. put:
  3833. tags:
  3834. - user APIs
  3835. summary: Update share
  3836. description: 'Updates an existing share belonging to the logged in user'
  3837. operationId: update_user_share
  3838. requestBody:
  3839. required: true
  3840. content:
  3841. application/json:
  3842. schema:
  3843. $ref: '#/components/schemas/Share'
  3844. responses:
  3845. '200':
  3846. description: successful operation
  3847. content:
  3848. application/json:
  3849. schema:
  3850. $ref: '#/components/schemas/ApiResponse'
  3851. example:
  3852. message: Share updated
  3853. '400':
  3854. $ref: '#/components/responses/BadRequest'
  3855. '401':
  3856. $ref: '#/components/responses/Unauthorized'
  3857. '403':
  3858. $ref: '#/components/responses/Forbidden'
  3859. '404':
  3860. $ref: '#/components/responses/NotFound'
  3861. '500':
  3862. $ref: '#/components/responses/InternalServerError'
  3863. default:
  3864. $ref: '#/components/responses/DefaultResponse'
  3865. delete:
  3866. tags:
  3867. - user APIs
  3868. summary: Delete share
  3869. description: 'Deletes an existing share belonging to the logged in user'
  3870. operationId: delete_user_share
  3871. responses:
  3872. '200':
  3873. description: successful operation
  3874. content:
  3875. application/json:
  3876. schema:
  3877. $ref: '#/components/schemas/ApiResponse'
  3878. example:
  3879. message: Share deleted
  3880. '400':
  3881. $ref: '#/components/responses/BadRequest'
  3882. '401':
  3883. $ref: '#/components/responses/Unauthorized'
  3884. '403':
  3885. $ref: '#/components/responses/Forbidden'
  3886. '404':
  3887. $ref: '#/components/responses/NotFound'
  3888. '500':
  3889. $ref: '#/components/responses/InternalServerError'
  3890. default:
  3891. $ref: '#/components/responses/DefaultResponse'
  3892. /user/dirs:
  3893. get:
  3894. tags:
  3895. - user APIs
  3896. summary: Read directory contents
  3897. description: Returns the contents of the specified directory for the logged in user
  3898. operationId: get_user_dir_contents
  3899. parameters:
  3900. - in: query
  3901. name: path
  3902. 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
  3903. schema:
  3904. type: string
  3905. responses:
  3906. '200':
  3907. description: successful operation
  3908. content:
  3909. application/json:
  3910. schema:
  3911. type: array
  3912. items:
  3913. $ref: '#/components/schemas/DirEntry'
  3914. '400':
  3915. $ref: '#/components/responses/BadRequest'
  3916. '401':
  3917. $ref: '#/components/responses/Unauthorized'
  3918. '403':
  3919. $ref: '#/components/responses/Forbidden'
  3920. '500':
  3921. $ref: '#/components/responses/InternalServerError'
  3922. default:
  3923. $ref: '#/components/responses/DefaultResponse'
  3924. post:
  3925. tags:
  3926. - user APIs
  3927. summary: Create a directory
  3928. description: Create a directory for the logged in user
  3929. operationId: create_user_dir
  3930. parameters:
  3931. - in: query
  3932. name: path
  3933. 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"
  3934. schema:
  3935. type: string
  3936. required: true
  3937. - in: query
  3938. name: mkdir_parents
  3939. description: Create parent directories if they do not exist?
  3940. schema:
  3941. type: boolean
  3942. required: false
  3943. responses:
  3944. '201':
  3945. description: successful operation
  3946. content:
  3947. application/json:
  3948. schema:
  3949. type: array
  3950. items:
  3951. $ref: '#/components/schemas/ApiResponse'
  3952. '400':
  3953. $ref: '#/components/responses/BadRequest'
  3954. '401':
  3955. $ref: '#/components/responses/Unauthorized'
  3956. '403':
  3957. $ref: '#/components/responses/Forbidden'
  3958. '500':
  3959. $ref: '#/components/responses/InternalServerError'
  3960. default:
  3961. $ref: '#/components/responses/DefaultResponse'
  3962. patch:
  3963. tags:
  3964. - user APIs
  3965. summary: Rename a directory
  3966. 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
  3967. operationId: rename_user_dir
  3968. parameters:
  3969. - in: query
  3970. name: path
  3971. 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"
  3972. schema:
  3973. type: string
  3974. required: true
  3975. - in: query
  3976. name: target
  3977. description: New name. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir"
  3978. schema:
  3979. type: string
  3980. required: true
  3981. responses:
  3982. '200':
  3983. description: successful operation
  3984. content:
  3985. application/json:
  3986. schema:
  3987. type: array
  3988. items:
  3989. $ref: '#/components/schemas/ApiResponse'
  3990. '400':
  3991. $ref: '#/components/responses/BadRequest'
  3992. '401':
  3993. $ref: '#/components/responses/Unauthorized'
  3994. '403':
  3995. $ref: '#/components/responses/Forbidden'
  3996. '500':
  3997. $ref: '#/components/responses/InternalServerError'
  3998. default:
  3999. $ref: '#/components/responses/DefaultResponse'
  4000. delete:
  4001. tags:
  4002. - user APIs
  4003. summary: Delete a directory
  4004. description: Delete a directory for the logged in user. Only empty directories can be deleted
  4005. operationId: delete_user_dir
  4006. parameters:
  4007. - in: query
  4008. name: path
  4009. 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"
  4010. schema:
  4011. type: string
  4012. required: true
  4013. responses:
  4014. '200':
  4015. description: successful operation
  4016. content:
  4017. application/json:
  4018. schema:
  4019. type: array
  4020. items:
  4021. $ref: '#/components/schemas/ApiResponse'
  4022. '400':
  4023. $ref: '#/components/responses/BadRequest'
  4024. '401':
  4025. $ref: '#/components/responses/Unauthorized'
  4026. '403':
  4027. $ref: '#/components/responses/Forbidden'
  4028. '500':
  4029. $ref: '#/components/responses/InternalServerError'
  4030. default:
  4031. $ref: '#/components/responses/DefaultResponse'
  4032. /user/files:
  4033. get:
  4034. tags:
  4035. - user APIs
  4036. summary: Download a single file
  4037. description: Returns the file contents as response body
  4038. operationId: download_user_file
  4039. parameters:
  4040. - in: query
  4041. name: path
  4042. required: true
  4043. 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"
  4044. schema:
  4045. type: string
  4046. - in: query
  4047. name: inline
  4048. required: false
  4049. description: 'If set, the response will not have the Content-Disposition header set to `attachment`'
  4050. schema:
  4051. type: string
  4052. responses:
  4053. '200':
  4054. description: successful operation
  4055. content:
  4056. '*/*':
  4057. schema:
  4058. type: string
  4059. format: binary
  4060. '206':
  4061. description: successful operation
  4062. content:
  4063. '*/*':
  4064. schema:
  4065. type: string
  4066. format: binary
  4067. '400':
  4068. $ref: '#/components/responses/BadRequest'
  4069. '401':
  4070. $ref: '#/components/responses/Unauthorized'
  4071. '403':
  4072. $ref: '#/components/responses/Forbidden'
  4073. '500':
  4074. $ref: '#/components/responses/InternalServerError'
  4075. default:
  4076. $ref: '#/components/responses/DefaultResponse'
  4077. post:
  4078. tags:
  4079. - user APIs
  4080. summary: Upload files
  4081. description: Upload one or more files for the logged in user
  4082. operationId: create_user_files
  4083. parameters:
  4084. - in: query
  4085. name: path
  4086. 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
  4087. schema:
  4088. type: string
  4089. - in: query
  4090. name: mkdir_parents
  4091. description: Create parent directories if they do not exist?
  4092. schema:
  4093. type: boolean
  4094. required: false
  4095. requestBody:
  4096. content:
  4097. multipart/form-data:
  4098. schema:
  4099. type: object
  4100. properties:
  4101. filenames:
  4102. type: array
  4103. items:
  4104. type: string
  4105. format: binary
  4106. minItems: 1
  4107. uniqueItems: true
  4108. required: true
  4109. responses:
  4110. '201':
  4111. description: successful operation
  4112. content:
  4113. application/json:
  4114. schema:
  4115. type: array
  4116. items:
  4117. $ref: '#/components/schemas/ApiResponse'
  4118. '400':
  4119. $ref: '#/components/responses/BadRequest'
  4120. '401':
  4121. $ref: '#/components/responses/Unauthorized'
  4122. '403':
  4123. $ref: '#/components/responses/Forbidden'
  4124. '413':
  4125. $ref: '#/components/responses/RequestEntityTooLarge'
  4126. '500':
  4127. $ref: '#/components/responses/InternalServerError'
  4128. default:
  4129. $ref: '#/components/responses/DefaultResponse'
  4130. patch:
  4131. tags:
  4132. - user APIs
  4133. summary: Rename a file
  4134. description: Rename a file for the logged in user
  4135. operationId: rename_user_file
  4136. parameters:
  4137. - in: query
  4138. name: path
  4139. description: Path to the file to rename. It must be URL encoded
  4140. schema:
  4141. type: string
  4142. required: true
  4143. - in: query
  4144. name: target
  4145. description: New name. It must be URL encoded
  4146. schema:
  4147. type: string
  4148. required: true
  4149. responses:
  4150. '200':
  4151. description: successful operation
  4152. content:
  4153. application/json:
  4154. schema:
  4155. type: array
  4156. items:
  4157. $ref: '#/components/schemas/ApiResponse'
  4158. '400':
  4159. $ref: '#/components/responses/BadRequest'
  4160. '401':
  4161. $ref: '#/components/responses/Unauthorized'
  4162. '403':
  4163. $ref: '#/components/responses/Forbidden'
  4164. '500':
  4165. $ref: '#/components/responses/InternalServerError'
  4166. default:
  4167. $ref: '#/components/responses/DefaultResponse'
  4168. delete:
  4169. tags:
  4170. - user APIs
  4171. summary: Delete a file
  4172. description: Delete a file for the logged in user.
  4173. operationId: delete_user_file
  4174. parameters:
  4175. - in: query
  4176. name: path
  4177. description: Path to the file to delete. It must be URL encoded
  4178. schema:
  4179. type: string
  4180. required: true
  4181. responses:
  4182. '200':
  4183. description: successful operation
  4184. content:
  4185. application/json:
  4186. schema:
  4187. type: array
  4188. items:
  4189. $ref: '#/components/schemas/ApiResponse'
  4190. '400':
  4191. $ref: '#/components/responses/BadRequest'
  4192. '401':
  4193. $ref: '#/components/responses/Unauthorized'
  4194. '403':
  4195. $ref: '#/components/responses/Forbidden'
  4196. '500':
  4197. $ref: '#/components/responses/InternalServerError'
  4198. default:
  4199. $ref: '#/components/responses/DefaultResponse'
  4200. /user/files/upload:
  4201. post:
  4202. tags:
  4203. - user APIs
  4204. summary: Upload a single file
  4205. 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'
  4206. operationId: create_user_file
  4207. parameters:
  4208. - in: query
  4209. name: path
  4210. 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
  4211. schema:
  4212. type: string
  4213. required: true
  4214. - in: query
  4215. name: mkdir_parents
  4216. description: Create parent directories if they do not exist?
  4217. schema:
  4218. type: boolean
  4219. required: false
  4220. - in: header
  4221. name: X-SFTPGO-MTIME
  4222. schema:
  4223. type: integer
  4224. description: File modification time as unix timestamp in milliseconds
  4225. requestBody:
  4226. content:
  4227. application/*:
  4228. schema:
  4229. type: string
  4230. format: binary
  4231. text/*:
  4232. schema:
  4233. type: string
  4234. format: binary
  4235. image/*:
  4236. schema:
  4237. type: string
  4238. format: binary
  4239. audio/*:
  4240. schema:
  4241. type: string
  4242. format: binary
  4243. video/*:
  4244. schema:
  4245. type: string
  4246. format: binary
  4247. required: true
  4248. responses:
  4249. '201':
  4250. description: successful operation
  4251. content:
  4252. application/json:
  4253. schema:
  4254. type: array
  4255. items:
  4256. $ref: '#/components/schemas/ApiResponse'
  4257. '400':
  4258. $ref: '#/components/responses/BadRequest'
  4259. '401':
  4260. $ref: '#/components/responses/Unauthorized'
  4261. '403':
  4262. $ref: '#/components/responses/Forbidden'
  4263. '413':
  4264. $ref: '#/components/responses/RequestEntityTooLarge'
  4265. '500':
  4266. $ref: '#/components/responses/InternalServerError'
  4267. default:
  4268. $ref: '#/components/responses/DefaultResponse'
  4269. /user/files/metadata:
  4270. patch:
  4271. tags:
  4272. - user APIs
  4273. summary: Set metadata for a file/directory
  4274. description: 'Set supported metadata attributes for the specified file or directory'
  4275. operationId: setprops_user_file
  4276. parameters:
  4277. - in: query
  4278. name: path
  4279. 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"
  4280. schema:
  4281. type: string
  4282. required: true
  4283. requestBody:
  4284. content:
  4285. application/json:
  4286. schema:
  4287. type: object
  4288. properties:
  4289. modification_time:
  4290. type: integer
  4291. description: File modification time as unix timestamp in milliseconds
  4292. required: true
  4293. responses:
  4294. '200':
  4295. description: successful operation
  4296. content:
  4297. application/json:
  4298. schema:
  4299. type: array
  4300. items:
  4301. $ref: '#/components/schemas/ApiResponse'
  4302. '400':
  4303. $ref: '#/components/responses/BadRequest'
  4304. '401':
  4305. $ref: '#/components/responses/Unauthorized'
  4306. '403':
  4307. $ref: '#/components/responses/Forbidden'
  4308. '413':
  4309. $ref: '#/components/responses/RequestEntityTooLarge'
  4310. '500':
  4311. $ref: '#/components/responses/InternalServerError'
  4312. default:
  4313. $ref: '#/components/responses/DefaultResponse'
  4314. /user/streamzip:
  4315. post:
  4316. tags:
  4317. - user APIs
  4318. summary: Download multiple files and folders as a single zip file
  4319. 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
  4320. operationId: streamzip
  4321. requestBody:
  4322. required: true
  4323. content:
  4324. application/json:
  4325. schema:
  4326. type: array
  4327. items:
  4328. type: string
  4329. description: Absolute file or folder path
  4330. responses:
  4331. '200':
  4332. description: successful operation
  4333. content:
  4334. 'application/zip':
  4335. schema:
  4336. type: string
  4337. format: binary
  4338. '400':
  4339. $ref: '#/components/responses/BadRequest'
  4340. '401':
  4341. $ref: '#/components/responses/Unauthorized'
  4342. '403':
  4343. $ref: '#/components/responses/Forbidden'
  4344. '500':
  4345. $ref: '#/components/responses/InternalServerError'
  4346. default:
  4347. $ref: '#/components/responses/DefaultResponse'
  4348. components:
  4349. responses:
  4350. BadRequest:
  4351. description: Bad Request
  4352. content:
  4353. application/json:
  4354. schema:
  4355. $ref: '#/components/schemas/ApiResponse'
  4356. Unauthorized:
  4357. description: Unauthorized
  4358. content:
  4359. application/json:
  4360. schema:
  4361. $ref: '#/components/schemas/ApiResponse'
  4362. Forbidden:
  4363. description: Forbidden
  4364. content:
  4365. application/json:
  4366. schema:
  4367. $ref: '#/components/schemas/ApiResponse'
  4368. NotFound:
  4369. description: Not Found
  4370. content:
  4371. application/json:
  4372. schema:
  4373. $ref: '#/components/schemas/ApiResponse'
  4374. Conflict:
  4375. description: Conflict
  4376. content:
  4377. application/json:
  4378. schema:
  4379. $ref: '#/components/schemas/ApiResponse'
  4380. RequestEntityTooLarge:
  4381. description: Request Entity Too Large, max allowed size exceeded
  4382. content:
  4383. application/json:
  4384. schema:
  4385. $ref: '#/components/schemas/ApiResponse'
  4386. InternalServerError:
  4387. description: Internal Server Error
  4388. content:
  4389. application/json:
  4390. schema:
  4391. $ref: '#/components/schemas/ApiResponse'
  4392. DefaultResponse:
  4393. description: Unexpected Error
  4394. content:
  4395. application/json:
  4396. schema:
  4397. $ref: '#/components/schemas/ApiResponse'
  4398. schemas:
  4399. Permission:
  4400. type: string
  4401. enum:
  4402. - '*'
  4403. - list
  4404. - download
  4405. - upload
  4406. - overwrite
  4407. - delete
  4408. - delete_files
  4409. - delete_dirs
  4410. - rename
  4411. - rename_files
  4412. - rename_dirs
  4413. - create_dirs
  4414. - create_symlinks
  4415. - chmod
  4416. - chown
  4417. - chtimes
  4418. description: |
  4419. Permissions:
  4420. * `*` - all permissions are granted
  4421. * `list` - list items is allowed
  4422. * `download` - download files is allowed
  4423. * `upload` - upload files is allowed
  4424. * `overwrite` - overwrite an existing file, while uploading, is allowed. upload permission is required to allow file overwrite
  4425. * `delete` - delete files or directories is allowed
  4426. * `delete_files` - delete files is allowed
  4427. * `delete_dirs` - delete directories is allowed
  4428. * `rename` - rename files or directories is allowed
  4429. * `rename_files` - rename files is allowed
  4430. * `rename_dirs` - rename directories is allowed
  4431. * `create_dirs` - create directories is allowed
  4432. * `create_symlinks` - create links is allowed
  4433. * `chmod` changing file or directory permissions is allowed
  4434. * `chown` changing file or directory owner and group is allowed
  4435. * `chtimes` changing file or directory access and modification time is allowed
  4436. AdminPermissions:
  4437. type: string
  4438. enum:
  4439. - '*'
  4440. - add_users
  4441. - edit_users
  4442. - del_users
  4443. - view_users
  4444. - view_conns
  4445. - close_conns
  4446. - view_status
  4447. - manage_admins
  4448. - manage_groups
  4449. - manage_apikeys
  4450. - quota_scans
  4451. - manage_system
  4452. - manage_defender
  4453. - view_defender
  4454. - retention_checks
  4455. - metadata_checks
  4456. - view_events
  4457. - manage_event_rules
  4458. - manager_roles
  4459. description: |
  4460. Admin permissions:
  4461. * `*` - all permissions are granted
  4462. * `add_users` - add new users is allowed
  4463. * `edit_users` - change existing users is allowed
  4464. * `del_users` - remove users is allowed
  4465. * `view_users` - list users is allowed
  4466. * `view_conns` - list active connections is allowed
  4467. * `close_conns` - close active connections is allowed
  4468. * `view_status` - view the server status is allowed
  4469. * `manage_admins` - manage other admins is allowed
  4470. * `manage_groups` - manage groups is allowed
  4471. * `manage_apikeys` - manage API keys is allowed
  4472. * `quota_scans` - view and start quota scans is allowed
  4473. * `manage_system` - backups and restores are allowed
  4474. * `manage_defender` - remove ip from the dynamic blocklist is allowed
  4475. * `view_defender` - list the dynamic blocklist is allowed
  4476. * `retention_checks` - view and start retention checks is allowed
  4477. * `metadata_checks` - view and start metadata checks is allowed
  4478. * `view_events` - view and search filesystem and provider events is allowed
  4479. * `manage_event_rules` - manage event actions and rules is allowed
  4480. * `manager_roles` - manage roles is allowed
  4481. FsProviders:
  4482. type: integer
  4483. enum:
  4484. - 0
  4485. - 1
  4486. - 2
  4487. - 3
  4488. - 4
  4489. - 5
  4490. - 6
  4491. description: |
  4492. Filesystem providers:
  4493. * `0` - Local filesystem
  4494. * `1` - S3 Compatible Object Storage
  4495. * `2` - Google Cloud Storage
  4496. * `3` - Azure Blob Storage
  4497. * `4` - Local filesystem encrypted
  4498. * `5` - SFTP
  4499. * `6` - HTTP filesystem
  4500. EventActionTypes:
  4501. type: integer
  4502. enum:
  4503. - 1
  4504. - 2
  4505. - 3
  4506. - 4
  4507. - 5
  4508. - 6
  4509. - 7
  4510. - 8
  4511. - 9
  4512. description: |
  4513. Supported event action types:
  4514. * `1` - HTTP
  4515. * `2` - Command
  4516. * `3` - Email
  4517. * `4` - Backup
  4518. * `5` - User quota reset
  4519. * `6` - Folder quota reset
  4520. * `7` - Transfer quota reset
  4521. * `8` - Data retention check
  4522. * `9` - Filesystem
  4523. FilesystemActionTypes:
  4524. type: integer
  4525. enum:
  4526. - 1
  4527. - 2
  4528. - 3
  4529. - 4
  4530. description: |
  4531. Supported filesystem action types:
  4532. * `1` - Rename
  4533. * `2` - Delete
  4534. * `3` - Mkdis
  4535. * `4` - Exist
  4536. EventTriggerTypes:
  4537. type: integer
  4538. enum:
  4539. - 1
  4540. - 2
  4541. - 3
  4542. - 4
  4543. - 5
  4544. description: |
  4545. Supported event trigger types:
  4546. * `1` - Filesystem event
  4547. * `2` - Provider event
  4548. * `3` - Schedule
  4549. * `4` - IP blocked
  4550. * `5` - Certificate renewal
  4551. LoginMethods:
  4552. type: string
  4553. enum:
  4554. - publickey
  4555. - password
  4556. - password-over-SSH
  4557. - keyboard-interactive
  4558. - publickey+password
  4559. - publickey+keyboard-interactive
  4560. - TLSCertificate
  4561. - TLSCertificate+password
  4562. description: |
  4563. Available login methods. To enable multi-step authentication you have to allow only multi-step login methods
  4564. * `publickey`
  4565. * `password`, password for all the supported protocols
  4566. * `password-over-SSH`, password over SSH protocol (SSH/SFTP/SCP)
  4567. * `keyboard-interactive`
  4568. * `publickey+password` - multi-step auth: public key and password
  4569. * `publickey+keyboard-interactive` - multi-step auth: public key and keyboard interactive
  4570. * `TLSCertificate`
  4571. * `TLSCertificate+password` - multi-step auth: TLS client certificate and password
  4572. SupportedProtocols:
  4573. type: string
  4574. enum:
  4575. - SSH
  4576. - FTP
  4577. - DAV
  4578. - HTTP
  4579. description: |
  4580. Protocols:
  4581. * `SSH` - includes both SFTP and SSH commands
  4582. * `FTP` - plain FTP and FTPES/FTPS
  4583. * `DAV` - WebDAV over HTTP/HTTPS
  4584. * `HTTP` - WebClient/REST API
  4585. MFAProtocols:
  4586. type: string
  4587. enum:
  4588. - SSH
  4589. - FTP
  4590. - HTTP
  4591. description: |
  4592. Protocols:
  4593. * `SSH` - includes both SFTP and SSH commands
  4594. * `FTP` - plain FTP and FTPES/FTPS
  4595. * `HTTP` - WebClient/REST API
  4596. EventProtocols:
  4597. type: string
  4598. enum:
  4599. - SSH
  4600. - SFTP
  4601. - SCP
  4602. - FTP
  4603. - DAV
  4604. - HTTP
  4605. - HTTPShare
  4606. - DataRetention
  4607. - OIDC
  4608. description: |
  4609. Protocols:
  4610. * `SSH` - SSH commands
  4611. * `SFTP` - SFTP protocol
  4612. * `FTP` - plain FTP and FTPES/FTPS
  4613. * `DAV` - WebDAV
  4614. * `HTTP` - WebClient/REST API
  4615. * `HTTPShare` - the event is generated in a public share
  4616. * `DataRetention` - the event is generated by a data retention check
  4617. * `OIDC` - OpenID Connect
  4618. WebClientOptions:
  4619. type: string
  4620. enum:
  4621. - publickey-change-disabled
  4622. - write-disabled
  4623. - mfa-disabled
  4624. - password-change-disabled
  4625. - api-key-auth-change-disabled
  4626. - info-change-disabled
  4627. - shares-disabled
  4628. - password-reset-disabled
  4629. - shares-without-password-disabled
  4630. description: |
  4631. Options:
  4632. * `publickey-change-disabled` - changing SSH public keys is not allowed
  4633. * `write-disabled` - upload, rename, delete are not allowed even if the user has permissions for these actions
  4634. * `mfa-disabled` - enabling multi-factor authentication is not allowed. This option cannot be set if the user has MFA already enabled
  4635. * `password-change-disabled` - changing password is not allowed
  4636. * `api-key-auth-change-disabled` - enabling/disabling API key authentication is not allowed
  4637. * `info-change-disabled` - changing info such as email and description is not allowed
  4638. * `shares-disabled` - sharing files and directories with external users is not allowed
  4639. * `password-reset-disabled` - resetting the password is not allowed
  4640. * `shares-without-password-disabled` - creating shares without password protection is not allowed
  4641. RetentionCheckNotification:
  4642. type: string
  4643. enum:
  4644. - Hook
  4645. - Email
  4646. description: |
  4647. Options:
  4648. * `Hook` - notify result using the defined hook. A "data_retention_hook" must be defined in your configuration file for this to work
  4649. * `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
  4650. APIKeyScope:
  4651. type: integer
  4652. enum:
  4653. - 1
  4654. - 2
  4655. description: |
  4656. Options:
  4657. * `1` - admin scope. The API key will be used to impersonate an SFTPGo admin
  4658. * `2` - user scope. The API key will be used to impersonate an SFTPGo user
  4659. ShareScope:
  4660. type: integer
  4661. enum:
  4662. - 1
  4663. - 2
  4664. description: |
  4665. Options:
  4666. * `1` - read scope
  4667. * `2` - write scope
  4668. TOTPHMacAlgo:
  4669. type: string
  4670. enum:
  4671. - sha1
  4672. - sha256
  4673. - sha512
  4674. description: 'Supported HMAC algorithms for Time-based one time passwords'
  4675. UserType:
  4676. type: string
  4677. enum:
  4678. - ''
  4679. - LDAPUser
  4680. - OSUser
  4681. description: This is an hint for authentication plugins. It is ignored when using SFTPGo internal authentication
  4682. FsEventStatus:
  4683. type: integer
  4684. enum:
  4685. - 1
  4686. - 2
  4687. - 3
  4688. description: >
  4689. Event status:
  4690. * `1` - no error
  4691. * `2` - generic error
  4692. * `3` - quota exceeded error
  4693. FsEventAction:
  4694. type: string
  4695. enum:
  4696. - download
  4697. - pre-upload
  4698. - upload
  4699. - delete
  4700. - rename
  4701. - mkdir
  4702. - rmdir
  4703. - ssh_cmd
  4704. ProviderEventAction:
  4705. type: string
  4706. enum:
  4707. - add
  4708. - update
  4709. - delete
  4710. ProviderEventObjectType:
  4711. type: string
  4712. enum:
  4713. - user
  4714. - folder
  4715. - group
  4716. - admin
  4717. - api_key
  4718. - share
  4719. - event_action
  4720. - event_rule
  4721. - role
  4722. SSHAuthentications:
  4723. type: string
  4724. enum:
  4725. - publickey
  4726. - password
  4727. - keyboard-interactive
  4728. - publickey+password
  4729. - publickey+keyboard-interactive
  4730. TLSVersions:
  4731. type: integer
  4732. enum:
  4733. - 12
  4734. - 13
  4735. description: >
  4736. TLS version:
  4737. * `12` - TLS 1.2
  4738. * `13` - TLS 1.3
  4739. TOTPConfig:
  4740. type: object
  4741. properties:
  4742. name:
  4743. type: string
  4744. issuer:
  4745. type: string
  4746. algo:
  4747. $ref: '#/components/schemas/TOTPHMacAlgo'
  4748. RecoveryCode:
  4749. type: object
  4750. properties:
  4751. secret:
  4752. $ref: '#/components/schemas/Secret'
  4753. used:
  4754. type: boolean
  4755. 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'
  4756. BaseTOTPConfig:
  4757. type: object
  4758. properties:
  4759. enabled:
  4760. type: boolean
  4761. config_name:
  4762. type: string
  4763. 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'
  4764. secret:
  4765. $ref: '#/components/schemas/Secret'
  4766. AdminTOTPConfig:
  4767. allOf:
  4768. - $ref: '#/components/schemas/BaseTOTPConfig'
  4769. UserTOTPConfig:
  4770. allOf:
  4771. - $ref: '#/components/schemas/BaseTOTPConfig'
  4772. - type: object
  4773. properties:
  4774. protocols:
  4775. type: array
  4776. items:
  4777. $ref: '#/components/schemas/MFAProtocols'
  4778. 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.'
  4779. PatternsFilter:
  4780. type: object
  4781. properties:
  4782. path:
  4783. type: string
  4784. 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'
  4785. allowed_patterns:
  4786. type: array
  4787. items:
  4788. type: string
  4789. description: 'list of, case insensitive, allowed shell like patterns.'
  4790. example:
  4791. - '*.jpg'
  4792. - a*b?.png
  4793. denied_patterns:
  4794. type: array
  4795. items:
  4796. type: string
  4797. description: 'list of, case insensitive, denied shell like patterns. Denied patterns are evaluated before the allowed ones'
  4798. example:
  4799. - '*.zip'
  4800. deny_policy:
  4801. type: integer
  4802. enum:
  4803. - 0
  4804. - 1
  4805. description: |
  4806. Deny policies
  4807. * `0` - default policy. Denied files/directories matching the filters are visible in directory listing but cannot be uploaded/downloaded/overwritten/renamed
  4808. * `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
  4809. HooksFilter:
  4810. type: object
  4811. properties:
  4812. external_auth_disabled:
  4813. type: boolean
  4814. example: false
  4815. description: If true, the external auth hook, if defined, will not be executed
  4816. pre_login_disabled:
  4817. type: boolean
  4818. example: false
  4819. description: If true, the pre-login hook, if defined, will not be executed
  4820. check_password_disabled:
  4821. type: boolean
  4822. example: false
  4823. description: If true, the check password hook, if defined, will not be executed
  4824. description: User specific hook overrides
  4825. BandwidthLimit:
  4826. type: object
  4827. properties:
  4828. sources:
  4829. type: array
  4830. items:
  4831. type: string
  4832. 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'
  4833. upload_bandwidth:
  4834. type: integer
  4835. format: int32
  4836. description: 'Maximum upload bandwidth as KB/s, 0 means unlimited'
  4837. download_bandwidth:
  4838. type: integer
  4839. format: int32
  4840. description: 'Maximum download bandwidth as KB/s, 0 means unlimited'
  4841. DataTransferLimit:
  4842. type: object
  4843. properties:
  4844. sources:
  4845. type: array
  4846. items:
  4847. type: string
  4848. 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'
  4849. upload_data_transfer:
  4850. type: integer
  4851. description: 'Maximum data transfer allowed for uploads as MB. 0 means no limit'
  4852. download_data_transfer:
  4853. type: integer
  4854. description: 'Maximum data transfer allowed for downloads as MB. 0 means no limit'
  4855. total_data_transfer:
  4856. type: integer
  4857. 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'
  4858. BaseUserFilters:
  4859. type: object
  4860. properties:
  4861. allowed_ip:
  4862. type: array
  4863. items:
  4864. type: string
  4865. 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"'
  4866. example:
  4867. - 192.0.2.0/24
  4868. - '2001:db8::/32'
  4869. denied_ip:
  4870. type: array
  4871. items:
  4872. type: string
  4873. description: clients connecting from these IP/Mask are not allowed. Denied rules are evaluated before allowed ones
  4874. example:
  4875. - 172.16.0.0/16
  4876. denied_login_methods:
  4877. type: array
  4878. items:
  4879. $ref: '#/components/schemas/LoginMethods'
  4880. description: if null or empty any available login method is allowed
  4881. denied_protocols:
  4882. type: array
  4883. items:
  4884. $ref: '#/components/schemas/SupportedProtocols'
  4885. description: if null or empty any available protocol is allowed
  4886. file_patterns:
  4887. type: array
  4888. items:
  4889. $ref: '#/components/schemas/PatternsFilter'
  4890. 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'
  4891. max_upload_file_size:
  4892. type: integer
  4893. format: int64
  4894. 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`'
  4895. tls_username:
  4896. type: string
  4897. enum:
  4898. - None
  4899. - CommonName
  4900. 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'
  4901. hooks:
  4902. $ref: '#/components/schemas/HooksFilter'
  4903. disable_fs_checks:
  4904. type: boolean
  4905. example: false
  4906. 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
  4907. web_client:
  4908. type: array
  4909. items:
  4910. $ref: '#/components/schemas/WebClientOptions'
  4911. description: WebClient/user REST API related configuration options
  4912. allow_api_key_auth:
  4913. type: boolean
  4914. description: 'API key authentication allows to impersonate this user with an API key'
  4915. user_type:
  4916. $ref: '#/components/schemas/UserType'
  4917. bandwidth_limits:
  4918. type: array
  4919. items:
  4920. $ref: '#/components/schemas/BandwidthLimit'
  4921. data_transfer_limits:
  4922. type: array
  4923. items:
  4924. $ref: '#/components/schemas/DataTransferLimit'
  4925. external_auth_cache_time:
  4926. type: integer
  4927. description: 'Defines the cache time, in seconds, for users authenticated using an external auth hook. 0 means no cache'
  4928. start_directory:
  4929. type: string
  4930. 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.'
  4931. 2fa_protocols:
  4932. type: array
  4933. items:
  4934. $ref: '#/components/schemas/MFAProtocols'
  4935. description: 'Defines protocols that require two factor authentication'
  4936. ftp_security:
  4937. type: integer
  4938. enum:
  4939. - 0
  4940. - 1
  4941. 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.'
  4942. is_anonymous:
  4943. type: boolean
  4944. 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)'
  4945. default_shares_expiration:
  4946. type: integer
  4947. description: 'Defines the default expiration for newly created shares as number of days. 0 means no expiration'
  4948. description: Additional user options
  4949. UserFilters:
  4950. allOf:
  4951. - $ref: '#/components/schemas/BaseUserFilters'
  4952. - type: object
  4953. properties:
  4954. totp_config:
  4955. $ref: '#/components/schemas/UserTOTPConfig'
  4956. recovery_codes:
  4957. type: array
  4958. items:
  4959. $ref: '#/components/schemas/RecoveryCode'
  4960. Secret:
  4961. type: object
  4962. properties:
  4963. status:
  4964. type: string
  4965. enum:
  4966. - Plain
  4967. - AES-256-GCM
  4968. - Secretbox
  4969. - GCP
  4970. - AWS
  4971. - VaultTransit
  4972. - AzureKeyVault
  4973. - Redacted
  4974. description: 'Set to "Plain" to add or update an existing secret, set to "Redacted" to preserve the existing value'
  4975. payload:
  4976. type: string
  4977. key:
  4978. type: string
  4979. additional_data:
  4980. type: string
  4981. mode:
  4982. type: integer
  4983. description: 1 means encrypted using a master key
  4984. 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
  4985. S3Config:
  4986. type: object
  4987. properties:
  4988. bucket:
  4989. type: string
  4990. minLength: 1
  4991. region:
  4992. type: string
  4993. minLength: 1
  4994. access_key:
  4995. type: string
  4996. access_secret:
  4997. $ref: '#/components/schemas/Secret'
  4998. role_arn:
  4999. type: string
  5000. description: 'Optional IAM Role ARN to assume'
  5001. endpoint:
  5002. type: string
  5003. description: optional endpoint
  5004. storage_class:
  5005. type: string
  5006. acl:
  5007. type: string
  5008. 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'
  5009. upload_part_size:
  5010. type: integer
  5011. 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.'
  5012. upload_concurrency:
  5013. type: integer
  5014. description: 'the number of parts to upload in parallel. If this value is set to zero, the default value (5) will be used'
  5015. upload_part_max_time:
  5016. type: integer
  5017. 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'
  5018. download_part_size:
  5019. type: integer
  5020. 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'
  5021. download_concurrency:
  5022. type: integer
  5023. 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'
  5024. download_part_max_time:
  5025. type: integer
  5026. 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.'
  5027. force_path_style:
  5028. type: boolean
  5029. 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")'
  5030. key_prefix:
  5031. type: string
  5032. 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'
  5033. example: folder/subfolder/
  5034. description: S3 Compatible Object Storage configuration details
  5035. GCSConfig:
  5036. type: object
  5037. properties:
  5038. bucket:
  5039. type: string
  5040. minLength: 1
  5041. credentials:
  5042. $ref: '#/components/schemas/Secret'
  5043. automatic_credentials:
  5044. type: integer
  5045. enum:
  5046. - 0
  5047. - 1
  5048. description: |
  5049. Automatic credentials:
  5050. * `0` - disabled, explicit credentials, using a JSON credentials file, must be provided. This is the default value if the field is null
  5051. * `1` - enabled, we try to use the Application Default Credentials (ADC) strategy to find your application's credentials
  5052. storage_class:
  5053. type: string
  5054. acl:
  5055. type: string
  5056. 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'
  5057. key_prefix:
  5058. type: string
  5059. 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'
  5060. example: folder/subfolder/
  5061. 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'
  5062. AzureBlobFsConfig:
  5063. type: object
  5064. properties:
  5065. container:
  5066. type: string
  5067. account_name:
  5068. type: string
  5069. description: 'Storage Account Name, leave blank to use SAS URL'
  5070. account_key:
  5071. $ref: '#/components/schemas/Secret'
  5072. sas_url:
  5073. $ref: '#/components/schemas/Secret'
  5074. endpoint:
  5075. type: string
  5076. 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"'
  5077. upload_part_size:
  5078. type: integer
  5079. 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.'
  5080. upload_concurrency:
  5081. type: integer
  5082. description: 'the number of parts to upload in parallel. If this value is set to zero, the default value (5) will be used'
  5083. download_part_size:
  5084. type: integer
  5085. 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.'
  5086. download_concurrency:
  5087. type: integer
  5088. description: 'the number of parts to download in parallel. If this value is set to zero, the default value (5) will be used'
  5089. access_tier:
  5090. type: string
  5091. enum:
  5092. - ''
  5093. - Archive
  5094. - Hot
  5095. - Cool
  5096. key_prefix:
  5097. type: string
  5098. 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'
  5099. example: folder/subfolder/
  5100. use_emulator:
  5101. type: boolean
  5102. description: Azure Blob Storage configuration details
  5103. CryptFsConfig:
  5104. type: object
  5105. properties:
  5106. passphrase:
  5107. $ref: '#/components/schemas/Secret'
  5108. description: Crypt filesystem configuration details
  5109. SFTPFsConfig:
  5110. type: object
  5111. properties:
  5112. endpoint:
  5113. type: string
  5114. description: 'remote SFTP endpoint as host:port'
  5115. username:
  5116. type: string
  5117. description: you can specify a password or private key or both. In the latter case the private key will be tried first.
  5118. password:
  5119. $ref: '#/components/schemas/Secret'
  5120. private_key:
  5121. $ref: '#/components/schemas/Secret'
  5122. key_passphrase:
  5123. $ref: '#/components/schemas/Secret'
  5124. fingerprints:
  5125. type: array
  5126. items:
  5127. type: string
  5128. 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'
  5129. prefix:
  5130. type: string
  5131. description: Specifying a prefix you can restrict all operations to a given path within the remote SFTP server.
  5132. disable_concurrent_reads:
  5133. type: boolean
  5134. 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.
  5135. buffer_size:
  5136. type: integer
  5137. minimum: 0
  5138. maximum: 16
  5139. example: 2
  5140. 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.
  5141. equality_check_mode:
  5142. type: integer
  5143. enum:
  5144. - 0
  5145. - 1
  5146. description: |
  5147. 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:
  5148. * `0` username and endpoint must match. This is the default
  5149. * `1` only the endpoint must match
  5150. HTTPFsConfig:
  5151. type: object
  5152. properties:
  5153. endpoint:
  5154. type: string
  5155. description: 'HTTP/S endpoint URL. SFTPGo will use this URL as base, for example for the `stat` API, SFTPGo will add `/stat/{name}`'
  5156. username:
  5157. type: string
  5158. password:
  5159. $ref: '#/components/schemas/Secret'
  5160. api_key:
  5161. $ref: '#/components/schemas/Secret'
  5162. skip_tls_verify:
  5163. type: boolean
  5164. equality_check_mode:
  5165. type: integer
  5166. enum:
  5167. - 0
  5168. - 1
  5169. description: |
  5170. 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:
  5171. * `0` username and endpoint must match. This is the default
  5172. * `1` only the endpoint must match
  5173. FilesystemConfig:
  5174. type: object
  5175. properties:
  5176. provider:
  5177. $ref: '#/components/schemas/FsProviders'
  5178. s3config:
  5179. $ref: '#/components/schemas/S3Config'
  5180. gcsconfig:
  5181. $ref: '#/components/schemas/GCSConfig'
  5182. azblobconfig:
  5183. $ref: '#/components/schemas/AzureBlobFsConfig'
  5184. cryptconfig:
  5185. $ref: '#/components/schemas/CryptFsConfig'
  5186. sftpconfig:
  5187. $ref: '#/components/schemas/SFTPFsConfig'
  5188. httpconfig:
  5189. $ref: '#/components/schemas/HTTPFsConfig'
  5190. description: Storage filesystem details
  5191. BaseVirtualFolder:
  5192. type: object
  5193. properties:
  5194. id:
  5195. type: integer
  5196. format: int32
  5197. minimum: 1
  5198. name:
  5199. type: string
  5200. description: unique name for this virtual folder
  5201. mapped_path:
  5202. type: string
  5203. description: absolute filesystem path to use as virtual folder
  5204. description:
  5205. type: string
  5206. description: optional description
  5207. used_quota_size:
  5208. type: integer
  5209. format: int64
  5210. used_quota_files:
  5211. type: integer
  5212. format: int32
  5213. last_quota_update:
  5214. type: integer
  5215. format: int64
  5216. description: Last quota update as unix timestamp in milliseconds
  5217. users:
  5218. type: array
  5219. items:
  5220. type: string
  5221. description: list of usernames associated with this virtual folder
  5222. filesystem:
  5223. $ref: '#/components/schemas/FilesystemConfig'
  5224. 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.'
  5225. VirtualFolder:
  5226. allOf:
  5227. - $ref: '#/components/schemas/BaseVirtualFolder'
  5228. - type: object
  5229. properties:
  5230. virtual_path:
  5231. type: string
  5232. quota_size:
  5233. type: integer
  5234. format: int64
  5235. 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'
  5236. quota_files:
  5237. type: integer
  5238. format: int32
  5239. 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'
  5240. required:
  5241. - virtual_path
  5242. 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.'
  5243. User:
  5244. type: object
  5245. properties:
  5246. id:
  5247. type: integer
  5248. format: int32
  5249. minimum: 1
  5250. status:
  5251. type: integer
  5252. enum:
  5253. - 0
  5254. - 1
  5255. description: |
  5256. status:
  5257. * `0` user is disabled, login is not allowed
  5258. * `1` user is enabled
  5259. username:
  5260. type: string
  5261. description: username is unique
  5262. email:
  5263. type: string
  5264. format: email
  5265. description:
  5266. type: string
  5267. description: 'optional description, for example the user full name'
  5268. expiration_date:
  5269. type: integer
  5270. format: int64
  5271. description: expiration date as unix timestamp in milliseconds. An expired account cannot login. 0 means no expiration
  5272. password:
  5273. type: string
  5274. format: password
  5275. 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
  5276. public_keys:
  5277. type: array
  5278. items:
  5279. type: string
  5280. example: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEUWwDwEWhTbF0MqAsp/oXK1HR2cElhM8oo1uVmL3ZeDKDiTm4ljMr92wfTgIGDqIoxmVqgYIkAOAhuykAVWBzc= user@host
  5281. description: Public keys in OpenSSH format. A password or at least one public key/SSH user certificate are mandatory.
  5282. home_dir:
  5283. type: string
  5284. 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
  5285. virtual_folders:
  5286. type: array
  5287. items:
  5288. $ref: '#/components/schemas/VirtualFolder'
  5289. 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
  5290. uid:
  5291. type: integer
  5292. format: int32
  5293. minimum: 0
  5294. maximum: 2147483647
  5295. 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'
  5296. gid:
  5297. type: integer
  5298. format: int32
  5299. minimum: 0
  5300. maximum: 2147483647
  5301. 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'
  5302. max_sessions:
  5303. type: integer
  5304. format: int32
  5305. description: Limit the sessions that a user can open. 0 means unlimited
  5306. quota_size:
  5307. type: integer
  5308. format: int64
  5309. 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
  5310. quota_files:
  5311. type: integer
  5312. format: int32
  5313. 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
  5314. permissions:
  5315. type: object
  5316. additionalProperties:
  5317. type: array
  5318. items:
  5319. $ref: '#/components/schemas/Permission'
  5320. minItems: 1
  5321. minProperties: 1
  5322. 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'
  5323. example:
  5324. /:
  5325. - '*'
  5326. /somedir:
  5327. - list
  5328. - download
  5329. used_quota_size:
  5330. type: integer
  5331. format: int64
  5332. used_quota_files:
  5333. type: integer
  5334. format: int32
  5335. last_quota_update:
  5336. type: integer
  5337. format: int64
  5338. description: Last quota update as unix timestamp in milliseconds
  5339. upload_bandwidth:
  5340. type: integer
  5341. description: 'Maximum upload bandwidth as KB/s, 0 means unlimited'
  5342. download_bandwidth:
  5343. type: integer
  5344. description: 'Maximum download bandwidth as KB/s, 0 means unlimited'
  5345. upload_data_transfer:
  5346. type: integer
  5347. description: 'Maximum data transfer allowed for uploads as MB. 0 means no limit'
  5348. download_data_transfer:
  5349. type: integer
  5350. description: 'Maximum data transfer allowed for downloads as MB. 0 means no limit'
  5351. total_data_transfer:
  5352. type: integer
  5353. 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'
  5354. used_upload_data_transfer:
  5355. type: integer
  5356. description: 'Uploaded size, as bytes, since the last reset'
  5357. used_download_data_transfer:
  5358. type: integer
  5359. description: 'Downloaded size, as bytes, since the last reset'
  5360. created_at:
  5361. type: integer
  5362. format: int64
  5363. description: 'creation time as unix timestamp in milliseconds. It will be 0 for users created before v2.2.0'
  5364. updated_at:
  5365. type: integer
  5366. format: int64
  5367. description: last update time as unix timestamp in milliseconds
  5368. last_login:
  5369. type: integer
  5370. format: int64
  5371. description: Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes
  5372. first_download:
  5373. type: integer
  5374. format: int64
  5375. description: first download time as unix timestamp in milliseconds
  5376. first_upload:
  5377. type: integer
  5378. format: int64
  5379. description: first upload time as unix timestamp in milliseconds
  5380. filters:
  5381. $ref: '#/components/schemas/UserFilters'
  5382. filesystem:
  5383. $ref: '#/components/schemas/FilesystemConfig'
  5384. additional_info:
  5385. type: string
  5386. description: Free form text field for external systems
  5387. groups:
  5388. type: array
  5389. items:
  5390. $ref: '#/components/schemas/GroupMapping'
  5391. oidc_custom_fields:
  5392. type: object
  5393. additionalProperties: true
  5394. 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'
  5395. role:
  5396. type: string
  5397. AdminPreferences:
  5398. type: object
  5399. properties:
  5400. hide_user_page_sections:
  5401. type: integer
  5402. 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'
  5403. default_users_expiration:
  5404. type: integer
  5405. description: 'Defines the default expiration for newly created users as number of days. 0 means no expiration'
  5406. AdminFilters:
  5407. type: object
  5408. properties:
  5409. allow_list:
  5410. type: array
  5411. items:
  5412. type: string
  5413. 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"'
  5414. example:
  5415. - 192.0.2.0/24
  5416. - '2001:db8::/32'
  5417. allow_api_key_auth:
  5418. type: boolean
  5419. description: 'API key auth allows to impersonate this administrator with an API key'
  5420. totp_config:
  5421. $ref: '#/components/schemas/AdminTOTPConfig'
  5422. recovery_codes:
  5423. type: array
  5424. items:
  5425. $ref: '#/components/schemas/RecoveryCode'
  5426. preferences:
  5427. $ref: '#/components/schemas/AdminPreferences'
  5428. Admin:
  5429. type: object
  5430. properties:
  5431. id:
  5432. type: integer
  5433. format: int32
  5434. minimum: 1
  5435. status:
  5436. type: integer
  5437. enum:
  5438. - 0
  5439. - 1
  5440. description: |
  5441. status:
  5442. * `0` user is disabled, login is not allowed
  5443. * `1` user is enabled
  5444. username:
  5445. type: string
  5446. description: username is unique
  5447. description:
  5448. type: string
  5449. description: 'optional description, for example the admin full name'
  5450. password:
  5451. type: string
  5452. format: password
  5453. description: Admin password. For security reasons this field is omitted when you search/get admins
  5454. email:
  5455. type: string
  5456. format: email
  5457. permissions:
  5458. type: array
  5459. items:
  5460. $ref: '#/components/schemas/AdminPermissions'
  5461. filters:
  5462. $ref: '#/components/schemas/AdminFilters'
  5463. additional_info:
  5464. type: string
  5465. description: Free form text field
  5466. groups:
  5467. type: array
  5468. items:
  5469. $ref: '#/components/schemas/AdminGroupMapping'
  5470. 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.'
  5471. created_at:
  5472. type: integer
  5473. format: int64
  5474. description: 'creation time as unix timestamp in milliseconds. It will be 0 for admins created before v2.2.0'
  5475. updated_at:
  5476. type: integer
  5477. format: int64
  5478. description: last update time as unix timestamp in milliseconds
  5479. last_login:
  5480. type: integer
  5481. format: int64
  5482. description: Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes
  5483. role:
  5484. type: string
  5485. 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", "view_events"'
  5486. AdminProfile:
  5487. type: object
  5488. properties:
  5489. email:
  5490. type: string
  5491. format: email
  5492. description:
  5493. type: string
  5494. allow_api_key_auth:
  5495. type: boolean
  5496. description: 'If enabled, you can impersonate this admin, in REST API, using an API key. If disabled admin credentials are required for impersonation'
  5497. UserProfile:
  5498. type: object
  5499. properties:
  5500. email:
  5501. type: string
  5502. format: email
  5503. description:
  5504. type: string
  5505. allow_api_key_auth:
  5506. type: boolean
  5507. description: 'If enabled, you can impersonate this user, in REST API, using an API key. If disabled user credentials are required for impersonation'
  5508. public_keys:
  5509. type: array
  5510. items:
  5511. type: string
  5512. example: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEUWwDwEWhTbF0MqAsp/oXK1HR2cElhM8oo1uVmL3ZeDKDiTm4ljMr92wfTgIGDqIoxmVqgYIkAOAhuykAVWBzc= user@host
  5513. description: Public keys in OpenSSH format
  5514. APIKey:
  5515. type: object
  5516. properties:
  5517. id:
  5518. type: string
  5519. description: unique key identifier
  5520. name:
  5521. type: string
  5522. description: User friendly key name
  5523. key:
  5524. type: string
  5525. format: password
  5526. 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
  5527. scope:
  5528. $ref: '#/components/schemas/APIKeyScope'
  5529. created_at:
  5530. type: integer
  5531. format: int64
  5532. description: creation time as unix timestamp in milliseconds
  5533. updated_at:
  5534. type: integer
  5535. format: int64
  5536. description: last update time as unix timestamp in milliseconds
  5537. last_use_at:
  5538. type: integer
  5539. format: int64
  5540. description: last use time as unix timestamp in milliseconds. It is saved at most once every 10 minutes
  5541. expires_at:
  5542. type: integer
  5543. format: int64
  5544. description: expiration time as unix timestamp in milliseconds
  5545. description:
  5546. type: string
  5547. description: optional description
  5548. user:
  5549. type: string
  5550. description: username associated with this API key. If empty and the scope is "user scope" the key can impersonate any user
  5551. admin:
  5552. type: string
  5553. description: admin associated with this API key. If empty and the scope is "admin scope" the key can impersonate any admin
  5554. QuotaUsage:
  5555. type: object
  5556. properties:
  5557. used_quota_size:
  5558. type: integer
  5559. format: int64
  5560. used_quota_files:
  5561. type: integer
  5562. format: int32
  5563. TransferQuotaUsage:
  5564. type: object
  5565. properties:
  5566. used_upload_data_transfer:
  5567. type: integer
  5568. format: int64
  5569. description: 'The value must be specified as bytes'
  5570. used_download_data_transfer:
  5571. type: integer
  5572. format: int64
  5573. description: 'The value must be specified as bytes'
  5574. Transfer:
  5575. type: object
  5576. properties:
  5577. operation_type:
  5578. type: string
  5579. enum:
  5580. - upload
  5581. - download
  5582. description: |
  5583. Operations:
  5584. * `upload`
  5585. * `download`
  5586. path:
  5587. type: string
  5588. description: file path for the upload/download
  5589. start_time:
  5590. type: integer
  5591. format: int64
  5592. description: start time as unix timestamp in milliseconds
  5593. size:
  5594. type: integer
  5595. format: int64
  5596. description: bytes transferred
  5597. ConnectionStatus:
  5598. type: object
  5599. properties:
  5600. username:
  5601. type: string
  5602. description: connected username
  5603. connection_id:
  5604. type: string
  5605. description: unique connection identifier
  5606. client_version:
  5607. type: string
  5608. description: client version
  5609. remote_address:
  5610. type: string
  5611. description: Remote address for the connected client
  5612. connection_time:
  5613. type: integer
  5614. format: int64
  5615. description: connection time as unix timestamp in milliseconds
  5616. command:
  5617. type: string
  5618. description: Last SSH/FTP command or WebDAV method
  5619. last_activity:
  5620. type: integer
  5621. format: int64
  5622. description: last client activity as unix timestamp in milliseconds
  5623. protocol:
  5624. type: string
  5625. enum:
  5626. - SFTP
  5627. - SCP
  5628. - SSH
  5629. - FTP
  5630. - DAV
  5631. active_transfers:
  5632. type: array
  5633. items:
  5634. $ref: '#/components/schemas/Transfer'
  5635. node:
  5636. type: string
  5637. description: 'Node identifier, omitted for single node installations'
  5638. FolderRetention:
  5639. type: object
  5640. properties:
  5641. path:
  5642. type: string
  5643. 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'
  5644. example: '/'
  5645. retention:
  5646. type: integer
  5647. 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
  5648. example: 24
  5649. delete_empty_dirs:
  5650. type: boolean
  5651. description: if enabled, empty directories will be deleted
  5652. ignore_user_permissions:
  5653. type: boolean
  5654. 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'
  5655. RetentionCheck:
  5656. type: object
  5657. properties:
  5658. username:
  5659. type: string
  5660. description: username to which the retention check refers
  5661. folders:
  5662. type: array
  5663. items:
  5664. $ref: '#/components/schemas/FolderRetention'
  5665. start_time:
  5666. type: integer
  5667. format: int64
  5668. description: check start time as unix timestamp in milliseconds
  5669. notifications:
  5670. type: array
  5671. items:
  5672. $ref: '#/components/schemas/RetentionCheckNotification'
  5673. email:
  5674. type: string
  5675. format: email
  5676. 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'
  5677. MetadataCheck:
  5678. type: object
  5679. properties:
  5680. username:
  5681. type: string
  5682. description: username to which the check refers
  5683. start_time:
  5684. type: integer
  5685. format: int64
  5686. description: check start time as unix timestamp in milliseconds
  5687. QuotaScan:
  5688. type: object
  5689. properties:
  5690. username:
  5691. type: string
  5692. description: username to which the quota scan refers
  5693. start_time:
  5694. type: integer
  5695. format: int64
  5696. description: scan start time as unix timestamp in milliseconds
  5697. FolderQuotaScan:
  5698. type: object
  5699. properties:
  5700. name:
  5701. type: string
  5702. description: folder name to which the quota scan refers
  5703. start_time:
  5704. type: integer
  5705. format: int64
  5706. description: scan start time as unix timestamp in milliseconds
  5707. DefenderEntry:
  5708. type: object
  5709. properties:
  5710. id:
  5711. type: string
  5712. ip:
  5713. type: string
  5714. score:
  5715. type: integer
  5716. 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
  5717. ban_time:
  5718. type: string
  5719. format: date-time
  5720. 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
  5721. SSHHostKey:
  5722. type: object
  5723. properties:
  5724. path:
  5725. type: string
  5726. fingerprint:
  5727. type: string
  5728. SSHBinding:
  5729. type: object
  5730. properties:
  5731. address:
  5732. type: string
  5733. description: TCP address the server listen on
  5734. port:
  5735. type: integer
  5736. description: the port used for serving requests
  5737. apply_proxy_config:
  5738. type: boolean
  5739. description: 'apply the proxy configuration, if any'
  5740. WebDAVBinding:
  5741. type: object
  5742. properties:
  5743. address:
  5744. type: string
  5745. description: TCP address the server listen on
  5746. port:
  5747. type: integer
  5748. description: the port used for serving requests
  5749. enable_https:
  5750. type: boolean
  5751. min_tls_version:
  5752. $ref: '#/components/schemas/TLSVersions'
  5753. client_auth_type:
  5754. type: integer
  5755. description: 1 means that client certificate authentication is required in addition to HTTP basic authentication
  5756. tls_cipher_suites:
  5757. type: array
  5758. items:
  5759. type: string
  5760. 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'
  5761. prefix:
  5762. type: string
  5763. description: 'Prefix for WebDAV resources, if empty WebDAV resources will be available at the `/` URI'
  5764. proxy_allowed:
  5765. type: array
  5766. items:
  5767. type: string
  5768. description: 'List of IP addresses and IP ranges allowed to set proxy headers'
  5769. PassiveIPOverride:
  5770. type: object
  5771. properties:
  5772. networks:
  5773. type: array
  5774. items:
  5775. type: string
  5776. ip:
  5777. type: string
  5778. FTPDBinding:
  5779. type: object
  5780. properties:
  5781. address:
  5782. type: string
  5783. description: TCP address the server listen on
  5784. port:
  5785. type: integer
  5786. description: the port used for serving requests
  5787. apply_proxy_config:
  5788. type: boolean
  5789. description: 'apply the proxy configuration, if any'
  5790. tls_mode:
  5791. type: integer
  5792. enum:
  5793. - 0
  5794. - 1
  5795. - 2
  5796. description: |
  5797. TLS mode:
  5798. * `0` - clear or explicit TLS
  5799. * `1` - explicit TLS required
  5800. * `2` - implicit TLS
  5801. min_tls_version:
  5802. $ref: '#/components/schemas/TLSVersions'
  5803. force_passive_ip:
  5804. type: string
  5805. description: External IP address to expose for passive connections
  5806. passive_ip_overrides:
  5807. type: array
  5808. items:
  5809. $ref: '#/components/schemas/PassiveIPOverride'
  5810. client_auth_type:
  5811. type: integer
  5812. description: 1 means that client certificate authentication is required in addition to FTP authentication
  5813. tls_cipher_suites:
  5814. type: array
  5815. items:
  5816. type: string
  5817. 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'
  5818. passive_connections_security:
  5819. type: integer
  5820. enum:
  5821. - 0
  5822. - 1
  5823. description: |
  5824. Active connections security:
  5825. * `0` - require matching peer IP addresses of control and data connection
  5826. * `1` - disable any checks
  5827. active_connections_security:
  5828. type: integer
  5829. enum:
  5830. - 0
  5831. - 1
  5832. description: |
  5833. Active connections security:
  5834. * `0` - require matching peer IP addresses of control and data connection
  5835. * `1` - disable any checks
  5836. debug:
  5837. type: boolean
  5838. description: 'If enabled any FTP command will be logged'
  5839. SSHServiceStatus:
  5840. type: object
  5841. properties:
  5842. is_active:
  5843. type: boolean
  5844. bindings:
  5845. type: array
  5846. items:
  5847. $ref: '#/components/schemas/SSHBinding'
  5848. nullable: true
  5849. host_keys:
  5850. type: array
  5851. items:
  5852. $ref: '#/components/schemas/SSHHostKey'
  5853. nullable: true
  5854. ssh_commands:
  5855. type: array
  5856. items:
  5857. type: string
  5858. authentications:
  5859. type: array
  5860. items:
  5861. $ref: '#/components/schemas/SSHAuthentications'
  5862. FTPPassivePortRange:
  5863. type: object
  5864. properties:
  5865. start:
  5866. type: integer
  5867. end:
  5868. type: integer
  5869. FTPServiceStatus:
  5870. type: object
  5871. properties:
  5872. is_active:
  5873. type: boolean
  5874. bindings:
  5875. type: array
  5876. items:
  5877. $ref: '#/components/schemas/FTPDBinding'
  5878. nullable: true
  5879. passive_port_range:
  5880. $ref: '#/components/schemas/FTPPassivePortRange'
  5881. WebDAVServiceStatus:
  5882. type: object
  5883. properties:
  5884. is_active:
  5885. type: boolean
  5886. bindings:
  5887. type: array
  5888. items:
  5889. $ref: '#/components/schemas/WebDAVBinding'
  5890. nullable: true
  5891. DataProviderStatus:
  5892. type: object
  5893. properties:
  5894. is_active:
  5895. type: boolean
  5896. driver:
  5897. type: string
  5898. error:
  5899. type: string
  5900. MFAStatus:
  5901. type: object
  5902. properties:
  5903. is_active:
  5904. type: boolean
  5905. totp_configs:
  5906. type: array
  5907. items:
  5908. $ref: '#/components/schemas/TOTPConfig'
  5909. ServicesStatus:
  5910. type: object
  5911. properties:
  5912. ssh:
  5913. $ref: '#/components/schemas/SSHServiceStatus'
  5914. ftp:
  5915. $ref: '#/components/schemas/FTPServiceStatus'
  5916. webdav:
  5917. $ref: '#/components/schemas/WebDAVServiceStatus'
  5918. data_provider:
  5919. $ref: '#/components/schemas/DataProviderStatus'
  5920. defender:
  5921. type: object
  5922. properties:
  5923. is_active:
  5924. type: boolean
  5925. mfa:
  5926. $ref: '#/components/schemas/MFAStatus'
  5927. Share:
  5928. type: object
  5929. properties:
  5930. id:
  5931. type: string
  5932. description: auto-generated unique share identifier
  5933. name:
  5934. type: string
  5935. description:
  5936. type: string
  5937. description: optional description
  5938. scope:
  5939. $ref: '#/components/schemas/ShareScope'
  5940. paths:
  5941. type: array
  5942. items:
  5943. type: string
  5944. 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'
  5945. example:
  5946. - '/dir1'
  5947. - '/dir2/file.txt'
  5948. - '/dir3/subdir'
  5949. username:
  5950. type: string
  5951. created_at:
  5952. type: integer
  5953. format: int64
  5954. description: 'creation time as unix timestamp in milliseconds'
  5955. updated_at:
  5956. type: integer
  5957. format: int64
  5958. description: 'last update time as unix timestamp in milliseconds'
  5959. last_use_at:
  5960. type: integer
  5961. format: int64
  5962. description: last use time as unix timestamp in milliseconds
  5963. expires_at:
  5964. type: integer
  5965. format: int64
  5966. description: 'optional share expiration, as unix timestamp in milliseconds. 0 means no expiration'
  5967. password:
  5968. type: string
  5969. 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'
  5970. max_tokens:
  5971. type: integer
  5972. description: 'maximum allowed access tokens. 0 means no limit'
  5973. used_tokens:
  5974. type: integer
  5975. allow_from:
  5976. type: array
  5977. items:
  5978. type: string
  5979. 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'
  5980. example:
  5981. - 192.0.2.0/24
  5982. - '2001:db8::/32'
  5983. GroupUserSettings:
  5984. type: object
  5985. properties:
  5986. home_dir:
  5987. type: string
  5988. max_sessions:
  5989. type: integer
  5990. format: int32
  5991. quota_size:
  5992. type: integer
  5993. format: int64
  5994. quota_files:
  5995. type: integer
  5996. format: int32
  5997. permissions:
  5998. type: object
  5999. additionalProperties:
  6000. type: array
  6001. items:
  6002. $ref: '#/components/schemas/Permission'
  6003. minItems: 1
  6004. minProperties: 1
  6005. 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'
  6006. example:
  6007. /:
  6008. - '*'
  6009. /somedir:
  6010. - list
  6011. - download
  6012. upload_bandwidth:
  6013. type: integer
  6014. description: 'Maximum upload bandwidth as KB/s'
  6015. download_bandwidth:
  6016. type: integer
  6017. description: 'Maximum download bandwidth as KB/s'
  6018. upload_data_transfer:
  6019. type: integer
  6020. description: 'Maximum data transfer allowed for uploads as MB'
  6021. download_data_transfer:
  6022. type: integer
  6023. description: 'Maximum data transfer allowed for downloads as MB'
  6024. total_data_transfer:
  6025. type: integer
  6026. description: 'Maximum total data transfer as MB'
  6027. filters:
  6028. $ref: '#/components/schemas/BaseUserFilters'
  6029. Role:
  6030. type: object
  6031. properties:
  6032. id:
  6033. type: integer
  6034. format: int32
  6035. minimum: 1
  6036. name:
  6037. type: string
  6038. description: name is unique
  6039. description:
  6040. type: string
  6041. description: 'optional description'
  6042. created_at:
  6043. type: integer
  6044. format: int64
  6045. description: creation time as unix timestamp in milliseconds
  6046. updated_at:
  6047. type: integer
  6048. format: int64
  6049. description: last update time as unix timestamp in milliseconds
  6050. users:
  6051. type: array
  6052. items:
  6053. type: string
  6054. description: list of usernames associated with this group
  6055. admins:
  6056. type: array
  6057. items:
  6058. type: string
  6059. description: list of admins usernames associated with this group
  6060. Group:
  6061. type: object
  6062. properties:
  6063. id:
  6064. type: integer
  6065. format: int32
  6066. minimum: 1
  6067. name:
  6068. type: string
  6069. description: name is unique
  6070. description:
  6071. type: string
  6072. description: 'optional description'
  6073. created_at:
  6074. type: integer
  6075. format: int64
  6076. description: creation time as unix timestamp in milliseconds
  6077. updated_at:
  6078. type: integer
  6079. format: int64
  6080. description: last update time as unix timestamp in milliseconds
  6081. user_settings:
  6082. $ref: '#/components/schemas/GroupUserSettings'
  6083. virtual_folders:
  6084. type: array
  6085. items:
  6086. $ref: '#/components/schemas/VirtualFolder'
  6087. description: mapping between virtual SFTPGo paths and folders
  6088. users:
  6089. type: array
  6090. items:
  6091. type: string
  6092. description: list of usernames associated with this group
  6093. admins:
  6094. type: array
  6095. items:
  6096. type: string
  6097. description: list of admins usernames associated with this group
  6098. GroupMapping:
  6099. type: object
  6100. properties:
  6101. name:
  6102. type: string
  6103. description: group name
  6104. type:
  6105. enum:
  6106. - 1
  6107. - 2
  6108. - 3
  6109. description: |
  6110. Group type:
  6111. * `1` - Primary group
  6112. * `2` - Secondary group
  6113. * `3` - Membership only, no settings are inherited from this group type
  6114. AdminGroupMappingOptions:
  6115. type: object
  6116. properties:
  6117. add_to_users_as:
  6118. enum:
  6119. - 0
  6120. - 1
  6121. - 2
  6122. description: |
  6123. Add to new users as:
  6124. * `0` - the admin's group will be added as membership group for new users
  6125. * `1` - the admin's group will be added as primary group for new users
  6126. * `2` - the admin's group will be added as secondary group for new users
  6127. AdminGroupMapping:
  6128. type: object
  6129. properties:
  6130. name:
  6131. type: string
  6132. description: group name
  6133. options:
  6134. $ref: '#/components/schemas/AdminGroupMappingOptions'
  6135. BackupData:
  6136. type: object
  6137. properties:
  6138. users:
  6139. type: array
  6140. items:
  6141. $ref: '#/components/schemas/User'
  6142. folders:
  6143. type: array
  6144. items:
  6145. $ref: '#/components/schemas/BaseVirtualFolder'
  6146. groups:
  6147. type: array
  6148. items:
  6149. $ref: '#/components/schemas/Group'
  6150. admins:
  6151. type: array
  6152. items:
  6153. $ref: '#/components/schemas/Admin'
  6154. api_keys:
  6155. type: array
  6156. items:
  6157. $ref: '#/components/schemas/APIKey'
  6158. shares:
  6159. type: array
  6160. items:
  6161. $ref: '#/components/schemas/Share'
  6162. event_actions:
  6163. type: array
  6164. items:
  6165. $ref: '#/components/schemas/EventAction'
  6166. event_rules:
  6167. type: array
  6168. items:
  6169. $ref: '#/components/schemas/EventRule'
  6170. roles:
  6171. type: array
  6172. items:
  6173. $ref: '#/components/schemas/Role'
  6174. version:
  6175. type: integer
  6176. PwdChange:
  6177. type: object
  6178. properties:
  6179. current_password:
  6180. type: string
  6181. new_password:
  6182. type: string
  6183. DirEntry:
  6184. type: object
  6185. properties:
  6186. name:
  6187. type: string
  6188. 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
  6189. size:
  6190. type: integer
  6191. format: int64
  6192. description: file size, omitted for folders and non regular files
  6193. mode:
  6194. type: integer
  6195. description: |
  6196. File mode and permission bits. More details here: https://golang.org/pkg/io/fs/#FileMode.
  6197. Let's see some examples:
  6198. - for a directory mode&2147483648 != 0
  6199. - for a symlink mode&134217728 != 0
  6200. - for a regular file mode&2401763328 == 0
  6201. last_modified:
  6202. type: string
  6203. format: date-time
  6204. FsEvent:
  6205. type: object
  6206. properties:
  6207. id:
  6208. type: string
  6209. timestamp:
  6210. type: integer
  6211. format: int64
  6212. description: 'unix timestamp in nanoseconds'
  6213. action:
  6214. $ref: '#/components/schemas/FsEventAction'
  6215. username:
  6216. type: string
  6217. fs_path:
  6218. type: string
  6219. fs_target_path:
  6220. type: string
  6221. virtual_path:
  6222. type: string
  6223. virtual_target_path:
  6224. type: string
  6225. ssh_cmd:
  6226. type: string
  6227. file_size:
  6228. type: integer
  6229. format: int64
  6230. status:
  6231. $ref: '#/components/schemas/FsEventStatus'
  6232. protocol:
  6233. $ref: '#/components/schemas/EventProtocols'
  6234. ip:
  6235. type: string
  6236. session_id:
  6237. type: string
  6238. fs_provider:
  6239. $ref: '#/components/schemas/FsProviders'
  6240. bucket:
  6241. type: string
  6242. endpoint:
  6243. type: string
  6244. open_flags:
  6245. type: string
  6246. instance_id:
  6247. type: string
  6248. ProviderEvent:
  6249. type: object
  6250. properties:
  6251. id:
  6252. type: string
  6253. timestamp:
  6254. type: integer
  6255. format: int64
  6256. description: 'unix timestamp in nanoseconds'
  6257. action:
  6258. $ref: '#/components/schemas/ProviderEventAction'
  6259. username:
  6260. type: string
  6261. ip:
  6262. type: string
  6263. object_type:
  6264. $ref: '#/components/schemas/ProviderEventObjectType'
  6265. object_name:
  6266. type: string
  6267. instance_id:
  6268. type: string
  6269. KeyValue:
  6270. type: object
  6271. properties:
  6272. key:
  6273. type: string
  6274. value:
  6275. type: string
  6276. HTTPPart:
  6277. type: object
  6278. properties:
  6279. name:
  6280. type: string
  6281. headers:
  6282. type: array
  6283. items:
  6284. $ref: '#/components/schemas/KeyValue'
  6285. description: 'Additional headers. Content-Disposition header is automatically set. Content-Type header is automatically detect for files to attach'
  6286. filepath:
  6287. type: string
  6288. description: 'path to the file to be sent as an attachment'
  6289. body:
  6290. type: string
  6291. EventActionHTTPConfig:
  6292. type: object
  6293. properties:
  6294. endpoint:
  6295. type: string
  6296. description: HTTP endpoint
  6297. example: https://example.com
  6298. username:
  6299. type: string
  6300. password:
  6301. $ref: '#/components/schemas/Secret'
  6302. headers:
  6303. type: array
  6304. items:
  6305. $ref: '#/components/schemas/KeyValue'
  6306. description: headers to add
  6307. timeout:
  6308. type: integer
  6309. minimum: 1
  6310. maximum: 180
  6311. description: 'Ignored for multipart requests with files as attachments'
  6312. skip_tls_verify:
  6313. type: boolean
  6314. 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.'
  6315. method:
  6316. type: string
  6317. enum:
  6318. - GET
  6319. - POST
  6320. - PUT
  6321. query_parameters:
  6322. type: array
  6323. items:
  6324. $ref: '#/components/schemas/KeyValue'
  6325. body:
  6326. type: string
  6327. description: HTTP POST/PUT body
  6328. parts:
  6329. type: array
  6330. items:
  6331. $ref: '#/components/schemas/HTTPPart'
  6332. 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.'
  6333. EventActionCommandConfig:
  6334. type: object
  6335. properties:
  6336. cmd:
  6337. type: string
  6338. description: absolute path to the command to execute
  6339. args:
  6340. type: array
  6341. items:
  6342. type: string
  6343. description: 'command line arguments'
  6344. timeout:
  6345. type: integer
  6346. minimum: 1
  6347. maximum: 120
  6348. env_vars:
  6349. type: array
  6350. items:
  6351. $ref: '#/components/schemas/KeyValue'
  6352. EventActionEmailConfig:
  6353. type: object
  6354. properties:
  6355. recipients:
  6356. type: array
  6357. items:
  6358. type: string
  6359. subject:
  6360. type: string
  6361. body:
  6362. type: string
  6363. attachments:
  6364. type: array
  6365. items:
  6366. type: string
  6367. description: 'list of file paths to attach. The total size is limited to 10 MB'
  6368. EventActionDataRetentionConfig:
  6369. type: object
  6370. properties:
  6371. folders:
  6372. type: array
  6373. items:
  6374. $ref: '#/components/schemas/FolderRetention'
  6375. EventActionFsCompress:
  6376. type: object
  6377. properties:
  6378. name:
  6379. type: string
  6380. description: 'Full path to the (zip) archive to create. The parent dir must exist'
  6381. paths:
  6382. type: array
  6383. items:
  6384. type: string
  6385. description: 'paths to add the archive'
  6386. EventActionFilesystemConfig:
  6387. type: object
  6388. properties:
  6389. type:
  6390. $ref: '#/components/schemas/FilesystemActionTypes'
  6391. renames:
  6392. type: array
  6393. items:
  6394. $ref: '#/components/schemas/KeyValue'
  6395. mkdirs:
  6396. type: array
  6397. items:
  6398. type: string
  6399. deletes:
  6400. type: array
  6401. items:
  6402. type: string
  6403. exist:
  6404. type: array
  6405. items:
  6406. type: string
  6407. compress:
  6408. $ref: '#/components/schemas/EventActionFsCompress'
  6409. BaseEventActionOptions:
  6410. type: object
  6411. properties:
  6412. http_config:
  6413. $ref: '#/components/schemas/EventActionHTTPConfig'
  6414. cmd_config:
  6415. $ref: '#/components/schemas/EventActionCommandConfig'
  6416. email_config:
  6417. $ref: '#/components/schemas/EventActionEmailConfig'
  6418. retention_config:
  6419. $ref: '#/components/schemas/EventActionDataRetentionConfig'
  6420. fs_config:
  6421. $ref: '#/components/schemas/EventActionFilesystemConfig'
  6422. BaseEventAction:
  6423. type: object
  6424. properties:
  6425. id:
  6426. type: integer
  6427. format: int32
  6428. minimum: 1
  6429. name:
  6430. type: string
  6431. description: unique name
  6432. description:
  6433. type: string
  6434. description: optional description
  6435. type:
  6436. $ref: '#/components/schemas/EventActionTypes'
  6437. options:
  6438. $ref: '#/components/schemas/BaseEventActionOptions'
  6439. rules:
  6440. type: array
  6441. items:
  6442. type: string
  6443. description: list of event rules names associated with this action
  6444. EventActionOptions:
  6445. type: object
  6446. properties:
  6447. is_failure_action:
  6448. type: boolean
  6449. stop_on_failure:
  6450. type: boolean
  6451. execute_sync:
  6452. type: boolean
  6453. EventAction:
  6454. allOf:
  6455. - $ref: '#/components/schemas/BaseEventAction'
  6456. - type: object
  6457. properties:
  6458. order:
  6459. type: integer
  6460. description: execution order
  6461. relation_options:
  6462. $ref: '#/components/schemas/EventActionOptions'
  6463. EventActionMinimal:
  6464. type: object
  6465. properties:
  6466. name:
  6467. type: string
  6468. order:
  6469. type: integer
  6470. description: execution order
  6471. relation_options:
  6472. $ref: '#/components/schemas/EventActionOptions'
  6473. ConditionPattern:
  6474. type: object
  6475. properties:
  6476. pattern:
  6477. type: string
  6478. inverse_match:
  6479. type: boolean
  6480. ConditionOptions:
  6481. type: object
  6482. properties:
  6483. names:
  6484. type: array
  6485. items:
  6486. $ref: '#/components/schemas/ConditionPattern'
  6487. group_names:
  6488. type: array
  6489. items:
  6490. $ref: '#/components/schemas/ConditionPattern'
  6491. fs_paths:
  6492. type: array
  6493. items:
  6494. $ref: '#/components/schemas/ConditionPattern'
  6495. protocols:
  6496. type: array
  6497. items:
  6498. type: string
  6499. enum:
  6500. - SFTP
  6501. - SCP
  6502. - SSH
  6503. - FTP
  6504. - DAV
  6505. - HTTP
  6506. - HTTPShare
  6507. - OIDC
  6508. provider_objects:
  6509. type: array
  6510. items:
  6511. type: string
  6512. enum:
  6513. - user
  6514. - group
  6515. - admin
  6516. - api_key
  6517. - share
  6518. - event_action
  6519. - event_rule
  6520. min_size:
  6521. type: integer
  6522. format: int64
  6523. max_size:
  6524. type: integer
  6525. format: int64
  6526. concurrent_execution:
  6527. type: boolean
  6528. description: allow concurrent execution from multiple nodes
  6529. Schedule:
  6530. type: object
  6531. properties:
  6532. hour:
  6533. type: string
  6534. day_of_week:
  6535. type: string
  6536. day_of_month:
  6537. type: string
  6538. month:
  6539. type: string
  6540. EventConditions:
  6541. type: object
  6542. properties:
  6543. fs_events:
  6544. type: array
  6545. items:
  6546. type: string
  6547. enum:
  6548. - upload
  6549. - download
  6550. - delete
  6551. - rename
  6552. - mkdir
  6553. - rmdir
  6554. - ssh_cmd
  6555. provider_events:
  6556. type: array
  6557. items:
  6558. type: string
  6559. enum:
  6560. - add
  6561. - update
  6562. - delete
  6563. schedules:
  6564. type: array
  6565. items:
  6566. $ref: '#/components/schemas/Schedule'
  6567. options:
  6568. $ref: '#/components/schemas/ConditionOptions'
  6569. BaseEventRule:
  6570. type: object
  6571. properties:
  6572. id:
  6573. type: integer
  6574. format: int32
  6575. minimum: 1
  6576. name:
  6577. type: string
  6578. description: unique name
  6579. description:
  6580. type: string
  6581. description: optional description
  6582. created_at:
  6583. type: integer
  6584. format: int64
  6585. description: creation time as unix timestamp in milliseconds
  6586. updated_at:
  6587. type: integer
  6588. format: int64
  6589. description: last update time as unix timestamp in millisecond
  6590. trigger:
  6591. $ref: '#/components/schemas/EventTriggerTypes'
  6592. conditions:
  6593. $ref: '#/components/schemas/EventConditions'
  6594. EventRule:
  6595. allOf:
  6596. - $ref: '#/components/schemas/BaseEventRule'
  6597. - type: object
  6598. properties:
  6599. actions:
  6600. type: array
  6601. items:
  6602. $ref: '#/components/schemas/EventAction'
  6603. EventRuleMinimal:
  6604. allOf:
  6605. - $ref: '#/components/schemas/BaseEventRule'
  6606. - type: object
  6607. properties:
  6608. actions:
  6609. type: array
  6610. items:
  6611. $ref: '#/components/schemas/EventActionMinimal'
  6612. ApiResponse:
  6613. type: object
  6614. properties:
  6615. message:
  6616. type: string
  6617. description: 'message, can be empty'
  6618. error:
  6619. type: string
  6620. description: error description if any
  6621. VersionInfo:
  6622. type: object
  6623. properties:
  6624. version:
  6625. type: string
  6626. build_date:
  6627. type: string
  6628. commit_hash:
  6629. type: string
  6630. features:
  6631. type: array
  6632. items:
  6633. type: string
  6634. description: 'Features for the current build. Available features are `portable`, `bolt`, `mysql`, `sqlite`, `pgsql`, `s3`, `gcs`, `metrics`. If a feature is available it has a `+` prefix, otherwise a `-` prefix'
  6635. Token:
  6636. type: object
  6637. properties:
  6638. access_token:
  6639. type: string
  6640. expires_at:
  6641. type: string
  6642. format: date-time
  6643. securitySchemes:
  6644. BasicAuth:
  6645. type: http
  6646. scheme: basic
  6647. BearerAuth:
  6648. type: http
  6649. scheme: bearer
  6650. bearerFormat: JWT
  6651. APIKeyAuth:
  6652. type: apiKey
  6653. in: header
  6654. name: X-SFTPGO-API-KEY
  6655. 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.'