Skip to main content

Delete object

For your information

If the baket has an Bucket Policy, it must allow deletion of the object, see the Actions subsection of the Bucket Policy instruction for details.

When deleting an object, consider the peculiarities of deleting objects with segments.

If versioning is enabled or paused in the package, some objects can be restored after deletion, for more details see Delete an object when versioning is enabled or paused. If versioning is disabled (never enabled) in the package, the object is irretrievably deleted.

If an object has an active lock (Object Lock), the ability to delete depends on the type and mode of the lock, see Delete Object with Object Lock for details.

Conditional queries can be used when deleting objects through the S3 API.

Delete object

  1. In the control panel, on the top menu, click Products and select S3.
  2. Go to the Buckets section.
  3. Open the baket page → Objects tab.
  4. Mark the object you want to delete.
  5. Click Delete.
  6. Enter delete to confirm the deletion.
  7. Click Start Deletion.

Delete a segmented object

carefully

When storing an object, you cannot delete segments of it in the service bucket - doing so will break the entire file.

To delete an object with segments, delete the manifest file. To delete, use the API you used to load the object. When deleting through the control panel, the Swift API is used.

If an object is loaded and deleted using different methods (for example, an object was loaded using the S3 API and deleted in the control panel), the object segments may not be deleted, continue to be stored in the hidden buckets and billed.

Delete an object when versioning is enabled or paused

If versioning is enabled or paused in the bucket, an object may have versions - objects with the same name that were loaded earlier than the current version of the object.

The behavior when deleting an object depends on whether you delete the object with or without specifying a version:

  • when deleting without specifying a version, the current version of the object is moved to the list of versions. An empty object with its own version ID and a Deleted tag will be created as the current version . To make the object available to users, restore it from any version that does not have the Deleted tag.

  • if a particular version is deleted, the version is deleted with no possibility of recovery. If the version to be deleted is:

    • current - the version will become an empty object and will be included in the list of versions with the Deleted tag. The current version of the object becomes the most recent version from the list, which does not have the Deleted tag;
    • the previous one - it will be removed from the list of versions altogether.

    If the deleted version is the only version, the object cannot be restored.

Delete an object without specifying a version

For your information

To delete an object without specifying a version via API or other tools, do not specify the version-id parameter.

  1. In the control panel, on the top menu, click Products and select S3.
  2. Go to the Buckets section.
  3. Open the baket page → Objects tab.
  4. Make sure the Version toggle switch is off.
  5. Mark the object you want to delete.
  6. Click Delete.
  7. Enter delete to confirm the deletion.
  8. Click Start Deletion.

Delete a specific version

For your information

To remove a specific version via the API or other tools, specify the version-id parameter with the value of the version ID.

  1. In the control panel, on the top menu, click Products and select S3.
  2. Go to the Buckets section.
  3. Open the baket page → Objects tab.
  4. Turn on the Versions toggle switch.
  5. Check the box next to the version you want to uninstall.
  6. Click Delete.
  7. Enter delete to confirm the deletion.
  8. Click Start Deletion.

Delete an object with Object Lock

If the baquette uses Object Lock and:

  • the object is locked indefinitely - to delete the object, you must disable the lock;

  • the object is temporarily blocked:

    • Governance mode - only a user with the role of member or a user with another role, if the access policy allows him/her the action s3:BypassGovernanceRetention. Other users will be able to delete the object only after the lock expires;
    • Compliance mode - the object cannot be deleted before the locking period expires.

In bucket with Object Lock enabled, operations to delete objects with active locking via Swift API and Swift API (old) will return an error. To bypass the lock via the s3:BypassGovernance access policy action or disable it, use the S3 API or tools that use it.