Attaches a policy to a RAM user.


Use OpenAPI Explorer to perform debug operations and generate SDK code examples.

Request parameters

Parameter Type Required? Example value Description
Action String Yes AttachPolicyToUser

The name of this action.

Value: AttachPolicyToUser

PolicyName String Yes OSS-Administrator The policy name.
PolicyType String Yes Custom

The policy type. If this parameter is left unspecified, all polices are listed.

Valid values: System | Custom

UserName String Yes Alice The username of the RAM user to which the policy is attached.

Response parameters

Parameter Type Example value Description
RequestId String 697852FB-50D7-44D9-9774-530C31EAC572 The request ID.


Request example
&<Common parameters>

Response example

XML format


JSON format



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