Syntra Storage
Bucket management
- •
storage_list_buckets— see existing buckets - •
storage_create_bucket— create withnameand optionalis_public - •
storage_get_bucket— get bucket details by ID - •
storage_update_bucket— toggle public access - •
storage_delete_bucket— delete bucket and all objects
Public vs private buckets
- •Public (
is_public: true): Objects accessible via direct URL without authentication - •Private (
is_public: false): Requires signed URLs or authenticated download
Upload files
Small files (< 5MB) — inline base64
json
{
"bucket_name": "avatars",
"key": "users/user-123/avatar.png",
"content_base64": "<base64-encoded-content>",
"content_type": "image/png"
}
Use storage_upload_object with base64-encoded content.
Large files — signed upload URL
- •
storage_get_signed_upload_urlwithbucket_name,key,content_type - •Returns a
signed_urlvalid for 1 hour (configurable viaexpires_in) - •Client uploads directly via HTTP PUT to the signed URL
Download files
Inline download
storage_download_object returns:
- •Files < 5MB:
content_base64+content_type+size - •Files > 5MB:
signed_urlfor direct download
Signed download URL
storage_get_signed_download_url — returns a time-limited URL for direct access.
File operations
- •
storage_list_objects— list files in a bucket with optionalprefixfilter and pagination - •
storage_delete_object— delete a single file - •
storage_copy_object— copy between buckets or rename within a bucket
Common patterns
User avatar upload
code
1. storage_create_bucket { name: "avatars", is_public: true }
2. storage_upload_object { bucket_name: "avatars", key: "users/{user_id}/avatar.png", content_base64: "...", content_type: "image/png" }
Document storage (private)
code
1. storage_create_bucket { name: "documents", is_public: false }
2. storage_upload_object { bucket_name: "documents", key: "contracts/2024/contract-001.pdf", ... }
3. storage_get_signed_download_url { bucket_name: "documents", key: "contracts/2024/contract-001.pdf", expires_in: 3600 }
Organize with prefixes
Use / in keys to create virtual folder structures:
- •
images/products/shoe-001.jpg - •
images/products/shoe-002.jpg - •
images/banners/hero.png
Then list with prefix: "images/products/" to get only product images.
Storage providers
Configured via environment variables:
- •Local:
STORAGE_PROVIDER=local, files inLOCAL_STORAGE_PATH - •S3-compatible:
STORAGE_PROVIDER=s3withS3_BUCKET,S3_REGION,S3_ACCESS_KEY,S3_SECRET_KEY, optionalS3_ENDPOINT(for MinIO, Cloudflare R2, etc.)