openapi.yaml 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882
  1. openapi: 3.0.1
  2. info:
  3. title: SFTPGo
  4. description: 'SFTPGo REST API'
  5. version: 1.9.4
  6. servers:
  7. - url: /api/v1
  8. security:
  9. - BasicAuth: []
  10. paths:
  11. /version:
  12. get:
  13. tags:
  14. - version
  15. summary: Get version details
  16. operationId: get_version
  17. responses:
  18. 200:
  19. description: successful operation
  20. content:
  21. application/json:
  22. schema:
  23. type: array
  24. items:
  25. $ref : '#/components/schemas/VersionInfo'
  26. 401:
  27. description: Unauthorized
  28. content:
  29. application/json:
  30. schema:
  31. $ref: '#/components/schemas/ApiResponse'
  32. example:
  33. status: 401
  34. message: ""
  35. error: "Error description if any"
  36. 403:
  37. description: Forbidden
  38. content:
  39. application/json:
  40. schema:
  41. $ref: '#/components/schemas/ApiResponse'
  42. example:
  43. status: 403
  44. message: ""
  45. error: "Error description if any"
  46. 500:
  47. description: Internal Server Error
  48. content:
  49. application/json:
  50. schema:
  51. $ref: '#/components/schemas/ApiResponse'
  52. example:
  53. status: 500
  54. message: ""
  55. error: "Error description if any"
  56. /providerstatus:
  57. get:
  58. tags:
  59. - providerstatus
  60. summary: Get data provider status
  61. operationId: get_provider_status
  62. responses:
  63. 200:
  64. description: successful operation
  65. content:
  66. application/json:
  67. schema:
  68. $ref: '#/components/schemas/ApiResponse'
  69. example:
  70. status: 200
  71. message: "Alive"
  72. error: ""
  73. 401:
  74. description: Unauthorized
  75. content:
  76. application/json:
  77. schema:
  78. $ref: '#/components/schemas/ApiResponse'
  79. example:
  80. status: 401
  81. message: ""
  82. error: "Error description if any"
  83. 403:
  84. description: Forbidden
  85. content:
  86. application/json:
  87. schema:
  88. $ref: '#/components/schemas/ApiResponse'
  89. example:
  90. status: 403
  91. message: ""
  92. error: "Error description if any"
  93. 500:
  94. description: Provider Error
  95. content:
  96. application/json:
  97. schema:
  98. $ref: '#/components/schemas/ApiResponse'
  99. example:
  100. status: 500
  101. message: ""
  102. error: "Error description if any"
  103. /connection:
  104. get:
  105. tags:
  106. - connections
  107. summary: Get the active users and info about their uploads/downloads
  108. operationId: get_connections
  109. responses:
  110. 200:
  111. description: successful operation
  112. content:
  113. application/json:
  114. schema:
  115. type: array
  116. items:
  117. $ref : '#/components/schemas/ConnectionStatus'
  118. 401:
  119. description: Unauthorized
  120. content:
  121. application/json:
  122. schema:
  123. $ref: '#/components/schemas/ApiResponse'
  124. example:
  125. status: 401
  126. message: ""
  127. error: "Error description if any"
  128. 403:
  129. description: Forbidden
  130. content:
  131. application/json:
  132. schema:
  133. $ref: '#/components/schemas/ApiResponse'
  134. example:
  135. status: 403
  136. message: ""
  137. error: "Error description if any"
  138. 500:
  139. description: Internal Server Error
  140. content:
  141. application/json:
  142. schema:
  143. $ref: '#/components/schemas/ApiResponse'
  144. example:
  145. status: 500
  146. message: ""
  147. error: "Error description if any"
  148. /connection/{connectionID}:
  149. delete:
  150. tags:
  151. - connections
  152. summary: Terminate an active connection
  153. operationId: close_connection
  154. parameters:
  155. - name: connectionID
  156. in: path
  157. description: ID of the connection to close
  158. required: true
  159. schema:
  160. type: string
  161. responses:
  162. 200:
  163. description: successful operation
  164. content:
  165. application/json:
  166. schema:
  167. $ref: '#/components/schemas/ApiResponse'
  168. example:
  169. status: 200
  170. message: "Connection closed"
  171. error: ""
  172. 400:
  173. description: Bad request
  174. content:
  175. application/json:
  176. schema:
  177. $ref: '#/components/schemas/ApiResponse'
  178. example:
  179. status: 400
  180. message: ""
  181. error: "Error description if any"
  182. 401:
  183. description: Unauthorized
  184. content:
  185. application/json:
  186. schema:
  187. $ref: '#/components/schemas/ApiResponse'
  188. example:
  189. status: 401
  190. message: ""
  191. error: "Error description if any"
  192. 403:
  193. description: Forbidden
  194. content:
  195. application/json:
  196. schema:
  197. $ref: '#/components/schemas/ApiResponse'
  198. example:
  199. status: 403
  200. message: ""
  201. error: "Error description if any"
  202. 404:
  203. description: Not Found
  204. content:
  205. application/json:
  206. schema:
  207. $ref: '#/components/schemas/ApiResponse'
  208. example:
  209. status: 404
  210. message: ""
  211. error: "Error description if any"
  212. 500:
  213. description: Internal Server Error
  214. content:
  215. application/json:
  216. schema:
  217. $ref: '#/components/schemas/ApiResponse'
  218. example:
  219. status: 500
  220. message: ""
  221. error: "Error description if any"
  222. /quota_scan:
  223. get:
  224. tags:
  225. - quota
  226. summary: Get the active quota scans for users home directories
  227. operationId: get_quota_scans
  228. responses:
  229. 200:
  230. description: successful operation
  231. content:
  232. application/json:
  233. schema:
  234. type: array
  235. items:
  236. $ref : '#/components/schemas/QuotaScan'
  237. 401:
  238. description: Unauthorized
  239. content:
  240. application/json:
  241. schema:
  242. $ref: '#/components/schemas/ApiResponse'
  243. example:
  244. status: 401
  245. message: ""
  246. error: "Error description if any"
  247. 403:
  248. description: Forbidden
  249. content:
  250. application/json:
  251. schema:
  252. $ref: '#/components/schemas/ApiResponse'
  253. example:
  254. status: 403
  255. message: ""
  256. error: "Error description if any"
  257. 500:
  258. description: Internal Server Error
  259. content:
  260. application/json:
  261. schema:
  262. $ref: '#/components/schemas/ApiResponse'
  263. example:
  264. status: 500
  265. message: ""
  266. error: "Error description if any"
  267. post:
  268. tags:
  269. - quota
  270. summary: start a new user quota scan
  271. description: A quota scan update the number of files and their total size for the specified user
  272. operationId: start_quota_scan
  273. requestBody:
  274. required: true
  275. content:
  276. application/json:
  277. schema:
  278. $ref : '#/components/schemas/User'
  279. responses:
  280. 201:
  281. description: successful operation
  282. content:
  283. application/json:
  284. schema:
  285. $ref: '#/components/schemas/ApiResponse'
  286. example:
  287. status: 201
  288. message: "Scan started"
  289. error: ""
  290. 400:
  291. description: Bad request
  292. content:
  293. application/json:
  294. schema:
  295. $ref: '#/components/schemas/ApiResponse'
  296. example:
  297. status: 400
  298. message: ""
  299. error: "Error description if any"
  300. 401:
  301. description: Unauthorized
  302. content:
  303. application/json:
  304. schema:
  305. $ref: '#/components/schemas/ApiResponse'
  306. example:
  307. status: 401
  308. message: ""
  309. error: "Error description if any"
  310. 403:
  311. description: Forbidden
  312. content:
  313. application/json:
  314. schema:
  315. $ref: '#/components/schemas/ApiResponse'
  316. example:
  317. status: 403
  318. message: ""
  319. error: "Error description if any"
  320. 404:
  321. description: Not Found
  322. content:
  323. application/json:
  324. schema:
  325. $ref: '#/components/schemas/ApiResponse'
  326. example:
  327. status: 404
  328. message: ""
  329. error: "Error description if any"
  330. 409:
  331. description: Another scan is already in progress for this user
  332. content:
  333. application/json:
  334. schema:
  335. $ref: '#/components/schemas/ApiResponse'
  336. example:
  337. status: 409
  338. message: "Another scan is already in progress"
  339. error: "Error description if any"
  340. 500:
  341. description: Internal Server Error
  342. content:
  343. application/json:
  344. schema:
  345. $ref: '#/components/schemas/ApiResponse'
  346. example:
  347. status: 500
  348. message: ""
  349. error: "Error description if any"
  350. /quota_update:
  351. put:
  352. tags:
  353. - quota
  354. summary: update the user used quota limits
  355. description: Set the current used quota limits for the given user
  356. operationId: quota_update
  357. parameters:
  358. - in: query
  359. name: mode
  360. required: false
  361. description: the update mode specifies if the given quota usage values should be added or replace the current ones
  362. schema:
  363. type: string
  364. enum: [add, reset]
  365. description: >
  366. Update type:
  367. * `add` - add the specified quota limits to the current used ones
  368. * `reset` - reset the values to the specified ones. This is the default
  369. example: reset
  370. requestBody:
  371. required: true
  372. 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
  373. content:
  374. application/json:
  375. schema:
  376. $ref : '#/components/schemas/User'
  377. responses:
  378. 200:
  379. description: successful operation
  380. content:
  381. application/json:
  382. schema:
  383. $ref: '#/components/schemas/ApiResponse'
  384. example:
  385. status: 200
  386. message: "Quota updated"
  387. error: ""
  388. 400:
  389. description: Bad request
  390. content:
  391. application/json:
  392. schema:
  393. $ref: '#/components/schemas/ApiResponse'
  394. example:
  395. status: 400
  396. message: ""
  397. error: "Error description if any"
  398. 401:
  399. description: Unauthorized
  400. content:
  401. application/json:
  402. schema:
  403. $ref: '#/components/schemas/ApiResponse'
  404. example:
  405. status: 401
  406. message: ""
  407. error: "Error description if any"
  408. 403:
  409. description: Forbidden
  410. content:
  411. application/json:
  412. schema:
  413. $ref: '#/components/schemas/ApiResponse'
  414. example:
  415. status: 403
  416. message: ""
  417. error: "Error description if any"
  418. 404:
  419. description: Not Found
  420. content:
  421. application/json:
  422. schema:
  423. $ref: '#/components/schemas/ApiResponse'
  424. example:
  425. status: 404
  426. message: ""
  427. error: "Error description if any"
  428. 409:
  429. description: A quota scan is in progress for this user
  430. content:
  431. application/json:
  432. schema:
  433. $ref: '#/components/schemas/ApiResponse'
  434. example:
  435. status: 409
  436. message: "A quota scan is in progress"
  437. error: "Error description if any"
  438. 500:
  439. description: Internal Server Error
  440. content:
  441. application/json:
  442. schema:
  443. $ref: '#/components/schemas/ApiResponse'
  444. example:
  445. status: 500
  446. message: ""
  447. error: "Error description if any"
  448. /folder_quota_update:
  449. put:
  450. tags:
  451. - quota
  452. summary: update the folder used quota limits
  453. description: Set the current used quota limits for the given folder
  454. operationId: folder_quota_update
  455. parameters:
  456. - in: query
  457. name: mode
  458. required: false
  459. description: the update mode specifies if the given quota usage values should be added or replace the current ones
  460. schema:
  461. type: string
  462. enum: [add, reset]
  463. description: >
  464. Update type:
  465. * `add` - add the specified quota limits to the current used ones
  466. * `reset` - reset the values to the specified ones. This is the default
  467. example: reset
  468. requestBody:
  469. required: true
  470. 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
  471. content:
  472. application/json:
  473. schema:
  474. $ref : '#/components/schemas/BaseVirtualFolder'
  475. responses:
  476. 200:
  477. description: successful operation
  478. content:
  479. application/json:
  480. schema:
  481. $ref: '#/components/schemas/ApiResponse'
  482. example:
  483. status: 200
  484. message: "Quota updated"
  485. error: ""
  486. 400:
  487. description: Bad request
  488. content:
  489. application/json:
  490. schema:
  491. $ref: '#/components/schemas/ApiResponse'
  492. example:
  493. status: 400
  494. message: ""
  495. error: "Error description if any"
  496. 401:
  497. description: Unauthorized
  498. content:
  499. application/json:
  500. schema:
  501. $ref: '#/components/schemas/ApiResponse'
  502. example:
  503. status: 401
  504. message: ""
  505. error: "Error description if any"
  506. 403:
  507. description: Forbidden
  508. content:
  509. application/json:
  510. schema:
  511. $ref: '#/components/schemas/ApiResponse'
  512. example:
  513. status: 403
  514. message: ""
  515. error: "Error description if any"
  516. 404:
  517. description: Not Found
  518. content:
  519. application/json:
  520. schema:
  521. $ref: '#/components/schemas/ApiResponse'
  522. example:
  523. status: 404
  524. message: ""
  525. error: "Error description if any"
  526. 409:
  527. description: A quota scan is in progress for this folder
  528. content:
  529. application/json:
  530. schema:
  531. $ref: '#/components/schemas/ApiResponse'
  532. example:
  533. status: 409
  534. message: "A quota scan is in progress"
  535. error: "Error description if any"
  536. 500:
  537. description: Internal Server Error
  538. content:
  539. application/json:
  540. schema:
  541. $ref: '#/components/schemas/ApiResponse'
  542. example:
  543. status: 500
  544. message: ""
  545. error: "Error description if any"
  546. /folder_quota_scan:
  547. get:
  548. tags:
  549. - quota
  550. summary: Get the active quota scans for folders
  551. operationId: get_folders_quota_scans
  552. responses:
  553. 200:
  554. description: successful operation
  555. content:
  556. application/json:
  557. schema:
  558. type: array
  559. items:
  560. $ref : '#/components/schemas/FolderQuotaScan'
  561. 401:
  562. description: Unauthorized
  563. content:
  564. application/json:
  565. schema:
  566. $ref: '#/components/schemas/ApiResponse'
  567. example:
  568. status: 401
  569. message: ""
  570. error: "Error description if any"
  571. 403:
  572. description: Forbidden
  573. content:
  574. application/json:
  575. schema:
  576. $ref: '#/components/schemas/ApiResponse'
  577. example:
  578. status: 403
  579. message: ""
  580. error: "Error description if any"
  581. 500:
  582. description: Internal Server Error
  583. content:
  584. application/json:
  585. schema:
  586. $ref: '#/components/schemas/ApiResponse'
  587. example:
  588. status: 500
  589. message: ""
  590. error: "Error description if any"
  591. post:
  592. tags:
  593. - quota
  594. summary: start a new folder quota scan
  595. description: A quota scan update the number of files and their total size for the specified folder
  596. operationId: start_folder_quota_scan
  597. requestBody:
  598. required: true
  599. content:
  600. application/json:
  601. schema:
  602. $ref : '#/components/schemas/BaseVirtualFolder'
  603. responses:
  604. 201:
  605. description: successful operation
  606. content:
  607. application/json:
  608. schema:
  609. $ref: '#/components/schemas/ApiResponse'
  610. example:
  611. status: 201
  612. message: "Scan started"
  613. error: ""
  614. 400:
  615. description: Bad request
  616. content:
  617. application/json:
  618. schema:
  619. $ref: '#/components/schemas/ApiResponse'
  620. example:
  621. status: 400
  622. message: ""
  623. error: "Error description if any"
  624. 401:
  625. description: Unauthorized
  626. content:
  627. application/json:
  628. schema:
  629. $ref: '#/components/schemas/ApiResponse'
  630. example:
  631. status: 401
  632. message: ""
  633. error: "Error description if any"
  634. 403:
  635. description: Forbidden
  636. content:
  637. application/json:
  638. schema:
  639. $ref: '#/components/schemas/ApiResponse'
  640. example:
  641. status: 403
  642. message: ""
  643. error: "Error description if any"
  644. 404:
  645. description: Not Found
  646. content:
  647. application/json:
  648. schema:
  649. $ref: '#/components/schemas/ApiResponse'
  650. example:
  651. status: 404
  652. message: ""
  653. error: "Error description if any"
  654. 409:
  655. description: Another scan is already in progress for this user
  656. content:
  657. application/json:
  658. schema:
  659. $ref: '#/components/schemas/ApiResponse'
  660. example:
  661. status: 409
  662. message: "Another scan is already in progress"
  663. error: "Error description if any"
  664. 500:
  665. description: Internal Server Error
  666. content:
  667. application/json:
  668. schema:
  669. $ref: '#/components/schemas/ApiResponse'
  670. example:
  671. status: 500
  672. message: ""
  673. error: "Error description if any"
  674. /folder:
  675. get:
  676. tags:
  677. - folders
  678. summary: Returns an array with one or more folders
  679. operationId: get_folders
  680. parameters:
  681. - in: query
  682. name: offset
  683. schema:
  684. type: integer
  685. minimum: 0
  686. default: 0
  687. required: false
  688. - in: query
  689. name: limit
  690. schema:
  691. type: integer
  692. minimum: 1
  693. maximum: 500
  694. default: 100
  695. required: false
  696. description: The maximum number of items to return. Max value is 500, default is 100
  697. - in: query
  698. name: order
  699. required: false
  700. description: Ordering folders by path. Default ASC
  701. schema:
  702. type: string
  703. enum:
  704. - ASC
  705. - DESC
  706. example: ASC
  707. - in: query
  708. name: folder_path
  709. required: false
  710. description: Filter by folder path, extact match case sensitive
  711. schema:
  712. type: string
  713. responses:
  714. 200:
  715. description: successful operation
  716. content:
  717. application/json:
  718. schema:
  719. type: array
  720. items:
  721. $ref : '#/components/schemas/BaseVirtualFolder'
  722. 400:
  723. description: Bad request
  724. content:
  725. application/json:
  726. schema:
  727. $ref: '#/components/schemas/ApiResponse'
  728. example:
  729. status: 400
  730. message: ""
  731. error: "Error description if any"
  732. 401:
  733. description: Unauthorized
  734. content:
  735. application/json:
  736. schema:
  737. $ref: '#/components/schemas/ApiResponse'
  738. example:
  739. status: 401
  740. message: ""
  741. error: "Error description if any"
  742. 403:
  743. description: Forbidden
  744. content:
  745. application/json:
  746. schema:
  747. $ref: '#/components/schemas/ApiResponse'
  748. example:
  749. status: 403
  750. message: ""
  751. error: "Error description if any"
  752. 500:
  753. description: Internal Server Error
  754. content:
  755. application/json:
  756. schema:
  757. $ref: '#/components/schemas/ApiResponse'
  758. example:
  759. status: 500
  760. message: ""
  761. error: "Error description if any"
  762. post:
  763. tags:
  764. - folders
  765. summary: Adds a new folder
  766. operationId: add_folder
  767. description: a new folder with the specified mapped_path will be added. To update the used quota parameters a quota scan is needed
  768. requestBody:
  769. required: true
  770. content:
  771. application/json:
  772. schema:
  773. $ref : '#/components/schemas/BaseVirtualFolder'
  774. responses:
  775. 200:
  776. description: successful operation
  777. content:
  778. application/json:
  779. schema:
  780. $ref : '#/components/schemas/BaseVirtualFolder'
  781. 400:
  782. description: Bad request
  783. content:
  784. application/json:
  785. schema:
  786. $ref: '#/components/schemas/ApiResponse'
  787. example:
  788. status: 400
  789. message: ""
  790. error: "Error description if any"
  791. 401:
  792. description: Unauthorized
  793. content:
  794. application/json:
  795. schema:
  796. $ref: '#/components/schemas/ApiResponse'
  797. example:
  798. status: 401
  799. message: ""
  800. error: "Error description if any"
  801. 403:
  802. description: Forbidden
  803. content:
  804. application/json:
  805. schema:
  806. $ref: '#/components/schemas/ApiResponse'
  807. example:
  808. status: 403
  809. message: ""
  810. error: "Error description if any"
  811. 500:
  812. description: Internal Server Error
  813. content:
  814. application/json:
  815. schema:
  816. $ref: '#/components/schemas/ApiResponse'
  817. example:
  818. status: 500
  819. message: ""
  820. error: "Error description if any"
  821. delete:
  822. tags:
  823. - folders
  824. summary: Delete an existing folder
  825. operationId: delete_folder
  826. parameters:
  827. - name: folder_path
  828. in: query
  829. description: path to the folder to delete
  830. required: true
  831. schema:
  832. type: string
  833. responses:
  834. 200:
  835. description: successful operation
  836. content:
  837. application/json:
  838. schema:
  839. $ref : '#/components/schemas/ApiResponse'
  840. example:
  841. status: 200
  842. message: "Folder deleted"
  843. error: ""
  844. 400:
  845. description: Bad request
  846. content:
  847. application/json:
  848. schema:
  849. $ref: '#/components/schemas/ApiResponse'
  850. example:
  851. status: 400
  852. message: ""
  853. error: "Error description if any"
  854. 401:
  855. description: Unauthorized
  856. content:
  857. application/json:
  858. schema:
  859. $ref: '#/components/schemas/ApiResponse'
  860. example:
  861. status: 401
  862. message: ""
  863. error: "Error description if any"
  864. 403:
  865. description: Forbidden
  866. content:
  867. application/json:
  868. schema:
  869. $ref: '#/components/schemas/ApiResponse'
  870. example:
  871. status: 403
  872. message: ""
  873. error: "Error description if any"
  874. 404:
  875. description: Not Found
  876. content:
  877. application/json:
  878. schema:
  879. $ref: '#/components/schemas/ApiResponse'
  880. example:
  881. status: 404
  882. message: ""
  883. error: "Error description if any"
  884. 500:
  885. description: Internal Server Error
  886. content:
  887. application/json:
  888. schema:
  889. $ref: '#/components/schemas/ApiResponse'
  890. example:
  891. status: 500
  892. message: ""
  893. error: "Error description if any"
  894. /user:
  895. get:
  896. tags:
  897. - users
  898. summary: Returns an array with one or more users
  899. description: For security reasons hashed passwords are omitted in the response
  900. operationId: get_users
  901. parameters:
  902. - in: query
  903. name: offset
  904. schema:
  905. type: integer
  906. minimum: 0
  907. default: 0
  908. required: false
  909. - in: query
  910. name: limit
  911. schema:
  912. type: integer
  913. minimum: 1
  914. maximum: 500
  915. default: 100
  916. required: false
  917. description: The maximum number of items to return. Max value is 500, default is 100
  918. - in: query
  919. name: order
  920. required: false
  921. description: Ordering users by username. Default ASC
  922. schema:
  923. type: string
  924. enum:
  925. - ASC
  926. - DESC
  927. example: ASC
  928. - in: query
  929. name: username
  930. required: false
  931. description: Filter by username, extact match case sensitive
  932. schema:
  933. type: string
  934. responses:
  935. 200:
  936. description: successful operation
  937. content:
  938. application/json:
  939. schema:
  940. type: array
  941. items:
  942. $ref : '#/components/schemas/User'
  943. 400:
  944. description: Bad request
  945. content:
  946. application/json:
  947. schema:
  948. $ref: '#/components/schemas/ApiResponse'
  949. example:
  950. status: 400
  951. message: ""
  952. error: "Error description if any"
  953. 401:
  954. description: Unauthorized
  955. content:
  956. application/json:
  957. schema:
  958. $ref: '#/components/schemas/ApiResponse'
  959. example:
  960. status: 401
  961. message: ""
  962. error: "Error description if any"
  963. 403:
  964. description: Forbidden
  965. content:
  966. application/json:
  967. schema:
  968. $ref: '#/components/schemas/ApiResponse'
  969. example:
  970. status: 403
  971. message: ""
  972. error: "Error description if any"
  973. 500:
  974. description: Internal Server Error
  975. content:
  976. application/json:
  977. schema:
  978. $ref: '#/components/schemas/ApiResponse'
  979. example:
  980. status: 500
  981. message: ""
  982. error: "Error description if any"
  983. post:
  984. tags:
  985. - users
  986. summary: Adds a new user
  987. operationId: add_user
  988. requestBody:
  989. required: true
  990. content:
  991. application/json:
  992. schema:
  993. $ref : '#/components/schemas/User'
  994. responses:
  995. 200:
  996. description: successful operation
  997. content:
  998. application/json:
  999. schema:
  1000. $ref : '#/components/schemas/User'
  1001. 400:
  1002. description: Bad request
  1003. content:
  1004. application/json:
  1005. schema:
  1006. $ref: '#/components/schemas/ApiResponse'
  1007. example:
  1008. status: 400
  1009. message: ""
  1010. error: "Error description if any"
  1011. 401:
  1012. description: Unauthorized
  1013. content:
  1014. application/json:
  1015. schema:
  1016. $ref: '#/components/schemas/ApiResponse'
  1017. example:
  1018. status: 401
  1019. message: ""
  1020. error: "Error description if any"
  1021. 403:
  1022. description: Forbidden
  1023. content:
  1024. application/json:
  1025. schema:
  1026. $ref: '#/components/schemas/ApiResponse'
  1027. example:
  1028. status: 403
  1029. message: ""
  1030. error: "Error description if any"
  1031. 500:
  1032. description: Internal Server Error
  1033. content:
  1034. application/json:
  1035. schema:
  1036. $ref: '#/components/schemas/ApiResponse'
  1037. example:
  1038. status: 500
  1039. message: ""
  1040. error: "Error description if any"
  1041. /user/{userID}:
  1042. get:
  1043. tags:
  1044. - users
  1045. summary: Find user by ID
  1046. description: For security reasons the hashed password is omitted in the response
  1047. operationId: get_user_by_id
  1048. parameters:
  1049. - name: userID
  1050. in: path
  1051. description: ID of the user to retrieve
  1052. required: true
  1053. schema:
  1054. type: integer
  1055. format: int32
  1056. responses:
  1057. 200:
  1058. description: successful operation
  1059. content:
  1060. application/json:
  1061. schema:
  1062. $ref : '#/components/schemas/User'
  1063. 400:
  1064. description: Bad request
  1065. content:
  1066. application/json:
  1067. schema:
  1068. $ref: '#/components/schemas/ApiResponse'
  1069. example:
  1070. status: 400
  1071. message: ""
  1072. error: "Error description if any"
  1073. 401:
  1074. description: Unauthorized
  1075. content:
  1076. application/json:
  1077. schema:
  1078. $ref: '#/components/schemas/ApiResponse'
  1079. example:
  1080. status: 401
  1081. message: ""
  1082. error: "Error description if any"
  1083. 403:
  1084. description: Forbidden
  1085. content:
  1086. application/json:
  1087. schema:
  1088. $ref: '#/components/schemas/ApiResponse'
  1089. example:
  1090. status: 403
  1091. message: ""
  1092. error: "Error description if any"
  1093. 404:
  1094. description: Not Found
  1095. content:
  1096. application/json:
  1097. schema:
  1098. $ref: '#/components/schemas/ApiResponse'
  1099. example:
  1100. status: 404
  1101. message: ""
  1102. error: "Error description if any"
  1103. 500:
  1104. description: Internal Server Error
  1105. content:
  1106. application/json:
  1107. schema:
  1108. $ref: '#/components/schemas/ApiResponse'
  1109. example:
  1110. status: 500
  1111. message: ""
  1112. error: "Error description if any"
  1113. put:
  1114. tags:
  1115. - users
  1116. summary: Update an existing user
  1117. operationId: update_user
  1118. parameters:
  1119. - name: userID
  1120. in: path
  1121. description: ID of the user to update
  1122. required: true
  1123. schema:
  1124. type: integer
  1125. format: int32
  1126. requestBody:
  1127. required: true
  1128. content:
  1129. application/json:
  1130. schema:
  1131. $ref : '#/components/schemas/User'
  1132. responses:
  1133. 200:
  1134. description: successful operation
  1135. content:
  1136. application/json:
  1137. schema:
  1138. $ref : '#/components/schemas/ApiResponse'
  1139. example:
  1140. status: 200
  1141. message: "User updated"
  1142. error: ""
  1143. 400:
  1144. description: Bad request
  1145. content:
  1146. application/json:
  1147. schema:
  1148. $ref: '#/components/schemas/ApiResponse'
  1149. example:
  1150. status: 400
  1151. message: ""
  1152. error: "Error description if any"
  1153. 401:
  1154. description: Unauthorized
  1155. content:
  1156. application/json:
  1157. schema:
  1158. $ref: '#/components/schemas/ApiResponse'
  1159. example:
  1160. status: 401
  1161. message: ""
  1162. error: "Error description if any"
  1163. 403:
  1164. description: Forbidden
  1165. content:
  1166. application/json:
  1167. schema:
  1168. $ref: '#/components/schemas/ApiResponse'
  1169. example:
  1170. status: 403
  1171. message: ""
  1172. error: "Error description if any"
  1173. 404:
  1174. description: Not Found
  1175. content:
  1176. application/json:
  1177. schema:
  1178. $ref: '#/components/schemas/ApiResponse'
  1179. example:
  1180. status: 404
  1181. message: ""
  1182. error: "Error description if any"
  1183. 500:
  1184. description: Internal Server Error
  1185. content:
  1186. application/json:
  1187. schema:
  1188. $ref: '#/components/schemas/ApiResponse'
  1189. example:
  1190. status: 500
  1191. message: ""
  1192. error: "Error description if any"
  1193. delete:
  1194. tags:
  1195. - users
  1196. summary: Delete an existing user
  1197. operationId: delete_user
  1198. parameters:
  1199. - name: userID
  1200. in: path
  1201. description: ID of the user to delete
  1202. required: true
  1203. schema:
  1204. type: integer
  1205. format: int32
  1206. responses:
  1207. 200:
  1208. description: successful operation
  1209. content:
  1210. application/json:
  1211. schema:
  1212. $ref : '#/components/schemas/ApiResponse'
  1213. example:
  1214. status: 200
  1215. message: "User deleted"
  1216. error: ""
  1217. 400:
  1218. description: Bad request
  1219. content:
  1220. application/json:
  1221. schema:
  1222. $ref: '#/components/schemas/ApiResponse'
  1223. example:
  1224. status: 400
  1225. message: ""
  1226. error: "Error description if any"
  1227. 401:
  1228. description: Unauthorized
  1229. content:
  1230. application/json:
  1231. schema:
  1232. $ref: '#/components/schemas/ApiResponse'
  1233. example:
  1234. status: 401
  1235. message: ""
  1236. error: "Error description if any"
  1237. 403:
  1238. description: Forbidden
  1239. content:
  1240. application/json:
  1241. schema:
  1242. $ref: '#/components/schemas/ApiResponse'
  1243. example:
  1244. status: 403
  1245. message: ""
  1246. error: "Error description if any"
  1247. 404:
  1248. description: Not Found
  1249. content:
  1250. application/json:
  1251. schema:
  1252. $ref: '#/components/schemas/ApiResponse'
  1253. example:
  1254. status: 404
  1255. message: ""
  1256. error: "Error description if any"
  1257. 500:
  1258. description: Internal Server Error
  1259. content:
  1260. application/json:
  1261. schema:
  1262. $ref: '#/components/schemas/ApiResponse'
  1263. example:
  1264. status: 500
  1265. message: ""
  1266. error: "Error description if any"
  1267. /dumpdata:
  1268. get:
  1269. tags:
  1270. - maintenance
  1271. summary: Backup SFTPGo data serializing them as JSON
  1272. description: The backup is saved to a local file to avoid to expose users hashed passwords over the network. The output of dumpdata can be used as input for loaddata
  1273. operationId: dumpdata
  1274. parameters:
  1275. - in: query
  1276. name: output_file
  1277. schema:
  1278. type: string
  1279. required: true
  1280. 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
  1281. - in: query
  1282. name: indent
  1283. schema:
  1284. type: integer
  1285. enum:
  1286. - 0
  1287. - 1
  1288. description: >
  1289. indent:
  1290. * `0` no indentation. This is the default
  1291. * `1` format the output JSON
  1292. responses:
  1293. 200:
  1294. description: successful operation
  1295. content:
  1296. application/json:
  1297. schema:
  1298. $ref : '#/components/schemas/ApiResponse'
  1299. example:
  1300. status: 200
  1301. message: "Data saved"
  1302. error: ""
  1303. 400:
  1304. description: Bad request
  1305. content:
  1306. application/json:
  1307. schema:
  1308. $ref: '#/components/schemas/ApiResponse'
  1309. example:
  1310. status: 400
  1311. message: ""
  1312. error: "Error description if any"
  1313. 401:
  1314. description: Unauthorized
  1315. content:
  1316. application/json:
  1317. schema:
  1318. $ref: '#/components/schemas/ApiResponse'
  1319. example:
  1320. status: 401
  1321. message: ""
  1322. error: "Error description if any"
  1323. 403:
  1324. description: Forbidden
  1325. content:
  1326. application/json:
  1327. schema:
  1328. $ref: '#/components/schemas/ApiResponse'
  1329. example:
  1330. status: 403
  1331. message: ""
  1332. error: "Error description if any"
  1333. 500:
  1334. description: Internal Server Error
  1335. content:
  1336. application/json:
  1337. schema:
  1338. $ref: '#/components/schemas/ApiResponse'
  1339. example:
  1340. status: 500
  1341. message: ""
  1342. error: "Error description if any"
  1343. /loaddata:
  1344. get:
  1345. tags:
  1346. - maintenance
  1347. summary: Restore SFTPGo data from a JSON backup
  1348. description: Users and folders will be restored one by one and the restore is stopped if a user/folder cannot be added or updated, so it could happen a partial restore
  1349. operationId: loaddata
  1350. parameters:
  1351. - in: query
  1352. name: input_file
  1353. schema:
  1354. type: string
  1355. required: true
  1356. 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
  1357. - in: query
  1358. name: scan_quota
  1359. schema:
  1360. type: integer
  1361. enum:
  1362. - 0
  1363. - 1
  1364. - 2
  1365. description: >
  1366. Quota scan:
  1367. * `0` no quota scan is done, the imported users will have used_quota_size and used_quota_files = 0 or the existing values if they already exists. This is the default
  1368. * `1` scan quota
  1369. * `2` scan quota if the user has quota restrictions
  1370. required: false
  1371. - in: query
  1372. name: mode
  1373. schema:
  1374. type: integer
  1375. enum:
  1376. - 0
  1377. - 1
  1378. description: >
  1379. Mode:
  1380. * `0` New users are added, existing users are updated. This is the default
  1381. * `1` New users are added, existing users are not modified
  1382. responses:
  1383. 200:
  1384. description: successful operation
  1385. content:
  1386. application/json:
  1387. schema:
  1388. $ref : '#/components/schemas/ApiResponse'
  1389. example:
  1390. status: 200
  1391. message: "Data restored"
  1392. error: ""
  1393. 400:
  1394. description: Bad request
  1395. content:
  1396. application/json:
  1397. schema:
  1398. $ref: '#/components/schemas/ApiResponse'
  1399. example:
  1400. status: 400
  1401. message: ""
  1402. error: "Error description if any"
  1403. 401:
  1404. description: Unauthorized
  1405. content:
  1406. application/json:
  1407. schema:
  1408. $ref: '#/components/schemas/ApiResponse'
  1409. example:
  1410. status: 401
  1411. message: ""
  1412. error: "Error description if any"
  1413. 403:
  1414. description: Forbidden
  1415. content:
  1416. application/json:
  1417. schema:
  1418. $ref: '#/components/schemas/ApiResponse'
  1419. example:
  1420. status: 403
  1421. message: ""
  1422. error: "Error description if any"
  1423. 500:
  1424. description: Internal Server Error
  1425. content:
  1426. application/json:
  1427. schema:
  1428. $ref: '#/components/schemas/ApiResponse'
  1429. example:
  1430. status: 500
  1431. message: ""
  1432. error: "Error description if any"
  1433. components:
  1434. schemas:
  1435. Permission:
  1436. type: string
  1437. enum:
  1438. - '*'
  1439. - list
  1440. - download
  1441. - upload
  1442. - overwrite
  1443. - delete
  1444. - rename
  1445. - create_dirs
  1446. - create_symlinks
  1447. - chmod
  1448. - chown
  1449. - chtimes
  1450. description: >
  1451. Permissions:
  1452. * `*` - all permissions are granted
  1453. * `list` - list items is allowed
  1454. * `download` - download files is allowed
  1455. * `upload` - upload files is allowed
  1456. * `overwrite` - overwrite an existing file, while uploading, is allowed. upload permission is required to allow file overwrite
  1457. * `delete` - delete files or directories is allowed
  1458. * `rename` - rename files or directories is allowed
  1459. * `create_dirs` - create directories is allowed
  1460. * `create_symlinks` - create links is allowed
  1461. * `chmod` changing file or directory permissions is allowed
  1462. * `chown` changing file or directory owner and group is allowed
  1463. * `chtimes` changing file or directory access and modification time is allowed
  1464. DirPermissions:
  1465. type: object
  1466. additionalProperties:
  1467. type: array
  1468. items:
  1469. $ref: '#/components/schemas/Permission'
  1470. minItems: 1
  1471. minProperties: 1
  1472. 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
  1473. LoginMethods:
  1474. type: string
  1475. enum:
  1476. - 'publickey'
  1477. - 'password'
  1478. - 'keyboard-interactive'
  1479. - 'publickey+password'
  1480. - 'publickey+keyboard-interactive'
  1481. ExtensionsFilter:
  1482. type: object
  1483. properties:
  1484. path:
  1485. type: string
  1486. description: exposed SFTPGo 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
  1487. allowed_extensions:
  1488. type: array
  1489. items:
  1490. type: string
  1491. nullable: true
  1492. description: list of, case insensitive, allowed files extension. Shell like expansion is not supported so you have to specify `.jpg` and not `*.jpg`
  1493. example: [ ".jpg", ".png" ]
  1494. denied_extensions:
  1495. type: array
  1496. items:
  1497. type: string
  1498. nullable: true
  1499. description: list of, case insensitive, denied files extension. Denied file extensions are evaluated before the allowed ones
  1500. example: [ ".zip" ]
  1501. UserFilters:
  1502. type: object
  1503. properties:
  1504. allowed_ip:
  1505. type: array
  1506. items:
  1507. type: string
  1508. nullable: true
  1509. 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"
  1510. example: [ "192.0.2.0/24", "2001:db8::/32" ]
  1511. denied_ip:
  1512. type: array
  1513. items:
  1514. type: string
  1515. nullable: true
  1516. description: clients connecting from these IP/Mask are not allowed. Denied rules are evaluated before allowed ones
  1517. example: [ "172.16.0.0/16" ]
  1518. denied_login_methods:
  1519. type: array
  1520. items:
  1521. $ref: '#/components/schemas/LoginMethods'
  1522. nullable: true
  1523. description: if null or empty any available login method is allowed
  1524. file_extensions:
  1525. type: array
  1526. items:
  1527. $ref: '#/components/schemas/ExtensionsFilter'
  1528. nullable: true
  1529. description: filters based on file extensions. 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 listed in the list of files. Please note that these restrictions can be easily bypassed
  1530. max_upload_file_size:
  1531. type: integer
  1532. format: int64
  1533. nullable: true
  1534. 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`
  1535. description: Additional restrictions
  1536. S3Config:
  1537. type: object
  1538. properties:
  1539. bucket:
  1540. type: string
  1541. minLength: 1
  1542. region:
  1543. type: string
  1544. minLength: 1
  1545. access_key:
  1546. type: string
  1547. minLength: 1
  1548. access_secret:
  1549. type: string
  1550. minLength: 1
  1551. description: the access secret is stored encrypted (AES-256-GCM)
  1552. endpoint:
  1553. type: string
  1554. description: optional endpoint
  1555. storage_class:
  1556. type: string
  1557. upload_part_size:
  1558. type: integer
  1559. 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.
  1560. upload_concurrency:
  1561. type: integer
  1562. description: the number of parts to upload in parallel. If this value is set to zero, the default value (2) will be used
  1563. key_prefix:
  1564. type: string
  1565. 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
  1566. example: folder/subfolder/
  1567. required:
  1568. - bucket
  1569. - region
  1570. nullable: true
  1571. description: S3 Compatible Object Storage configuration details
  1572. GCSConfig:
  1573. type: object
  1574. properties:
  1575. bucket:
  1576. type: string
  1577. minLength: 1
  1578. credentials:
  1579. type: string
  1580. format: byte
  1581. description: Google Cloud Storage JSON credentials base64 encoded. This 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. The credentials will be stored in the configured "credentials_path"
  1582. automatic_credentials:
  1583. type: integer
  1584. nullable: true
  1585. enum:
  1586. - 0
  1587. - 1
  1588. description: >
  1589. Automatic credentials:
  1590. * `0` - disabled, explicit credentials, using a JSON credentials file, must be provided. This is the default value if the field is null
  1591. * `1` - enabled, we try to use the Application Default Credentials (ADC) strategy to find your application's credentials
  1592. storage_class:
  1593. type: string
  1594. key_prefix:
  1595. type: string
  1596. 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
  1597. example: folder/subfolder/
  1598. required:
  1599. - bucket
  1600. nullable: true
  1601. description: Google Cloud Storage configuration details
  1602. FilesystemConfig:
  1603. type: object
  1604. properties:
  1605. provider:
  1606. type: integer
  1607. enum:
  1608. - 0
  1609. - 1
  1610. - 2
  1611. description: >
  1612. Providers:
  1613. * `0` - local filesystem
  1614. * `1` - S3 Compatible Object Storage
  1615. * `2` - Google Cloud Storage
  1616. s3config:
  1617. $ref: '#/components/schemas/S3Config'
  1618. gcsconfig:
  1619. $ref: '#/components/schemas/GCSConfig'
  1620. description: Storage filesystem details
  1621. BaseVirtualFolder:
  1622. type: object
  1623. properties:
  1624. id:
  1625. type: integer
  1626. format: int32
  1627. minimum: 1
  1628. mapped_path:
  1629. type: string
  1630. description: absolute filesystem path to use as virtual folder. This field is unique
  1631. used_quota_size:
  1632. type: integer
  1633. format: int64
  1634. used_quota_files:
  1635. type: integer
  1636. format: int32
  1637. last_quota_update:
  1638. type: integer
  1639. format: int64
  1640. description: Last quota update as unix timestamp in milliseconds
  1641. users:
  1642. type: array
  1643. nullable: true
  1644. items:
  1645. type: string
  1646. description: list of usernames associated with this virtual folder
  1647. required:
  1648. - mapped_path
  1649. description: defines the path 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.
  1650. VirtualFolder:
  1651. allOf:
  1652. - $ref: '#/components/schemas/BaseVirtualFolder'
  1653. - type: object
  1654. properties:
  1655. virtual_path:
  1656. type: string
  1657. quota_size:
  1658. type: integer
  1659. format: int64
  1660. 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
  1661. quota_files:
  1662. type: integer
  1663. format: int32
  1664. 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
  1665. required:
  1666. - virtual_path
  1667. 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.
  1668. User:
  1669. type: object
  1670. properties:
  1671. id:
  1672. type: integer
  1673. format: int32
  1674. minimum: 1
  1675. status:
  1676. type: integer
  1677. enum:
  1678. - 0
  1679. - 1
  1680. description: >
  1681. status:
  1682. * `0` user is disabled, login is not allowed
  1683. * `1` user is enabled
  1684. username:
  1685. type: string
  1686. description: username is unique
  1687. expiration_date:
  1688. type: integer
  1689. format: int64
  1690. description: expiration date as unix timestamp in milliseconds. An expired account cannot login. 0 means no expiration
  1691. password:
  1692. type: string
  1693. nullable: true
  1694. description: password or public key/SSH user certificate are mandatory. If the password has no known hashing algo prefix it will be stored using argon2id. You can send a password hashed as bcrypt or pbkdf2 and it will be stored as is. For security reasons this field is omitted when you search/get users
  1695. public_keys:
  1696. type: array
  1697. items:
  1698. type: string
  1699. nullable: true
  1700. description: a password or at least one public key/SSH user certificate are mandatory.
  1701. home_dir:
  1702. type: string
  1703. 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
  1704. virtual_folders:
  1705. type: array
  1706. items:
  1707. $ref: '#/components/schemas/VirtualFolder'
  1708. nullable: true
  1709. 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
  1710. uid:
  1711. type: integer
  1712. format: int32
  1713. minimum: 0
  1714. maximum: 65535
  1715. 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
  1716. gid:
  1717. type: integer
  1718. format: int32
  1719. minimum: 0
  1720. maximum: 65535
  1721. 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
  1722. max_sessions:
  1723. type: integer
  1724. format: int32
  1725. description: Limit the sessions that a user can open. 0 means unlimited
  1726. quota_size:
  1727. type: integer
  1728. format: int64
  1729. 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
  1730. quota_files:
  1731. type: integer
  1732. format: int32
  1733. 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
  1734. permissions:
  1735. type: object
  1736. items:
  1737. $ref: '#/components/schemas/DirPermissions'
  1738. minItems: 1
  1739. example: {"/":["*"],"/somedir":["list","download"]}
  1740. used_quota_size:
  1741. type: integer
  1742. format: int64
  1743. used_quota_files:
  1744. type: integer
  1745. format: int32
  1746. last_quota_update:
  1747. type: integer
  1748. format: int64
  1749. description: Last quota update as unix timestamp in milliseconds
  1750. upload_bandwidth:
  1751. type: integer
  1752. format: int32
  1753. description: Maximum upload bandwidth as KB/s, 0 means unlimited
  1754. download_bandwidth:
  1755. type: integer
  1756. format: int32
  1757. description: Maximum download bandwidth as KB/s, 0 means unlimited
  1758. last_login:
  1759. type: integer
  1760. format: int64
  1761. description: Last user login as unix timestamp in milliseconds
  1762. filters:
  1763. $ref: '#/components/schemas/UserFilters'
  1764. filesystem:
  1765. $ref: '#/components/schemas/FilesystemConfig'
  1766. Transfer:
  1767. type: object
  1768. properties:
  1769. operation_type:
  1770. type: string
  1771. enum:
  1772. - upload
  1773. - download
  1774. path:
  1775. type: string
  1776. description: file path for the upload/download
  1777. start_time:
  1778. type: integer
  1779. format: int64
  1780. description: start time as unix timestamp in milliseconds
  1781. size:
  1782. type: integer
  1783. format: int64
  1784. description: bytes transferred
  1785. ConnectionStatus:
  1786. type: object
  1787. properties:
  1788. username:
  1789. type: string
  1790. description: connected username
  1791. connection_id:
  1792. type: string
  1793. description: unique connection identifier
  1794. client_version:
  1795. type: string
  1796. nullable: true
  1797. description: client version
  1798. remote_address:
  1799. type: string
  1800. description: Remote address for the connected client
  1801. connection_time:
  1802. type: integer
  1803. format: int64
  1804. description: connection time as unix timestamp in milliseconds
  1805. command:
  1806. type: string
  1807. nullable: true
  1808. description: SSH command or WebDAV method
  1809. last_activity:
  1810. type: integer
  1811. format: int64
  1812. description: last client activity as unix timestamp in milliseconds
  1813. protocol:
  1814. type: string
  1815. enum:
  1816. - SFTP
  1817. - SCP
  1818. - SSH
  1819. - FTP
  1820. - DAV
  1821. active_transfers:
  1822. type: array
  1823. nullable: true
  1824. items:
  1825. $ref : '#/components/schemas/Transfer'
  1826. QuotaScan:
  1827. type: object
  1828. properties:
  1829. username:
  1830. type: string
  1831. description: username with an active scan
  1832. start_time:
  1833. type: integer
  1834. format: int64
  1835. description: scan start time as unix timestamp in milliseconds
  1836. FolderQuotaScan:
  1837. type: object
  1838. properties:
  1839. mapped_path:
  1840. type: string
  1841. description: path with an active scan
  1842. start_time:
  1843. type: integer
  1844. format: int64
  1845. description: scan start time as unix timestamp in milliseconds
  1846. ApiResponse:
  1847. type: object
  1848. properties:
  1849. status:
  1850. type: integer
  1851. format: int32
  1852. minimum: 200
  1853. maximum: 509
  1854. example: 200
  1855. description: HTTP Status code, for example 200 OK, 400 Bad request and so on
  1856. message:
  1857. type: string
  1858. nullable: true
  1859. description: additional message if any
  1860. error:
  1861. type: string
  1862. nullable: true
  1863. description: error description if any
  1864. VersionInfo:
  1865. type: object
  1866. properties:
  1867. version:
  1868. type: string
  1869. build_date:
  1870. type: string
  1871. commit_hash:
  1872. type: string
  1873. features:
  1874. type: array
  1875. items:
  1876. type: string
  1877. 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
  1878. securitySchemes:
  1879. BasicAuth:
  1880. type: http
  1881. scheme: basic