twoFactorStatus
Requires an authenticated session.
Returns whether two-factor sign-in is on for the signed-in user and whether backup codes exist.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query TwoFactorStatus {
twoFactorStatus {
enabled
hasBackupCodes
lastUsed
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query TwoFactorStatus {\n twoFactorStatus {\n enabled\n hasBackupCodes\n lastUsed\n }\n}"
}
EOF
Response:
{
"data": {
"twoFactorStatus": {
"enabled": true,
"hasBackupCodes": true,
"lastUsed": "2025-01-15T00:00:00Z"
}
}
}
twoFactorStatus: TwoFactorStatusResponse!
Type
TwoFactorStatusResponse object
Whether two-factor sign in is on.