All Products
Search
Document Center

Resource Access Management:CreateAccessKey

更新時間:May 08, 2024

Creates an AccessKey pair for an Alibaba Cloud account or a RAM user.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ram:CreateAccessKeyWrite
  • User
    acs:ram::{#accountId}:user/{#UserName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
UserPrincipalNamestringNo

The logon name of the RAM user.

If this parameter is empty, an AccessKey pair is created for the current user.

test@example.onaliyun.com

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

19DDD9F7-AFCC-4D72-8CBA-CCE5A142E7AB
AccessKeyobject

The information of the AccessKey pair.

Statusstring

The status of the AccessKey pair. Valid values:

  • Active
  • Inactive
Active
AccessKeySecretstring

The AccessKey secret provided to you by Alibaba Cloud.

Y3MSLE6OgizS4qrz5LVFDoyZEL****
AccessKeyIdstring

The AccessKey ID provided to you by Alibaba Cloud.

LTAI4G3HaMmeHpay2gcq****
CreateDatestring

The time when the AccessKey pair was created.

2020-10-15T08:08:54Z

Examples

Sample success responses

JSONformat

{
  "RequestId": "19DDD9F7-AFCC-4D72-8CBA-CCE5A142E7AB",
  "AccessKey": {
    "Status": "Active",
    "AccessKeySecret": "Y3MSLE6OgizS4qrz5LVFDoyZEL****",
    "AccessKeyId": "LTAI4G3HaMmeHpay2gcq****",
    "CreateDate": "2020-10-15T08:08:54Z"
  }
}

Error codes

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