PutBucketAcl
Updated at:2025-11-03
API description
This API is designed to configure the access permission of a bucket. Currently, BOS supports two methods for setting ACLs. The first method is to use CannedAcl. During PutBucketAcl, configure the item via the header "x-bce-acl". Current settable permissions include: private, public-read and public-read-write (case-sensitive). The second method is to upload an ACL file. Refer to [ACL File Format](BOS/API Reference/Access control.md#Permission control by uploading ACL files) for the file format.
ACL file content can be generated using the BOS ACL Editing Tool.
Note:
BOS does not support setting "x-bce-acl" and uploading ACL files in the same request simultaneously.
Request
-
Request syntax
Plain Text1PUT /?acl HTTP/1.1 2Host: <BucketName>.bj.bcebos.com 3x-bce-date: <Date> 4Content-Length: <ContentLength> 5Content-Type:application/json; charset=utf-8 6Authorization: <AuthorizationString> 7x-bce-acl: <ACLString> -
Request parameters
No special parameters
-
Request headers
| Name | Types | Description | Whether required |
|---|---|---|---|
| x-bce-acl | String | ACL permissions set for the bucket include: private, public-read and public-read-write. | No |
Response
Notes
- Only the bucket owner or users with FULL_CONTROL permissions can set the bucket's ACL.
- By default, a bucket's permission is set to private when it is created.
Example
-
Example of request using CannedAcl
Plain Text1PUT /?acl HTTP/1.1 2Host: BucketName.bj.bcebos.com 3x-bce-date: 2016-04-06T08:23:49Z 4Authorization: AuthorizationString 5x-bce-acl: public-read 6Content-Type: application/json; charset=utf-8 7Content-length: 0 -
Example of uploading an ACL file
Plain Text1PUT /?acl HTTP/1.1 2Host: BucketName.bj.bcebos.com 3x-bce-date: 2016-04-06T08:23:49Z 4Content-Length :1324 5Content-Type: application/json; charset=utf-8 6Authorization: AuthorizationString 7{ 8 "accessControlList":[ 9 { 10 "grantee":[{ 11 "id":"168bf6fd8fa74d9789f35a283a1f15e2" 12 }], 13 "permission":["READ"] 14 } 15 ] 16} -
Response example
Plain Text1HTTPS/1.1 200 OK 2x-bce-request-id: 4db2b34d-654d-4d8a-b49b-3049ca786409 3Content-Length: 0 4Date: Wed, 06 Apr 2016 06:34:40 GMT 5Server: BceBos
