Retrieves the list of service credentials for a Resource Access Management (RAM) user or all RAM users under an Alibaba Cloud account.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ram:ListServiceCredentials |
list |
*User
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| AllUsers |
boolean |
No |
Specifies whether to query service credentials for all Resource Access Management (RAM) users under the Alibaba Cloud account. If this parameter is set to true, you cannot specify UserPrincipalName at the same time. Valid values:
|
true |
| UserPrincipalName |
string |
No |
The logon name of the Resource Access Management (RAM) user. Queries the service credentials of the specified RAM user. |
test@example.onaliyun.com |
| ServiceName |
string |
No |
The service name of the Alibaba Cloud service. |
xxx.aliyuncs.com |
| MaxResults |
integer |
No |
The maximum number of entries per page. Valid values: 1 to 100. Default value: 10. |
20 |
| NextToken |
string |
No |
The token that is used to retrieve the next page of results. You do not need to specify this parameter for the first API call. |
EXAMPLE******* |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
D80A0F97-6F12-5CD1-A70A-77A03BF4CFC5 |
| ServiceCredentials |
array<object> |
The list of service credentials. |
|
|
object |
The service credential information. |
||
| ServiceCredentialId |
string |
The ID of the service credential. |
SC************* |
| ServiceCredentialName |
string |
The name of the service credential. |
test |
| ServiceName |
string |
The service name of the Alibaba Cloud service. |
xxx.aliyuncs.com |
| UserPrincipalName |
string |
The logon name of the Resource Access Management (RAM) user. |
test@example.onaliyun.com |
| CreateTime |
string |
The time when the service credential was created. |
2026-05-07T05:49:57Z |
| ExpirationTime |
string |
The expiration time. This field is not returned for service credentials that are permanently valid. |
2026-06-07T05:49:57Z |
| Status |
string |
The status of the service credential. |
Active |
| IsTruncated |
boolean |
Indicates whether there is a next page of results. |
true |
| NextToken |
string |
The token that is used to retrieve the next page of results. |
EXAMPLE******* |
| MaxResults |
integer |
The maximum number of entries per page. |
20 |
Examples
Success response
JSON format
{
"RequestId": "D80A0F97-6F12-5CD1-A70A-77A03BF4CFC5",
"ServiceCredentials": [
{
"ServiceCredentialId": "SC*************",
"ServiceCredentialName": "test",
"ServiceName": "xxx.aliyuncs.com",
"UserPrincipalName": "test@example.onaliyun.com",
"CreateTime": "2026-05-07T05:49:57Z",
"ExpirationTime": "2026-06-07T05:49:57Z",
"Status": "Active"
}
],
"IsTruncated": true,
"NextToken": "EXAMPLE*******",
"MaxResults": 20
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.