---
sidebar_position: 3
description: Head bucket and other functions to work with S3 in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, S3]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Head bucket
 Checks if the bucket is available for the current account or account by ID



`Function HeadBucket(Val Name, Val BasicData, Val Directory = False, Val AccountID = "", Val Headers = Undefined) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Name | --name | String | &#x2714; | Bucket name |
  | BasicData | --basic | Structure Of KeyAndValue | &#x2714; | Basic request data. See GetBasicDataStructure |
  | Directory | --dir | Boolean | &#x2716; | True > Path style URL, False > Virtual hosted style URL |
  | AccountID | --account | String | &#x2716; | Account ID to verify that hes the bucket owner |
  | Headers | --headers | Map Of KeyAndValue | &#x2716; | Additional request headers, if necessary |

  
  Returns:  Structure Of KeyAndValue - serialized JSON response from storage

:::tip
Method at AWS documentation: [HeadBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    URL       = "storage-155.s3hoster.by";
    AccessKey = "BRN5RKJE67...";
    SecretKey = "NNhv+i9PrytpT8Tu0C1N...";
    Region    = "BTC";

    BasicData = OPI_S3.GetBasicDataStructure(URL, AccessKey, SecretKey, Region);

    Directory = True; // Formation URL in path-style
    Name = "";
    Result = OPI_S3.HeadBucket(Name, BasicData, Directory);

    Result = OPI_S3.HeadBucket(Name, BasicData, Directory, "1234");
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint s3 HeadBucket \
             --name "7c4d3d52" \
             --basic "{'URL':'storage-564.s3hoster.by','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}" \
             --dir true \
             --account "1234"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint s3 HeadBucket ^
             --name "7c4d3d52" ^
             --basic "{'URL':'storage-564.s3hoster.by','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}" ^
             --dir true ^
             --account "1234"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "status": 200,
 "response": {},
 "headers": {
  "Accept-Ranges": "bytes",
  "Date": "Wed, 10 Dec 2025 20:15:40 GMT",
  "Server": "MinIO",
  "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
  "Vary": "Origin, Accept-Encoding",
  "X-Amz-Id-2": "ce258a107703b2b071aa1a8145ffe6228f368a6d9b7af539b99dbf83a96b1e00",
  "X-Amz-Request-Id": "187FF3E447AC9CF5",
  "X-Content-Type-Options": "nosniff",
  "X-XSS-Protection": "1; mode=block",
  "Content-Length": "0",
  "Content-Type": "application/xml"
 }
}
```
