---
title: "Delete a user"
type: reference
method: DELETE
path: /rest-api/system-users/{userId}/delete.do
tag: "Users"
---

# Delete a user

`DELETE https://YOUR-NETWORK-DOMAIN/rest-api/system-users/{userId}/delete.do`

Removes a user account for good, the way the console's Users grid does. The caller needs the DELETE permission on the target's role: at All level it may delete any user of that role, at Shared level only the users it owns (the statistics accounts it created). A user whose role was deleted takes MANAGE_ROLE on some role instead - and, if it was an administrator, an administrator - and a caller cannot delete their own account. This is not a soft delete and cannot be undone: the account and everything that hangs off it go with it - its advertiser, site, action and template shares (so an advertiser or site it was the owner of is left without one), its saved reports and their schedules, its dashboard widgets, notification settings and notifications, its scheduled events, payment details, limits, API-key and IP whitelist rows, and its action-log history. The advertisers, campaigns, sites and placements themselves are not touched, and neither is the traffic they have served. Accounts the deleted user owned are left without an owner, not deleted. The deletion is written to the action log, and the user is gone from /rest-api/system-users/search.do afterwards.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `userId` | integer | yes | `42` | Numeric id of the user to delete, as /rest-api/system-users/search.do reports it |

## Responses

- `200` — {success, deletedUserId, username}
- `400` — userId is the caller's own account
- `401` — Unauthorized - authentication error
- `403` — The caller lacks DELETE on the target's role (or MANAGE_ROLE for a user whose role was deleted); the message names it
- `404` — No user with this id

## Example request

```bash
curl --request DELETE \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/system-users/42/delete.do' \
  --header 'X-Api-Key: YOUR_API_KEY'
```

Source: https://epom.com/ad-server/docs/api/users/delete-system-users