Skip to main content

Two Factor Auth - Admin Check

Endpoint

/i/two-factor-auth?method=admin_check

Overview

Returns whether a target user currently has 2FA enabled.

Authentication

Countly API supports three authentication methods:

  1. api_key=YOUR_API_KEY
  2. auth_token=YOUR_AUTH_TOKEN
  3. countly-token: YOUR_AUTH_TOKEN

Permissions

Requires Global Admin.

Request Parameters

ParameterTypeRequiredDescription
methodStringYesMust be admin_check.
api_keyStringYes (or use auth_token)API key for authentication.
auth_tokenStringNoAuth token as query parameter or countly-token header.
uidStringYesTarget user id.

Response

Success Response

{
"result": "true"
}

or

{
"result": "false"
}

Response Fields

FieldTypeDescription
resultStringString boolean ("true" or "false").

Error Responses

  • 400
{
"result": "User id required"
}
  • 404
{
"result": "User does not exist"
}
  • 500
{
"result": "Database error while checking 2FA"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Admin check successGlobal admin and valid uid that existsReads member record and checks two_factor_auth.enabled.Wrapped result string: "true" or "false".
Validation failureMissing uidStops before DB read.Wrapped error in result.
Missing userValid uid but member not foundReturns not-found response.Wrapped error in result.
Database failureDB read errorReturns server error.Wrapped error in result.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersUser account lookupReads two_factor_auth.enabled for target user.

Examples

Check user 2FA status

/i/two-factor-auth?api_key=YOUR_API_KEY&method=admin_check&uid=65f1f7b2ad5b9b001f12ab34

Last Updated

2026-03-05