openapi.yaml 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191
  1. openapi: 3.0.3
  2. tags:
  3. - name: healthcheck
  4. - name: token
  5. - name: maintenance
  6. - name: admins
  7. - name: connections
  8. - name: defender
  9. - name: quota
  10. - name: folders
  11. - name: users
  12. info:
  13. title: SFTPGo
  14. description: |
  15. SFTPGo allows to securely share your files over SFTP and optionally FTP/S and WebDAV too.
  16. 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.
  17. 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.
  18. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user.
  19. version: 2.0.5
  20. contact:
  21. name: API support
  22. url: 'https://github.com/drakkan/sftpgo'
  23. license:
  24. name: AGPLv3
  25. url: 'https://www.gnu.org/licenses/agpl-3.0.en.html'
  26. servers:
  27. - url: /api/v2
  28. security:
  29. - BearerAuth: []
  30. paths:
  31. /healthz:
  32. get:
  33. security: []
  34. servers:
  35. - url: /
  36. tags:
  37. - healthcheck
  38. summary: health check
  39. description: This endpoint can be used to check if the application is running and responding to requests
  40. operationId: healthz
  41. responses:
  42. '200':
  43. description: successful operation
  44. content:
  45. text/plain:
  46. schema:
  47. type: string
  48. example: ok
  49. /token:
  50. get:
  51. security:
  52. - BasicAuth: []
  53. tags:
  54. - token
  55. summary: Get a new access token
  56. description: Returns an access token and its expiration
  57. operationId: get_token
  58. responses:
  59. '200':
  60. description: successful operation
  61. content:
  62. application/json:
  63. schema:
  64. $ref: '#/components/schemas/Token'
  65. '401':
  66. $ref: '#/components/responses/Unauthorized'
  67. '403':
  68. $ref: '#/components/responses/Forbidden'
  69. '500':
  70. $ref: '#/components/responses/InternalServerError'
  71. default:
  72. $ref: '#/components/responses/DefaultResponse'
  73. /logout:
  74. get:
  75. tags:
  76. - token
  77. summary: Invalidate
  78. description: Allows to invalidate a token before its expiration
  79. operationId: logout
  80. responses:
  81. '200':
  82. description: successful operation
  83. content:
  84. application/json:
  85. schema:
  86. $ref: '#/components/schemas/ApiResponse'
  87. '401':
  88. $ref: '#/components/responses/Unauthorized'
  89. '403':
  90. $ref: '#/components/responses/Forbidden'
  91. '500':
  92. $ref: '#/components/responses/InternalServerError'
  93. default:
  94. $ref: '#/components/responses/DefaultResponse'
  95. /version:
  96. get:
  97. tags:
  98. - maintenance
  99. summary: Get version details
  100. description: 'Returns version details such as the version number, build date, commit hash and enabled features'
  101. operationId: get_version
  102. responses:
  103. '200':
  104. description: successful operation
  105. content:
  106. application/json:
  107. schema:
  108. $ref: '#/components/schemas/VersionInfo'
  109. '401':
  110. $ref: '#/components/responses/Unauthorized'
  111. '403':
  112. $ref: '#/components/responses/Forbidden'
  113. '500':
  114. $ref: '#/components/responses/InternalServerError'
  115. default:
  116. $ref: '#/components/responses/DefaultResponse'
  117. /changepwd/admin:
  118. put:
  119. tags:
  120. - admins
  121. summary: Change admin password
  122. description: Changes the password for the logged in admin
  123. operationId: change_admin_password
  124. requestBody:
  125. required: true
  126. content:
  127. application/json:
  128. schema:
  129. $ref: '#/components/schemas/PwdChange'
  130. responses:
  131. '200':
  132. description: successful operation
  133. content:
  134. application/json:
  135. schema:
  136. $ref: '#/components/schemas/ApiResponse'
  137. '401':
  138. $ref: '#/components/responses/Unauthorized'
  139. '403':
  140. $ref: '#/components/responses/Forbidden'
  141. '500':
  142. $ref: '#/components/responses/InternalServerError'
  143. default:
  144. $ref: '#/components/responses/DefaultResponse'
  145. /connections:
  146. get:
  147. tags:
  148. - connections
  149. summary: Get connections details
  150. description: Returns the active users and info about their current uploads/downloads
  151. operationId: get_connections
  152. responses:
  153. '200':
  154. description: successful operation
  155. content:
  156. application/json:
  157. schema:
  158. type: array
  159. items:
  160. $ref: '#/components/schemas/ConnectionStatus'
  161. '401':
  162. $ref: '#/components/responses/Unauthorized'
  163. '403':
  164. $ref: '#/components/responses/Forbidden'
  165. '500':
  166. $ref: '#/components/responses/InternalServerError'
  167. default:
  168. $ref: '#/components/responses/DefaultResponse'
  169. '/connections/{connectionID}':
  170. delete:
  171. tags:
  172. - connections
  173. summary: Close connection
  174. description: Terminates an active connection
  175. operationId: close_connection
  176. parameters:
  177. - name: connectionID
  178. in: path
  179. description: ID of the connection to close
  180. required: true
  181. schema:
  182. type: string
  183. responses:
  184. '200':
  185. description: successful operation
  186. content:
  187. application/json:
  188. schema:
  189. $ref: '#/components/schemas/ApiResponse'
  190. example:
  191. message: Connection closed
  192. '401':
  193. $ref: '#/components/responses/Unauthorized'
  194. '403':
  195. $ref: '#/components/responses/Forbidden'
  196. '404':
  197. $ref: '#/components/responses/NotFound'
  198. '500':
  199. $ref: '#/components/responses/InternalServerError'
  200. default:
  201. $ref: '#/components/responses/DefaultResponse'
  202. /defender/bantime:
  203. get:
  204. tags:
  205. - defender
  206. summary: Get ban time
  207. description: Returns the ban time for the specified IPv4/IPv6 address
  208. operationId: get_ban_time
  209. parameters:
  210. - in: query
  211. name: ip
  212. required: true
  213. description: IPv4/IPv6 address
  214. schema:
  215. type: string
  216. responses:
  217. '200':
  218. description: successful operation
  219. content:
  220. application/json:
  221. schema:
  222. $ref: '#/components/schemas/BanStatus'
  223. '401':
  224. $ref: '#/components/responses/Unauthorized'
  225. '403':
  226. $ref: '#/components/responses/Forbidden'
  227. '404':
  228. $ref: '#/components/responses/NotFound'
  229. '500':
  230. $ref: '#/components/responses/InternalServerError'
  231. default:
  232. $ref: '#/components/responses/DefaultResponse'
  233. /defender/unban:
  234. post:
  235. tags:
  236. - defender
  237. summary: Unban
  238. description: Removes the specified IPv4/IPv6 from the banned ones
  239. operationId: unban_host
  240. requestBody:
  241. required: true
  242. content:
  243. application/json:
  244. schema:
  245. type: object
  246. properties:
  247. ip:
  248. type: string
  249. description: IPv4/IPv6 address to remove
  250. responses:
  251. '200':
  252. description: successful operation
  253. content:
  254. application/json:
  255. schema:
  256. $ref: '#/components/schemas/ApiResponse'
  257. '400':
  258. $ref: '#/components/responses/BadRequest'
  259. '401':
  260. $ref: '#/components/responses/Unauthorized'
  261. '403':
  262. $ref: '#/components/responses/Forbidden'
  263. '404':
  264. $ref: '#/components/responses/NotFound'
  265. '500':
  266. $ref: '#/components/responses/InternalServerError'
  267. default:
  268. $ref: '#/components/responses/DefaultResponse'
  269. /defender/score:
  270. get:
  271. tags:
  272. - defender
  273. summary: Get score
  274. description: Returns the score for the specified IPv4/IPv6 address
  275. operationId: get_score
  276. parameters:
  277. - in: query
  278. name: ip
  279. required: true
  280. description: IPv4/IPv6 address
  281. schema:
  282. type: string
  283. responses:
  284. '200':
  285. description: successful operation
  286. content:
  287. application/json:
  288. schema:
  289. $ref: '#/components/schemas/ScoreStatus'
  290. '401':
  291. $ref: '#/components/responses/Unauthorized'
  292. '403':
  293. $ref: '#/components/responses/Forbidden'
  294. '404':
  295. $ref: '#/components/responses/NotFound'
  296. '500':
  297. $ref: '#/components/responses/InternalServerError'
  298. default:
  299. $ref: '#/components/responses/DefaultResponse'
  300. /quota-scans:
  301. get:
  302. tags:
  303. - quota
  304. summary: Get quota scans
  305. description: Returns active user quota scans
  306. operationId: get_quota_scans
  307. responses:
  308. '200':
  309. description: successful operation
  310. content:
  311. application/json:
  312. schema:
  313. type: array
  314. items:
  315. $ref: '#/components/schemas/QuotaScan'
  316. '401':
  317. $ref: '#/components/responses/Unauthorized'
  318. '403':
  319. $ref: '#/components/responses/Forbidden'
  320. '500':
  321. $ref: '#/components/responses/InternalServerError'
  322. default:
  323. $ref: '#/components/responses/DefaultResponse'
  324. post:
  325. tags:
  326. - quota
  327. summary: Start user quota scan
  328. 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
  329. operationId: start_quota_scan
  330. requestBody:
  331. required: true
  332. content:
  333. application/json:
  334. schema:
  335. $ref: '#/components/schemas/User'
  336. responses:
  337. '202':
  338. description: successful operation
  339. content:
  340. application/json:
  341. schema:
  342. $ref: '#/components/schemas/ApiResponse'
  343. example:
  344. message: Scan started
  345. '400':
  346. $ref: '#/components/responses/BadRequest'
  347. '401':
  348. $ref: '#/components/responses/Unauthorized'
  349. '403':
  350. $ref: '#/components/responses/Forbidden'
  351. '404':
  352. $ref: '#/components/responses/NotFound'
  353. '409':
  354. $ref: '#/components/responses/Conflict'
  355. '500':
  356. $ref: '#/components/responses/InternalServerError'
  357. default:
  358. $ref: '#/components/responses/DefaultResponse'
  359. /quota-update:
  360. put:
  361. tags:
  362. - quota
  363. summary: Update user quota limits
  364. description: Sets the current used quota limits for the given user
  365. operationId: quota_update
  366. parameters:
  367. - in: query
  368. name: mode
  369. required: false
  370. description: the update mode specifies if the given quota usage values should be added or replace the current ones
  371. schema:
  372. type: string
  373. enum:
  374. - add
  375. - reset
  376. description: |
  377. Update type:
  378. * `add` - add the specified quota limits to the current used ones
  379. * `reset` - reset the values to the specified ones. This is the default
  380. example: reset
  381. requestBody:
  382. required: true
  383. 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'
  384. content:
  385. application/json:
  386. schema:
  387. $ref: '#/components/schemas/User'
  388. responses:
  389. '200':
  390. description: successful operation
  391. content:
  392. application/json:
  393. schema:
  394. $ref: '#/components/schemas/ApiResponse'
  395. example:
  396. message: Quota updated
  397. '400':
  398. $ref: '#/components/responses/BadRequest'
  399. '401':
  400. $ref: '#/components/responses/Unauthorized'
  401. '403':
  402. $ref: '#/components/responses/Forbidden'
  403. '404':
  404. $ref: '#/components/responses/NotFound'
  405. '409':
  406. $ref: '#/components/responses/Conflict'
  407. '500':
  408. $ref: '#/components/responses/InternalServerError'
  409. default:
  410. $ref: '#/components/responses/DefaultResponse'
  411. /folder-quota-update:
  412. put:
  413. tags:
  414. - quota
  415. summary: Update folder quota limits
  416. description: Sets the current used quota limits for the given folder
  417. operationId: folder_quota_update
  418. parameters:
  419. - in: query
  420. name: mode
  421. required: false
  422. description: the update mode specifies if the given quota usage values should be added or replace the current ones
  423. schema:
  424. type: string
  425. enum:
  426. - add
  427. - reset
  428. description: |
  429. Update type:
  430. * `add` - add the specified quota limits to the current used ones
  431. * `reset` - reset the values to the specified ones. This is the default
  432. example: reset
  433. requestBody:
  434. required: true
  435. 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'
  436. content:
  437. application/json:
  438. schema:
  439. $ref: '#/components/schemas/BaseVirtualFolder'
  440. responses:
  441. '200':
  442. description: successful operation
  443. content:
  444. application/json:
  445. schema:
  446. $ref: '#/components/schemas/ApiResponse'
  447. example:
  448. message: Quota updated
  449. '400':
  450. $ref: '#/components/responses/BadRequest'
  451. '401':
  452. $ref: '#/components/responses/Unauthorized'
  453. '403':
  454. $ref: '#/components/responses/Forbidden'
  455. '404':
  456. $ref: '#/components/responses/NotFound'
  457. '409':
  458. $ref: '#/components/responses/Conflict'
  459. '500':
  460. $ref: '#/components/responses/InternalServerError'
  461. default:
  462. $ref: '#/components/responses/DefaultResponse'
  463. /folder-quota-scans:
  464. get:
  465. tags:
  466. - quota
  467. summary: Get folders quota scans
  468. description: Returns the active quota scans for folders
  469. operationId: get_folders_quota_scans
  470. responses:
  471. '200':
  472. description: successful operation
  473. content:
  474. application/json:
  475. schema:
  476. type: array
  477. items:
  478. $ref: '#/components/schemas/FolderQuotaScan'
  479. '401':
  480. $ref: '#/components/responses/Unauthorized'
  481. '403':
  482. $ref: '#/components/responses/Forbidden'
  483. '500':
  484. $ref: '#/components/responses/InternalServerError'
  485. default:
  486. $ref: '#/components/responses/DefaultResponse'
  487. post:
  488. tags:
  489. - quota
  490. summary: Start folder quota scan
  491. 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
  492. operationId: start_folder_quota_scan
  493. requestBody:
  494. required: true
  495. content:
  496. application/json:
  497. schema:
  498. $ref: '#/components/schemas/BaseVirtualFolder'
  499. responses:
  500. '202':
  501. description: successful operation
  502. content:
  503. application/json:
  504. schema:
  505. $ref: '#/components/schemas/ApiResponse'
  506. example:
  507. message: Scan started
  508. '400':
  509. $ref: '#/components/responses/BadRequest'
  510. '401':
  511. $ref: '#/components/responses/Unauthorized'
  512. '403':
  513. $ref: '#/components/responses/Forbidden'
  514. '404':
  515. $ref: '#/components/responses/NotFound'
  516. '409':
  517. $ref: '#/components/responses/Conflict'
  518. '500':
  519. $ref: '#/components/responses/InternalServerError'
  520. default:
  521. $ref: '#/components/responses/DefaultResponse'
  522. /folders:
  523. get:
  524. tags:
  525. - folders
  526. summary: Get folders
  527. description: Returns an array with one or more folders
  528. operationId: get_folders
  529. parameters:
  530. - in: query
  531. name: offset
  532. schema:
  533. type: integer
  534. minimum: 0
  535. default: 0
  536. required: false
  537. - in: query
  538. name: limit
  539. schema:
  540. type: integer
  541. minimum: 1
  542. maximum: 500
  543. default: 100
  544. required: false
  545. description: 'The maximum number of items to return. Max value is 500, default is 100'
  546. - in: query
  547. name: order
  548. required: false
  549. description: Ordering folders by path. Default ASC
  550. schema:
  551. type: string
  552. enum:
  553. - ASC
  554. - DESC
  555. example: ASC
  556. responses:
  557. '200':
  558. description: successful operation
  559. content:
  560. application/json:
  561. schema:
  562. type: array
  563. items:
  564. $ref: '#/components/schemas/BaseVirtualFolder'
  565. '400':
  566. $ref: '#/components/responses/BadRequest'
  567. '401':
  568. $ref: '#/components/responses/Unauthorized'
  569. '403':
  570. $ref: '#/components/responses/Forbidden'
  571. '500':
  572. $ref: '#/components/responses/InternalServerError'
  573. default:
  574. $ref: '#/components/responses/DefaultResponse'
  575. post:
  576. tags:
  577. - folders
  578. summary: Add folder
  579. operationId: add_folder
  580. description: Adds a new folder. A quota scan is required to update the used files/size
  581. requestBody:
  582. required: true
  583. content:
  584. application/json:
  585. schema:
  586. $ref: '#/components/schemas/BaseVirtualFolder'
  587. responses:
  588. '201':
  589. description: successful operation
  590. content:
  591. application/json:
  592. schema:
  593. $ref: '#/components/schemas/BaseVirtualFolder'
  594. '400':
  595. $ref: '#/components/responses/BadRequest'
  596. '401':
  597. $ref: '#/components/responses/Unauthorized'
  598. '403':
  599. $ref: '#/components/responses/Forbidden'
  600. '500':
  601. $ref: '#/components/responses/InternalServerError'
  602. default:
  603. $ref: '#/components/responses/DefaultResponse'
  604. '/folders/{name}':
  605. parameters:
  606. - name: name
  607. in: path
  608. description: folder name
  609. required: true
  610. schema:
  611. type: string
  612. get:
  613. tags:
  614. - folders
  615. summary: Find folders by name
  616. description: Returns the folder with the given name if it exists.
  617. operationId: get_folder_by_name
  618. responses:
  619. '200':
  620. description: successful operation
  621. content:
  622. application/json:
  623. schema:
  624. $ref: '#/components/schemas/BaseVirtualFolder'
  625. '400':
  626. $ref: '#/components/responses/BadRequest'
  627. '401':
  628. $ref: '#/components/responses/Unauthorized'
  629. '403':
  630. $ref: '#/components/responses/Forbidden'
  631. '404':
  632. $ref: '#/components/responses/NotFound'
  633. '500':
  634. $ref: '#/components/responses/InternalServerError'
  635. default:
  636. $ref: '#/components/responses/DefaultResponse'
  637. put:
  638. tags:
  639. - folders
  640. summary: Update folder
  641. description: Updates an existing folder
  642. operationId: update_folder
  643. requestBody:
  644. required: true
  645. content:
  646. application/json:
  647. schema:
  648. $ref: '#/components/schemas/BaseVirtualFolder'
  649. responses:
  650. '200':
  651. description: successful operation
  652. content:
  653. application/json:
  654. schema:
  655. $ref: '#/components/schemas/ApiResponse'
  656. example:
  657. message: User updated
  658. '400':
  659. $ref: '#/components/responses/BadRequest'
  660. '401':
  661. $ref: '#/components/responses/Unauthorized'
  662. '403':
  663. $ref: '#/components/responses/Forbidden'
  664. '404':
  665. $ref: '#/components/responses/NotFound'
  666. '500':
  667. $ref: '#/components/responses/InternalServerError'
  668. default:
  669. $ref: '#/components/responses/DefaultResponse'
  670. delete:
  671. tags:
  672. - folders
  673. summary: Delete folder
  674. description: Deletes an existing folder
  675. operationId: delete_folder
  676. responses:
  677. '200':
  678. description: successful operation
  679. content:
  680. application/json:
  681. schema:
  682. $ref: '#/components/schemas/ApiResponse'
  683. example:
  684. message: User deleted
  685. '400':
  686. $ref: '#/components/responses/BadRequest'
  687. '401':
  688. $ref: '#/components/responses/Unauthorized'
  689. '403':
  690. $ref: '#/components/responses/Forbidden'
  691. '404':
  692. $ref: '#/components/responses/NotFound'
  693. '500':
  694. $ref: '#/components/responses/InternalServerError'
  695. default:
  696. $ref: '#/components/responses/DefaultResponse'
  697. /admins:
  698. get:
  699. tags:
  700. - admins
  701. summary: Get admins
  702. description: Returns an array with one or more admins. For security reasons hashed passwords are omitted in the response
  703. operationId: get_admins
  704. parameters:
  705. - in: query
  706. name: offset
  707. schema:
  708. type: integer
  709. minimum: 0
  710. default: 0
  711. required: false
  712. - in: query
  713. name: limit
  714. schema:
  715. type: integer
  716. minimum: 1
  717. maximum: 500
  718. default: 100
  719. required: false
  720. description: 'The maximum number of items to return. Max value is 500, default is 100'
  721. - in: query
  722. name: order
  723. required: false
  724. description: Ordering admins by username. Default ASC
  725. schema:
  726. type: string
  727. enum:
  728. - ASC
  729. - DESC
  730. example: ASC
  731. responses:
  732. '200':
  733. description: successful operation
  734. content:
  735. application/json:
  736. schema:
  737. type: array
  738. items:
  739. $ref: '#/components/schemas/Admin'
  740. '400':
  741. $ref: '#/components/responses/BadRequest'
  742. '401':
  743. $ref: '#/components/responses/Unauthorized'
  744. '403':
  745. $ref: '#/components/responses/Forbidden'
  746. '500':
  747. $ref: '#/components/responses/InternalServerError'
  748. default:
  749. $ref: '#/components/responses/DefaultResponse'
  750. post:
  751. tags:
  752. - admins
  753. summary: Add admin
  754. description: Adds a new admin
  755. operationId: add_admin
  756. requestBody:
  757. required: true
  758. content:
  759. application/json:
  760. schema:
  761. $ref: '#/components/schemas/Admin'
  762. examples:
  763. example-1:
  764. value:
  765. id: 1
  766. status: 0
  767. username: string
  768. description: string
  769. password: pa$$word
  770. email: [email protected]
  771. permissions:
  772. - '*'
  773. filters:
  774. allow_list:
  775. - 192.0.2.0/24
  776. - '2001:db8::/32'
  777. additional_info: string
  778. responses:
  779. '201':
  780. description: successful operation
  781. content:
  782. application/json:
  783. schema:
  784. $ref: '#/components/schemas/Admin'
  785. '400':
  786. $ref: '#/components/responses/BadRequest'
  787. '401':
  788. $ref: '#/components/responses/Unauthorized'
  789. '403':
  790. $ref: '#/components/responses/Forbidden'
  791. '500':
  792. $ref: '#/components/responses/InternalServerError'
  793. default:
  794. $ref: '#/components/responses/DefaultResponse'
  795. '/admins/{username}':
  796. parameters:
  797. - name: username
  798. in: path
  799. description: the admin username
  800. required: true
  801. schema:
  802. type: string
  803. get:
  804. tags:
  805. - admins
  806. summary: Find admins by username
  807. description: Returns the admin with the given username, if it exists. For security reasons the hashed password is omitted in the response
  808. operationId: get_admin_by_username
  809. responses:
  810. '200':
  811. description: successful operation
  812. content:
  813. application/json:
  814. schema:
  815. $ref: '#/components/schemas/Admin'
  816. '400':
  817. $ref: '#/components/responses/BadRequest'
  818. '401':
  819. $ref: '#/components/responses/Unauthorized'
  820. '403':
  821. $ref: '#/components/responses/Forbidden'
  822. '404':
  823. $ref: '#/components/responses/NotFound'
  824. '500':
  825. $ref: '#/components/responses/InternalServerError'
  826. default:
  827. $ref: '#/components/responses/DefaultResponse'
  828. put:
  829. tags:
  830. - admins
  831. summary: Update admin
  832. description: Updates an existing admin
  833. operationId: update_admin
  834. requestBody:
  835. required: true
  836. content:
  837. application/json:
  838. schema:
  839. $ref: '#/components/schemas/Admin'
  840. responses:
  841. '200':
  842. description: successful operation
  843. content:
  844. application/json:
  845. schema:
  846. $ref: '#/components/schemas/ApiResponse'
  847. example:
  848. message: Admin updated
  849. '400':
  850. $ref: '#/components/responses/BadRequest'
  851. '401':
  852. $ref: '#/components/responses/Unauthorized'
  853. '403':
  854. $ref: '#/components/responses/Forbidden'
  855. '404':
  856. $ref: '#/components/responses/NotFound'
  857. '500':
  858. $ref: '#/components/responses/InternalServerError'
  859. default:
  860. $ref: '#/components/responses/DefaultResponse'
  861. delete:
  862. tags:
  863. - admins
  864. summary: Delete admin
  865. description: Deletes an existing admin
  866. operationId: delete_admin
  867. responses:
  868. '200':
  869. description: successful operation
  870. content:
  871. application/json:
  872. schema:
  873. $ref: '#/components/schemas/ApiResponse'
  874. example:
  875. message: Admin deleted
  876. '400':
  877. $ref: '#/components/responses/BadRequest'
  878. '401':
  879. $ref: '#/components/responses/Unauthorized'
  880. '403':
  881. $ref: '#/components/responses/Forbidden'
  882. '404':
  883. $ref: '#/components/responses/NotFound'
  884. '500':
  885. $ref: '#/components/responses/InternalServerError'
  886. default:
  887. $ref: '#/components/responses/DefaultResponse'
  888. /users:
  889. get:
  890. tags:
  891. - users
  892. summary: Get users
  893. description: Returns an array with one or more users. For security reasons hashed passwords are omitted in the response
  894. operationId: get_users
  895. parameters:
  896. - in: query
  897. name: offset
  898. schema:
  899. type: integer
  900. minimum: 0
  901. default: 0
  902. required: false
  903. - in: query
  904. name: limit
  905. schema:
  906. type: integer
  907. minimum: 1
  908. maximum: 500
  909. default: 100
  910. required: false
  911. description: 'The maximum number of items to return. Max value is 500, default is 100'
  912. - in: query
  913. name: order
  914. required: false
  915. description: Ordering users by username. Default ASC
  916. schema:
  917. type: string
  918. enum:
  919. - ASC
  920. - DESC
  921. example: ASC
  922. responses:
  923. '200':
  924. description: successful operation
  925. content:
  926. application/json:
  927. schema:
  928. type: array
  929. items:
  930. $ref: '#/components/schemas/User'
  931. '400':
  932. $ref: '#/components/responses/BadRequest'
  933. '401':
  934. $ref: '#/components/responses/Unauthorized'
  935. '403':
  936. $ref: '#/components/responses/Forbidden'
  937. '500':
  938. $ref: '#/components/responses/InternalServerError'
  939. default:
  940. $ref: '#/components/responses/DefaultResponse'
  941. post:
  942. tags:
  943. - users
  944. summary: Add user
  945. description: Adds a new user
  946. operationId: add_user
  947. requestBody:
  948. required: true
  949. content:
  950. application/json:
  951. schema:
  952. $ref: '#/components/schemas/User'
  953. responses:
  954. '201':
  955. description: successful operation
  956. content:
  957. application/json:
  958. schema:
  959. $ref: '#/components/schemas/User'
  960. '400':
  961. $ref: '#/components/responses/BadRequest'
  962. '401':
  963. $ref: '#/components/responses/Unauthorized'
  964. '403':
  965. $ref: '#/components/responses/Forbidden'
  966. '500':
  967. $ref: '#/components/responses/InternalServerError'
  968. default:
  969. $ref: '#/components/responses/DefaultResponse'
  970. '/users/{username}':
  971. parameters:
  972. - name: username
  973. in: path
  974. description: the username
  975. required: true
  976. schema:
  977. type: string
  978. get:
  979. tags:
  980. - users
  981. summary: Find users by username
  982. description: Returns the user with the given username if it exists. For security reasons the hashed password is omitted in the response
  983. operationId: get_user_by_username
  984. responses:
  985. '200':
  986. description: successful operation
  987. content:
  988. application/json:
  989. schema:
  990. $ref: '#/components/schemas/User'
  991. '400':
  992. $ref: '#/components/responses/BadRequest'
  993. '401':
  994. $ref: '#/components/responses/Unauthorized'
  995. '403':
  996. $ref: '#/components/responses/Forbidden'
  997. '404':
  998. $ref: '#/components/responses/NotFound'
  999. '500':
  1000. $ref: '#/components/responses/InternalServerError'
  1001. default:
  1002. $ref: '#/components/responses/DefaultResponse'
  1003. put:
  1004. tags:
  1005. - users
  1006. summary: Update user
  1007. description: 'Updates an existing user and optionally disconnects it, if connected, to apply the new settings'
  1008. operationId: update_user
  1009. parameters:
  1010. - in: query
  1011. name: disconnect
  1012. schema:
  1013. type: integer
  1014. enum:
  1015. - 0
  1016. - 1
  1017. description: |
  1018. Disconnect:
  1019. * `0` The user will not be disconnected and it will continue to use the old configuration until connected. This is the default
  1020. * `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
  1021. requestBody:
  1022. required: true
  1023. content:
  1024. application/json:
  1025. schema:
  1026. $ref: '#/components/schemas/User'
  1027. responses:
  1028. '200':
  1029. description: successful operation
  1030. content:
  1031. application/json:
  1032. schema:
  1033. $ref: '#/components/schemas/ApiResponse'
  1034. example:
  1035. message: User updated
  1036. '400':
  1037. $ref: '#/components/responses/BadRequest'
  1038. '401':
  1039. $ref: '#/components/responses/Unauthorized'
  1040. '403':
  1041. $ref: '#/components/responses/Forbidden'
  1042. '404':
  1043. $ref: '#/components/responses/NotFound'
  1044. '500':
  1045. $ref: '#/components/responses/InternalServerError'
  1046. default:
  1047. $ref: '#/components/responses/DefaultResponse'
  1048. delete:
  1049. tags:
  1050. - users
  1051. summary: Delete user
  1052. description: Deletes an existing user
  1053. operationId: delete_user
  1054. responses:
  1055. '200':
  1056. description: successful operation
  1057. content:
  1058. application/json:
  1059. schema:
  1060. $ref: '#/components/schemas/ApiResponse'
  1061. example:
  1062. message: User deleted
  1063. '400':
  1064. $ref: '#/components/responses/BadRequest'
  1065. '401':
  1066. $ref: '#/components/responses/Unauthorized'
  1067. '403':
  1068. $ref: '#/components/responses/Forbidden'
  1069. '404':
  1070. $ref: '#/components/responses/NotFound'
  1071. '500':
  1072. $ref: '#/components/responses/InternalServerError'
  1073. default:
  1074. $ref: '#/components/responses/DefaultResponse'
  1075. /status:
  1076. get:
  1077. tags:
  1078. - maintenance
  1079. summary: Get status
  1080. description: Retrieves the status of the active services
  1081. operationId: get_status
  1082. responses:
  1083. '200':
  1084. description: successful operation
  1085. content:
  1086. application/json:
  1087. schema:
  1088. $ref: '#/components/schemas/ServicesStatus'
  1089. '400':
  1090. $ref: '#/components/responses/BadRequest'
  1091. '401':
  1092. $ref: '#/components/responses/Unauthorized'
  1093. '403':
  1094. $ref: '#/components/responses/Forbidden'
  1095. '500':
  1096. $ref: '#/components/responses/InternalServerError'
  1097. default:
  1098. $ref: '#/components/responses/DefaultResponse'
  1099. /dumpdata:
  1100. get:
  1101. tags:
  1102. - maintenance
  1103. summary: Dump data
  1104. 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'
  1105. operationId: dumpdata
  1106. parameters:
  1107. - in: query
  1108. name: output-file
  1109. schema:
  1110. type: string
  1111. 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.
  1112. - in: query
  1113. name: output-data
  1114. schema:
  1115. type: integer
  1116. enum:
  1117. - 0
  1118. - 1
  1119. description: |
  1120. output data:
  1121. * `0` or any other value != 1, the backup will be saved to a file on the server, `output_file` is required
  1122. * `1` the backup will be returned as response body
  1123. - in: query
  1124. name: indent
  1125. schema:
  1126. type: integer
  1127. enum:
  1128. - 0
  1129. - 1
  1130. description: |
  1131. indent:
  1132. * `0` no indentation. This is the default
  1133. * `1` format the output JSON
  1134. responses:
  1135. '200':
  1136. description: successful operation
  1137. content:
  1138. application/json:
  1139. schema:
  1140. oneOf:
  1141. - $ref: '#/components/schemas/ApiResponse'
  1142. - $ref: '#/components/schemas/BackupData'
  1143. '400':
  1144. $ref: '#/components/responses/BadRequest'
  1145. '401':
  1146. $ref: '#/components/responses/Unauthorized'
  1147. '403':
  1148. $ref: '#/components/responses/Forbidden'
  1149. '500':
  1150. $ref: '#/components/responses/InternalServerError'
  1151. default:
  1152. $ref: '#/components/responses/DefaultResponse'
  1153. /loaddata:
  1154. parameters:
  1155. - in: query
  1156. name: scan-quota
  1157. schema:
  1158. type: integer
  1159. enum:
  1160. - 0
  1161. - 1
  1162. - 2
  1163. description: |
  1164. Quota scan:
  1165. * `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
  1166. * `1` scan quota
  1167. * `2` scan quota if the user has quota restrictions
  1168. required: false
  1169. - in: query
  1170. name: mode
  1171. schema:
  1172. type: integer
  1173. enum:
  1174. - 0
  1175. - 1
  1176. - 2
  1177. description: |
  1178. Mode:
  1179. * `0` New users/admins are added, existing users/admins are updated. This is the default
  1180. * `1` New users/admins are added, existing users/admins are not modified
  1181. * `2` New users are added, existing users are updated and, if connected, they are disconnected and so forced to use the new configuration
  1182. get:
  1183. tags:
  1184. - maintenance
  1185. summary: Load data from path
  1186. description: 'Restores SFTPGo data from a JSON backup file on the server. Users, folders and admins will be restored one by one and the restore is stopped if a user/folder/admin cannot be added or updated, so it could happen a partial restore'
  1187. operationId: loaddata_from_file
  1188. parameters:
  1189. - in: query
  1190. name: input-file
  1191. schema:
  1192. type: string
  1193. required: true
  1194. 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
  1195. responses:
  1196. '200':
  1197. description: successful operation
  1198. content:
  1199. application/json:
  1200. schema:
  1201. $ref: '#/components/schemas/ApiResponse'
  1202. example:
  1203. message: Data restored
  1204. '400':
  1205. $ref: '#/components/responses/BadRequest'
  1206. '401':
  1207. $ref: '#/components/responses/Unauthorized'
  1208. '403':
  1209. $ref: '#/components/responses/Forbidden'
  1210. '500':
  1211. $ref: '#/components/responses/InternalServerError'
  1212. default:
  1213. $ref: '#/components/responses/DefaultResponse'
  1214. post:
  1215. tags:
  1216. - maintenance
  1217. summary: Load data
  1218. description: 'Restores SFTPGo data from a JSON backup. Users, folders and admins will be restored one by one and the restore is stopped if a user/folder/admin cannot be added or updated, so it could happen a partial restore'
  1219. operationId: loaddata_from_request_body
  1220. requestBody:
  1221. required: true
  1222. content:
  1223. application/json:
  1224. schema:
  1225. $ref: '#/components/schemas/BackupData'
  1226. responses:
  1227. '200':
  1228. description: successful operation
  1229. content:
  1230. application/json:
  1231. schema:
  1232. $ref: '#/components/schemas/ApiResponse'
  1233. example:
  1234. message: Data restored
  1235. '400':
  1236. $ref: '#/components/responses/BadRequest'
  1237. '401':
  1238. $ref: '#/components/responses/Unauthorized'
  1239. '403':
  1240. $ref: '#/components/responses/Forbidden'
  1241. '500':
  1242. $ref: '#/components/responses/InternalServerError'
  1243. default:
  1244. $ref: '#/components/responses/DefaultResponse'
  1245. components:
  1246. responses:
  1247. BadRequest:
  1248. description: Bad Request
  1249. content:
  1250. application/json:
  1251. schema:
  1252. $ref: '#/components/schemas/ApiResponse'
  1253. Unauthorized:
  1254. description: Unauthorized
  1255. content:
  1256. application/json:
  1257. schema:
  1258. $ref: '#/components/schemas/ApiResponse'
  1259. Forbidden:
  1260. description: Forbidden
  1261. content:
  1262. application/json:
  1263. schema:
  1264. $ref: '#/components/schemas/ApiResponse'
  1265. NotFound:
  1266. description: Not Found
  1267. content:
  1268. application/json:
  1269. schema:
  1270. $ref: '#/components/schemas/ApiResponse'
  1271. Conflict:
  1272. description: Conflict
  1273. content:
  1274. application/json:
  1275. schema:
  1276. $ref: '#/components/schemas/ApiResponse'
  1277. InternalServerError:
  1278. description: Internal Server Error
  1279. content:
  1280. application/json:
  1281. schema:
  1282. $ref: '#/components/schemas/ApiResponse'
  1283. DefaultResponse:
  1284. description: Unexpected Error
  1285. content:
  1286. application/json:
  1287. schema:
  1288. $ref: '#/components/schemas/ApiResponse'
  1289. schemas:
  1290. Permission:
  1291. type: string
  1292. enum:
  1293. - '*'
  1294. - list
  1295. - download
  1296. - upload
  1297. - overwrite
  1298. - delete
  1299. - rename
  1300. - create_dirs
  1301. - create_symlinks
  1302. - chmod
  1303. - chown
  1304. - chtimes
  1305. description: |
  1306. Permissions:
  1307. * `*` - all permissions are granted
  1308. * `list` - list items is allowed
  1309. * `download` - download files is allowed
  1310. * `upload` - upload files is allowed
  1311. * `overwrite` - overwrite an existing file, while uploading, is allowed. upload permission is required to allow file overwrite
  1312. * `delete` - delete files or directories is allowed
  1313. * `rename` - rename files or directories is allowed
  1314. * `create_dirs` - create directories is allowed
  1315. * `create_symlinks` - create links is allowed
  1316. * `chmod` changing file or directory permissions is allowed
  1317. * `chown` changing file or directory owner and group is allowed
  1318. * `chtimes` changing file or directory access and modification time is allowed
  1319. DirPermissions:
  1320. type: object
  1321. additionalProperties:
  1322. type: array
  1323. items:
  1324. $ref: '#/components/schemas/Permission'
  1325. minItems: 1
  1326. minProperties: 1
  1327. 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'
  1328. AdminPermissions:
  1329. type: string
  1330. enum:
  1331. - '*'
  1332. - add_users
  1333. - edit_users
  1334. - del_users
  1335. - view_users
  1336. - view_conns
  1337. - close_conns
  1338. - view_status
  1339. - manage_admins
  1340. - quota_scans
  1341. - manage_system
  1342. - manage_defender
  1343. - view_defender
  1344. description: |
  1345. Admin permissions:
  1346. * `*` - all permissions are granted
  1347. * `add_users` - add new users is allowed
  1348. * `edit_users` - change existing users is allowed
  1349. * `del_users` - remove users is allowed
  1350. * `view_users` - list users is allowed
  1351. * `view_conns` - list active connections is allowed
  1352. * `close_conns` - close active connections is allowed
  1353. * `view_status` - view the server status is allowed
  1354. * `manage_admins` - manage other admins is allowed
  1355. * `manage_defender` - remove ip from the dynamic blocklist is allowed
  1356. * `view_defender` - list the dynamic blocklist is allowed
  1357. LoginMethods:
  1358. type: string
  1359. enum:
  1360. - publickey
  1361. - password
  1362. - keyboard-interactive
  1363. - publickey+password
  1364. - publickey+keyboard-interactive
  1365. - TLSCertificate
  1366. - TLSCertificate+password
  1367. description: |
  1368. Available login methods. To enable multi-step authentication you have to allow only multi-step login methods
  1369. * `publickey`
  1370. * `password`
  1371. * `keyboard-interactive`
  1372. * `publickey+password` - multi-step auth: public key and password
  1373. * `publickey+keyboard-interactive` - multi-step auth: public key and keyboard interactive
  1374. * `TLSCertificate`
  1375. * `TLSCertificate+password` - multi-step auth: TLS client certificate and password
  1376. SupportedProtocols:
  1377. type: string
  1378. enum:
  1379. - SSH
  1380. - FTP
  1381. - DAV
  1382. - HTTP
  1383. description: |
  1384. Protocols:
  1385. * `SSH` - includes both SFTP and SSH commands
  1386. * `FTP` - plain FTP and FTPES/FTPS
  1387. * `DAV` - WebDAV over HTTP/HTTPS
  1388. * `HTTP` - WebClient
  1389. WebClientOptions:
  1390. type: string
  1391. enum:
  1392. - publickey-change-disabled
  1393. description: |
  1394. Options:
  1395. * `publickey-change-disabled` - changing SSH public keys is not allowed
  1396. PatternsFilter:
  1397. type: object
  1398. properties:
  1399. path:
  1400. type: string
  1401. description: 'exposed virtual path, if no other specific filter is defined, the filter apply 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'
  1402. allowed_patterns:
  1403. type: array
  1404. items:
  1405. type: string
  1406. description: 'list of, case insensitive, allowed shell like file patterns.'
  1407. example:
  1408. - '*.jpg'
  1409. - a*b?.png
  1410. denied_patterns:
  1411. type: array
  1412. items:
  1413. type: string
  1414. description: 'list of, case insensitive, denied shell like file patterns. Denied patterns are evaluated before the allowed ones'
  1415. example:
  1416. - '*.zip'
  1417. ExtensionsFilter:
  1418. type: object
  1419. properties:
  1420. path:
  1421. type: string
  1422. description: 'exposed virtual path, if no other specific filter is defined, the filter apply 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'
  1423. allowed_extensions:
  1424. type: array
  1425. items:
  1426. type: string
  1427. description: 'list of, case insensitive, allowed files extension. Shell like expansion is not supported so you have to specify `.jpg` and not `*.jpg`'
  1428. example:
  1429. - .jpg
  1430. - .png
  1431. denied_extensions:
  1432. type: array
  1433. items:
  1434. type: string
  1435. description: 'list of, case insensitive, denied files extension. Denied file extensions are evaluated before the allowed ones'
  1436. example:
  1437. - .zip
  1438. HooksFilter:
  1439. type: object
  1440. properties:
  1441. external_auth_disabled:
  1442. type: boolean
  1443. example: false
  1444. description: If true, the external auth hook, if defined, will not be executed
  1445. pre_login_disabled:
  1446. type: boolean
  1447. example: false
  1448. description: If true, the pre-login hook, if defined, will not be executed
  1449. check_password_disabled:
  1450. type: boolean
  1451. example: false
  1452. description: If true, the check password hook, if defined, will not be executed
  1453. description: User specific hook overrides
  1454. UserFilters:
  1455. type: object
  1456. properties:
  1457. allowed_ip:
  1458. type: array
  1459. items:
  1460. type: string
  1461. 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"'
  1462. example:
  1463. - 192.0.2.0/24
  1464. - '2001:db8::/32'
  1465. denied_ip:
  1466. type: array
  1467. items:
  1468. type: string
  1469. description: clients connecting from these IP/Mask are not allowed. Denied rules are evaluated before allowed ones
  1470. example:
  1471. - 172.16.0.0/16
  1472. denied_login_methods:
  1473. type: array
  1474. items:
  1475. $ref: '#/components/schemas/LoginMethods'
  1476. description: if null or empty any available login method is allowed
  1477. denied_protocols:
  1478. type: array
  1479. items:
  1480. $ref: '#/components/schemas/SupportedProtocols'
  1481. description: if null or empty any available protocol is allowed
  1482. file_patterns:
  1483. type: array
  1484. items:
  1485. $ref: '#/components/schemas/PatternsFilter'
  1486. 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'
  1487. file_extensions:
  1488. type: array
  1489. items:
  1490. $ref: '#/components/schemas/ExtensionsFilter'
  1491. description: 'filters based on shell like patterns. Deprecated, use 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'
  1492. max_upload_file_size:
  1493. type: integer
  1494. format: int64
  1495. 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`'
  1496. tls_username:
  1497. type: string
  1498. enum:
  1499. - None
  1500. - CommonName
  1501. 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'
  1502. hooks:
  1503. $ref: '#/components/schemas/HooksFilter'
  1504. disable_fs_checks:
  1505. type: boolean
  1506. example: false
  1507. 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
  1508. web_client:
  1509. type: array
  1510. items:
  1511. $ref: '#/components/schemas/WebClientOptions'
  1512. description: WebClient related configuration options
  1513. description: Additional user options
  1514. Secret:
  1515. type: object
  1516. properties:
  1517. status:
  1518. type: string
  1519. enum:
  1520. - Plain
  1521. - AES-256-GCM
  1522. - Secretbox
  1523. - GCP
  1524. - AWS
  1525. - VaultTransit
  1526. - Redacted
  1527. description: 'Set to "Plain" to add or update an existing secret, set to "Redacted" to preserve the existing value'
  1528. payload:
  1529. type: string
  1530. key:
  1531. type: string
  1532. additional_data:
  1533. type: string
  1534. mode:
  1535. type: integer
  1536. description: 1 means encrypted using a master key
  1537. 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
  1538. S3Config:
  1539. type: object
  1540. properties:
  1541. bucket:
  1542. type: string
  1543. minLength: 1
  1544. region:
  1545. type: string
  1546. minLength: 1
  1547. access_key:
  1548. type: string
  1549. access_secret:
  1550. $ref: '#/components/schemas/Secret'
  1551. endpoint:
  1552. type: string
  1553. description: optional endpoint
  1554. storage_class:
  1555. type: string
  1556. upload_part_size:
  1557. type: integer
  1558. 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.'
  1559. upload_concurrency:
  1560. type: integer
  1561. description: 'the number of parts to upload in parallel. If this value is set to zero, the default value (2) will be used'
  1562. key_prefix:
  1563. type: string
  1564. 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'
  1565. example: folder/subfolder/
  1566. description: S3 Compatible Object Storage configuration details
  1567. GCSConfig:
  1568. type: object
  1569. properties:
  1570. bucket:
  1571. type: string
  1572. minLength: 1
  1573. credentials:
  1574. $ref: '#/components/schemas/Secret'
  1575. automatic_credentials:
  1576. type: integer
  1577. enum:
  1578. - 0
  1579. - 1
  1580. description: |
  1581. Automatic credentials:
  1582. * `0` - disabled, explicit credentials, using a JSON credentials file, must be provided. This is the default value if the field is null
  1583. * `1` - enabled, we try to use the Application Default Credentials (ADC) strategy to find your application's credentials
  1584. storage_class:
  1585. type: string
  1586. key_prefix:
  1587. type: string
  1588. 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'
  1589. example: folder/subfolder/
  1590. 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'
  1591. AzureBlobFsConfig:
  1592. type: object
  1593. properties:
  1594. container:
  1595. type: string
  1596. account_name:
  1597. type: string
  1598. description: 'Storage Account Name, leave blank to use SAS URL'
  1599. account_key:
  1600. $ref: '#/components/schemas/Secret'
  1601. sas_url:
  1602. type: string
  1603. description: 'Shared access signature URL, leave blank if using account/key'
  1604. endpoint:
  1605. type: string
  1606. 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"'
  1607. upload_part_size:
  1608. type: integer
  1609. 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.'
  1610. upload_concurrency:
  1611. type: integer
  1612. description: 'the number of parts to upload in parallel. If this value is set to zero, the default value (2) will be used'
  1613. access_tier:
  1614. type: string
  1615. enum:
  1616. - ''
  1617. - Archive
  1618. - Hot
  1619. - Cool
  1620. key_prefix:
  1621. type: string
  1622. 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'
  1623. example: folder/subfolder/
  1624. use_emulator:
  1625. type: boolean
  1626. description: Azure Blob Storage configuration details
  1627. CryptFsConfig:
  1628. type: object
  1629. properties:
  1630. passphrase:
  1631. $ref: '#/components/schemas/Secret'
  1632. description: Crypt filesystem configuration details
  1633. SFTPFsConfig:
  1634. type: object
  1635. properties:
  1636. endpoint:
  1637. type: string
  1638. description: 'remote SFTP endpoint as host:port'
  1639. username:
  1640. type: string
  1641. description: you can specify a password or private key or both. In the latter case the private key will be tried first.
  1642. password:
  1643. $ref: '#/components/schemas/Secret'
  1644. private_key:
  1645. $ref: '#/components/schemas/Secret'
  1646. fingerprints:
  1647. type: array
  1648. items:
  1649. type: string
  1650. 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'
  1651. prefix:
  1652. type: string
  1653. description: Specifying a prefix you can restrict all operations to a given path within the remote SFTP server.
  1654. disable_concurrent_reads:
  1655. type: boolean
  1656. 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.
  1657. buffer_size:
  1658. type: integer
  1659. minimum: 0
  1660. maximum: 16
  1661. example: 2
  1662. 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.
  1663. FilesystemConfig:
  1664. type: object
  1665. properties:
  1666. provider:
  1667. type: integer
  1668. enum:
  1669. - 0
  1670. - 1
  1671. - 2
  1672. - 3
  1673. - 4
  1674. - 5
  1675. description: |
  1676. Providers:
  1677. * `0` - Local filesystem
  1678. * `1` - S3 Compatible Object Storage
  1679. * `2` - Google Cloud Storage
  1680. * `3` - Azure Blob Storage
  1681. * `4` - Local filesystem encrypted
  1682. * `5` - SFTP
  1683. s3config:
  1684. $ref: '#/components/schemas/S3Config'
  1685. gcsconfig:
  1686. $ref: '#/components/schemas/GCSConfig'
  1687. azblobconfig:
  1688. $ref: '#/components/schemas/AzureBlobFsConfig'
  1689. cryptconfig:
  1690. $ref: '#/components/schemas/CryptFsConfig'
  1691. sftpconfig:
  1692. $ref: '#/components/schemas/SFTPFsConfig'
  1693. description: Storage filesystem details
  1694. BaseVirtualFolder:
  1695. type: object
  1696. properties:
  1697. id:
  1698. type: integer
  1699. format: int32
  1700. minimum: 1
  1701. name:
  1702. type: string
  1703. description: unique name for this virtual folder
  1704. mapped_path:
  1705. type: string
  1706. description: absolute filesystem path to use as virtual folder
  1707. description:
  1708. type: string
  1709. description: optional description
  1710. used_quota_size:
  1711. type: integer
  1712. format: int64
  1713. used_quota_files:
  1714. type: integer
  1715. format: int32
  1716. last_quota_update:
  1717. type: integer
  1718. format: int64
  1719. description: Last quota update as unix timestamp in milliseconds
  1720. users:
  1721. type: array
  1722. items:
  1723. type: string
  1724. description: list of usernames associated with this virtual folder
  1725. filesystem:
  1726. $ref: '#/components/schemas/FilesystemConfig'
  1727. 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.
  1728. VirtualFolder:
  1729. allOf:
  1730. - $ref: '#/components/schemas/BaseVirtualFolder'
  1731. - type: object
  1732. properties:
  1733. virtual_path:
  1734. type: string
  1735. quota_size:
  1736. type: integer
  1737. format: int64
  1738. 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'
  1739. quota_files:
  1740. type: integer
  1741. format: int32
  1742. 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'
  1743. required:
  1744. - virtual_path
  1745. 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.'
  1746. User:
  1747. type: object
  1748. properties:
  1749. id:
  1750. type: integer
  1751. format: int32
  1752. minimum: 1
  1753. status:
  1754. type: integer
  1755. enum:
  1756. - 0
  1757. - 1
  1758. description: |
  1759. status:
  1760. * `0` user is disabled, login is not allowed
  1761. * `1` user is enabled
  1762. username:
  1763. type: string
  1764. description: username is unique
  1765. description:
  1766. type: string
  1767. description: 'optional description, for example the user full name'
  1768. expiration_date:
  1769. type: integer
  1770. format: int64
  1771. description: expiration date as unix timestamp in milliseconds. An expired account cannot login. 0 means no expiration
  1772. password:
  1773. type: string
  1774. format: password
  1775. 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
  1776. public_keys:
  1777. type: array
  1778. items:
  1779. type: string
  1780. description: a password or at least one public key/SSH user certificate are mandatory.
  1781. home_dir:
  1782. type: string
  1783. 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
  1784. virtual_folders:
  1785. type: array
  1786. items:
  1787. $ref: '#/components/schemas/VirtualFolder'
  1788. 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
  1789. uid:
  1790. type: integer
  1791. format: int32
  1792. minimum: 0
  1793. maximum: 2147483647
  1794. 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'
  1795. gid:
  1796. type: integer
  1797. format: int32
  1798. minimum: 0
  1799. maximum: 2147483647
  1800. 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'
  1801. max_sessions:
  1802. type: integer
  1803. format: int32
  1804. description: Limit the sessions that a user can open. 0 means unlimited
  1805. quota_size:
  1806. type: integer
  1807. format: int64
  1808. 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
  1809. quota_files:
  1810. type: integer
  1811. format: int32
  1812. 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
  1813. permissions:
  1814. type: object
  1815. items:
  1816. $ref: '#/components/schemas/DirPermissions'
  1817. minItems: 1
  1818. example:
  1819. /:
  1820. - '*'
  1821. /somedir:
  1822. - list
  1823. - download
  1824. used_quota_size:
  1825. type: integer
  1826. format: int64
  1827. used_quota_files:
  1828. type: integer
  1829. format: int32
  1830. last_quota_update:
  1831. type: integer
  1832. format: int64
  1833. description: Last quota update as unix timestamp in milliseconds
  1834. upload_bandwidth:
  1835. type: integer
  1836. format: int32
  1837. description: 'Maximum upload bandwidth as KB/s, 0 means unlimited'
  1838. download_bandwidth:
  1839. type: integer
  1840. format: int32
  1841. description: 'Maximum download bandwidth as KB/s, 0 means unlimited'
  1842. last_login:
  1843. type: integer
  1844. format: int64
  1845. description: Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes
  1846. filters:
  1847. $ref: '#/components/schemas/UserFilters'
  1848. filesystem:
  1849. $ref: '#/components/schemas/FilesystemConfig'
  1850. additional_info:
  1851. type: string
  1852. description: Free form text field for external systems
  1853. AdminFilters:
  1854. type: object
  1855. properties:
  1856. allow_list:
  1857. type: array
  1858. items:
  1859. type: string
  1860. 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"'
  1861. example:
  1862. - 192.0.2.0/24
  1863. - '2001:db8::/32'
  1864. Admin:
  1865. type: object
  1866. properties:
  1867. id:
  1868. type: integer
  1869. format: int32
  1870. minimum: 1
  1871. status:
  1872. type: integer
  1873. enum:
  1874. - 0
  1875. - 1
  1876. description: |
  1877. status:
  1878. * `0` user is disabled, login is not allowed
  1879. * `1` user is enabled
  1880. username:
  1881. type: string
  1882. description: username is unique
  1883. description:
  1884. type: string
  1885. description: 'optional description, for example the admin full name'
  1886. password:
  1887. type: string
  1888. format: password
  1889. description: Admin password. For security reasons this field is omitted when you search/get admins
  1890. email:
  1891. type: string
  1892. format: email
  1893. permissions:
  1894. type: array
  1895. items:
  1896. $ref: '#/components/schemas/AdminPermissions'
  1897. filters:
  1898. $ref: '#/components/schemas/AdminFilters'
  1899. additional_info:
  1900. type: string
  1901. description: Free form text field
  1902. Transfer:
  1903. type: object
  1904. properties:
  1905. operation_type:
  1906. type: string
  1907. enum:
  1908. - upload
  1909. - download
  1910. description: |
  1911. Operations:
  1912. * `upload`
  1913. * `download`
  1914. path:
  1915. type: string
  1916. description: file path for the upload/download
  1917. start_time:
  1918. type: integer
  1919. format: int64
  1920. description: start time as unix timestamp in milliseconds
  1921. size:
  1922. type: integer
  1923. format: int64
  1924. description: bytes transferred
  1925. ConnectionStatus:
  1926. type: object
  1927. properties:
  1928. username:
  1929. type: string
  1930. description: connected username
  1931. connection_id:
  1932. type: string
  1933. description: unique connection identifier
  1934. client_version:
  1935. type: string
  1936. description: client version
  1937. remote_address:
  1938. type: string
  1939. description: Remote address for the connected client
  1940. connection_time:
  1941. type: integer
  1942. format: int64
  1943. description: connection time as unix timestamp in milliseconds
  1944. command:
  1945. type: string
  1946. description: Last SSH/FTP command or WebDAV method
  1947. last_activity:
  1948. type: integer
  1949. format: int64
  1950. description: last client activity as unix timestamp in milliseconds
  1951. protocol:
  1952. type: string
  1953. enum:
  1954. - SFTP
  1955. - SCP
  1956. - SSH
  1957. - FTP
  1958. - DAV
  1959. active_transfers:
  1960. type: array
  1961. items:
  1962. $ref: '#/components/schemas/Transfer'
  1963. QuotaScan:
  1964. type: object
  1965. properties:
  1966. username:
  1967. type: string
  1968. description: username with an active scan
  1969. start_time:
  1970. type: integer
  1971. format: int64
  1972. description: scan start time as unix timestamp in milliseconds
  1973. FolderQuotaScan:
  1974. type: object
  1975. properties:
  1976. name:
  1977. type: string
  1978. description: folder name with an active scan
  1979. start_time:
  1980. type: integer
  1981. format: int64
  1982. description: scan start time as unix timestamp in milliseconds
  1983. SSHHostKey:
  1984. type: object
  1985. properties:
  1986. path:
  1987. type: string
  1988. fingerprint:
  1989. type: string
  1990. SSHBinding:
  1991. type: object
  1992. properties:
  1993. address:
  1994. type: string
  1995. description: TCP address the server listen on
  1996. port:
  1997. type: integer
  1998. description: the port used for serving requests
  1999. apply_proxy_config:
  2000. type: boolean
  2001. description: 'apply the proxy configuration, if any'
  2002. WebDAVBinding:
  2003. type: object
  2004. properties:
  2005. address:
  2006. type: string
  2007. description: TCP address the server listen on
  2008. port:
  2009. type: integer
  2010. description: the port used for serving requests
  2011. enable_https:
  2012. type: boolean
  2013. client_auth_type:
  2014. type: integer
  2015. description: 1 means that client certificate authentication is required in addition to HTTP basic authentication
  2016. FTPDBinding:
  2017. type: object
  2018. properties:
  2019. address:
  2020. type: string
  2021. description: TCP address the server listen on
  2022. port:
  2023. type: integer
  2024. description: the port used for serving requests
  2025. apply_proxy_config:
  2026. type: boolean
  2027. description: 'apply the proxy configuration, if any'
  2028. tls_mode:
  2029. type: integer
  2030. enum:
  2031. - 0
  2032. - 1
  2033. - 2
  2034. description: |
  2035. * `0` - clear or explicit TLS * `1` - explicit TLS required * `2` - implicit TLS
  2036. force_passive_ip:
  2037. type: string
  2038. description: External IP address to expose for passive connections
  2039. client_auth_type:
  2040. type: integer
  2041. description: 1 means that client certificate authentication is required in addition to FTP authentication
  2042. SSHServiceStatus:
  2043. type: object
  2044. properties:
  2045. is_active:
  2046. type: boolean
  2047. bindings:
  2048. type: array
  2049. items:
  2050. $ref: '#/components/schemas/SSHBinding'
  2051. nullable: true
  2052. host_keys:
  2053. type: array
  2054. items:
  2055. $ref: '#/components/schemas/SSHHostKey'
  2056. nullable: true
  2057. ssh_commands:
  2058. type: array
  2059. items:
  2060. type: string
  2061. FTPPassivePortRange:
  2062. type: object
  2063. properties:
  2064. start:
  2065. type: integer
  2066. end:
  2067. type: integer
  2068. FTPServiceStatus:
  2069. type: object
  2070. properties:
  2071. is_active:
  2072. type: boolean
  2073. bindings:
  2074. type: array
  2075. items:
  2076. $ref: '#/components/schemas/FTPDBinding'
  2077. nullable: true
  2078. passive_port_range:
  2079. $ref: '#/components/schemas/FTPPassivePortRange'
  2080. WebDAVServiceStatus:
  2081. type: object
  2082. properties:
  2083. is_active:
  2084. type: boolean
  2085. bindings:
  2086. type: array
  2087. items:
  2088. $ref: '#/components/schemas/WebDAVBinding'
  2089. nullable: true
  2090. DataProviderStatus:
  2091. type: object
  2092. properties:
  2093. is_active:
  2094. type: boolean
  2095. driver:
  2096. type: string
  2097. error:
  2098. type: string
  2099. ServicesStatus:
  2100. type: object
  2101. properties:
  2102. ssh:
  2103. $ref: '#/components/schemas/SSHServiceStatus'
  2104. ftp:
  2105. $ref: '#/components/schemas/FTPServiceStatus'
  2106. webdav:
  2107. $ref: '#/components/schemas/WebDAVServiceStatus'
  2108. data_provider:
  2109. $ref: '#/components/schemas/DataProviderStatus'
  2110. defender:
  2111. type: object
  2112. properties:
  2113. is_active:
  2114. type: boolean
  2115. BanStatus:
  2116. type: object
  2117. properties:
  2118. date_time:
  2119. type: string
  2120. format: date-time
  2121. nullable: true
  2122. description: if null the host is not banned
  2123. ScoreStatus:
  2124. type: object
  2125. properties:
  2126. score:
  2127. type: integer
  2128. description: if 0 the host is not listed
  2129. BackupData:
  2130. type: object
  2131. properties:
  2132. users:
  2133. type: array
  2134. items:
  2135. $ref: '#/components/schemas/User'
  2136. folders:
  2137. type: array
  2138. items:
  2139. $ref: '#/components/schemas/BaseVirtualFolder'
  2140. admins:
  2141. type: array
  2142. items:
  2143. $ref: '#/components/schemas/Admin'
  2144. version:
  2145. type: integer
  2146. PwdChange:
  2147. type: object
  2148. properties:
  2149. current_password:
  2150. type: string
  2151. new_password:
  2152. type: string
  2153. ApiResponse:
  2154. type: object
  2155. properties:
  2156. message:
  2157. type: string
  2158. description: 'message, can be empty'
  2159. error:
  2160. type: string
  2161. description: error description if any
  2162. VersionInfo:
  2163. type: object
  2164. properties:
  2165. version:
  2166. type: string
  2167. build_date:
  2168. type: string
  2169. commit_hash:
  2170. type: string
  2171. features:
  2172. type: array
  2173. items:
  2174. type: string
  2175. 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'
  2176. Token:
  2177. type: object
  2178. properties:
  2179. access_token:
  2180. type: string
  2181. expires_at:
  2182. type: string
  2183. format: date-time
  2184. securitySchemes:
  2185. BasicAuth:
  2186. type: http
  2187. scheme: basic
  2188. BearerAuth:
  2189. type: http
  2190. scheme: bearer
  2191. bearerFormat: JWT