PUT/apikeys/{id}

Update API key

Updates an existing API key. The key value, creation date and last use timestamp cannot be changed

1 parameter · 11 body fields
idstringrequired
the key id
adminstringoptional
admin associated with this API key. If empty and the scope is "admin scope" the key can impersonate any admin
created_atintegeroptional
creation time as unix timestamp in milliseconds
descriptionstringoptional
optional description
expires_atintegeroptional
expiration time as unix timestamp in milliseconds. Once set, the expiration date cannot be extended. It can only be shortened.
idstringoptional
unique key identifier
keystringoptional
We store the hash of the key. This is just like a password. For security reasons this field is omitted when you search/get API keys
last_use_atintegeroptional
last use time as unix timestamp in milliseconds. It is saved at most once every 10 minutes
namestringoptional
User friendly key name
scopeintegeroptional
Options: * `1` - admin scope. The API key will be used to impersonate an SFTPGo admin * `2` - user scope. The API key will be used to impersonate an SFTPGo user
Allowed:12
updated_atintegeroptional
last update time as unix timestamp in milliseconds
userstringoptional
username associated with this API key. If empty and the scope is "user scope" the key can impersonate any user

7 status codes
200successful operation
errorstringoptional
error description if any
messagestringoptional
message, can be empty
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.