All Products
Search
Document Center

Resource Management:ListRoles

Last Updated:Dec 15, 2025

Queries a list of RAM roles.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
PageNumberintegerNo

The page number.

Pages start from page 1. Default value: 1.

1
PageSizeintegerNo

The number of entries per page.

Valid values: 1 to 100. Default value: 10.

10
LanguagestringNo

The language in which you want to return the descriptions of the RAM roles. Valid values:

  • en: English
  • zh-CN: Chinese
  • ja: Japanese
zh-CN

Response parameters

ParameterTypeDescriptionExample
object
PageNumberinteger

The page number.

1
PageSizeinteger

The number of entries per page.

10
RequestIdstring

The request ID.

7B8A4E7D-6CFF-471D-84DF-195A7A241ECB
Rolesarray<object>

The information about the roles.

Roleobject

The information about the role.

Arnstring

The Alibaba Cloud Resource Name (ARN) of the role.

acs:ram::123456789012****:role/ECSAdmin
CreateDatestring

The time when the role was created.

2015-01-23T12:33:18Z
Descriptionstring

The description of the role.

ECS administrator
IsServiceLinkedRoleboolean

Indicates whether the role is a service-linked role.

true
LatestDeletionTaskobject

The information of the most recent deletion task.

CreateDatestring

The time when the deletion task was created.

2018-10-23T12:33:18Z
DeletionTaskIdstring

The ID of the deletion task.

ECSAdmin/cc61514b-26eb-4453-ab53-b142eb70****
MaxSessionDurationlong

The maximum session duration of the role.

3600
RoleIdstring

The ID of the role.

90123456789****
RoleNamestring

The name of the role.

ECSAdmin
RolePrincipalNamestring

The name of the role after authorization.

ECSAdmin@role.123456.onaliyunservice.com
UpdateDatestring

The time when the role was updated.

2016-01-23T12:33:18Z
TotalCountinteger

The total number of roles.

2

Examples

Sample success responses

JSONformat

{
  "PageNumber": 1,
  "PageSize": 10,
  "RequestId": "7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
  "Roles": {
    "Role": [
      {
        "Arn": "acs:ram::123456789012****:role/ECSAdmin",
        "CreateDate": "2015-01-23T12:33:18Z",
        "Description": "ECS administrator",
        "IsServiceLinkedRole": true,
        "LatestDeletionTask": {
          "CreateDate": "2018-10-23T12:33:18Z",
          "DeletionTaskId": "ECSAdmin/cc61514b-26eb-4453-ab53-b142eb70****"
        },
        "MaxSessionDuration": 3600,
        "RoleId": "90123456789****",
        "RoleName": "ECSAdmin",
        "RolePrincipalName": "ECSAdmin@role.123456.onaliyunservice.com",
        "UpdateDate": "2016-01-23T12:33:18Z"
      }
    ]
  },
  "TotalCount": 2
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history