GetObjectTagging - Amazon Simple Storage Service


Returns the tag-set of an object. You send the GET request against the tagging subresource associated with the object.

To use this operation, you must have permission to perform the s3:GetObjectTagging action. By default, the GET operation returns information about current version of an object. For a versioned bucket, you can have multiple versions of an object in your bucket. To retrieve tags of any other version, use the versionId query parameter. You also need permission for the s3:GetObjectVersionTagging action.

By default, the bucket owner has this permission and can grant this permission to others.

For information about the Amazon S3 object tagging feature, see Object Tagging.

The following operation is related to GetObjectTagging:

Request Syntax

GET /{Key+}?tagging&versionId=VersionId HTTP/1.1 Host: x-amz-expected-bucket-owner: ExpectedBucketOwner

URI Request Parameters

The request uses the following URI parameters.


The bucket name containing the object for which to get the tagging information.

When using this API with an access point, you must direct requests to the access point hostname. The access point hostname takes the form When using this operation using an access point through the AWS SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using Access Points in the Amazon Simple Storage Service Developer Guide.

Required: Yes


Object key for which to get the tagging information.

Length Constraints: Minimum length of 1.

Required: Yes


The versionId of the object for which to get the tagging information.


The account id of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 x-amz-version-id: VersionId <?xml version="1.0" encoding="UTF-8"?> <Tagging> <TagSet> <Tag> <Key>string</Key> <Value>string</Value> </Tag> </TagSet> </Tagging>

Response Elements

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

The response returns the following HTTP headers.


The versionId of the object for which you got the tagging information.

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


Root level tag for the Tagging parameters.

Required: Yes


Contains the tag set.

Type: Array of Tag data types


Sample Request

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

GET /example-object?tagging HTTP/1.1 Host: examplebucket.s3.<Region> Date: Thu, 22 Sep 2016 21:33:08 GMT Authorization: authorization string

Sample Response

HTTP/1.1 200 OK Date: Thu, 22 Sep 2016 21:33:08 GMT Connection: close Server: AmazonS3 <?xml version="1.0" encoding="UTF-8"?> <Tagging xmlns=""> <TagSet> <Tag> <Key>tag1</Key> <Value>val1</Value> </Tag> <Tag> <Key>tag2</Key> <Value>val2</Value> </Tag> </TagSet> </Tagging>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: