All Products
Search
Document Center

Object Storage Service:PutAccessPointPolicy

Last Updated:Jun 18, 2026

Configures a policy for an access point.

Usage notes

An Alibaba Cloud account has the permissions to configure access point policies by default. To configure access point policies as a RAM user or by using Security Token Service (STS), you must have the oss:PutAccessPointPolicy permission.

Request syntax

PUT /?accessPointPolicy HTTP/1.1
Date: GMT Date
Content-Length: ContentLength
Content-Type: application/json
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
x-oss-access-point-name: apname
Authorization: SignatureValue

Policy written in JSON

Request headers

Header

Type

Required

Example

Description

x-oss-access-point-name

String

Yes

ap-01

The name of the access point.

This request also includes common request headers such as Date and Authorization. For more information, see Common HTTP headers.

Response headers

The response contains only common response headers. For more information, see Common HTTP headers.

Examples

  • Sample request

    PUT /?accessPointPolicy HTTP/1.1
    Date: Mon, 19 Jun 2023 03:15:40 GMT
    Content-Length: 230
    Content-Type: application/json
    Host: oss-example.oss-cn-hangzhou.aliyuncs.com
    x-oss-access-point-name: ap-01
    Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,AdditionalHeaders=content-length,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e
    
    {
       "Version":"1",
       "Statement":[
       {
         "Action":[
           "oss:PutObject",
           "oss:GetObject"
        ],
        "Effect":"Deny",
        "Principal":["27737962156157xxxx"],
        "Resource":[
           "acs:oss:cn-hangzhou:111933544165xxxx:accesspoint/ap-01",
           "acs:oss:cn-hangzhou:111933544165xxxx:accesspoint/ap-01/object/*"
         ]
       }
      ]
     }
  • Sample response

    HTTP/1.1 200 OK
    x-oss-request-id: 5C1B138A109F4E405B2D****
    Date: Mon, 19 Jun 2023 03:15:40 GMT
    Content-Length: 0
    Connection: keep-alive
    Server: AliyunOSS

ossutil

For information about the ossutil command that corresponds to the PutAccessPointPolicy operation, see put-access-point-policy.