API RestAuth
Dernière mise à jour le 20 juillet 2026
Enable or disable email-based 2FA for the authenticated user.
Authorization
JwtAuth AuthorizationBearer <token>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Payload to enable or disable email 2FA from the user profile.
- Enable (step 1): { enabled: true } → triggers OTP send, returns 202.
- Enable (step 2): { enabled: true, challenge_id, code } → confirms activation.
- Disable: { enabled: false, password } → verifies password and disables.
Response Body
application/json
application/json
curl -X PATCH "https://example.com/auth/user/2fa/email" \ -H "Content-Type: application/json" \ -d '{ "enabled": true }'{ "detail": "string"}{ "challenge_id": "331c5928-fdd1-4016-9993-1395c38cce7b", "expires_at": "2019-08-24T14:15:22Z", "resend_available_at": "2019-08-24T14:15:22Z", "delivery_method": "email"}Continuer plus loin