Storage

File Storage

Store and serve files in buckets. Upload images, documents, videos, or any file type. All endpoints below are under /api/v1/storage/projects/{project_slug} and accept your project API key. They are served by the platform API at https://api.wowsql.com. Your project host (https://your-project-slug.wowsqlconnect.com) serves storage under /storage/v1/ (bucket CRUD, /object/list/{bucket}, upload, download, delete, move, copy and /object/public/...) and also accepts the same /api/v1/storage/projects/{project_slug}/... paths that the SDKs call.

Buckets

POST   /api/v1/storage/projects/{project_slug}/buckets                 // Create bucket
GET    /api/v1/storage/projects/{project_slug}/buckets                 // List buckets
GET    /api/v1/storage/projects/{project_slug}/buckets/{bucket}        // Get bucket
PATCH  /api/v1/storage/projects/{project_slug}/buckets/{bucket}        // Update bucket
DELETE /api/v1/storage/projects/{project_slug}/buckets/{bucket}        // Delete bucket

Create body:
{
  "name": "avatars",
  "public": false,
  "file_size_limit": null,
  "allowed_mime_types": null
}

Upload Files

POST /api/v1/storage/projects/{project_slug}/buckets/{bucket}/files?folder=images

Headers:
  Authorization: Bearer YOUR_API_KEY
  Content-Type: multipart/form-data

Form Data:
  file: [binary file data]          // stored as images/<original file name>

Public or private access is a property of the bucket ("public": true when you create or update it), not of each upload.

List Files

GET /api/v1/storage/projects/{project_slug}/buckets/{bucket}/files?prefix=images&limit=10&offset=0

Headers:
  Authorization: Bearer YOUR_API_KEY

Download Files

GET /api/v1/storage/projects/{project_slug}/files/{bucket}/{path}

Headers:
  Authorization: Bearer YOUR_API_KEY

Get Public URL

Files in a public bucket are served without authentication:

GET https://your-project-slug.wowsqlconnect.com/storage/v1/object/public/{bucket}/{path}

// or, through the control-plane API host:
GET https://api.wowsql.com/storage/v1/object/public/{bucket}/{path}?project=your-project-slug

Presigned URLs

Not available: WoWSQL storage does not issue presigned URLs. The request below belongs to the retired AWS S3 add-on; its routes (/api/v1/storage/s3/...) now return 410 Gone. Use a public bucket for openly shared files, or download private files with your API key (see Download Files). The example is kept for reference only.

Generate temporary URLs for secure file access:

POST /api/v1/storage/projects/{project_slug}/presigned-url

Headers:
  Authorization: Bearer YOUR_API_KEY
  Content-Type: application/json

Body:
{
  "file_key": "images/profile.jpg",
  "expires_in": 3600
}

Response:
{
  "url": "https://...?signature=...",
  "expires_at": "2024-01-01T01:00:00Z"
}

Delete Files

DELETE /api/v1/storage/projects/{project_slug}/files/{bucket}/{path}

Headers:
  Authorization: Bearer YOUR_API_KEY

Check Storage Usage

GET /api/v1/storage/projects/{project_slug}/stats

Headers:
  Authorization: Bearer YOUR_API_KEY

GET /api/v1/storage/projects/{project_slug}/quota returns the same response as /stats (it is kept for SDK getQuota() calls).