CDNShark Documentation

Customer API

← Back to Documentation

Storage Buckets API

S3-compatible object storage. Create buckets here, then read and write objects with any S3 client (AWS SDK, rclone, s3cmd), using the bucket's credentials. Needs an active paid service. Creating a bucket needs a plan that includes storage.

List buckets

GET /api/storage/buckets (storage:read). Returns {"data": [bucket, ...]}, without secrets. Video-library buckets are not listed here.

Create a bucket

POST /api/storage/buckets (storage:write)

FieldRequiredNotes
bucket_namenoLowercase letters, digits and hyphens, up to 63 characters, globally unique. Generated if you leave it out.
user_friendly_namenoDisplay name, up to 100 characters.
is_privatenotrue = objects are only reachable with credentials or presigned URLs.

Returns 201 {"data": bucket}. Get the access keys with the credentials call below.

Get S3 credentials

GET /api/storage/buckets/{bucket_name}/credentials (storage:read)

{
  "data": {
    "bucket_name": "my-files",
    "endpoint": "https://s3-s06.cdnshark.com",
    "region": "cdnshark-sto-hdd-01",
    "access_key_id": "GK...",
    "secret_key": "...",
    "is_private": false,
    "cdn_url": "my-files.cdn.cdnshark.com",
    "status": "active"
  }
}

Use endpoint, region, access_key_id and secret_key in your S3 client, with path-style addressing.

Delete a bucket

DELETE /api/storage/buckets/{bucket_name} (storage:write). The bucket and all its objects are deleted in the background. Returns {"message": "Delete queued for bucket cleanup.", "bucket_name": "..."}. Calling it again is harmless.

Creating and deleting buckets fires the storage.bucket.created and storage.bucket.deleted webhooks.