Get your free beta license ↗
API operation · users group
DELETE

/users/{name}/second-factor

First published 3 Oct 20260.1.0Unchanged since publication

Clear a user's second factor

Who may call it
AdministratorResellerCustomer
Token scope, any of
usersall
Answers200 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 server

Parameters

namepath ·UsernameRequired

Example

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 sentence
400--name is required
400<name> has an owner: move them to the administrator before changing their role
400<name> is an administrator: administrators have no home, so nothing to back up
400<name> is an administrator: administrators have no system account
400<name> is an administrator: administrators have no system account, so no shell
400Cannot demote or suspend the last active administrator
400Domain name required
400Domain name too long
400Invalid IPv4 address
400Invalid IPv6 address
400Invalid boolean
400Invalid domain name
400Invalid email address
400Invalid id
400Invalid password hash
400Invalid password: 8 to 128 printable characters
400Invalid port
400Invalid role: admin, user or reseller
400Invalid setting key
400Invalid status
400Invalid system password hash
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Nothing to change
400Only a customer has an owner: an administrator or a reseller is the administrator's own
400The second factor can only be turned off here; a user enrols from their own page
400Turn your own second factor off from your account, with your password
400Username '<value>' is reserved
401Authentication required
401The password is not the panel password
404Setting '<key>' not found
404User '<name>' not found
409<name> is on the package <p.name> of the reseller <p.owner>: change the package before the move
409<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>
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/