users
Update user
Updates an existing user and optionally disconnects it, if connected, to apply the new settings. The current password will be preserved if the password field is omitted in the request body. Recovery codes and TOTP configuration cannot be set/updated using this API: each user must use the specific APIs
put/users/{username}
Request
- Base URL/api/v2 (relative, and the document was published on a file host, not at the API’s origin)
- Auth
- HTTP bearer
- or API key in header X-SFTPGO-API-KEY
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
disconnect0 | 1
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
Request body
Example request
{
"public_keys": [
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEUWwDwEWhTbF0MqAsp/oXK1HR2cElhM8oo1uVmL3ZeDKDiTm4ljMr92wfTgIGDqIoxmVqgYIkAOAhuykAVWBzc= user@host"
],
"virtual_folders": [
{
"filesystem": {
"s3config": {
"key_prefix": "folder/subfolder/"
},
"gcsconfig": {
"key_prefix": "folder/subfolder/"
},
"azblobconfig": {
"key_prefix": "folder/subfolder/"
},
"sftpconfig": {
"buffer_size": 2
}
}
}
],
"permissions": {
"/": [
"*"
],
"/somedir": [
"list",
"download"
]
},
"filters": {
"allowed_ip": [
"192.0.2.0/24",
"2001:db8::/32"
],
"denied_ip": [
"172.16.0.0/16"
],
"file_patterns": [
{
"allowed_patterns": [
"*.jpg",
"a*b?.png"
],
"denied_patterns": [
"*.zip"
]
}
]
},
"filesystem": {
"s3config": {
"key_prefix": "folder/subfolder/"
},
"gcsconfig": {
"key_prefix": "folder/subfolder/"
},
"azblobconfig": {
"key_prefix": "folder/subfolder/"
},
"sftpconfig": {
"buffer_size": 2
}
}
}Response
successful operation
Changes
No recorded changes to this operation across all 1 revision of this API.