Two Factor Auth - Disable
Endpoint
/i/two-factor-auth?method=disable
Overview
Disables 2FA for the authenticated user.
Authentication
Countly API supports three authentication methods:
api_key=YOUR_API_KEYauth_token=YOUR_AUTH_TOKENcountly-token: YOUR_AUTH_TOKEN
Permissions
Requires authenticated user context.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
method | String | Yes | Must be disable. |
api_key | String | Yes (or use auth_token) | API key for authentication. |
auth_token | String | No | Auth token as query parameter or countly-token header. |
Configuration Impact
| Setting | Default | Affects | User-visible impact |
|---|---|---|---|
two-factor-auth.globally_enabled | false | Disable flow | When true, user self-disable is blocked with 403. |
Response
Success Response
{
"result": "Disabled 2FA for user"
}
Response Fields
| Field | Type | Description |
|---|---|---|
result | String | Result message. |
Error Responses
403
{
"result": "Can not disable 2FA for user when it is globally enabled"
}
500
{
"result": "Database error while disabling 2FA"
}
Behavior/Processing
- Clears
two_factor_auth.secret_tokenand setstwo_factor_auth.enabled=false. - Emits system log action:
two_factor_auth_disabled.
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.members | User account settings | Disables user 2FA and removes stored secret. |
countly.systemlogs | Audit trail | Receives two_factor_auth_disabled action. |
Examples
Disable 2FA for current user
/i/two-factor-auth?api_key=YOUR_API_KEY&method=disable
Related Endpoints
Last Updated
2026-03-05