--- title: "Delete Objects" url: https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/stratus/delete-objects/ description: "This page lists the Python SDK method to delete objects stores in a bucket." last_updated: 2026-09-08T11:07:33Z service: Cloud Scale type: general related_links: - name: "Stratus Component Help Documentation" url: /en/cloud-scale/help/stratus/introduction - name: "Java SDK" url: /en/sdk/java/v1/cloud-scale/stratus/delete-objects/ - name: "JavaScript SDK Documentation" url: /en/sdk/javascript/v1/cloudscale/stratus/delete-object/ - name: "iOS SDK" url: /en/sdk/ios/v2/cloud-scale/stratus/delete-object/ - name: "Android SDK" url: /en/sdk/android/v2/cloud-scale/stratus/delete-object/ - name: "Flutter SDK" url: /en/sdk/flutter/v2/cloud-scale/stratus/delete-object/ - name: "REST API" url: /en/api/code-reference/cloud-scale/stratus/get-all-buckets/#GetAllBuckets --- # Delete Objects The following SDK methods will allow you to perform delete operations in Stratus. The Bucket reference used in the below code snippet is the [component instance](https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/stratus/create-bucket-instance/). **Parameters Used**
Parameter Name Data Type Definition
`key` **String** A **Mandatory** parameter. Will hold the complete name of the object along with it's [path](https://docs.catalyst.zoho.com/en/cloud-scale/help/stratus/objects/introduction/#path).
`version_id` **String** An **Optional** parameter. If [Versioning](https://docs.catalyst.zoho.com/en/cloud-scale/help/stratus/stratus-config/general-settings/#versioning) is enabled for your bucket then, this param will help you refer to a particular version using its unique Version ID.
`ttl` **int** An **Optional** parameter. It allows you to schedule your delete operations. For example, if you provide the value of `ttl` as **60**, the delete operation will only occur after 60 seconds. The value of `ttl` has to be >= 60 seconds.
### Delete a Single Object Using this SDK method, you can delete a particular object by passing the object name to the `delete_object()` method. ```python delete_res = bucket.delete_object("sam/out/sample.txt") print(delete_res) ``` > **Note:** If [Versioning](https://docs.catalyst.zoho.com/en/cloud-scale/help/stratus/stratus-config/general-settings/#versioning) is enabled on the bucket and no specific `version_id` is provided, deleting an object will **remove all versions** of that object by default. ### Delete a Specific Version of an Object after a Specific Time Ensure you provide the `versionId` of the object if you enabled [Versioning](https://docs.catalyst.zoho.com/en/cloud-scale/help/stratus/stratus-config/general-settings/#versioning) for your bucket. > **Info:** To use this SDK method, you need intialize it with **Admin** scope. You can learn more about this requirement from this [section](https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview/#initialize-sdk-with-scopes) You can also schedule your delete operation using the `ttl` variable. For example, if you provide the value of `ttl` as **100**, the delete operation will only occur after **100 seconds**. Always ensure that the value of `ttl` is greater than equal to **60 seconds**. ```python delete_res = bucket.delete_object("sam/out/sample.txt", 'version_id', ttl=300) print(delete_res) ``` ### Delete Multiple Objects Using this SDK method, you can delete multiple objects by passing the names of the objects that need to be deleted as an array. > **Info:** To use this SDK method, you need intialize it with **Admin** scope. You can learn more about this requirement from this [section](https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview/#initialize-sdk-with-scopes) Ensure you provide the `versionId` of the object if you enabled [Versioning](https://docs.catalyst.zoho.com/en/cloud-scale/help/stratus/stratus-config/general-settings/#versioning) for your bucket. You can also schedule your delete operation using the `ttl` variable. For example, if you provide the value of `ttl` as **100**, the delete operation will only occur after **100 seconds**. Always ensure that the value of `ttl` is greater than equal to **60 seconds**. ```python delete_objects_res = bucket.delete_objects([ { 'key' : "sam/out/sample.txt", 'version_id':'01hj6ackcxpha9151n7mj0cq6g' }, { 'key' :"sam/out/sample1.txt", 'version_id':'01hj68v1tmb33wa7zchb1vtbjn' }],ttl=300) print(delete_objects_res) ``` #### Example Response for Delete Operation ```json {'message': 'Object Deletion successful.'} ``` ### Truncate Bucket Using this SDK method you will be able to essentially every single object present in the bucket. > **Info:** To use this SDK method, you need intialize it with **Admin** scope. You can learn more about this requirement from this [section](https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview/#initialize-sdk-with-scopes) ```python # delete all the objects in the bucket truncate_res = bucket.truncate() print(truncate_res) ``` ### Delete a Path in the Bucket Using this SDK, you will be able to delete all the objects present in a [path](https://docs.catalyst.zoho.com/en/cloud-scale/help/stratus/objects/introduction/#path). > **Info:** To use this SDK method, you need intialize it with **Admin** scope. You can learn more about this requirement from this [section](https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview/#initialize-sdk-with-scopes) You need to pass the complete path to the `delete_path()` method. ```python path_res = bucket.delete_path("sam/") print(path_res) ``` > **Note:** Ensure that you provide the exact path. If an incorrect path is provided, the delete action will get scheduled, but it will result in an error. #### Example Response ```json { "path": "sam/", "message": "Path deletion scheduled" } ```