Amazon Simple Storage Service
Developer Guide (API Version 2006-03-01)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Deleting Object Versions

A DELETE request has the following use cases:

  • When versioning is enabled, a simple DELETE cannot permanently delete an object.

    Instead, Amazon S3 inserts a delete marker in the bucket and that becomes the latest version of the object with a new ID. When you try to GET an object whose latest version is a delete marker, Amazon S3 behaves as though the object has been deleted (even though it has not been erased) and returns a 404 error.

  • To permanently delete versioned objects, you must use DELETE Object versionId.

The following figure shows that a simple DELETE does not actually remove the specified object. Instead, Amazon S3 inserts a delete marker.

The following figure shows that deleting a specified object version permanently removes that object.

To a delete a specific version of an object

  • In a DELETE request specify a version ID.

Example Deleting a Specific Version

The following example shows how to delete version UIORUnfnd89493jJFJ of photo.gif.

DELETE /photo.gif?versionId=UIORUnfnd89493jJFJ HTTP/1.1 
Host: bucket.s3.amazonaws.com
Date: Wed, 12 Oct 2009 17:50:00 GMT
Authorization: AWS 15B4D3461F177624206A:xQE0diMbLRepdf3YB+FIEXAMPLE=
Content-Type: text/plain
Content-Length: 0