app:user:delete
Delete a user account. The command runs the same use case as deleting a user in the admin panel (DELETE /api/admin/users/{publicId} in the admin API). To stop someone from signing in while keeping their account, use app:user:disable instead.
Quick start
The Make examples below target the checkout's development preview. For an
installed instance, use the dc function from
Getting started and replace
make exec cmd="php bin/console …" with dc exec app php bin/console ….
make exec cmd="php bin/console app:user:delete alice@baander.app"
Without a terminal, for example in a script:
make exec cmd="php bin/console app:user:delete alice@baander.app --force"
Arguments
| Argument | Required | Description |
|---|---|---|
identifier |
Yes | The user's email address or public ID |
Options
| Option | Default | Description |
|---|---|---|
--force |
— | Delete without asking. Required when no terminal is attached |
--json |
— | Print nothing on success, as the admin API answers 204 No Content; the exit code reports the outcome |
Details
Deletion cannot be undone. On a terminal, the command asks before it deletes; answering no leaves the account as it was. Without a terminal and without --force, the command deletes nothing and exits with code 2.
With --json the command prints nothing on success, because the API answers 204 No Content; read the outcome from the exit code. Errors still go to stderr. --json does not stand in for --force.
The command acts with full authority. It can delete any account, an admin's or a super admin's included, and it does not check whether another super admin remains. If the last super admin is deleted, create a new one with app:user:create and --role=super-admin.
Exit codes
| Code | Meaning |
|---|---|
| 0 | User deleted |
| 1 | No user has the email address or public ID, the operator declined, or another error occurred; the message says why |
| 2 | No terminal is attached and --force was not given; nothing was deleted |