Storage
All endpoints require Authorization: Bearer TOKEN.
Create Bucket
POST /api/v1/storageBody:
{
"name": "my-assets",
"project_id": "prj_abc123"
}List Buckets
GET /api/v1/storageGet Bucket
GET /api/v1/storage/:idDelete Bucket
DELETE /api/v1/storage/:idGet Credentials
Returns S3-compatible credentials.
GET /api/v1/storage/:id/credentialsResponse: 200
{
"endpoint": "https://s3.espace-tech.com",
"access_key_id": "GKxxxxxxxx",
"secret_key": "xxxxxxxx",
"bucket": "st-myassets-a1b2c3d4",
"region": "espace-garage"
}Rotate Credentials
POST /api/v1/storage/:id/rotateLink / Unlink
POST /api/v1/storage/:id/link
POST /api/v1/storage/:id/unlinkBody:
{
"project_id": "prj_abc123"
}Injects S3_ENDPOINT, S3_ACCESS_KEY, S3_SECRET_KEY, and S3_BUCKET into the project.
Expose / Unexpose
Make bucket publicly accessible or restrict access.
POST /api/v1/storage/:id/expose
POST /api/v1/storage/:id/unexposePresigned Upload URL
Generate a time-limited URL for client-side uploads.
POST /api/v1/storage/:id/presign/uploadBody:
{
"key": "uploads/photo.jpg",
"content_type": "image/jpeg",
"expiry": 3600
}Response: 200
{
"upload_url": "https://s3.espace-tech.com/bucket/key?X-Amz-Signature=...",
"expires_in": 3600
}Presigned Download URL
Generate a time-limited URL for accessing private files.
POST /api/v1/storage/:id/presign/downloadBody:
{
"key": "images/photo.jpg",
"expiry": 3600
}Response: 200
{
"download_url": "https://s3.espace-tech.com/bucket/key?X-Amz-Signature=...",
"expires_in": 3600
}Presigned URLs can be used directly in browsers (<img>, <video>, fetch) — no authentication headers needed.