Edge

Storage API

Manage buckets, S3 access keys, and objects under /api/storage. For high-volume object traffic, use the S3-compatible endpoint at storage.edge.network with any S3 SDK — see SDK Examples.

Quick Start

# Create a bucket
curl -X POST https://edge.network/api/storage/buckets \
  -H "Authorization: Bearer ek_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "my-assets" }'

# Create S3 credentials
curl -X POST https://edge.network/api/storage/keys \
  -H "Authorization: Bearer ek_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "app-uploads" }'

Buckets

Endpoint Description
GET | POST /api/storage/bucketsList / create buckets — body { name, notes? }
GET | PATCH | DELETE /api/storage/buckets/:nameGet / update notes / delete (bucket must be empty)
PATCH /api/storage/buckets/:name/publicToggle public access — body { "is_public": true }
GET | POST /api/storage/buckets/:name/lifecycleList / add expiry rules — { prefix?, expire_days }
DELETE .../lifecycle/:ruleIdRemove a lifecycle rule
GET /api/storage/usageTotal bytes, object counts, and per-bucket breakdown

S3 Access Keys

Endpoint Description
GET | POST /api/storage/keysList / create S3 credentials — { name?, permissions?, bucketScope? }
DELETE /api/storage/keys/:idDelete credentials
GET /api/storage/endpointS3 connection details — { endpoint, port, region }

These are separate from your account API keys — they authenticate S3 SDKs against storage.edge.network. See Access Keys.

Objects

Endpoint Description
GET /api/storage/buckets/:name/objects?prefix=&marker=List objects, optionally under a prefix
POST /api/storage/buckets/:name/uploadUpload — multipart or raw body
GET /api/storage/buckets/:name/download/*Download an object (also accepts presigned ?token=)
DELETE /api/storage/buckets/:name/objects/*Delete an object
POST /api/storage/buckets/:name/copyCopy within a bucket — { source_key, dest_key }
POST /api/storage/buckets/:name/foldersCreate a folder — { path }
POST /api/storage/buckets/:name/download-zipDownload up to 100 objects as a ZIP — { keys: [...] }

Presigned URLs

Generate time-limited upload or download URLs to hand to browsers and untrusted clients:

curl -X POST https://edge.network/api/storage/buckets/my-assets/presign \
  -H "Authorization: Bearer ek_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "key": "uploads/photo.jpg", "action": "upload", "expires": "1h" }'

# Response
{
  "url": "https://storage.edge.network/...",
  "method": "PUT",
  "expires": "1h"
}

expires accepts values like 30m, 1h, 7d (default 1h, max 7d). See Presigned URLs.

Activity & Metrics

Endpoint Description
GET /api/storage/buckets/:name/events?limit=50Bucket activity log
GET /api/storage/buckets/:name/metrics?hours=168Hourly request and bandwidth metrics
GET .../metrics/summary?hours=24Aggregated metrics for a window
GET .../metrics/top-objects?limit=10Most-accessed objects
GET .../metrics/file-typesStorage broken down by file type