All Products
Search
Document Center

Resource Management:DeleteRole

Last Updated:Oct 26, 2026

Deletes a role.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

RoleName

string

Yes

The name of the role.

The name must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-).

ECSAdmin

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

898FAB24-7509-43EE-A287-086FE4C44394

Examples

Success response

JSON format

{
  "RequestId": "898FAB24-7509-43EE-A287-086FE4C44394"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter.RoleName.InvalidChars The specified role name contains invalid characters. The specified role name contains invalid characters.
400 InvalidParameter.RoleName.Length The maximum length of the role name is exceeded. The maximum length of the role name is exceeded.
404 EntityNotExist.Role The role does not exist. The role does not exist.
409 DeleteConflict.Role.Policy The role cannot have any attached policies when you delete it. The role cannot have any attached policies when you delete it.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.