Object Storage API

S3-compatible object storage for files, backups, media, and static assets. Powered by Rook/Ceph RGW or MinIO.

Storage Status

Check if object storage is available:
GET /api/v1/storage/status
{
  "available": true,
  "endpoint": "http://s3.cluster.local:9000",
  "region": "us-east-1"
}

Buckets

List Buckets

GET /api/v1/storage/buckets
[
  {
    "name": "my-assets",
    "created_at": "2024-01-15T10:30:00Z",
    "object_count": 142,
    "size_bytes": 52428800
  }
]

Create a Bucket

POST /api/v1/storage/buckets
name
string
required
Bucket name (must be DNS-compatible)
{
  "name": "my-assets"
}

Delete a Bucket

DELETE /api/v1/storage/buckets/{name}
The bucket must be empty before deletion. Delete all objects first.

Objects

List Objects

GET /api/v1/storage/buckets/{name}/objects
prefix
string
Filter by key prefix (e.g., images/)
[
  {
    "key": "images/photo.jpg",
    "size_bytes": 1048576,
    "content_type": "image/jpeg",
    "last_modified": "2024-01-15T10:30:00Z"
  },
  {
    "key": "documents/report.pdf",
    "size_bytes": 2097152,
    "content_type": "application/pdf",
    "last_modified": "2024-01-14T08:00:00Z"
  }
]

Upload an Object

POST /api/v1/storage/buckets/{name}/objects
Content-Type: multipart/form-data
Upload files using multipart form data.

Delete an Object

DELETE /api/v1/storage/buckets/{name}/objects
key
string
required
Object key to delete

Pre-signed URLs

Generate temporary URLs for direct upload or download:
POST /api/v1/storage/buckets/{name}/objects/presign
key
string
required
Object key
expires_in
integer
Expiry time in seconds (default: 3600)
method
string
HTTP method: GET (download) or PUT (upload)
{
  "key": "uploads/file.zip",
  "expires_in": 3600,
  "method": "PUT"
}
Response:
{
  "url": "http://s3.cluster.local:9000/my-assets/uploads/file.zip?X-Amz-Signature=...",
  "expires_at": "2024-01-15T11:30:00Z"
}

Using with S3 Clients

Object storage is S3-compatible. Use any AWS SDK or S3 client:
# AWS CLI
aws s3 ls s3://my-assets/ \
  --endpoint-url http://s3.cluster.local:9000

# s3cmd
s3cmd ls s3://my-assets/ \
  --host=s3.cluster.local:9000