API operation · users group
DELETE
/users/{name}/second-factor
First published 3 Oct 2026
0.1.0Unchanged since publicationClear a user's second factor
Who may call it
AdministratorResellerCustomer
Token scope, any of
usersallAnswers200 OK
Administrators can clear the second factor for another account. Resellers can clear it for their own customers. Use this operation when an account holder loses their second-factor device. The account holder can sign in with their password alone and enrol again from their account page in the web interface.
A request targeting your own account returns 400. To clear your own second factor, supply your password to POST /auth/second-factor/disable.
The response contains the updated account in user. For customers and resellers, home gives the path configured through home_base and uid gives the Linux user ID, or null if the Linux account is missing. Both fields are null for administrators.
As a command
Run as root on the serverParameters
namepath ·UsernameRequiredExample
See the API overview for how to set $API and $TOKEN.Request
curl -sS -X DELETE "$API/users/alice/second-factor" \ -H "Authorization: Bearer $TOKEN"
Response ·
200 OK{
"user": {
"backups": true,
"bandwidth_bytes": 1,
"bandwidth_cut": true,
"bandwidth_cut_at": "text",
"bandwidth_limit_bytes": 1,
"created_at": "2026-09-09T10:15:00Z",
"customers": 1,
"disk_limit_bytes": 1,
"email": "alice@example.com",
"home": "text",
"id": 1,
"move_state": "leaving",
"name": "alice",
"owner": "text",
"owner_id": 1,
"package": "basic",
"package_backups": true,
"package_id": 1,
"package_shell": true,
"role": "user",
"second_factor": true,
"shell": true,
"status": "active",
"system_password": true,
"uid": 1
}
}Errors
36 errors, each a status and a sentence400--name is required400<name> has an owner: move them to the administrator before changing their role400<name> is an administrator: administrators have no home, so nothing to back up400<name> is an administrator: administrators have no system account400<name> is an administrator: administrators have no system account, so no shell400Cannot demote or suspend the last active administrator400Domain name required400Domain name too long400Invalid IPv4 address400Invalid IPv6 address400Invalid boolean400Invalid domain name400Invalid email address400Invalid id400Invalid password hash400Invalid password: 8 to 128 printable characters400Invalid port400Invalid role: admin, user or reseller400Invalid setting key400Invalid status400Invalid system password hash400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Nothing to change400Only a customer has an owner: an administrator or a reseller is the administrator's own400The second factor can only be turned off here; a user enrols from their own page400Turn your own second factor off from your account, with your password400Username '<value>' is reserved401Authentication required401The password is not the panel password404Setting '<key>' not found404User '<name>' not found409<name> is on the package <p.name> of the reseller <p.owner>: change the package before the move409<name> owns <owned> 409<who> and its bandwidth for the month is used up: 409<who> and its disk is used up: 409The package <p.name> allows <limit> No error of this operation matches.
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/delete-users-name-second-factor/