Get Own MFA Setting
GET
/api/v1/users/self/mfa
const url = 'https://api.spartanauth.com/api/v1/users/self/mfa';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.spartanauth.com/api/v1/users/self/mfaReturns whether the signed-in user requires a second factor on their own sign-ins. enforcedByPolicy is true when the platform or the sector already requires MFA, and the account control is hidden. enabled is that user’s opt-in. Passkey and social sign-in are unchanged. Existing sessions stay valid.
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" } ]}