# DELETE /users/{name}/second-factor

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the users group.

Clear a user's second factor

- Who may call it: administrator, reseller
- Token scope, any of: users, all
- Answers: 200 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

- [urbestack-user-set](https://urbestack.com/docs/commands/urbestack-user-set.md): Updates an existing UrbeStack account.

## Parameters

- `name` (path, Username, required)

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
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

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