openapi.yaml 184 KB

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