All functions
uploadAsset
Upload a file (image or PDF, max 10 MB) to cloud storage. Returns the storage key and a time-limited signed URL for reading. Optionally creates an Asset database record. When temp is true, the asset is scheduled for deletion after 24 hours.
2 credits / day / MB
Use cases
User-generated content uploads
Store profile images, avatars, or user-uploaded PDFs. Use temp: true for previews that expire in 24h, or create persistent assets with metadata.
Temporary file sharing
Generate time-limited share links for documents. Upload with temp: true and pass the signed URL to recipients—files auto-delete after 24 hours.
Parameters
| Name | Type | Description | |
|---|---|---|---|
| organizationId | string | required | The ID of the organization making the request |
| fileBase64 | string | required | The file encoded as a base64 string |
| filename | string | required | Original filename including extension |
| contentType | string | required | MIME type (image/jpeg, image/png, image/gif, image/webp, application/pdf) |
| title | string | optional | Optional display title for the asset record |
| temp | boolean | optional | If true, the asset is scheduled for deletion after 24 hours. Defaults to false |
Response
| Name | Type | Description |
|---|---|---|
| key | string | Storage key for the uploaded file |
| url | string | Signed URL for reading the file (valid for 1 hour) |
| asset | object | undefined | Asset database record, if title was provided or temp is true |