The PUT Object ACL sets the Access Control List (ACL) permissions on an existing bucket object. To set ACL permissions on an existing bucket object, you must have WRITE_ACP permissions. You can choose to use request headers to specify the permissions, or specify the ACL in the request body. For more details about using the PUT Object ACL, see the following:
The ACL for an object is set at the object version level. By default, a PUT request sets the ACL for the current version of the object. To set the ACL for a different version, use the versionId subresource.
For syntax examples of the PUT Object ACL operation, see Amazon's official S3 API PUT Object ACL documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUTacl.html).
This implementation of the PUT Object ACL operation does not support the use of request parameters.
The PUT Object ACL operation supports the use of the following access-control headers to set permissions:
x-amz-acl header – Use this header to specify canned ACL permissions.
x-amz-grant-permission header – Use this header to individually specify the permissions for a grantee.
For more information about how to specify ACL permissions, see:
Amazon's official S3 API documentation for PUT Object ACL (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUTacl.html).
The PUT Object ACL operation supports the use of request elements when not using a request body. Note that if you use a request body, you cannot use the request headers to set an ACL. For a list of supported request elements, see Amazon's official S3 API PUT Object ACL documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUTacl.html).
The PUT Object ACL operation supports the use of the following response headers:
Response headers common to all operations. – For more information, see Figure 9, Table 9, Supported Response Headers .
Response headers for PUT Object operation, which include x-amz-version-id. – For further details about this response header, see Amazon's official S3 API PUT Object ACL documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUTacl.html).
This implementation of the PUT Object ACL does not support the use of response elements.
200 OK
The PUT Object ACL operation does not return special errors. For general information about S3 errors and a list of error codes, see S3 Client Error Handling Reference.
PUT /my-image.jpg?acl <AccessControlPolicy> <Owner> <ID>joe</ID> <DisplayName>joe/DisplayName> </Owner> <AccessControlList> <Grant> <Grantee type="CanonicalUser"> <ID>jack</ID> <DisplayName>joe</DisplayName> </Grantee> <Permission>FULL_CONTROL</Permission> </Grant> </AccessControlList> </AccessControlPolicy> HTTP/1.1 200 OK x-amz-request-id: tx318BC8BC148832E5 x-amz-version-id: 0055 Date: Wed, 28 Oct 2018 22:32:00 GMT Last-Modified: Sun, 1 Jan 2018 12:00:00 GMT Content-Length: 0 Connection: close Server: Apache
Alternatively, a request can also be made to a specific version of an object, for instance:
PUT /my-image.jpg?acl&versionId=0099