openapi.yaml 196 KB

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