Retrieves the list of service credentials for a Resource Access Management (RAM) user or all Resource Access Management (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. When the value is 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 Alibaba Cloud service name. |
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 used to retrieve the next page of results. This parameter is not required for the first API call. |
EXAMPLE******* |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| IsTruncated |
boolean |
Indicates whether there is a next page. |
true |
| MaxResults |
integer |
The maximum number of entries per page. |
20 |
| NextToken |
string |
The token used to retrieve the next page of results. |
EXAMPLE******* |
| RequestId |
string |
The request ID. |
D80A0F97-6F12-5CD1-A70A-77A03BF4CFC5 |
| ServiceCredentials |
array<object> |
The list of service credentials. |
|
|
object |
The service credential information. |
||
| CreateTime |
string |
The time when the service credential was created. Format: RFC 3339 (UTC). Example: 2026-05-07T05:49:57Z. |
2026-05-07T05:49:57Z |
| ExpirationTime |
string |
The expiration time. This field is not returned for permanent service credentials. Format: RFC 3339 (UTC). Example: 2026-06-07T05:49:57Z. |
2026-06-07T05:49:57Z |
| ServiceCredentialId |
string |
The ID of the service credential. |
SC************* |
| ServiceCredentialName |
string |
The name of the service credential. |
test |
| ServiceName |
string |
The Alibaba Cloud service name. |
xxx.aliyuncs.com |
| Status |
string |
The status of the service credential. Valid values:
|
Active |
| UserPrincipalName |
string |
The logon name of the Resource Access Management (RAM) user. |
test@example.onaliyun.com |
Examples
Success response
JSON format
{
"IsTruncated": true,
"MaxResults": 20,
"NextToken": "EXAMPLE*******",
"RequestId": "D80A0F97-6F12-5CD1-A70A-77A03BF4CFC5",
"ServiceCredentials": [
{
"CreateTime": "2026-05-07T05:49:57Z",
"ExpirationTime": "2026-06-07T05:49:57Z",
"ServiceCredentialId": "SC*************",
"ServiceCredentialName": "test",
"ServiceName": "xxx.aliyuncs.com",
"Status": "Active",
"UserPrincipalName": "test@example.onaliyun.com"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.