--- title: "Check Object Availability" url: https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/stratus/check-object-availability/ description: "This page lists the Python SDK method to check if an object is present 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/check-object-availability/ - name: "JavaScript SDK Documentation" url: /en/sdk/javascript/v1/cloudscale/stratus/rename-move/ - name: "iOS SDK" url: /en/sdk/ios/v2/cloud-scale/stratus/overview/ - name: "Android SDK" url: /en/sdk/android/v2/cloud-scale/stratus/overview/ - name: "Flutter SDK" url: /en/sdk/flutter/v2/cloud-scale/stratus/overview/ - name: "REST API" url: /en/api/code-reference/cloud-scale/stratus/get-all-buckets/#GetAllBuckets --- # Check Object Availability Using this 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 below code snippet is the [component instance](https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/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 `version_id ` 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
`key` **String** A **Mandatory** parameter. Will hold the complete name of the object.
`version_id` **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.
`throw_err` **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**"
```python head_object_res = bucket.head_object( "sam/out/sample.txt", 'version_id', throw_err=False) print(head_object_res) ``` #### 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.