Skip to main content

Object Metadata

Retrieve file metadata using HEAD requests without downloading the entire file.

Endpoint

HEAD /v1/storage/{bucket}/{key}

Get Metadata

cURL

curl -I "https://api.wayscloud.services/v1/storage/my-bucket/document.pdf" \
-H "Authorization: Bearer wayscloud_storage_abc123_YourSecretKey"

Python

import requests
import os

API_KEY = os.getenv('WAYSCLOUD_API_KEY')

response = requests.head(
'https://api.wayscloud.services/v1/storage/my-bucket/document.pdf',
headers={'Authorization': f'Bearer {API_KEY}'}
)

print(f'Content-Type: {response.headers.get("Content-Type")}')
print(f'Content-Length: {response.headers.get("Content-Length")} bytes')
print(f'Last-Modified: {response.headers.get("Last-Modified")}')
print(f'ETag: {response.headers.get("ETag")}')

Response Headers

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Length: 1048576
ETag: "a1b2c3d4e5f6789"
Last-Modified: Mon, 04 Nov 2025 10:30:00 GMT
x-amz-meta-author: John Doe
x-amz-meta-camera: Canon EOS R5

Use Cases

  1. Check if file exists without downloading
  2. Get file size for progress bars
  3. Check last modified for sync tools
  4. Verify ETag for integrity checks

Next Steps