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.

PieceWhere it livesWho can touch it
Bucket and object metadataProject database, storage schemaThe engine only — not the Data API or SQL roles’ writes
File bytesPrivate S3 bucket, encrypted at restThe engine’s IAM role; clients via short-lived authorizations
Quota accountingCentral metadata databaseThe 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.

CredentialCan do
Publishable key aloneRead objects in public buckets (metered)
Publishable key + user JWTUpload, list, read, and delete according to bucket visibility and object ownership
Publishable key + secret API keyFull project-scoped access — still subject to every quota
Signed download tokenRead exactly one object until the token expires

Route map

CallPurpose
POST /storage/v1/bucketsCreate a bucket
GET /storage/v1/bucketsList 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/uploadStart an upload (reserves quota, returns the S3 policy)
POST /storage/v1/uploads/{id}/completeVerify and finalize the uploaded object
GET /storage/v1/uploads/{id}Upload session status
GET /storage/v1/objectsList objects by bucket, prefix, and search
GET /storage/v1/objects/{id}Object metadata
GET /storage/v1/objects/{id}/contentDownload (metered; Range supported)
POST /storage/v1/objects/{id}/signShort-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/usageThis project’s storage and bandwidth consumption
List objects · prefix browsing
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.

Additional resources