Menu
Amazon Simple Storage Service
API Reference (API Version 2006-03-01)

DELETE Bucket policy

Description

This implementation of the DELETE operation uses the policy subresource to delete the policy on a specified bucket. To use the operation, you must have DeletePolicy permissions on the specified bucket and be the bucket owner.

If you do not have DeletePolicy permissions, Amazon S3 returns a 403 Access Denied error. If you have the correct permissions, but are not a user of the bucket owner account, Amazon S3 returns a 405 Method Not Allowed error. If the bucket doesn't have a policy, Amazon S3 returns a 204 No Content error. There are restrictions about who can create bucket policies and which objects in a bucket they can apply to. For more information, go to Using Bucket Policies.

Requests

Syntax

Copy
DELETE /?policy HTTP/1.1 Host: BucketName.s3.amazonaws.com Date: date Authorization: authorization string (see Authenticating Requests (AWS Signature Version 4))

Request Parameters

This implementation of the operation does not use request parameters.

Request Headers

This implementation of the operation uses only request headers that are common to all operations. For more information, see Common Request Headers.

Request Elements

This implementation of the operation does not use request elements.

Responses

Response Headers

This implementation of the operation uses only response headers that are common to most responses. For more information, see Common Response Headers.

Response Elements

The response elements contain the status of the DELETE operation including the error code if the request failed.

Special Errors

This implementation of the operation does not return special errors. For general information about Amazon S3 errors and a list of error codes, see Error Responses.

Examples

Sample Request

This request deletes the bucket named BucketName.

Copy
DELETE /?policy HTTP/1.1 Host: BucketName.s3.amazonaws.com Date: Tue, 04 Apr 2010 20:34:56 GMT Authorization: signatureValue

Sample Response

Copy
HTTP/1.1 204 No Content x-amz-id-2: Uuag1LuByRx9e6j5OnimrSAMPLEtRPfTaOFg== x-amz-request-id: 656c76696e672SAMPLE5657374 Date: Tue, 04 Apr 2010 20:34:56 GMT Connection: keep-alive Server: AmazonS3

Related Resources