> For the complete documentation index, see [llms.txt](https://docs.petabox.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.petabox.io/http-api-compatible-with-amazon-s3/api-reference/getbuckettagging.md).

# GetBucketTagging

Returns the tag set associated with the bucket

To use this operation, you must have permission to perform the `s3:GetBucketTagging` action. By default, the bucket owner has this permission and can grant this permission to others.

`GetBucketTagging` has the following special error:

* Error code: `NoSuchTagSet`
  * Description: There is no tag set associated with the bucket.

## Request Syntax <a href="#api_getbuckettagging_requestsyntax" id="api_getbuckettagging_requestsyntax"></a>

```http
GET /?tagging HTTP/1.1
Host: Bucket.s3.petabox.io
x-amz-expected-bucket-owner: ExpectedBucketOwner
```

## URI Request Parameters <a href="#api_getbuckettagging_requestparameters" id="api_getbuckettagging_requestparameters"></a>

The request uses the following URI parameters.

#### Bucket

The name of the bucket for which to get the tagging information.

Required: Yes

#### x-amz-expected-bucket-owner

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code `403 Forbidden` (access denied).

## Request Body <a href="#api_getbuckettagging_requestbody" id="api_getbuckettagging_requestbody"></a>

The request does not have a request body.

## Response Syntax <a href="#api_getbuckettagging_responsesyntax" id="api_getbuckettagging_responsesyntax"></a>

```xml
HTTP/1.1 200
<?xml version="1.0" encoding="UTF-8"?>
<Tagging>
   <TagSet>
      <Tag>
         <Key>string</Key>
         <Value>string</Value>
      </Tag>
   </TagSet>
</Tagging>
```

## Response Elements <a href="#api_getbuckettagging_responseelements" id="api_getbuckettagging_responseelements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in XML format by the service.

#### Tagging

Root level tag for the Tagging parameters.

Required: Yes

#### TagSet

Contains the tag set.

Type: Array of Tag data types

## Examples <a href="#api_getbuckettagging_examples" id="api_getbuckettagging_examples"></a>

### Sample Request <a href="#api_getbuckettagging_example_1" id="api_getbuckettagging_example_1"></a>

The following request returns the tag set of the specified bucket.

```http
GET ?tagging HTTP/1.1
Host: bucket.s3.<Region>.petabox.io
Date: Wed, 28 Oct 2009 22:32:00 GMT
Authorization: authorization string
```

### Sample Response <a href="#api_getbuckettagging_example_2" id="api_getbuckettagging_example_2"></a>

Delete the metric configuration with a specified ID, which disables the CloudWatch metrics with the `ExampleMetrics` value for the `FilterId` dimension.

<pre class="language-xml"><code class="lang-xml"><strong>HTTP/1.1 200 OK
</strong>Date: Wed, 25 Nov 2009 12:00:00 GMT
Connection: close
Server: Petabox

&#x3C;Tagging>
  &#x3C;TagSet>
     &#x3C;Tag>
       &#x3C;Key>Project&#x3C;/Key>
      &#x3C;Value>Project One&#x3C;/Value>
     &#x3C;/Tag>
     &#x3C;Tag>
       &#x3C;Key>User&#x3C;/Key>
       &#x3C;Value>jsmith&#x3C;/Value>
     &#x3C;/Tag>
  &#x3C;/TagSet>
&#x3C;/Tagging> 
</code></pre>
