Delete User
The Delete User operation deletes a User object designated by its object ID. This operation is not valid for pattern-based users.
HTTP method and URI
DELETE /api/users/{user-id} In this request, the URI variable {user-id} is the object ID of the User object to be deleted.
Description
This operation removes a specified user from the console. The user is identified by the {user-id} variable in the URI.
Upon successfully removing the user, HTTP status code 204 (No Content) is returned and no response body is provided. An Inventory Change notification is emitted asynchronously.
The URI path must designate an existing User object; otherwise, status code 404 (Not Found) is returned. If the API user does not have user-related-access permission to the designated User object or action/task permission to the Manage Users or Manage User Templates task, whichever is appropriate, status code 404 (Not Found) is returned. If the API user has user-related-access permission to the designated User object but not action/task permission to the Manage Users or Manage User Templates task, whichever is appropriate, status code 403 (Forbidden) is returned. It is an error for an API user to attempt to delete his own User object; any attempt to do so results in status code 400 (Bad Request). If the request URI identifies a template user, and a user or a User Pattern refers to that template user, the request fails and status code 409 (Conflict) is returned. An attempt to delete a pattern-based user is not valid and fails with status code 400 (Bad Request).
Authorization requirements
- Action/task permission to the Manage Users task to delete a non-template user, or the Manage User Templates task to delete a template user.
HTTP status and reason codes
On success, HTTP status code 204 (No Content) is returned and no response body is provided.
The following HTTP status codes are returned for the indicated errors, and the response body is a standard error response body providing the reason code indicated and associated error message.
| HTTP error status code | Reason code | Description |
|---|---|---|
| 400 (Bad Request) | Various | Errors were detected during common request validation. See Common request validation reason codes for a list of the possible reason codes. |
| 312 | This operation is not supported for an object of this type. Pattern-based users may not be deleted. | |
| 313 | The request URI designates the API user's own User object. | |
| 403 (Forbidden) | 1 | The API user does not have the required permission for this operation. |
| 404 (Not Found) | 1 | The request URI does not designate an existing resource of the correct type or the API user has no access permission to it. |
| 409 (Conflict) | 317 | The object cannot be deleted at this time. One or more users or User Patterns refer to this template user. |
| 320 | The object cannot be deleted at this time. It is currently identified as the Automatic Logon ID for the Hardware Management Console. | |
| 321 | The object cannot be deleted at this time. It is currently the only locally-authenticated user with permission to the tasks for managing users and user roles. |
Additional standard status and reason codes can be returned, as described in Invoking API operations.
Example HTTP interaction
DELETE /api/users/e9e8d20a-4a7a-11e4-91ee-1c6f65065a91 HTTP/1.1
x-api-session: 2t4ixcf8nplr7yersi8i9b953fgxvvqxl8c4r066ge9kcyzr4c
204 No Content
server: zSeries management console API web server / 2.0
cache-control: no-cache
date: Thu, 02 Oct 2014 21:27:31 GMT
<No response body>