Update Own MFA Setting
PUT
/api/v1/users/self/mfa
const url = 'https://api.spartanauth.com/api/v1/users/self/mfa';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"enabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.spartanauth.com/api/v1/users/self/mfa \ --header 'Content-Type: application/json' \ --data '{ "enabled": true }'Turns a second factor on or off for the signed-in user’s own sign-ins when the platform and the sector do not already require one. When either already requires MFA, the call is rejected and the stored choice is left unchanged. Existing sessions stay valid until they expire.
Request Body
Section titled “Request Body ” Media type application/json
object
enabled
boolean
Example generated
{ "enabled": true}Responses
Section titled “ Responses ”A successful response.
Media type application/json
OwnMFASetting is the signed-in user’s MFA opt-in. Platform and sector requirements win. The profile flag can only add a requirement.
object
enforcedByPolicy
True when the platform or the sector already requires a second factor.
boolean
enabled
The user’s own opt-in. A false value does not turn off a platform or sector requirement.
boolean
Example generated
{ "enforcedByPolicy": true, "enabled": true}default
Section titled “default ”An unexpected error response.
Media type application/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
Example generated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}