Object Storage - How to retrieve object metadata with GetObjectAttributes
Objective
This guide explains how to use the GetObjectAttributes S31 API operation to retrieve metadata attributes from objects in your OVHcloud Object Storage buckets without downloading the object body.
Requirements
- A Public Cloud project in your OVHcloud account
- An Object Storage user already created
- AWS CLI installed and configured
Instructions
Why use GetObjectAttributes?
Inspecting an object's metadata traditionally requires at least 2 separate API calls: HeadObject to retrieve the ETag, size, and storage class, and ListParts to enumerate the parts of multipart objects. Each additional call adds latency, which becomes significant at scale in data pipelines, integrity verification workflows, or storage auditing systems.
GetObjectAttributes consolidates all attribute retrieval into a single selective API call. You request exactly the attributes you need; the service returns only those fields — no object body is transferred.
Key benefits:
- No body transfer: retrieve metadata only, regardless of object size.
- Selective response: receive only the attributes you request.
- Any S3-compatible client: works with AWS CLI, any S3 SDK, and direct HTTP calls.
Supported attributes
You select which attributes to retrieve by listing them in the x-amz-object-attributes request header (space-separated for AWS CLI, comma-separated for raw HTTP). Attributes not listed are absent from the response.
| Attribute | Description |
|---|---|
ETag | Opaque identifier representing a specific version of the object's content |
Checksum | Checksum value computed using the algorithm stored with the object at upload time |
ObjectParts | Multipart structure of the object: list of parts with their number, size, and optional checksum |
StorageClass | Storage class of the object (STANDARD, STANDARD_IA, GLACIER_IR, DEEP_ARCHIVE, EXPRESS_ONEZONE) |
ObjectSize | Total size of the object in bytes |
The Last-Modified response header is always returned regardless of which attributes are requested.
The x-amz-object-attributes header is required. A request without it returns 400 Bad Request. Attribute names are case-sensitive.
Retrieve object attributes
Successful response:
To request all attributes at once:
Success: HTTP 200 OK with an XML body containing the requested attributes.
Checksum attribute
When Checksum is requested, the response includes the algorithm and value stored with the object at upload time. If the object was uploaded without a checksum, the Checksum element is absent from the response — this is not an error.
Supported checksum algorithms on OVHcloud Object Storage:
| Algorithm | XML element in response |
|---|---|
| CRC-32 | ChecksumCRC32 |
| CRC-32C | ChecksumCRC32C |
| CRC-64/NVME | ChecksumCRC64NVME |
| SHA-1 | ChecksumSHA1 |
| SHA-256 | ChecksumSHA256 |
Response (object has a CRC32 checksum):
Response (object has no checksum):
ObjectParts attribute (multipart objects)
When ObjectParts is requested on a multipart object, the response lists all parts with their number, size, and optional checksum. For single-part (non-multipart) objects, ObjectParts is returned as an empty element.
Pagination: results are paginated at up to 1000 parts per response.
Response:
Paginating through ObjectParts (objects with more than 1000 parts)
When an object has more than 1000 parts, IsTruncated is true and NextPartNumberMarker indicates where to resume. Use --part-number-marker to fetch subsequent pages.
Versioned objects
By default, GetObjectAttributes operates on the current version of the object. To retrieve attributes for a specific version, add --version-id to the request.
The x-amz-version-id response header echoes the version ID of the retrieved object.
IAM permissions with versionId: using --version-id requires the s3:GetObjectVersion and s3:GetObjectVersionAttributes permissions, instead of the default s3:GetObject + s3:GetObjectAttributes.
Encrypted objects (SSE-C)
For objects encrypted with SSE-C (customer-provided keys), you must supply the three encryption headers with every GetObjectAttributes request. The service does not store the key.
All three SSE-C headers are mandatory for SSE-C objects. Omitting any one of them returns 400 Bad Request. Providing the wrong key returns 403 Forbidden.
For unencrypted and SSE-S3 objects, do not include SSE-C headers — including them returns 400 Bad Request.
IAM permissions
| Situation | Required permissions |
|---|---|
Without versionId | s3:GetObject + s3:GetObjectAttributes |
With versionId | s3:GetObjectVersion + s3:GetObjectVersionAttributes |
No additional permissions are required beyond the standard read permissions.
Error codes
| HTTP code | Error code | Condition |
|---|---|---|
200 OK | - | Request successful |
400 Bad Request | InvalidArgument | Missing x-amz-object-attributes, invalid attribute name, or invalid SSE-C header combination |
403 Forbidden | AccessDenied | Missing IAM permission, or wrong SSE-C key |
404 Not Found | NoSuchKey | Object does not exist and requester has s3:ListBucket |
403 Forbidden | AccessDenied | Object does not exist and requester does NOT have s3:ListBucket |
405 Method Not Allowed | - | The target version is a delete marker |
Delete markers: in a versioned bucket, if the current version of an object (or the version specified by --version-id) is a delete marker, the service returns 405 Method Not Allowed with the x-amz-delete-marker: true response header.
Go further
Join our community of users.
1: S3 is a trademark of Amazon Technologies, Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies, Inc.