GET/users/{username}

Get user by username

Returns the user with the given username if it exists. For security reasons, the hashed password is omitted from the response

2 parameters
usernamestringrequired
the username
confidential_dataintegeroptional
If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. Ignored if the * permission is not granted.

7 status codes
200successful operation
additional_infostringoptional
Free form text field for external systems
created_atintegeroptional
creation time as unix timestamp in milliseconds. It will be 0 for users created before v2.2.0
descriptionstringoptional
optional description, for example the user full name
download_bandwidthintegeroptional
Maximum download bandwidth as KB/s, 0 means unlimited. Enforced as an aggregate across the user concurrent downloads on an instance: the combined download rate stays within this value regardless of the number of parallel transfers or protocols in use
download_data_transferintegeroptional
Maximum data transfer allowed for downloads as MB. 0 means no limit
emailstringoptional
expiration_dateintegeroptional
expiration date as unix timestamp in milliseconds. An expired account cannot login. 0 means no expiration
filesystemobjectoptional
Storage filesystem details. The `provider` field selects which sub-config is active — all other sub-configs are ignored / cleared on save. See `FsProviders` for the mapping. * `provider: -1` → no sub-config (None; users and groups) * `provider: 0` → `osconfig` (local; root is the user's `home_dir`) * `provider: 1` → `s3config` * `provider: 2` → `gcsconfig` * `provider: 3` → `azblobconfig` * `provider: 4` → `cryptconfig` (encrypted local; root is the user's `home_dir`) * `provider: 5` → `sftpconfig` * `provider: 6` → `httpconfig` * `provider: 7` → `ftpconfig`
filtersobjectoptional
first_downloadintegeroptional
first download time as unix timestamp in milliseconds
first_uploadintegeroptional
first upload time as unix timestamp in milliseconds
gidintegeroptional
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
groupsarray<object>optional
has_passwordbooleanoptional
Indicates whether the password is set
home_dirstringoptional
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
idintegeroptional
last_loginintegeroptional
Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes
last_password_changeintegeroptional
last password change time as unix timestamp in milliseconds
last_quota_updateintegeroptional
Last quota update as unix timestamp in milliseconds
max_sessionsintegeroptional
Maximum number of concurrent sessions and file transfers for the user. 0 means unlimited
oidc_custom_fieldsobjectoptional
This field is passed to the pre-login hook if custom OIDC token fields have been configured. Field values can be of any type (this is a free form object) and depend on the type of the configured OIDC token fields
passwordstringoptional
If the password has no known hashing algo prefix it will be stored, by default, using bcrypt, argon2id is supported too. You can send a password hashed as bcrypt ($2a$ prefix), argon2id, pbkdf2 or unix crypt and it will be stored as is. For security reasons this field is omitted when you search/get users
permissionsobjectrequired
hash map with directory as key and an array of permissions as value. Directories must be absolute paths, permissions for root directory ("/") are required
public_keysarray<string>optional
Public keys in OpenSSH authorized_keys format. A key prefixed with from="<CIDR>[,<CIDR>...]" authenticates from the listed networks. This is the supported option, written in this exact form.
quota_filesintegeroptional
Quota as number of files. 0 means 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
quota_sizeintegeroptional
Quota as size in bytes. 0 means 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
rolestringoptional
Role name for the user. Administrators carrying the role manage the users carrying it. Where the role isolates its resources, the account reaches the groups and the folders of its own role, and its home directory and filesystem are measured against the role storage allowlist on every save
statusintegeroptional
Account status: * `0` user is disabled, login is not allowed * `1` user is enabled
Allowed:01
total_data_transferintegeroptional
Maximum total data transfer as MB. 0 means unlimited. You can set a total data transfer instead of the individual values for uploads and downloads
uidintegeroptional
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
updated_atintegeroptional
last update time as unix timestamp in milliseconds
upload_bandwidthintegeroptional
Maximum upload bandwidth as KB/s, 0 means unlimited. Enforced as an aggregate across the user concurrent uploads on an instance: the combined upload rate stays within this value regardless of the number of parallel transfers or protocols in use
upload_data_transferintegeroptional
Maximum data transfer allowed for uploads as MB. 0 means no limit
used_download_data_transferintegeroptional
Downloaded size, as bytes, since the last reset
used_quota_filesintegeroptional
used_quota_sizeintegeroptional
used_upload_data_transferintegeroptional
Uploaded size, as bytes, since the last reset
usernamestringrequired
Unique username. After creation it is immutable via the API.
virtual_foldersarray<object>optional
mapping between virtual SFTPGo paths and virtual folders
400Bad Request
errorstringoptional
error description if any
messagestringoptional
message, can be empty
401Unauthorized
errorstringoptional
error description if any
messagestringoptional
message, can be empty
403Forbidden
errorstringoptional
error description if any
messagestringoptional
message, can be empty
404Not Found
errorstringoptional
error description if any
messagestringoptional
message, can be empty
500Internal Server Error
errorstringoptional
error description if any
messagestringoptional
message, can be empty
defaultUnexpected Error
errorstringoptional
error description if any
messagestringoptional
message, can be empty

Error handling

A 400 is returned: Bad Request. A 401 is returned: Unauthorized. A 403 is returned: Forbidden. A 404 is returned: Not Found. A 500 is returned: Internal Server Error. Any other status is an error: Unexpected Error.