edit-icon download-icon

DeleteUser

Last Updated: Nov 10, 2017

Interface description

Deletes an RAM user.

  • Before deleting a user, you must ensure that the user does not have any authorization policies or belong to any user group.

Request parameters

Action

  • Name: Action
  • Type: String
  • Required: Yes
  • Description: Required system parameter. The parameter value is “DeleteUser”.

UserName

  • Name: UserName
  • Type: String
  • Required: Yes
  • Description: User name.Example: zhangqiang
  • Format: ^[a-zA-Z0-9\.@\-_]+$

Return parameters

Only public parameters are returned. For details, see Public return parameters.

Required permissions

Action

ram:DeleteUser

Resource

acs:ram:*:${AccountId}:user/${UserName}

Error messages

InvalidParameter.UserName.InvalidChars
  • HTTP Status: 400
  • Error Message: The parameter - “UserName” contains invalid chars.
InvalidParameter.UserName.Length
  • HTTP Status: 400
  • Error Message: The parameter - “UserName” beyond the length limit.
EntityNotExist.User
  • HTTP Status: 404
  • Error Message: The user does not exist.
DeleteConflict.User.Group
  • HTTP Status: 409
  • Error Message: The user CAN NOT be in any group while deleting the user.
DeleteConflict.User.AccessKey
  • HTTP Status: 409
  • Error Message: The user CAN NOT has any access key while deleting the user.
DeleteConflict.User.LoginProfile
  • HTTP Status: 409
  • Error Message: The user CAN NOT has any login profile while deleting the user.
DeleteConflict.User.MFADevice
  • HTTP Status: 409
  • Error Message: The user CAN NOT has any mfa device while deleting the user.
DeleteConflict.User.Policy
  • HTTP Status: 409
  • Error Message: The user CAN NOT has any attached policy while deleting the user.

Operation examples

Request example

  1. https://ram.aliyuncs.com/?Action=DeleteUser
  2. &UserName=zhangqiang
  3. &<Public request parameters>

Return example

XML format

  1. <DeleteUserResponse>
  2. <RequestId>1C488B66-B819-4D14-8711-C4EAAA13AC01</RequestId>
  3. </DeleteUserResponse>

JSON format

  1. {
  2. "RequestId": "1C488B66-B819-4D14-8711-C4EAAA13AC01"
  3. }
Thank you! We've received your feedback.