Skip to main content

Admin users

Generated from apiome-rest/openapi.yaml (API version 1.307.0) — do not edit by hand. How to authenticate is on the REST API reference.

Tag: admin-users · 1 operation

POST /v1/admin/users/{user_id}/two-factor/reset​

Admin Reset Two Factor

Reset any user's two-factor, as the installation's super-admin.

Clears the user's authenticator and backup codes, forgets their trusted devices and ends every one of their sessions. Their next sign-in needs the first factor only. The reset is recorded in the authentication ledger with the reason given.

Args: user_id: The user to reset. payload: The reason, and the user's email typed out as confirmation.

Returns: What was cleared.

Operation id: admin_reset_two_factor_v1_admin_users__user_id__two_factor_reset_post

Parameters

NameInTypeRequiredDescription
user_idpathstringyesPath parameter identifying the user id segment.
X-Admin-Sessionheaderstring or nullnoHeader parameter: X Admin Session.
admin_sessioncookiestring or nullnoCookie parameter: admin session.

Request body (required)

Request body for admin reset two factor.

Responses

StatusDescriptionBody
200Successful response for admin reset two factor.application/json TwoFactorResetResult
401No super-admin session presented.—
403Super-admin session invalid or expired.—
404No user has that id.—
422Reason missing or out of range, or the confirmation does not match.—

Schemas used​

TwoFactorResetRequest​

Why the factor is being reset, and proof the caller means this user.

PropertyTypeRequiredDescription
reasonstringyesWhy the two-factor is being reset (10–500 characters). Stored in the audit trail.
confirmstringyesThe target user's email address, typed out to confirm the reset.

TwoFactorResetResult​

What a reset cleared.

PropertyTypeRequiredDescription
user_idstringyesThe user whose two-factor was reset.
emailstring or nullnoThat user's email address.
namestring or nullnoThat user's display name.
had_two_factorbooleanyesWhether the user had two-factor on before the reset.
sessions_revokedintegeryesHow many of the user's sessions were ended.
trusted_devices_revokedintegeryesHow many trusted-device records were removed.