Also available: Markdown version · llms.txt · full site content
Storage
Storage overview
S3-backed object storage on your project host at /storage/v1. Public and private buckets, direct browser uploads, metered downloads, and server-enforced quotas.
How Storage is organized
Each project has buckets, and each bucket holds objects at logical paths such as images/avatar.png. Folders are path prefixes only — nothing is created for them. The catalog (buckets, objects, upload sessions, events) lives in a managed storage schema in your project’s PostgreSQL database. The file bytes live in the deployment’s private, encrypted S3 bucket under opaque platform-generated keys; your filenames never become S3 keys.
| Piece | Where it lives | Who can touch it |
|---|---|---|
| Bucket and object metadata | Project database, storage schema | The engine only — not the Data API or SQL roles’ writes |
| File bytes | Private S3 bucket, encrypted at rest | The engine’s IAM role; clients via short-lived authorizations |
| Quota accounting | Central metadata database | The engine, atomically per upload and download |
Authentication
Storage reuses the platform credentials. Every request carries the apikey header with the project’s publishable key. Writes and private reads additionally need an Authorization: Bearer token: either an end-user JWT from CubiBase Auth, or a secret API key (cb_sec_…) for trusted server code. Public-bucket reads need only the publishable key.
| Credential | Can do |
|---|---|
| Publishable key alone | Read objects in public buckets (metered) |
| Publishable key + user JWT | Upload, list, read, and delete according to bucket visibility and object ownership |
| Publishable key + secret API key | Full project-scoped access — still subject to every quota |
| Signed download token | Read exactly one object until the token expires |
Route map
| Call | Purpose |
|---|---|
POST /storage/v1/buckets | Create a bucket |
GET /storage/v1/buckets | List buckets |
GET /storage/v1/buckets/{bucket} | Bucket configuration |
PATCH /storage/v1/buckets/{bucket} | Update visibility, size cap, MIME allowlist |
DELETE /storage/v1/buckets/{bucket} | Delete the bucket and its objects |
POST /storage/v1/objects/upload | Start an upload (reserves quota, returns the S3 policy) |
POST /storage/v1/uploads/{id}/complete | Verify and finalize the uploaded object |
GET /storage/v1/uploads/{id} | Upload session status |
GET /storage/v1/objects | List objects by bucket, prefix, and search |
GET /storage/v1/objects/{id} | Object metadata |
GET /storage/v1/objects/{id}/content | Download (metered; Range supported) |
POST /storage/v1/objects/{id}/sign | Short-lived signed download link |
GET /storage/v1/public/{bucket}/{path} | Anonymous public-bucket read (metered) |
DELETE /storage/v1/objects/{id} | Delete an object |
GET /storage/v1/usage | This project’s storage and bandwidth consumption |
GET https://example-project.api.cubibase.com/storage/v1/objects?bucket=avatars&prefix=images/&delimiter=true&limit=50
apikey: cb_pub_EXAMPLE_ONLY
Authorization: Bearer <USER_JWT_OR_SECRET_KEY>In the Console
Open a project and choose Storage. The overview shows project, account, and bandwidth quotas with warnings at 50%, 75%, 90%, and 100%. Buckets manages visibility and limits; Files is a prefix-based browser with drag-and-drop uploads, downloads, share links, and deletion. Console traffic passes through the same quota and event machinery as the API — there is no unmetered side door.