Delete a user
DELETE/users/:username
Deletes a user outright. There is no soft delete, no archive and no undo,
and re-creating the same username afterwards produces a new user with a
new id.
The one guard is a check for AWS access. If the user has any
permission set assignment made directly to them, the deletion is refused
with a 409 and nothing is removed. Clear the assignments with
DELETE /permission-set-assignments/{id} first and retry.
That guard has two edges worth knowing before you rely on it:
- It counts direct assignments only. Access the user holds through a group does not block the deletion: the user disappears while the group assignment stays behind, still granting the role to everyone else in the group.
- It matches on the exact value in the path. Deleting the user by email address looks up assignments under that email, finds none because they are recorded against the username, and deletes the user with their AWS access unchecked. Always delete by username.
Nothing else is cleaned up. Custom application assignments, portal access records and Just-In-Time history that reference this user are all left in place, pointing at someone who no longer exists.
The operation is not idempotent: a second DELETE of the same user
returns 404. It answers 200 with a body, not 204, and that body
echoes the username rather than the deleted user. Fetch the user first
if you want a copy of it.
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 500
The user was deleted.
Authentication failed: the X-API-Token header was missing, malformed,
expired or not recognised.
This response is text/plain, not JSON. It is written by
http.Error in the authentication middleware, which runs before any
handler and therefore before anything that would build a JSON envelope.
A client that unconditionally JSON-parses response bodies will fail on
this one, so check the status code first.
The token is valid, but it is not allowed to act on this tenant.
An API token is minted inside one tenant and stays bound to it for life.
Sending it to a path whose tenant segment names a different tenant is
refused here, in middleware, before the operation runs, so this says
nothing about the resource you asked for, only about which tenant the
path named. Check the tenant server variable against the console the
token was created in.
No user in your tenant has this username or this email address, so
nothing was deleted. A repeated DELETE lands here.
The user still has permission set assignments made directly to them and nothing was deleted. The account is untouched and still usable.
The message names how many assignments are in the way, but not
which ones. List them with
GET /users/{username}/effective-assignments (the entries whose
assignmentType is direct are the blocking ones), delete each
through DELETE /permission-set-assignments/{id}, and retry.
The assignment check or the deletion itself failed. Read error to
tell a database problem from a directory one.