---
title: "Delete Objects"
url: https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/stratus/delete-object/
description: "This page describes the method to execute circuits in your application with sample code snippets."
last_updated: 2026-09-09T10:45:38Z
service: CloudScale
type: general
related_links:
- name: "Catalyst CloudScale"
url: /en/cloud-scale/
- name: "Stratus Help Documentation"
url: /en/cloud-scale/help/stratus/introduction/
- name: "Java SDK Documentation"
url: /en/sdk/java/v1/cloud-scale/stratus/delete-objects/
- name: "Python SDK Documentation"
url: /en/sdk/python/v1/cloud-scale/stratus/delete-objects/
- name: "iOS SDK Documentation"
url: /en/sdk/ios/v2/cloud-scale/stratus/delete-object/
- name: "Android SDK Documentation"
url: /en/sdk/android/v2/cloud-scale/stratus/delete-object/
- name: "Flutter SDK Documentation"
url: /en/sdk/flutter/v2/cloud-scale/stratus/delete-object/
- name: "REST API Documentation"
url: /en/api/code-reference/cloud-scale/stratus/delete-objects/#DeleteObject
repository:
name: "Repository"
url: https://github.com/catalystbyzoho/zcatalyst-sdk-js
---
# Delete Objects
> **Note:** Ensure you have installed the [required package](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/stratus/overview/#prerequisites) to use this SDK method.
#### Parameters Used
| Parameter Name |
Data Type |
Definition |
| `key` |
**String** |
A **mandatory** parameter. Will hold the complete name of the object along with its [path](https://docs.catalyst.zoho.com/en/cloud-scale/help/stratus/objects/introduction/#path). |
| `versionId` |
**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 parameter 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**. |
The following SDK methods will allow you to perform various types of delete operations on objects stored in a bucket in Stratus. The `bucket` reference used in the following code snippet is the [component instance](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/stratus/create-bucket-instance/).
### Delete a Single Object
You can delete the required object by passing its complete name to the `deleteObject()` SDK method.
```javascript
await bucket.deleteObject("sam/out/sample.txt");
```
> **Note:** If [Versioning](https://docs.catalyst.zoho.com/en/cloud-scale/help/stratus/stratus-config/general-settings/#versioning) is enabled on the bucket and if a specific `versionId` is not provided, deleting the object will remove all versions of that object by default.
### Delete a Specific Version of an Object after a Specific Time
You need to provide the required `versionId` to the `deleteObject()` SDK method. You also have the option to schedule the delete operation using the `ttl` parameter.
For example, if you pass the value of `ttl` as **100**, the delete operation will only occur after **100 seconds**.
Always ensure the value of `ttl` is **greater than or equal to 60 seconds**.
```javascript
const options = {
versionId: "01hthq82gwxtfyz6d9j8eg6k2f", // delete the object with given versionId
ttl: 100 // Time to live in number of seconds
};
await bucket.deleteObject("sam/out/sample.txt", options);
```
### Delete Multiple Objects
The `deleteObjects()` SDK method can be used to delete multiple objects stored in a bucket in Stratus. You need to pass the names of the required objects as an array to the SDK method.
> **Notes:**
* If [Versioning](https://docs.catalyst.zoho.com/en/cloud-scale/help/stratus/stratus-config/general-settings/#versioning) is enabled for your bucket, ensure you provide the versionId of the object that you are required to delete.
* Additionally, you also have the option to schedule the delete operation using the `ttl` parameter.
- 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 or equal to 60 seconds**.
```javascript
const objectDel = await bucket.deleteObjects(
[
{
key: "sam/out/sample.txt",
versionId: "01hhch20nfkx9hw9ebqy2jnz9d"
}
], 100);
console.log(objectDel);
```
#### Example of Expected Response
```json
{"message": "Object Deletion successful."}
```
### Delete a Path in the Bucket
Using the `deletePath()` SDK method you will be able to delete the required path and all the objects stored in it.
```javascript
// To delete an entire path
const res = await bucket.deletePath("sam/out/");
console.log(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 of Expected Response
```javascript
{
"path": "sam/out/",
"message": "Path deletion scheduled"
}
```
### Truncate Bucket
Using the `truncate()` SDK method, you can delete every single object stored in the bucket.
```javascript
const truncateRes = await bucket.truncate();
console.log(truncateRes);
```