Graphon API

S3 · Objects

DeleteObject

DELETE/{bucket}/{key}

Deletes an object, or one version of an object.

Without versionId, storage removes the object. In a bucket with versioning on, it adds a delete marker and keeps the versions. With versionId, storage removes that version for good.

View as Markdown
Role
Editor or higher
Support
Supported
  • With versionId, removes that version. In a versioned bucket, adds a delete marker.
  • A key with no object returns 404 NoSuchKey. Amazon S3 returns 204 for a missing key.
  • A version under object lock retention cannot be deleted before its retain-until date.

Path parameters

bucketstringrequired

The bucket name.

keystringrequired

The object key. Keep each / as it is. Percent-encode the other reserved characters.

Query parameters

versionIdstringoptional

Remove this version for good.

Headers

The workspace ID that must own the bucket. Another owner returns 403 AccessDenied.

Responses

204No Content

Storage deleted the object, or added a delete marker.

Response headers

The version that the delete removed or created.

true when the delete added a delete marker.

This response has no body.

Errors

Select an error in the response example to see its XML body. Any request can also get the common errors, such as SignatureDoesNotMatch.

404NoSuchKey

The bucket has no object at this key, or no version with this versionId.

What to do: Check the key and the versionId.

404NoSuchBucket

No bucket has this name, or the bucket was deleted.

What to do: Check the bucket name. ListBuckets shows the buckets of the workspace.

403AccessDenied

The key does not have the Editor role, or the version is under object lock retention.

What to do: Use an Editor key. A retained version stays until its retain-until date.

Was this page helpful?