---
title: "Check Object Availability"
url: https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/stratus/check-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/list-objects/
- name: "Python SDK Documentation"
url: /en/sdk/python/v1/cloud-scale/stratus/list-objects/
- name: "iOS SDK Documentation"
url: /en/sdk/ios/v2/cloud-scale/stratus/get-object/
- name: "Android SDK Documentation"
url: /en/sdk/android/v2/cloud-scale/stratus/get-object/
- name: "Flutter SDK Documentation"
url: /en/sdk/flutter/v2/cloud-scale/stratus/get-object/
- name: "REST API Documentation"
url: /en/api/code-reference/cloud-scale/stratus/get-object/#GetaSpecificObject
repository:
name: "Repository"
url: https://github.com/catalystbyzoho/zcatalyst-sdk-js
---
# Check Object Availability
> **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.
Using the `headObject()` SDK method, you can check if a particular object is present in the bucket, if the user has the required permissions to access the object.
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/).
If you have enabled [Versioning](https://docs.catalyst.zoho.com/en/cloud-scale/help/stratus/stratus-config/general-settings/#versioning) for your bucket, then you need to pass the `versionID` as the param, to check if a particular version of the object is available.
When you use this SDK method, you will get either of the following responses:
* `true`: If the object is available, the specified version is available, and if the user has the relevant permissions to access the objects.
* `false`:
- If the object or the particular version of the object is not available in the bucket.
- If the user does not have the required permissions to access the object.
- If the bucket does not exist.
#### Parameters Used
| Parameter Name |
Data Type |
Definition |
| `objectName` |
**String** |
A **Mandatory** parameter. Will hold the complete name of the object. |
| `versionId` |
**String** |
An **optional** parameter. Will hold the unique version ID of the object, if [Versioning](https://docs.catalyst.zoho.com/en/cloud-scale/help/stratus/stratus-config/general-settings/#versioning) is enabled. |
| `throwErr` |
**Boolean** |
An **optional** parameter. If you set this parameter as "**true**", then it will throw an error when the bucket is not found in the project. The default value is "**false**". |
```javascript
const options = {
versionId: 'djkfhdiufy762',
throwErr: false
};
const headObjectRes = await bucket.headObject("sam/out/sample.txt", options); // The object path should not start with the bucket name, just the parent directory of the object
console.log(headObjectRes);
```
#### Example of Expected Response
```javascript
true
```
#### Possible Errors
> **Note:** If you use the SDK with the `throw_err` parameter, and the object does not exist, or if you do not have sufficient permissions then you may encounter any of the errors listed below.
| Error Code |
Meaning |
| `404` |
**Not Found**. Object Not found in Stratus. |
| `401` |
**Unauthorized/Access Denied** - User doesn't have permission to perform the particular operation. |
| `403` |
**Permission Denied** - User does not have permission to access the particular object. |