Skip to content

Custom File Headers

Attach metadata headers to files for content-type, caching, and custom application data.

Attach metadata headers to files

Store custom key-value metadata alongside files — useful for Content-Type, caching directives, or custom application metadata.

# Add a single header
curl -X POST "/api/v1/tenants/:tenantId/buckets/:bucketId/files/:fileId/headers?apiKey=<your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"name": "content-type", "value": "image/jpeg"}'

# Add multiple headers at once
curl -X POST "/api/v1/tenants/:tenantId/buckets/:bucketId/files/:fileId/headers/bulk?apiKey=<your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"bulk": [
    {"name": "content-type", "value": "image/jpeg"},
    {"name": "cache-control", "value": "max-age=31536000"},
    {"name": "x-custom-tag", "value": "profile-photo"}
  ]}'

Headers are returned with file responses and used automatically when serving files (e.g., content-type determines the browser behavior).