Creates an AccessKey pair for a RAM user.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateAccessKey

The operation that you want to perform. Set the value to CreateAccessKey.

UserName String No zhangq****

The name of the RAM user. If a RAM user calls this operation and does not specify this parameter, an AccessKey pair is created for the RAM user.

Response parameters

Parameter Type Example Description
AccessKey

The information of the AccessKey pair.

AccessKeyId String 0wNEpMMlzy7s****

The AccessKey ID.

AccessKeySecret String PupkTg8jdmau1cXxYacgE736PJ****

The AccessKey secret.

CreateDate String 2015-01-23T12:33:18Z

The time when the AccessKey pair was created.

Status String Active

The status of the AccessKey pair. Valid values: Active and Inactive.

RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

The ID of the request.

Examples

Sample requests


https://ram.aliyuncs.com/?Action=CreateAccessKey
&UserName=zhangq****
&<Common request parameters>

Sample success responses

XML format

<RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
<AccessKey>
    <AccessKeyId>0wNEpMMlzy7s****</AccessKeyId>
    <AccessKeySecret>PupkTg8jdmau1cXxYacgE736PJ****</AccessKeySecret>
    <Status>Active</Status>
    <CreateDate>2015-01-23T12:33:18Z</CreateDate>
</AccessKey>

JSON format

{
	"AccessKey":{
		"Status":"Active",
		"AccessKeySecret":"PupkTg8jdmau1cXxYacgE736PJ****",
		"AccessKeyId":"0wNEpMMlzy7s****",
		"CreateDate":"2015-01-23T12:33:18Z"
	},
	"RequestId":"04F0F334-1335-436C-A1D7-6C044FE73368"
}

Error codes

For a list of error codes, visit the API Error Center.