All Products
Search
Document Center

Object Storage Service:delete-object

Last Updated:Mar 20, 2026

Deletes an object from an OSS bucket.

Prerequisites

Before you begin, ensure that you have:

  • The oss:DeleteObject permission. By default, an Alibaba Cloud account has this permission. To grant the permission to a RAM user or Security Token Service (STS) role, see Attach a custom policy to a RAM user

Usage notes

  • Symbolic links: Deleting a symbolic link removes the link itself, not the object it points to.

Command syntax

ossutil api delete-object --bucket <value> --key <value> [--version-id <value>] [flags]

Parameters

ParameterTypeRequiredDescription
--bucketstringYesName of the bucket.
--keystringYesFull path of the object.
--version-idstringNoVersion ID of the object.
Note

The delete-object command corresponds to the DeleteObject API operation. For supported global flags, see Command-line options.

Examples

Delete the exampleobject object from examplebucket:

ossutil api delete-object --bucket examplebucket --key exampleobject

Permanently delete a specific version of the exampleobject object:

ossutil api delete-object --bucket examplebucket --key exampleobject --version-id 123