2020-09-06 09:40:31 +00:00
openapi : 3.0 .3
2021-03-06 16:08:24 +00:00
tags :
- name : healthcheck
- name : token
- name : maintenance
- name : admins
- name : connections
- name : defender
- name : quota
- name : folders
- name : users
2019-07-20 10:26:52 +00:00
info :
title : SFTPGo
2020-12-08 10:18:34 +00:00
description : SFTPGo REST API
2021-03-21 18:15:47 +00:00
version : 2.0 .4
2021-03-06 16:08:24 +00:00
contact :
url : 'https://github.com/drakkan/sftpgo'
license :
name : AGPLv3
url : 'https://www.gnu.org/licenses/agpl-3.0.en.html'
2019-07-20 10:26:52 +00:00
servers :
2021-01-17 21:29:08 +00:00
- url : /api/v2
2020-02-03 23:08:00 +00:00
security :
2021-01-17 21:29:08 +00:00
- BearerAuth : [ ]
2019-07-20 10:26:52 +00:00
paths :
2020-11-01 09:39:10 +00:00
/healthz :
get :
2020-11-22 20:53:04 +00:00
security : [ ]
2020-11-01 09:39:10 +00:00
servers :
2021-03-06 16:08:24 +00:00
- url : /
2020-11-01 09:39:10 +00:00
tags :
- healthcheck
summary : health check
2021-03-07 17:41:56 +00:00
description : This endpoint can be used to check if the application is running and responding to requests
2021-03-06 16:08:24 +00:00
operationId : healthz
2020-11-01 09:39:10 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2020-11-01 09:39:10 +00:00
description : successful operation
content :
text/plain :
schema :
type : string
example : ok
2021-01-17 21:29:08 +00:00
/token :
get :
security :
- BasicAuth : [ ]
tags :
- token
2021-03-07 17:41:56 +00:00
summary : Get a new access token
2021-03-06 16:08:24 +00:00
description : Returns an access token and its expiration
2021-01-17 21:29:08 +00:00
operationId : get_token
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-01-17 21:29:08 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/Token'
'401' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-01-26 21:35:36 +00:00
/logout :
get :
tags :
- token
2021-03-07 17:41:56 +00:00
summary : Invalidate
2021-03-06 16:08:24 +00:00
description : Allows to invalidate a token before its expiration
2021-01-26 21:35:36 +00:00
operationId : logout
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-01-26 21:35:36 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/ApiResponse'
'401' :
2021-01-26 21:35:36 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-01-26 21:35:36 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2021-01-26 21:35:36 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2019-08-08 08:01:33 +00:00
/version :
get :
tags :
2020-12-08 10:18:34 +00:00
- maintenance
2019-08-08 08:01:33 +00:00
summary : Get version details
2021-03-07 17:41:56 +00:00
description : 'Returns version details such as the version number, build date, commit hash and enabled features'
2019-08-08 08:01:33 +00:00
operationId : get_version
responses :
2021-03-06 16:08:24 +00:00
'200' :
2019-08-08 08:01:33 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/VersionInfo'
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-01-17 21:29:08 +00:00
/changepwd/admin :
put :
tags :
- admins
2021-03-06 16:08:24 +00:00
summary : Change admin password
2021-03-07 17:41:56 +00:00
description : Changes the password for the logged in admin
2021-01-17 21:29:08 +00:00
operationId : change_admin_password
requestBody :
required : true
content :
application/json :
schema :
$ref : '#/components/schemas/PwdChange'
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-01-17 21:29:08 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/ApiResponse'
'401' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
/connections :
2019-07-20 10:26:52 +00:00
get :
tags :
2020-11-01 09:39:10 +00:00
- connections
2021-03-06 16:08:24 +00:00
summary : Get connections details
2021-03-07 17:41:56 +00:00
description : Returns the active users and info about their current uploads/downloads
2019-08-24 12:41:15 +00:00
operationId : get_connections
2019-07-20 10:26:52 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2019-07-20 10:26:52 +00:00
description : successful operation
content :
application/json :
schema :
type : array
items :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/ConnectionStatus'
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-03-06 16:08:24 +00:00
'/connections/{connectionID}' :
2019-07-20 10:26:52 +00:00
delete :
tags :
2020-11-01 09:39:10 +00:00
- connections
2021-03-06 16:08:24 +00:00
summary : Close connection
2021-03-07 17:41:56 +00:00
description : Terminates an active connection
2019-08-24 12:41:15 +00:00
operationId : close_connection
2019-11-13 10:36:21 +00:00
parameters :
2020-11-01 09:39:10 +00:00
- name : connectionID
in : path
description : ID of the connection to close
required : true
schema :
type : string
2019-07-20 10:26:52 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2019-07-20 10:26:52 +00:00
description : successful operation
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
2019-11-13 10:36:21 +00:00
example :
2021-03-06 16:08:24 +00:00
message : Connection closed
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-01-17 21:29:08 +00:00
/defender/bantime :
2021-01-02 18:33:24 +00:00
get :
tags :
- defender
2021-03-06 16:08:24 +00:00
summary : Get ban time
description : Returns the ban time for the specified IPv4/IPv6 address
2021-01-02 18:33:24 +00:00
operationId : get_ban_time
parameters :
- in : query
name : ip
required : true
description : IPv4/IPv6 address
schema :
type : string
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-01-02 18:33:24 +00:00
description : successful operation
content :
application/json :
schema :
$ref : '#/components/schemas/BanStatus'
2021-03-06 16:08:24 +00:00
'401' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
/defender/unban :
post :
tags :
- defender
2021-03-07 17:41:56 +00:00
summary : Unban
description : Removes the specified IPv4/IPv6 from the banned ones
2021-01-02 18:33:24 +00:00
operationId : unban_host
requestBody :
required : true
content :
application/json :
schema :
type : object
properties :
ip :
type : string
description : IPv4/IPv6 address to remove
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-01-02 18:33:24 +00:00
description : successful operation
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
2021-03-06 16:08:24 +00:00
'400' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
/defender/score :
get :
tags :
- defender
2021-03-06 16:08:24 +00:00
summary : Get score
description : Returns the score for the specified IPv4/IPv6 address
2021-01-02 18:33:24 +00:00
operationId : get_score
parameters :
- in : query
name : ip
required : true
description : IPv4/IPv6 address
schema :
type : string
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-01-02 18:33:24 +00:00
description : successful operation
content :
application/json :
schema :
$ref : '#/components/schemas/ScoreStatus'
2021-03-06 16:08:24 +00:00
'401' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2021-01-02 18:33:24 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-01-17 21:29:08 +00:00
/quota-scans :
2019-07-20 10:26:52 +00:00
get :
tags :
2020-11-01 09:39:10 +00:00
- quota
2021-03-06 16:08:24 +00:00
summary : Get quota scans
2021-03-07 17:41:56 +00:00
description : Returns active user quota scans
2019-08-01 20:42:46 +00:00
operationId : get_quota_scans
2019-07-20 10:26:52 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2019-07-20 10:26:52 +00:00
description : successful operation
content :
application/json :
schema :
type : array
items :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/QuotaScan'
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2019-07-20 10:26:52 +00:00
post :
tags :
2020-11-01 09:39:10 +00:00
- quota
2021-03-07 17:41:56 +00:00
summary : Start user quota scan
description : Starts a new quota scan for the given user. A quota scan update the number of files and their total size for the specified user
2019-07-20 10:26:52 +00:00
operationId : start_quota_scan
requestBody :
required : true
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/User'
2019-07-20 10:26:52 +00:00
responses :
2021-03-06 16:08:24 +00:00
'202' :
2019-07-20 10:26:52 +00:00
description : successful operation
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
2019-11-13 10:36:21 +00:00
example :
2021-03-06 16:08:24 +00:00
message : Scan started
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'409' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Conflict'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-01-17 21:29:08 +00:00
/quota-update :
2020-06-20 10:38:04 +00:00
put :
tags :
2020-11-01 09:39:10 +00:00
- quota
2021-03-06 16:08:24 +00:00
summary : Update user quota limits
2021-03-07 17:41:56 +00:00
description : Sets the current used quota limits for the given user
2020-06-20 10:38:04 +00:00
operationId : quota_update
parameters :
- in : query
name : mode
required : false
description : the update mode specifies if the given quota usage values should be added or replace the current ones
schema :
type : string
2021-03-06 16:08:24 +00:00
enum :
- add
- reset
description : |
2020-06-20 10:38:04 +00:00
Update type :
* `add` - add the specified quota limits to the current used ones
* `reset` - reset the values to the specified ones. This is the default
example : reset
requestBody :
required : true
2021-03-06 16:08:24 +00:00
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'
2020-06-20 10:38:04 +00:00
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/User'
2020-06-20 10:38:04 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2020-06-20 10:38:04 +00:00
description : successful operation
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
example :
2021-03-06 16:08:24 +00:00
message : Quota updated
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'409' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Conflict'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-01-17 21:29:08 +00:00
/folder-quota-update :
2020-06-20 10:38:04 +00:00
put :
tags :
2020-11-01 09:39:10 +00:00
- quota
2021-03-07 17:41:56 +00:00
summary : Update folder quota limits
description : Sets the current used quota limits for the given folder
2020-06-20 10:38:04 +00:00
operationId : folder_quota_update
parameters :
- in : query
name : mode
required : false
description : the update mode specifies if the given quota usage values should be added or replace the current ones
schema :
type : string
2021-03-06 16:08:24 +00:00
enum :
- add
- reset
description : |
2020-06-20 10:38:04 +00:00
Update type :
* `add` - add the specified quota limits to the current used ones
* `reset` - reset the values to the specified ones. This is the default
example : reset
requestBody :
required : true
2021-03-06 16:08:24 +00:00
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'
2020-06-20 10:38:04 +00:00
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/BaseVirtualFolder'
2020-06-20 10:38:04 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2020-06-20 10:38:04 +00:00
description : successful operation
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
example :
2021-03-06 16:08:24 +00:00
message : Quota updated
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'409' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Conflict'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-01-17 21:29:08 +00:00
/folder-quota-scans :
2020-06-07 21:30:18 +00:00
get :
tags :
2020-11-01 09:39:10 +00:00
- quota
2021-03-06 16:08:24 +00:00
summary : Get folders quota scans
2021-03-07 17:41:56 +00:00
description : Returns the active quota scans for folders
2020-06-07 21:30:18 +00:00
operationId : get_folders_quota_scans
responses :
2021-03-06 16:08:24 +00:00
'200' :
2020-06-07 21:30:18 +00:00
description : successful operation
content :
application/json :
schema :
type : array
items :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/FolderQuotaScan'
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2020-06-07 21:30:18 +00:00
post :
tags :
2020-11-01 09:39:10 +00:00
- quota
2021-03-07 17:41:56 +00:00
summary : Start folder quota scan
2021-03-21 18:15:47 +00:00
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
2020-06-07 21:30:18 +00:00
operationId : start_folder_quota_scan
requestBody :
required : true
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/BaseVirtualFolder'
2020-06-07 21:30:18 +00:00
responses :
2021-03-06 16:08:24 +00:00
'202' :
2020-06-07 21:30:18 +00:00
description : successful operation
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
example :
2021-03-06 16:08:24 +00:00
message : Scan started
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'409' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Conflict'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-01-17 21:29:08 +00:00
/folders :
2020-06-07 21:30:18 +00:00
get :
tags :
2020-11-01 09:39:10 +00:00
- folders
2021-03-06 16:08:24 +00:00
summary : Get folders
description : Returns an array with one or more folders
2020-06-07 21:30:18 +00:00
operationId : get_folders
parameters :
- in : query
name : offset
schema :
type : integer
minimum : 0
default : 0
required : false
- in : query
name : limit
schema :
type : integer
minimum : 1
maximum : 500
default : 100
required : false
2021-03-06 16:08:24 +00:00
description : 'The maximum number of items to return. Max value is 500, default is 100'
2020-06-07 21:30:18 +00:00
- in : query
name : order
required : false
description : Ordering folders by path. Default ASC
schema :
2021-03-06 16:08:24 +00:00
type : string
enum :
- ASC
- DESC
example : ASC
2020-06-07 21:30:18 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2020-06-07 21:30:18 +00:00
description : successful operation
content :
application/json :
schema :
type : array
items :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/BaseVirtualFolder'
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2020-06-07 21:30:18 +00:00
post :
tags :
2020-11-01 09:39:10 +00:00
- folders
2021-03-07 17:41:56 +00:00
summary : Add folder
2020-06-07 21:30:18 +00:00
operationId : add_folder
2021-03-07 17:41:56 +00:00
description : Adds a new folder. A quota scan is required to update the used files/size
2020-06-07 21:30:18 +00:00
requestBody :
required : true
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/BaseVirtualFolder'
2020-06-07 21:30:18 +00:00
responses :
2021-03-06 16:08:24 +00:00
'201' :
2020-06-07 21:30:18 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/BaseVirtualFolder'
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-03-06 16:08:24 +00:00
'/folders/{name}' :
2021-02-01 18:04:15 +00:00
parameters :
- name : name
in : path
description : folder name
required : true
schema :
type : string
get :
tags :
- folders
2021-03-07 17:41:56 +00:00
summary : Find folders by name
description : Returns the folder with the given name if it exists.
2021-02-01 18:04:15 +00:00
operationId : get_folder_by_name
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-02-01 18:04:15 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/BaseVirtualFolder'
'400' :
2021-02-01 18:04:15 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2021-02-01 18:04:15 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-02-01 18:04:15 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2021-02-01 18:04:15 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2021-02-01 18:04:15 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
put :
tags :
- folders
2021-03-06 16:08:24 +00:00
summary : Update folder
2021-03-07 17:41:56 +00:00
description : Updates an existing folder
2021-02-01 18:04:15 +00:00
operationId : update_folder
requestBody :
required : true
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/BaseVirtualFolder'
2021-02-01 18:04:15 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-02-01 18:04:15 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/ApiResponse'
2021-02-01 18:04:15 +00:00
example :
2021-03-06 16:08:24 +00:00
message : User updated
'400' :
2021-02-01 18:04:15 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2021-02-01 18:04:15 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-02-01 18:04:15 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2021-02-01 18:04:15 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2021-02-01 18:04:15 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2020-06-07 21:30:18 +00:00
delete :
tags :
2020-11-01 09:39:10 +00:00
- folders
2021-03-06 16:08:24 +00:00
summary : Delete folder
2021-03-07 17:41:56 +00:00
description : Deletes an existing folder
2020-06-07 21:30:18 +00:00
operationId : delete_folder
responses :
2021-03-06 16:08:24 +00:00
'200' :
2020-06-07 21:30:18 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/ApiResponse'
2020-06-07 21:30:18 +00:00
example :
2021-03-06 16:08:24 +00:00
message : User deleted
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-01-17 21:29:08 +00:00
/admins :
2019-07-20 10:26:52 +00:00
get :
tags :
2021-01-17 21:29:08 +00:00
- admins
2021-03-07 17:41:56 +00:00
summary : Get admins
description : Returns an array with one or more admins. For security reasons hashed passwords are omitted in the response
2021-01-17 21:29:08 +00:00
operationId : get_admins
2019-07-20 10:26:52 +00:00
parameters :
- in : query
name : offset
schema :
type : integer
minimum : 0
default : 0
required : false
- in : query
name : limit
schema :
type : integer
minimum : 1
maximum : 500
default : 100
required : false
2021-03-06 16:08:24 +00:00
description : 'The maximum number of items to return. Max value is 500, default is 100'
2019-07-20 10:26:52 +00:00
- in : query
name : order
required : false
2021-01-17 21:29:08 +00:00
description : Ordering admins by username. Default ASC
2019-07-20 10:26:52 +00:00
schema :
2021-03-06 16:08:24 +00:00
type : string
enum :
- ASC
- DESC
example : ASC
2021-01-17 21:29:08 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-01-17 21:29:08 +00:00
description : successful operation
content :
application/json :
schema :
type : array
items :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/Admin'
'400' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
post :
tags :
- admins
2021-03-06 16:08:24 +00:00
summary : Add admin
2021-03-07 17:41:56 +00:00
description : Adds a new admin
2021-01-17 21:29:08 +00:00
operationId : add_admin
requestBody :
required : true
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/Admin'
examples :
example-1 :
value :
id : 1
status : 0
username : string
description : string
password : pa$$word
email : user@example.com
permissions :
- '*'
filters :
allow_list :
- 192.0 .2 .0 /24
- '2001:db8::/32'
additional_info : string
2021-01-17 21:29:08 +00:00
responses :
2021-03-06 16:08:24 +00:00
'201' :
2021-01-17 21:29:08 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/Admin'
'400' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-03-06 16:08:24 +00:00
'/admins/{username}' :
2021-02-01 18:04:15 +00:00
parameters :
- name : username
in : path
description : the admin username
required : true
schema :
type : string
2021-01-17 21:29:08 +00:00
get :
tags :
- admins
2021-03-07 17:41:56 +00:00
summary : Find admins by username
description : Returns the admin with the given username, if it exists. For security reasons the hashed password is omitted in the response
2021-01-17 21:29:08 +00:00
operationId : get_admin_by_username
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-01-17 21:29:08 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/Admin'
'400' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
put :
tags :
- admins
2021-03-06 16:08:24 +00:00
summary : Update admin
2021-03-07 17:41:56 +00:00
description : Updates an existing admin
2021-01-17 21:29:08 +00:00
operationId : update_admin
requestBody :
required : true
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/Admin'
2021-01-17 21:29:08 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-01-17 21:29:08 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/ApiResponse'
2021-01-17 21:29:08 +00:00
example :
2021-03-06 16:08:24 +00:00
message : Admin updated
'400' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
delete :
tags :
- admins
2021-03-06 16:08:24 +00:00
summary : Delete admin
2021-03-07 17:41:56 +00:00
description : Deletes an existing admin
2021-01-17 21:29:08 +00:00
operationId : delete_admin
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-01-17 21:29:08 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/ApiResponse'
2021-01-17 21:29:08 +00:00
example :
2021-03-06 16:08:24 +00:00
message : Admin deleted
'400' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2021-01-17 21:29:08 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
/users :
get :
tags :
- users
2021-03-07 17:41:56 +00:00
summary : Get users
description : Returns an array with one or more users. For security reasons hashed passwords are omitted in the response
2021-01-17 21:29:08 +00:00
operationId : get_users
parameters :
- in : query
name : offset
schema :
type : integer
minimum : 0
default : 0
required : false
- in : query
name : limit
schema :
type : integer
minimum : 1
maximum : 500
default : 100
required : false
2021-03-06 16:08:24 +00:00
description : 'The maximum number of items to return. Max value is 500, default is 100'
2019-07-20 10:26:52 +00:00
- in : query
2021-01-17 21:29:08 +00:00
name : order
2019-07-20 10:26:52 +00:00
required : false
2021-01-17 21:29:08 +00:00
description : Ordering users by username. Default ASC
2019-07-20 10:26:52 +00:00
schema :
2021-03-06 16:08:24 +00:00
type : string
enum :
- ASC
- DESC
example : ASC
2019-07-20 10:26:52 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2019-07-20 10:26:52 +00:00
description : successful operation
content :
application/json :
schema :
type : array
items :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/User'
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2019-07-20 10:26:52 +00:00
post :
tags :
2020-11-01 09:39:10 +00:00
- users
2021-03-06 16:08:24 +00:00
summary : Add user
2021-03-07 17:41:56 +00:00
description : Adds a new user
2019-07-20 10:26:52 +00:00
operationId : add_user
requestBody :
required : true
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/User'
2019-07-20 10:26:52 +00:00
responses :
2021-03-06 16:08:24 +00:00
'201' :
2019-07-20 10:26:52 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/User'
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2021-03-06 16:08:24 +00:00
'/users/{username}' :
2021-02-01 18:04:15 +00:00
parameters :
- name : username
in : path
description : the username
required : true
schema :
type : string
2019-07-20 10:26:52 +00:00
get :
tags :
2020-11-01 09:39:10 +00:00
- users
2021-03-07 17:41:56 +00:00
summary : Find users by username
description : Returns the user with the given username if it exists. For security reasons the hashed password is omitted in the response
2021-01-17 21:29:08 +00:00
operationId : get_user_by_username
2019-07-20 10:26:52 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2019-07-20 10:26:52 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/User'
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2019-07-20 10:26:52 +00:00
put :
tags :
2020-11-01 09:39:10 +00:00
- users
2021-03-06 16:08:24 +00:00
summary : Update user
2021-03-07 17:41:56 +00:00
description : 'Updates an existing user and optionally disconnects it, if connected, to apply the new settings'
2019-08-01 20:42:46 +00:00
operationId : update_user
2019-11-13 10:36:21 +00:00
parameters :
2020-11-01 09:39:10 +00:00
- in : query
name : disconnect
schema :
type : integer
enum :
- 0
- 1
2021-03-06 16:08:24 +00:00
description : |
2020-11-01 09:39:10 +00:00
Disconnect :
* `0` The user will not be disconnected and it will continue to use the old configuration until connected. This is the default
* `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
2019-07-20 10:26:52 +00:00
requestBody :
required : true
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/User'
2019-07-20 10:26:52 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2019-07-20 10:26:52 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/ApiResponse'
2019-11-13 10:36:21 +00:00
example :
2021-03-06 16:08:24 +00:00
message : User updated
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2019-07-20 10:26:52 +00:00
delete :
tags :
2020-11-01 09:39:10 +00:00
- users
2021-03-06 16:08:24 +00:00
summary : Delete user
2021-03-07 17:41:56 +00:00
description : Deletes an existing user
2019-08-01 20:42:46 +00:00
operationId : delete_user
2019-07-20 10:26:52 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2019-07-20 10:26:52 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/ApiResponse'
2019-11-13 10:36:21 +00:00
example :
2021-03-06 16:08:24 +00:00
message : User deleted
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'404' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/NotFound'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2020-12-08 10:18:34 +00:00
/status :
get :
tags :
- maintenance
2021-03-06 16:08:24 +00:00
summary : Get status
2021-03-07 17:41:56 +00:00
description : Retrieves the status of the active services
2020-12-08 10:18:34 +00:00
operationId : get_status
responses :
2021-03-06 16:08:24 +00:00
'200' :
2020-12-08 10:18:34 +00:00
description : successful operation
content :
application/json :
schema :
$ref : '#/components/schemas/ServicesStatus'
2021-03-06 16:08:24 +00:00
'400' :
2020-12-08 10:18:34 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-12-08 10:18:34 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-12-08 10:18:34 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2020-12-08 10:18:34 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2019-12-27 22:12:44 +00:00
/dumpdata :
get :
tags :
2020-11-01 09:39:10 +00:00
- maintenance
2021-03-07 17:41:56 +00:00
summary : Dump data
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'
2019-12-27 22:12:44 +00:00
operationId : dumpdata
parameters :
- in : query
2021-01-22 18:42:18 +00:00
name : output-file
2019-12-27 22:12:44 +00:00
schema :
type : string
2021-01-22 18:42:18 +00:00
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.
- in : query
name : output-data
schema :
type : integer
enum :
- 0
- 1
2021-03-06 16:08:24 +00:00
description : |
2021-03-21 18:15:47 +00:00
output data :
2021-01-22 18:42:18 +00:00
* `0` or any other value != 1, the backup will be saved to a file on the server, `output_file` is required
* `1` the backup will be returned as response body
2020-02-02 21:20:39 +00:00
- in : query
name : indent
schema :
type : integer
enum :
- 0
- 1
2021-03-06 16:08:24 +00:00
description : |
2020-02-02 21:20:39 +00:00
indent :
* `0` no indentation. This is the default
* `1` format the output JSON
2019-12-27 22:12:44 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2019-12-27 22:12:44 +00:00
description : successful operation
content :
application/json :
schema :
2021-01-22 18:42:18 +00:00
oneOf :
- $ref : '#/components/schemas/ApiResponse'
- $ref : '#/components/schemas/BackupData'
2021-03-06 16:08:24 +00:00
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2019-12-27 22:12:44 +00:00
/loaddata :
2021-01-22 18:42:18 +00:00
parameters :
- in : query
name : scan-quota
schema :
type : integer
enum :
- 0
- 1
- 2
2021-03-06 16:08:24 +00:00
description : |
2021-01-22 18:42:18 +00:00
Quota scan :
* `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
* `1` scan quota
* `2` scan quota if the user has quota restrictions
required : false
- in : query
name : mode
schema :
type : integer
enum :
- 0
- 1
- 2
2021-03-06 16:08:24 +00:00
description : |
2021-01-22 18:42:18 +00:00
Mode :
* `0` New users/admins are added, existing users/admins are updated. This is the default
* `1` New users/admins are added, existing users/admins are not modified
* `2` New users are added, existing users are updated and, if connected, they are disconnected and so forced to use the new configuration
2019-12-27 22:12:44 +00:00
get :
tags :
2020-11-01 09:39:10 +00:00
- maintenance
2021-03-07 17:41:56 +00:00
summary : Load data from path
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'
2021-01-22 18:42:18 +00:00
operationId : loaddata_from_file
2019-12-27 22:12:44 +00:00
parameters :
- in : query
2021-01-22 18:42:18 +00:00
name : input-file
2019-12-27 22:12:44 +00:00
schema :
type : string
required : true
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
2021-01-22 18:42:18 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2021-01-22 18:42:18 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/ApiResponse'
2021-01-22 18:42:18 +00:00
example :
2021-03-06 16:08:24 +00:00
message : Data restored
'400' :
2021-01-22 18:42:18 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2021-01-22 18:42:18 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2021-01-22 18:42:18 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2021-01-22 18:42:18 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
post :
tags :
- maintenance
2021-03-07 17:41:56 +00:00
summary : Load data
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'
2021-01-22 18:42:18 +00:00
operationId : loaddata_from_request_body
requestBody :
required : true
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/BackupData'
2019-12-27 22:12:44 +00:00
responses :
2021-03-06 16:08:24 +00:00
'200' :
2019-12-27 22:12:44 +00:00
description : successful operation
content :
application/json :
schema :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/ApiResponse'
2019-12-27 22:12:44 +00:00
example :
2021-03-06 16:08:24 +00:00
message : Data restored
'400' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/BadRequest'
2021-03-06 16:08:24 +00:00
'401' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Unauthorized'
2021-03-06 16:08:24 +00:00
'403' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/Forbidden'
2021-03-06 16:08:24 +00:00
'500' :
2020-09-08 07:45:21 +00:00
$ref : '#/components/responses/InternalServerError'
default :
$ref : '#/components/responses/DefaultResponse'
2019-07-20 10:26:52 +00:00
components :
2020-09-08 07:45:21 +00:00
responses :
BadRequest :
description : Bad Request
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
Unauthorized :
description : Unauthorized
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
Forbidden :
description : Forbidden
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
NotFound :
description : Not Found
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
Conflict :
description : Conflict
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
InternalServerError :
description : Internal Server Error
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
DefaultResponse :
description : Unexpected Error
content :
application/json :
schema :
$ref : '#/components/schemas/ApiResponse'
2019-07-20 10:26:52 +00:00
schemas :
Permission :
type : string
enum :
- '*'
- list
- download
- upload
2019-09-17 06:53:45 +00:00
- overwrite
2019-07-20 10:26:52 +00:00
- delete
- rename
- create_dirs
- create_symlinks
2019-11-15 11:15:07 +00:00
- chmod
- chown
2019-11-16 09:23:41 +00:00
- chtimes
2021-03-06 16:08:24 +00:00
description : |
2019-07-20 10:26:52 +00:00
Permissions :
2019-09-18 20:19:34 +00:00
* `*` - all permissions are granted
2019-07-20 10:26:52 +00:00
* `list` - list items is allowed
* `download` - download files is allowed
* `upload` - upload files is allowed
2019-09-17 06:53:45 +00:00
* `overwrite` - overwrite an existing file, while uploading, is allowed. upload permission is required to allow file overwrite
2019-07-20 10:26:52 +00:00
* `delete` - delete files or directories is allowed
* `rename` - rename files or directories is allowed
* `create_dirs` - create directories is allowed
* `create_symlinks` - create links is allowed
2019-11-15 11:15:07 +00:00
* `chmod` changing file or directory permissions is allowed
* `chown` changing file or directory owner and group is allowed
2019-11-16 09:23:41 +00:00
* `chtimes` changing file or directory access and modification time is allowed
2019-12-25 17:20:19 +00:00
DirPermissions :
type : object
additionalProperties :
type : array
items :
$ref : '#/components/schemas/Permission'
minItems : 1
minProperties : 1
2021-03-06 16:08:24 +00:00
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'
2021-01-17 21:29:08 +00:00
AdminPermissions :
type : string
enum :
- '*'
2021-03-06 16:08:24 +00:00
- add_users
- edit_users
- del_users
- view_users
- view_conns
- close_conns
- view_status
- manage_admins
- quota_scans
- manage_system
- manage_defender
- view_defender
2021-03-21 18:15:47 +00:00
description : |
Admin permissions :
* `*` - all permissions are granted
* `add_users` - add new users is allowed
* `edit_users` - change existing users is allowed
* `del_users` - remove users is allowed
* `view_users` - list users is allowed
* `view_conns` - list active connections is allowed
* `close_conns` - close active connections is allowed
* `view_status` - view the server status is allowed
* `manage_admins` - manage other admins is allowed
* `manage_defender` - remove ip from the dynamic blocklist is allowed
* `view_defender` - list the dynamic blocklist is allowed
2020-02-19 21:39:30 +00:00
LoginMethods :
type : string
enum :
2021-03-06 16:08:24 +00:00
- publickey
- password
- keyboard-interactive
- publickey+password
- publickey+keyboard-interactive
- TLSCertificate
- TLSCertificate+password
description : |
2021-03-21 18:15:47 +00:00
Available login methods. To enable multi-step authentication you have to allow only multi-step login methods
* `publickey`
* `password`
* `keyboard-interactive`
* `publickey+password` - multi-step auth : public key and password
* `publickey+keyboard-interactive` - multi-step auth : public key and keyboard interactive
* `TLSCertificate`
* `TLSCertificate+password` - multi-step auth : TLS client certificate and password
2020-08-17 10:49:20 +00:00
SupportedProtocols :
type : string
enum :
2021-03-06 16:08:24 +00:00
- SSH
- FTP
- DAV
2021-03-21 18:15:47 +00:00
description : |
Protocols :
* `SSH` - includes both SFTP and SSH commands
* `FTP` - plain FTP and FTPES/FTPS
* `DAV` - WebDAV over HTTP/HTTPS
2020-11-15 21:04:48 +00:00
PatternsFilter :
type : object
properties :
path :
type : string
2021-03-06 16:08:24 +00:00
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'
2020-11-15 21:04:48 +00:00
allowed_patterns :
type : array
items :
type : string
2021-03-06 16:08:24 +00:00
description : 'list of, case insensitive, allowed shell like file patterns.'
example :
- '*.jpg'
- a*b?.png
2020-11-15 21:04:48 +00:00
denied_patterns :
type : array
items :
type : string
2021-03-06 16:08:24 +00:00
description : 'list of, case insensitive, denied shell like file patterns. Denied patterns are evaluated before the allowed ones'
example :
- '*.zip'
2020-03-01 21:10:29 +00:00
ExtensionsFilter :
type : object
properties :
path :
type : string
2021-03-06 16:08:24 +00:00
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'
2020-03-01 21:10:29 +00:00
allowed_extensions :
type : array
items :
type : string
2021-03-06 16:08:24 +00:00
description : 'list of, case insensitive, allowed files extension. Shell like expansion is not supported so you have to specify `.jpg` and not `*.jpg`'
example :
- .jpg
- .png
2020-03-01 21:10:29 +00:00
denied_extensions :
type : array
items :
type : string
2021-03-06 16:08:24 +00:00
description : 'list of, case insensitive, denied files extension. Denied file extensions are evaluated before the allowed ones'
example :
- .zip
2019-12-30 17:37:50 +00:00
UserFilters :
type : object
properties :
allowed_ip :
type : array
items :
type : string
2021-03-06 16:08:24 +00:00
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"'
example :
- 192.0 .2 .0 /24
- '2001:db8::/32'
2019-12-30 17:37:50 +00:00
denied_ip :
type : array
items :
type : string
description : clients connecting from these IP/Mask are not allowed. Denied rules are evaluated before allowed ones
2021-03-06 16:08:24 +00:00
example :
- 172.16 .0 .0 /16
2020-02-19 21:39:30 +00:00
denied_login_methods :
type : array
items :
$ref : '#/components/schemas/LoginMethods'
description : if null or empty any available login method is allowed
2020-08-17 10:49:20 +00:00
denied_protocols :
type : array
items :
$ref : '#/components/schemas/SupportedProtocols'
description : if null or empty any available protocol is allowed
2020-11-15 21:04:48 +00:00
file_patterns :
type : array
items :
$ref : '#/components/schemas/PatternsFilter'
2021-03-06 16:08:24 +00:00
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'
2020-03-01 21:10:29 +00:00
file_extensions :
type : array
items :
$ref : '#/components/schemas/ExtensionsFilter'
2021-03-06 16:08:24 +00:00
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'
2020-08-16 18:17:02 +00:00
max_upload_file_size :
type : integer
format : int64
2021-03-06 16:08:24 +00:00
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`'
2021-02-28 11:10:40 +00:00
tls_username :
type : string
enum :
- None
- CommonName
2021-03-06 16:08:24 +00:00
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'
2021-02-28 11:10:40 +00:00
description : Additional user restrictions
2020-11-22 20:53:04 +00:00
Secret :
type : object
properties :
status :
type : string
enum :
- Plain
- AES-256-GCM
2020-11-30 20:46:34 +00:00
- Secretbox
- GCP
- AWS
- VaultTransit
2020-11-22 20:53:04 +00:00
- Redacted
2021-03-06 16:08:24 +00:00
description : 'Set to "Plain" to add or update an existing secret, set to "Redacted" to preserve the existing value'
2020-11-22 20:53:04 +00:00
payload :
type : string
key :
type : string
additional_data :
type : string
2020-12-01 21:18:16 +00:00
mode :
type : integer
description : 1 means encrypted using a master key
2021-03-28 09:23:06 +00:00
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
2020-01-19 06:41:05 +00:00
S3Config :
type : object
properties :
bucket :
type : string
minLength : 1
region :
type : string
minLength : 1
access_key :
type : string
access_secret :
2020-11-22 20:53:04 +00:00
$ref : '#/components/schemas/Secret'
2020-01-19 06:41:05 +00:00
endpoint :
type : string
description : optional endpoint
storage_class :
type : string
2020-03-13 16:28:55 +00:00
upload_part_size :
type : integer
2021-03-06 16:08:24 +00:00
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.'
2020-03-13 16:28:55 +00:00
upload_concurrency :
type : integer
2021-03-06 16:08:24 +00:00
description : 'the number of parts to upload in parallel. If this value is set to zero, the default value (2) will be used'
2020-01-19 22:23:09 +00:00
key_prefix :
type : string
2021-03-06 16:08:24 +00:00
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'
2020-01-19 22:23:09 +00:00
example : folder/subfolder/
2020-01-19 06:41:05 +00:00
description : S3 Compatible Object Storage configuration details
2020-01-31 18:04:00 +00:00
GCSConfig :
type : object
properties :
bucket :
type : string
minLength : 1
credentials :
2020-11-22 20:53:04 +00:00
$ref : '#/components/schemas/Secret'
2020-02-19 08:41:15 +00:00
automatic_credentials :
type : integer
enum :
- 0
- 1
2021-03-06 16:08:24 +00:00
description : |
2020-02-19 08:41:15 +00:00
Automatic credentials :
* `0` - disabled, explicit credentials, using a JSON credentials file, must be provided. This is the default value if the field is null
* `1` - enabled, we try to use the Application Default Credentials (ADC) strategy to find your application's credentials
2020-01-31 18:04:00 +00:00
storage_class :
type : string
key_prefix :
type : string
2021-03-06 16:08:24 +00:00
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'
2020-01-31 18:04:00 +00:00
example : folder/subfolder/
2021-03-06 16:08:24 +00:00
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'
2020-10-25 07:18:48 +00:00
AzureBlobFsConfig :
type : object
properties :
container :
type : string
account_name :
type : string
2021-03-06 16:08:24 +00:00
description : 'Storage Account Name, leave blank to use SAS URL'
2020-10-25 07:18:48 +00:00
account_key :
2020-11-22 20:53:04 +00:00
$ref : '#/components/schemas/Secret'
2020-10-25 07:18:48 +00:00
sas_url :
type : string
2021-03-06 16:08:24 +00:00
description : 'Shared access signature URL, leave blank if using account/key'
2020-10-25 07:18:48 +00:00
endpoint :
type : string
2021-03-06 16:08:24 +00:00
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"'
2020-10-25 07:18:48 +00:00
upload_part_size :
type : integer
2021-03-06 16:08:24 +00:00
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.'
2020-10-25 07:18:48 +00:00
upload_concurrency :
type : integer
2021-03-06 16:08:24 +00:00
description : 'the number of parts to upload in parallel. If this value is set to zero, the default value (2) will be used'
2020-10-30 21:17:17 +00:00
access_tier :
type : string
enum :
2021-03-06 16:08:24 +00:00
- ''
- Archive
- Hot
- Cool
2020-10-25 07:18:48 +00:00
key_prefix :
type : string
2021-03-06 16:08:24 +00:00
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'
2020-10-25 07:18:48 +00:00
example : folder/subfolder/
use_emulator :
type : boolean
description : Azure Blob Storage configuration details
2020-12-05 12:48:13 +00:00
CryptFsConfig :
type : object
properties :
passphrase :
$ref : '#/components/schemas/Secret'
description : Crypt filesystem configuration details
2020-12-12 09:31:09 +00:00
SFTPFsConfig :
type : object
properties :
endpoint :
type : string
2021-03-06 16:08:24 +00:00
description : 'remote SFTP endpoint as host:port'
2020-12-12 09:31:09 +00:00
username :
type : string
description : you can specify a password or private key or both. In the latter case the private key will be tried first.
password :
$ref : '#/components/schemas/Secret'
private_key :
$ref : '#/components/schemas/Secret'
fingerprints :
type : array
items :
type : string
2021-03-06 16:08:24 +00:00
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'
2020-12-12 09:31:09 +00:00
prefix :
type : string
description : Specifying a prefix you can restrict all operations to a given path within the remote SFTP server.
2021-03-06 14:41:40 +00:00
disable_concurrent_reads :
type : boolean
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.
2020-01-19 06:41:05 +00:00
FilesystemConfig :
type : object
properties :
provider :
type : integer
enum :
- 0
- 1
2020-01-31 18:04:00 +00:00
- 2
2020-10-25 07:18:48 +00:00
- 3
2020-12-05 12:48:13 +00:00
- 4
2020-12-12 09:31:09 +00:00
- 5
2021-03-06 16:08:24 +00:00
description : |
2020-01-19 06:41:05 +00:00
Providers :
2020-10-25 07:18:48 +00:00
* `0` - Local filesystem
2020-01-19 06:41:05 +00:00
* `1` - S3 Compatible Object Storage
2020-01-31 18:04:00 +00:00
* `2` - Google Cloud Storage
2020-10-25 07:18:48 +00:00
* `3` - Azure Blob Storage
2020-12-05 12:48:13 +00:00
* `4` - Local filesystem encrypted
2020-12-12 09:31:09 +00:00
* `5` - SFTP
2020-01-19 06:41:05 +00:00
s3config :
$ref : '#/components/schemas/S3Config'
2020-01-31 18:04:00 +00:00
gcsconfig :
$ref : '#/components/schemas/GCSConfig'
2020-10-25 07:18:48 +00:00
azblobconfig :
$ref : '#/components/schemas/AzureBlobFsConfig'
2020-12-05 12:48:13 +00:00
cryptconfig :
$ref : '#/components/schemas/CryptFsConfig'
2020-12-12 09:31:09 +00:00
sftpconfig :
$ref : '#/components/schemas/SFTPFsConfig'
2020-01-19 06:41:05 +00:00
description : Storage filesystem details
2020-06-07 21:30:18 +00:00
BaseVirtualFolder :
2020-02-23 10:30:26 +00:00
type : object
properties :
2020-06-07 21:30:18 +00:00
id :
type : integer
format : int32
minimum : 1
2021-02-01 18:04:15 +00:00
name :
type : string
description : unique name for this virtual folder
2020-02-23 10:30:26 +00:00
mapped_path :
type : string
2021-02-01 18:04:15 +00:00
description : absolute filesystem path to use as virtual folder
2021-02-24 18:40:29 +00:00
description :
type : string
description : optional description
2020-06-07 21:30:18 +00:00
used_quota_size :
type : integer
format : int64
used_quota_files :
type : integer
format : int32
last_quota_update :
type : integer
format : int64
description : Last quota update as unix timestamp in milliseconds
users :
type : array
items :
type : string
description : list of usernames associated with this virtual folder
2021-03-21 18:15:47 +00:00
filesystem :
$ref : '#/components/schemas/FilesystemConfig'
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.
2020-06-07 21:30:18 +00:00
VirtualFolder :
allOf :
- $ref : '#/components/schemas/BaseVirtualFolder'
- type : object
properties :
virtual_path :
type : string
quota_size :
type : integer
format : int64
2021-03-06 16:08:24 +00:00
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'
2020-06-07 21:30:18 +00:00
quota_files :
type : integer
format : int32
2021-03-06 16:08:24 +00:00
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'
2020-06-07 21:30:18 +00:00
required :
- virtual_path
2021-03-06 16:08:24 +00:00
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.'
2019-07-20 10:26:52 +00:00
User :
type : object
properties :
id :
type : integer
format : int32
minimum : 1
2019-11-13 10:36:21 +00:00
status :
type : integer
enum :
- 0
- 1
2021-03-06 16:08:24 +00:00
description : |
2019-11-13 10:36:21 +00:00
status :
* `0` user is disabled, login is not allowed
* `1` user is enabled
2019-07-20 10:26:52 +00:00
username :
type : string
2020-06-07 21:30:18 +00:00
description : username is unique
2021-02-24 18:40:29 +00:00
description :
type : string
2021-03-06 16:08:24 +00:00
description : 'optional description, for example the user full name'
2019-11-13 10:36:21 +00:00
expiration_date :
type : integer
format : int64
description : expiration date as unix timestamp in milliseconds. An expired account cannot login. 0 means no expiration
2019-07-20 10:26:52 +00:00
password :
type : string
2021-01-17 21:29:08 +00:00
format : password
2020-05-15 18:08:53 +00:00
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
2019-08-07 21:41:10 +00:00
public_keys :
2019-08-01 20:42:46 +00:00
type : array
items :
type : string
2020-05-15 18:08:53 +00:00
description : a password or at least one public key/SSH user certificate are mandatory.
2019-07-20 10:26:52 +00:00
home_dir :
type : string
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
2020-02-23 10:30:26 +00:00
virtual_folders :
type : array
items :
$ref : '#/components/schemas/VirtualFolder'
2020-08-11 21:56:10 +00:00
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
2019-07-20 10:26:52 +00:00
uid :
type : integer
format : int32
minimum : 0
2021-03-25 16:11:42 +00:00
maximum : 2147483647
2021-03-06 16:08:24 +00:00
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'
2019-07-20 10:26:52 +00:00
gid :
type : integer
format : int32
minimum : 0
2021-03-25 16:11:42 +00:00
maximum : 2147483647
2021-03-06 16:08:24 +00:00
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'
2019-07-20 10:26:52 +00:00
max_sessions :
type : integer
format : int32
2020-03-27 22:26:22 +00:00
description : Limit the sessions that a user can open. 0 means unlimited
2019-07-20 10:26:52 +00:00
quota_size :
type : integer
format : int64
2020-08-11 21:56:10 +00:00
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
2019-07-20 10:26:52 +00:00
quota_files :
type : integer
format : int32
2020-08-11 21:56:10 +00:00
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
2019-07-20 10:26:52 +00:00
permissions :
2019-12-25 17:20:19 +00:00
type : object
2019-07-20 10:26:52 +00:00
items :
2019-12-25 17:20:19 +00:00
$ref : '#/components/schemas/DirPermissions'
2019-07-20 10:26:52 +00:00
minItems : 1
2021-03-06 16:08:24 +00:00
example :
/ :
- '*'
/somedir :
- list
- download
2019-07-20 10:26:52 +00:00
used_quota_size :
type : integer
format : int64
2020-06-07 21:30:18 +00:00
used_quota_files :
2019-07-20 10:26:52 +00:00
type : integer
format : int32
2019-07-28 17:29:32 +00:00
last_quota_update :
2019-07-20 10:26:52 +00:00
type : integer
format : int64
2019-12-30 17:37:50 +00:00
description : Last quota update as unix timestamp in milliseconds
2019-07-20 10:26:52 +00:00
upload_bandwidth :
type : integer
format : int32
2021-03-06 16:08:24 +00:00
description : 'Maximum upload bandwidth as KB/s, 0 means unlimited'
2019-07-20 10:26:52 +00:00
download_bandwidth :
type : integer
format : int32
2021-03-06 16:08:24 +00:00
description : 'Maximum download bandwidth as KB/s, 0 means unlimited'
2019-11-13 10:36:21 +00:00
last_login :
type : integer
format : int64
2020-11-30 20:46:34 +00:00
description : Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes
2019-12-30 17:37:50 +00:00
filters :
$ref : '#/components/schemas/UserFilters'
2020-01-19 06:41:05 +00:00
filesystem :
$ref : '#/components/schemas/FilesystemConfig'
2020-11-25 21:26:34 +00:00
additional_info :
type : string
description : Free form text field for external systems
2021-01-17 21:29:08 +00:00
AdminFilters :
type : object
properties :
allow_list :
type : array
items :
type : string
2021-03-06 16:08:24 +00:00
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"'
example :
- 192.0 .2 .0 /24
- '2001:db8::/32'
2021-01-17 21:29:08 +00:00
Admin :
type : object
properties :
id :
type : integer
format : int32
minimum : 1
status :
type : integer
enum :
- 0
- 1
2021-03-06 16:08:24 +00:00
description : |
2021-01-17 21:29:08 +00:00
status :
* `0` user is disabled, login is not allowed
* `1` user is enabled
username :
type : string
description : username is unique
2021-02-24 18:40:29 +00:00
description :
type : string
2021-03-06 16:08:24 +00:00
description : 'optional description, for example the admin full name'
2021-01-17 21:29:08 +00:00
password :
type : string
format : password
description : Admin password. For security reasons this field is omitted when you search/get admins
email :
type : string
format : email
permissions :
type : array
items :
$ref : '#/components/schemas/AdminPermissions'
filters :
$ref : '#/components/schemas/AdminFilters'
additional_info :
type : string
description : Free form text field
2019-08-24 12:41:15 +00:00
Transfer :
2019-07-20 10:26:52 +00:00
type : object
properties :
operation_type :
type : string
2019-11-13 10:36:21 +00:00
enum :
2019-07-20 10:26:52 +00:00
- upload
- download
2021-03-21 18:15:47 +00:00
description : |
Operations :
* `upload`
* `download`
2019-08-08 17:33:16 +00:00
path :
type : string
2019-11-18 22:30:37 +00:00
description : file path for the upload/download
2019-07-20 10:26:52 +00:00
start_time :
type : integer
format : int64
2019-07-28 17:29:32 +00:00
description : start time as unix timestamp in milliseconds
2019-07-20 10:26:52 +00:00
size :
type : integer
format : int64
description : bytes transferred
ConnectionStatus :
type : object
properties :
username :
type : string
description : connected username
connection_id :
type : string
2019-08-24 12:41:15 +00:00
description : unique connection identifier
2019-07-20 10:26:52 +00:00
client_version :
type : string
2019-11-18 22:30:37 +00:00
description : client version
2019-07-20 10:26:52 +00:00
remote_address :
type : string
2019-11-18 22:30:37 +00:00
description : Remote address for the connected client
2019-07-20 10:26:52 +00:00
connection_time :
type : integer
format : int64
2019-07-28 17:29:32 +00:00
description : connection time as unix timestamp in milliseconds
2020-08-11 21:56:10 +00:00
command :
2019-11-18 22:30:37 +00:00
type : string
2021-01-18 12:24:38 +00:00
description : Last SSH/FTP command or WebDAV method
2019-07-20 10:26:52 +00:00
last_activity :
type : integer
format : int64
2019-07-28 17:29:32 +00:00
description : last client activity as unix timestamp in milliseconds
2019-08-24 12:41:15 +00:00
protocol :
type : string
enum :
- SFTP
- SCP
2019-11-18 22:30:37 +00:00
- SSH
2020-08-11 21:56:10 +00:00
- FTP
- DAV
2019-07-20 10:26:52 +00:00
active_transfers :
type : array
items :
2021-03-06 16:08:24 +00:00
$ref : '#/components/schemas/Transfer'
2019-07-20 10:26:52 +00:00
QuotaScan :
type : object
properties :
username :
type : string
description : username with an active scan
start_time :
type : integer
format : int64
2019-07-28 17:29:32 +00:00
description : scan start time as unix timestamp in milliseconds
2020-06-07 21:30:18 +00:00
FolderQuotaScan :
type : object
properties :
2021-03-21 18:15:47 +00:00
name :
2020-06-07 21:30:18 +00:00
type : string
2021-03-21 18:15:47 +00:00
description : folder name with an active scan
2020-06-07 21:30:18 +00:00
start_time :
type : integer
format : int64
description : scan start time as unix timestamp in milliseconds
2020-12-08 10:18:34 +00:00
SSHHostKey :
type : object
properties :
path :
type : string
fingerprint :
type : string
2020-12-23 15:12:30 +00:00
SSHBinding :
2020-12-08 10:18:34 +00:00
type : object
properties :
2020-12-23 15:12:30 +00:00
address :
type : string
description : TCP address the server listen on
port :
type : integer
description : the port used for serving requests
apply_proxy_config :
type : boolean
2021-03-06 16:08:24 +00:00
description : 'apply the proxy configuration, if any'
2020-12-23 15:12:30 +00:00
WebDAVBinding :
type : object
properties :
address :
type : string
description : TCP address the server listen on
port :
type : integer
description : the port used for serving requests
enable_https :
2020-12-08 10:18:34 +00:00
type : boolean
2020-12-29 18:33:04 +00:00
client_auth_type :
type : integer
description : 1 means that client certificate authentication is required in addition to HTTP basic authentication
2020-12-23 15:12:30 +00:00
FTPDBinding :
type : object
properties :
2020-12-08 10:18:34 +00:00
address :
type : string
2020-12-23 15:12:30 +00:00
description : TCP address the server listen on
port :
type : integer
description : the port used for serving requests
apply_proxy_config :
type : boolean
2021-03-06 16:08:24 +00:00
description : 'apply the proxy configuration, if any'
2020-12-23 15:12:30 +00:00
tls_mode :
type : integer
enum :
- 0
- 1
- 2
2021-03-06 16:08:24 +00:00
description : |
* `0` - clear or explicit TLS * `1` - explicit TLS required * `2` - implicit TLS
2020-12-23 15:12:30 +00:00
force_passive_ip :
type : string
description : External IP address to expose for passive connections
2020-12-29 18:33:04 +00:00
client_auth_type :
type : integer
description : 1 means that client certificate authentication is required in addition to FTP authentication
2020-12-08 10:18:34 +00:00
SSHServiceStatus :
2020-12-23 15:12:30 +00:00
type : object
properties :
is_active :
type : boolean
bindings :
type : array
items :
$ref : '#/components/schemas/SSHBinding'
2021-01-18 12:24:38 +00:00
nullable : true
2020-12-23 15:12:30 +00:00
host_keys :
type : array
items :
$ref : '#/components/schemas/SSHHostKey'
2021-01-18 12:24:38 +00:00
nullable : true
2020-12-23 15:12:30 +00:00
ssh_commands :
2021-01-18 12:24:38 +00:00
type : array
items :
type : string
2020-12-08 10:18:34 +00:00
FTPPassivePortRange :
type : object
properties :
start :
type : integer
end :
type : integer
FTPServiceStatus :
2020-12-23 15:12:30 +00:00
type : object
properties :
is_active :
type : boolean
bindings :
type : array
items :
$ref : '#/components/schemas/FTPDBinding'
2021-01-18 12:24:38 +00:00
nullable : true
2020-12-23 15:12:30 +00:00
passive_port_range :
$ref : '#/components/schemas/FTPPassivePortRange'
2020-12-08 10:18:34 +00:00
WebDAVServiceStatus :
2020-12-23 15:12:30 +00:00
type : object
properties :
is_active :
type : boolean
bindings :
type : array
items :
$ref : '#/components/schemas/WebDAVBinding'
2021-01-18 12:24:38 +00:00
nullable : true
2020-12-08 10:18:34 +00:00
DataProviderStatus :
type : object
properties :
is_active :
type : boolean
driver :
type : string
error :
type : string
ServicesStatus :
type : object
properties :
ssh :
$ref : '#/components/schemas/SSHServiceStatus'
ftp :
$ref : '#/components/schemas/FTPServiceStatus'
webdav :
$ref : '#/components/schemas/WebDAVServiceStatus'
data_provider :
$ref : '#/components/schemas/DataProviderStatus'
2021-01-02 18:33:24 +00:00
defender :
type : object
properties :
is_active :
type : boolean
BanStatus :
type : object
properties :
date_time :
type : string
format : date-time
nullable : true
description : if null the host is not banned
ScoreStatus :
type : object
properties :
score :
type : integer
description : if 0 the host is not listed
2021-01-22 18:42:18 +00:00
BackupData :
type : object
properties :
users :
type : array
items :
$ref : '#/components/schemas/User'
folders :
type : array
items :
$ref : '#/components/schemas/BaseVirtualFolder'
admins :
type : array
items :
$ref : '#/components/schemas/Admin'
version :
type : integer
2021-01-17 21:29:08 +00:00
PwdChange :
type : object
properties :
current_password :
type : string
new_password :
type : string
2019-07-20 10:26:52 +00:00
ApiResponse :
type : object
properties :
message :
type : string
2021-03-06 16:08:24 +00:00
description : 'message, can be empty'
2019-07-20 10:26:52 +00:00
error :
type : string
description : error description if any
2019-08-08 08:01:33 +00:00
VersionInfo :
type : object
properties :
version :
type : string
build_date :
type : string
commit_hash :
type : string
2020-05-23 09:58:05 +00:00
features :
type : array
items :
type : string
2021-03-06 16:08:24 +00:00
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'
2021-01-17 21:29:08 +00:00
Token :
type : object
properties :
access_token :
type : string
expires_at :
type : string
format : date-time
2020-02-03 23:08:00 +00:00
securitySchemes :
BasicAuth :
type : http
scheme : basic
2021-01-17 21:29:08 +00:00
BearerAuth :
type : http
scheme : bearer
bearerFormat : JWT