POST/admin/totp/save

Save an administrator TOTP configuration

Saves a TOTP configuration for the authenticated administrator. Set config_name to a configuration defined in the totp section of the SFTPGo configuration file, and provide a new secret with status Plain; status Redacted preserves the existing secret. The encryption key and additional data are generated automatically when a new secret is saved.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 body fields

The TOTP configuration to save.

config_namestringoptional
This name must be defined within the "totp" section of the SFTPGo configuration file. You will be unable to save a user/admin referencing a missing config_name
enabledbooleanoptional
Whether the TOTP configuration is enabled.
secretobjectoptional
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 existing secret will be preserved

7 status codes
200Returns an object containing a message and, if applicable, an error description.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
400Returned when the request is invalid.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
401Returned when authentication is missing or invalid.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
403Returned when the authenticated user is not permitted to save the TOTP configuration.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
409Returned when saving the TOTP configuration conflicts with the current state.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
500Returned when an internal server error occurs.
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 when the request is invalid; a 401 when authentication is missing or invalid; a 403 when the authenticated user is not permitted to save the configuration; a 409 when the save conflicts with the current configuration; and a 500 when an internal error occurs. config_name must reference a configuration defined in the totp section; to set a new secret, provide its payload and set its status to Plain, while Redacted preserves the existing secret.