openapi.yaml 208 KB

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