Media Transformations
Dynamically crop, resize, and edit media via the CDN using Just-In-Time (JIT) APIs and Async Jobs.
Media Transformations (JIT)
/api/v2/transform/:appName/*objectKey
Transform public images on-the-fly. You can use pre-configured App Variants or generate arbitrary transformations using an HMAC signature.
Example of resizing and cropping an image to a 200x200 square using the 'cover' crop mode.
https://api.buzstorage.com/api/v2/transform/my-app/assets/shoes.jpg?w=200&h=200&c=cover&sig=...| Query Param | Type | Description |
|---|---|---|
| variant | string | Use a preset variant defined in your App Settings (e.g., thumbnail). No signature required. |
| w, h | number | Width and Height for arbitrary transformations. |
| c | string | Crop mode (fill, fit, cover, inside). |
| blur | number | Applies a gaussian blur to the image. Value specifies the sigma of the blur (e.g. 0.3 to 1000). |
| q | number | Output quality (1-100). Default is 80. |
| f | string | Target format (auto, webp, avif, jpeg, png). Default is auto. |
| sig | string | Required for arbitrary transformations. A SHA256 HMAC signature of the parameters. |
Generating HMAC Signatures
<img src="https://api.buzstorage.com/api/v2/transform/my-app/assets/image.png?variant=thumbnail" />Video Transformation Jobs (Async)
/api/v2/transform/video/jobs
Unlike images, video transformations (trimming, GIF conversions) are computationally heavy and cannot be performed Just-In-Time. Instead, submit a JSON payload to queue an asynchronous processing job.
Webhooks & Storage
saveAs path and a webhookUrl to be notified the moment your new video is ready!
Example of an asynchronous video job trimming 5 seconds from a raw MP4 and converting it into a high-quality looping GIF.
{ "trim": { "start": "00:00:10", "duration": 5 }, "format": "gif" }curl -X POST https://api.buzstorage.com/api/v2/transform/video/jobs \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"appName": "my-app",
"objectKey": "assets/raw-video.mp4",
"saveAs": "assets/clip-preview.gif",
"webhookUrl": "https://my-app.com/webhooks/video-ready",
"operations": {
"trim": { "start": "00:00:10", "duration": 5 },
"format": "gif"
}
}'DRM Watermarking (JIT)
/api/protected/folder/:folderId/watermark
Update the DRM watermark settings for an existing folder. When enabled, all images served from this folder will be auto-watermarked on-the-fly without permanently altering the original files.
{
"isWatermarkEnabled": true,
"watermarkFileId": "f1749123456789-abc123",
"watermarkOpacity": 0.5
}Folder Level Activation
"isWatermarkEnabled": true to the POST /api/protected/folders/create endpoint.curl -X PUT https://api.buzstorage.com/v1/folders/123/watermark \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"isWatermarkEnabled": true,
"watermarkOpacity": 0.6
}'