Skip to content

Delete User

DELETE /api/user/{id}

Required privilege: Users / Edit CSRF header required: X-XSRF-TOKEN

Performs a soft delete - the user's status is set to Inactive and their data is preserved for audit history. The account can be reactivated via Update User.


Path Parameters

Parameter Type Required Description
id integer Yes Internal user identifier

Response

HTTP/1.1 200 OK

{
  "message": "User deactivated successfully."
}

Errors

Status Code Description
400 User.NotFound No user with this ID
400 User.CannotModifySuperuser Cannot delete protected account
403 User.NotPrivileged Insufficient privilege

Code Examples

CSRF=$(grep csrf_access_token cookies.txt | awk '{print $NF}')
curl -b cookies.txt -X DELETE https://acme.knosc.com/api/user/42 \
  -H "X-XSRF-TOKEN: $CSRF"