Creates a policy.


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

Request parameters

Parameter Type Required? Example value Description
Action String Yes CreatePolicy

The name of this action.

Value: CreatePolicy

PolicyDocument String Yes {"Statement":[{"Action":["oss:*"],"Effect":"Allow","Resource":["acs:oss:*:*:*"]}],"Version":"1"} The policy text. It can be up to 2048 bytes.
PolicyName String Yes OSS-Administrator

The policy name. It must be 1 to 128 characters in length.

Pattern: ^[a-zA-Z0-9\-]+$

Description String No OSS administrator The policy description. It must be 1 to 1,024 characters in length.

Response parameters

Parameter Type Example value Description
Policy N/A N/A The information about the policy.
CreateDate String 2015-01-23T12:33:18Z The date and time when the policy was created.
DefaultVersion String v1 The default version.
Description String OSS administrator The policy description.
PolicyName String OSS-Administrator The policy name.
PolicyType String Custom The policy type.
RequestId String 9B34724D-54B0-4A51-B34D-4512372FE1BE The request ID.


Request example
&Description=OSS administrator
&<Common parameters>

Response example

XML format

    <Description>OSS administrator</Description>

JSON format

        "Description":"OSS administrator",


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