All Products
Search
Document Center

Object Storage Service:GetBucketPolicyStatus

Last Updated:Jun 17, 2026

Checks whether the current bucket policy allows public access.

Note

By default, an Alibaba Cloud account has the permissions to call this operation. To call this operation as a RAM user or by using Security Token Service (STS) credentials, you must have the oss:GetBucketPolicyStatus permission.

Request syntax

GET /?policyStatus HTTP/1.1
Date: GMT Date
Content-Length: ContentLength
Content-Type: application/xml
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Authorization: SignatureValue

Request headers

This operation uses only common request headers. For more information, see Common request headers.

Response headers

This operation returns only common response headers. For more information, see Common response headers.

Response elements

Element

Type

Example

Description

PolicyStatus

Container

N/A

The container that stores public access information.

Parent nodes: none

Child nodes: IsPublic

IsPublic

Boolean

true

Indicates whether the current bucket policy allows public access.

  • true

  • false

Example

  • Sample request

    GET /?policyStatus HTTP/1.1
    Date: Mon, 19 Feb 2024 08:40:17 GMT
    Content-Length: 0
    Content-Type: application/xml
    Host: examplebucket.oss-cn-hangzhou.aliyuncs.com
    Authorization:  OSS qn6q**************:77Dv****************
  • Sample success response

    HTTP/1.1 200 OK
    x-oss-request-id: 534B371674E88A4D8906****
    Date: Mon, 19 Feb 2024 08:40:17 GMT
    Server: AliyunOSS
    
    <?xml version="1.0" encoding="UTF-8"?>
    <PolicyStatus>
       <IsPublic>true</IsPublic>
    </PolicyStatus>

OSS SDKs

The following OSS SDKs support this operation:

ossutil

For the corresponding ossutil command, see get-bucket-policy-status.