Alibaba Cloud assigns a unique RequestId to every API request. Use the RequestId to diagnose errors in OpenAPI Troubleshoot or audit calls in ActionTrail.
Methods
You can retrieve the RequestId from the API response in various ways, depending on your workflow:
Console operations: Use browser developer tools.
API debugging: Use OpenAPI Explorer.
Code integration: Use an Alibaba Cloud SDK.
Command-line operations: Use the Alibaba Cloud CLI.
Infrastructure as code: Use Terraform.
A RequestId is a UUID-formatted string such asEB2D2E3C-DE2D-5ABD-8F40-7FA3E6D31AF4. If you find this field in the response, you have successfully retrieved the RequestId. The RequestId appears in both successful and error responses. If a request returns an error, enter the RequestId in OpenAPI Troubleshoot to get a diagnosis and solution. For permission errors, you can also get the specific unauthorized action (AuthAction) and the related encrypted diagnostic message (EncodedDiagnosticMessage) from theAccessDeniedDetailfield of the error response.
Use browser developer tools in the console
When you perform operations in the console, open the browser developer tools (F12) and filter for api.json? to view the RequestId of a request.
For example, when a RAM user without sufficient permissions triggers a Forbidden.RAM error, the console displays an Access Denied dialog box that contains fields such as Error code, Request ID, Action, and Identity principal type. Filter for the api.json?action=ModifySecurityGroupAttribute request in the network panel. The JSON response shows the corresponding requestId and the error details in accessDeniedDetail, which include the AuthAction, AuthPrincipalType, NoPermissionType, and PolicyType fields.
Use OpenAPI Explorer
When you debug an API in OpenAPI Explorer, the RequestId of the request appears in the call result.
The JSON response of the call also contains the following key fields:
HostId: The endpoint of the cloud service that processed the request, such as
ecs-cn-hangzhou.aliyuncs.com.Code: The error code. For example,
Forbidden.RAMindicates that the RAM user is not authorized to operate on the specified resource.Message: The error message that describes the cause of the failure.
Recommend: A URL to the OpenAPI Troubleshoot page for the error code. Open the URL to view diagnostic information and solutions.
AccessDeniedDetail: The details of the permission denial, including key sub-fields such as
AuthAction,AuthPrincipalType, andEncodedDiagnosticMessage.
Use SDKs
When you use an Alibaba Cloud SDK, you can get the RequestId from the API response. If an error occurs, catch the corresponding exception to get the error information, including the RequestId.
try {
ModifySecurityGroupAttributeRequest modifySecurityGroupAttributeRequest = new ModifySecurityGroupAttributeRequest()
.setRegionId("cn-chengdu")
.setSecurityGroupId("sg-2xxx")
.setDescription("only test");
ModifySecurityGroupAttributeResponse response = client.modifySecurityGroupAttributeWithOptions(modifySecurityGroupAttributeRequest, runtimeOptions);
System.out.println(new Gson().toJson(response));
} catch (Exception e) {
if (e instanceof TeaException) {
TeaException teaException = (TeaException) e;
System.err.println("Request ID: " + teaException.getRequestId());
System.err.println("Error Code: " + teaException.getCode());
System.err.println("Error Message: " + teaException.getMessage());
System.err.println("Error Data: " + teaException.getData());
throw new RuntimeException("API call failed", teaException);
} else {
System.err.println("Unexpected error occurred: " + e.getMessage());
throw new RuntimeException("Unexpected error", e);
}
}The getRequestId() method on the exception object returns the RequestId directly. You can also find the RequestId in the error output:
Error Code: Forbidden.RAM
Error Message: code: 403, User not authorized to operate on the specified resource, or this API doesn't support RAM. request id: EB2D2E3C-DE2D-5ABD-8F40-7FA3E6D31AF4
Error Data: {RequestId=EB2D2E3C-DE2D-5ABD-8F40-7FA3E6D31AF4, HostId=ecs-cn-hangzhou.aliyuncs.com, Code=Forbidden.RAM, Message=User not authorized to operate on the specified resource, or this API doesn't support RAM., Recommend=https://api.alibabacloud.com/troubleshoot?q=Forbidden.RAM&product=Ecs&requestId=EB2D2E3C-DE2D-5ABD-8F40-7FA3E6D31AF4, AccessDeniedDetail={PolicyType=ResourceGroupLevelIdentityBasedPolicy, AuthPrincipalOwnerId=1xxx6, EncodedDiagnosticMessage=AQIBIAAAAH13IrZA790Zkpi90wMZV/djLrVZYZ095+ad/t9KTHUamUspajhw3fLk2bPC33jhm9N7YhLxJBLwB4TzYmXq/afb6N916JVS3yCOw+TECTGjZr4QglIZsFA+h+ReEbwG+LpVFh12zZJrS8kkCW+8VNSLM1cfBKkNon9hAUyA5WK3ONRSCPFoDPplynjQ3qsYUTdtXHgsAxIEOZa6xCr+e56B0wmhm3x3ZjcRznY1D8u0Yfwn0cPf1oLFC4F1A1B2UeJBxzhn2t7s8NTAYcNBZp03zLu8VuL6gkAwJyZSEabaXs1bhidwZDrTc/JkToX/0AhHh0b8j/qqTZ6K9KtcZ7PJT0bESMPjXxezm4fr0CvozoHb9zAcyZkoRg1XkJfV9bcxvoWPaRcOdbyQSHMbRV089VUY4h8Cb5L8IblQt8TKREwrJJijrF80HfFiAfYORLQWCptgA/LeTZJisebTTNNcwmhdOy23NhFFWORjL9t4uhygqRWZqgwLb7FZMenr9PiTP4xVYcYELs/fsHKAbnIcn+XAKjaucIxqFucbmMLi1fuaeYJa0YY7FyAuxyuiCRwFHMtCRj191R1R2FSin3OXfsPd0K1u30m1Zi10XTaOmn69mScRe/NYGw5WW+pC/y7itJyLztHZp+S2o9kTEH6e1kNSV4FwsSwf4/+SKWa}}Use the Alibaba Cloud CLI
When you use the Alibaba Cloud CLI, the RequestId appears in the CLI output.
shell@Alicloud:~$ aliyun ecs ModifySecurityGroupAttribute --region cn-chengdu --RegionId 'cn-chengdu' --SecurityGroupId 'sg-2xxx' --Description 'test sg'
ERROR: SDK.ServerError
ErrorCode: Forbidden.RAM
Recommend: https://api.alibabacloud.com/troubleshoot?q=Forbidden.RAM&product=Ecs&requestId=9F1F4997-A1E7-5B35-A5B7-7D668F4F4A51
RequestId: 9F1F4997-A1E7-5B35-A5B7-7D668F4F4A51
Message: User not authorized to operate on the specified resource, or this API doesn't support RAM.
RespHeaders: map[Access-Control-Allow-Origin:[*] Access-Control-Expose-Headers:[*] Connection:[keep-alive] Content-Length:[1898] Content-Type:[applica
tion/json;charset=utf-8] Date:[Mon, 22 Sep 2025 06:09:05 GMT] Keep-Alive:[timeout=25] Vary:[Accept-Encoding] X-Acs-Request-Id:[9F1F4997-A1E7-5B35-A5B7
-7D668F4F4A51] X-Acs-Trace-Id:[06140130ef99e54579652c9ced2e0a79]]
AccessDeniedDetail: map[AuthAction:ecs:ModifySecurityGroupAttribute AuthPrincipalDisplayName:2xxx 4 AuthPrincipalOwnerId:14xxx 6
AuthPrincipalType:SubUser EncodedDiagnosticMessage:AQIBIAAAAHu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CpTc/nlExiWhn1nHMJVQ7OtssRCsrEcxyaknzqMZBLWDdOWJ1j9JWJ+HtaKZXPjLU+03
GJ5JZ4o97YutOwBtPi4Q9A4b0v+nCahKPLbOHLtGSeJOVnxFk1PIQGK/h6a6dabJPF8XXwNww9hJsgcK2+huCjsB1NcDq7/uI= NoPermissionType:ImplicitDeny PolicyType:ResourceG
roupLevelIdentityBasedPolicy]
shell@Alicloud:~$Use Terraform
Terraform orchestrates multiple resources, so it does not print the RequestId when a run succeeds. If an error occurs during a Terraform run, the error output includes the RequestId.
Error: [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_security_group_rule.go:209:
SDK.ServerError
ErrorCode: Forbidden.RAM
Recommend: https://api.alibabacloud.com/troubleshoot?q=Forbidden.RAM&product=Ecs&requestId=F7A01BD7-5771-544D-A80F-CD290806BBFA
RequestId: F7A01BD7-5771-544D-A80F-CD290806BBFA
Message: User not authorized to operate on the specified resource, or this API doesn't support RAM.
RespHeaders: map[Access-Control-Allow-Origin:[*] Access-Control-Expose-Headers:[*] Connection:[keep-alive] Content-Type:[application/json;charset=utf-8] Date:[Mon, 22 Sep 2025 06:28:49 GMT] Keep-Alive:[timeout=25] Vary:[Accept-Encoding Accept-Encoding] X-Acs-Request-Id:[F7A01BD7-5771-544D-A80F-CD290806BBFA] X-Acs-Trace-Id:[56259f4ddd3121273aedd3539554b295]]
AccessDeniedDetail: map[AuthAction:ecs:DescribeSecurityGroupAttribute AuthPrincipalDisplayName:2 ]44 AuthPrincipalOwnerId:1 1
6 AuthPrincipalType:SubUser EncodedDiagnosticMessage:AQIBIAAAAMAMz25m9UV+V73fYm+VwVpWAWalMx3dMLYLsDdvHje27uM8nS3Cfm+foIiXEIK+O0WPs41Aaw6QjwBXBjhN7c+N1A
g2FtPaTVWqa8gcqjDQUMO2nzu2orWnfdi12kFfrOZTOQQ1HU97svdvaB+dqur96J8MycNt5UBfp2Afq2H2loKzgNKftodLq6Bcpvxpax76L2MwQD2WpInUU/7i2Dfr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icy]Use Signature V3 directly
If you call an API by using Signature V3 instead of an SDK, the error response contains the RequestId in the JSON body.
The following Java sample code calls the ECS ModifySecurityGroupAttribute operation by using Signature V3:
private static final String ALGORITHM = "ACS3-HMAC-SHA256";
public static void main(String[] args) {
String httpMethod = "POST";
String canonicalUri = "/";
String host = "ecs.cn-chengdu.aliyuncs.com";
String xAcsAction = "ModifySecurityGroupAttribute";
String xAcsVersion = "2014-05-26";
SignatureRequest signatureRequest = new SignatureRequest(httpMethod, canonicalUri, host, xAcsAction, xAcsVersion);
signatureRequest.queryParam.put("SecurityGroupId", "sg-2vxxx");
signatureRequest.queryParam.put("Description", "test sg");
signatureRequest.queryParam.put("RegionId", "cn-chengdu");
}The call returns a Forbidden.RAM error. You can use the RequestId E172420D-62F4-5B54-879B-6926F779ED38 to troubleshoot the issue. The following is the complete console output:
authorization========>ACS3-HMAC-SHA256 Credential=LTAxxx ,SignedHeaders=host;x-acs-action;x-acs-content-sha256;x-acs-date;x-acs-signature-nonce;x-acs-version,Signature=fd3ba03422d195df95992f351cbe8bdc73de34cee61c6d94e1cf720406cfdbe4
V3 signature invoke result:
{"RequestId":"E172420D-62F4-5B54-879B-6926F779ED38","HostId":"ecs.cn-chengdu.aliyuncs.com","Code":"Forbidden.RAM","Message":"User not authorized to operate on the specified resource, or this API doesn't support RAM.","Recommend":"https://api.alibabacloud.com/troubleshoot?q=Forbidden.RAM&product=Ecs&requestId=E172420D-62F4-5B54-879B-6926F779ED38","AccessDeniedDetail":{"PolicyType":"ResourceGroupLevelIdentityBasedPolicy","AuthPrincipalOwnerId":"1xxx","EncodedDiagnosticMessage":"AQBIAAAAAQBSngosi X6fJmgifT84XorhK4BRg2Sou2s7OrXC9gig3UsY8fkC1px/q5sZZaE8SQv+FJtVx+ltT8dX11y2rIqnsfTIQtXqtCN3oFWFzs2TVg64/YnzemB0e/r4zyRuGT98DajQhDtfv2J/ua9WmgLpdv90n5OA4hctr/zabwYW1VokhLwLWfCvmYm6Q/A2/9hXf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rincipalDisplayName":"2xxx4","NoPermissionType":"ImplicitDeny","AuthAction":"ecs:ModifySecurityGroupAttribute"}}Diagnose errors with a RequestId
OpenAPI Troubleshoot
Enter a RequestId on the page to query the call chain, basic information, authentication information, and response content of the request. If the request returned an error, the diagnostic result also includes a solution.
If a request is denied because of insufficient RAM permissions, get the EncodedDiagnosticMessage parameter from the error response and call the DecodeDiagnosticMessage operation to decode the permission diagnostic message.
For an insufficient RAM permission error, the Solution tab displays the error code (such as Forbidden.RAM), the error message, and the permission diagnosis result, which includes the identity that made the call, the action that requires authorization, and the recommended system policies. The Log Information tab displays a visual analysis of the call chain from the caller IP address, through the UserAgent and the endpoint, to the destination cloud service, along with the HTTP status code.
ActionTrail
You can call the LookupEvents operation with a RequestId to query the details of an event. When you call this API operation, set the following values in LookupAttribute:
| Parameter | Description |
| Key | Set to EventId. |
| Value | The actual RequestId. |
Call the operation in Alibaba Cloud API Workbench and set the service address to the target region, such as China (Chengdu). After the call succeeds (status code 200), the Events array in the returned JSON response body contains the event details. The AccessDeniedDetail field of responseElements contains diagnostic information such as PolicyType, AuthPrincipalOwnerId, and EncodedDiagnosticMessage, which you can use to troubleshoot the cause of the permission denial.