Storage
The Storage router manages video files in Backblaze B2 cloud storage. Files are stored under users/<user-id>/ and accessed via presigned URLs.
Supported formats: .mp4, .mov, .avi, .mkv, .webm, .flv, .wmv, .m4v, .mpg, .mpeg, .3gp, .ogv, .ts, .mts, .vob, .asf, .rm, .rmvb, .divx
Max file size: 4 GB
POST /storage/upload-url
Section titled “POST /storage/upload-url”Generate a presigned upload URL. Upload your file via PUT to the returned URL.
Auth: Required
| Body Field | Type | Required | Description |
|---|---|---|---|
file_name | string | Yes* | Original filename (used for extension validation) |
key | string | Yes* | Explicit storage key (legacy — use file_name instead) |
content_type | string | No | MIME type (default: video/mp4) |
expires_in | integer | No | URL expiry in seconds (default: 3600, range: 300–7200) |
*One of file_name or key is required.
Response:
{ "success": true, "upload_url": "https://s3.eu-central-003.backblazeb2.com/...", "file_path": "users/550e8400-.../my-video.mp4", "public_url": "", "user_id": "550e8400-...", "sanitized_filename": "my-video.mp4", "original_filename": "My Video (1).mp4", "expires_at": null}Filenames are sanitized: whitespace → underscores, special characters removed, path separators stripped.
curl -X POST https://api.lynxvizion.com/api/storage/upload-url \ -H "Authorization: $LVZ_KEY" \ -H "Content-Type: application/json" \ -d '{"file_name": "product-demo.mp4", "content_type": "video/mp4"}'Then upload the file:
curl -X PUT "<upload_url>" \ -H "Content-Type: video/mp4" \ --data-binary @product-demo.mp4POST /storage/download-url
Section titled “POST /storage/download-url”Generate a presigned download URL for a file.
Auth: Required
| Body Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes* | Storage key |
file_path | string | Yes* | Alternative to key |
*One of key or file_path is required.
Paths starting with users/ or results/ are used as-is. Other paths are prefixed with users/<user-id>/.
Response:
{ "url": "https://s3.eu-central-003.backblazeb2.com/...?X-Amz-Signature=..."}curl -X POST https://api.lynxvizion.com/api/storage/download-url \ -H "Authorization: $LVZ_KEY" \ -H "Content-Type: application/json" \ -d '{"file_path": "users/550e8400-.../my-video.mp4"}'GET /storage/files
Section titled “GET /storage/files”List files in the user’s storage.
Auth: Required
| Query Param | Type | Required | Description |
|---|---|---|---|
prefix | string | No | Filter by path prefix within user directory |
Response:
{ "success": true, "files": [ { "name": "my-video.mp4", "size": 52428800, "lastModified": "2025-01-15T10:00:00Z", "publicUrl": "", "filePath": "users/550e8400-.../my-video.mp4" } ], "user_id": "550e8400-..."}curl "https://api.lynxvizion.com/api/storage/files?prefix=thumbnails/" \ -H "Authorization: $LVZ_KEY"DELETE /storage/files
Section titled “DELETE /storage/files”Delete a file from storage. Also removes the associated video record, segments, and shared reports if the file was analyzed.
Auth: Required
| Query Param | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Storage key of the file to delete |
Response:
{ "success": true, "ok": true}curl -X DELETE "https://api.lynxvizion.com/api/storage/files?key=users/550e8400-.../my-video.mp4" \ -H "Authorization: $LVZ_KEY"