Skip to content

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


Generate a presigned upload URL. Upload your file via PUT to the returned URL.

Auth: Required

Body FieldTypeRequiredDescription
file_namestringYes*Original filename (used for extension validation)
keystringYes*Explicit storage key (legacy — use file_name instead)
content_typestringNoMIME type (default: video/mp4)
expires_inintegerNoURL 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.

Terminal window
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:

Terminal window
curl -X PUT "<upload_url>" \
-H "Content-Type: video/mp4" \
--data-binary @product-demo.mp4

Generate a presigned download URL for a file.

Auth: Required

Body FieldTypeRequiredDescription
keystringYes*Storage key
file_pathstringYes*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=..."
}
Terminal window
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"}'

List files in the user’s storage.

Auth: Required

Query ParamTypeRequiredDescription
prefixstringNoFilter 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-..."
}
Terminal window
curl "https://api.lynxvizion.com/api/storage/files?prefix=thumbnails/" \
-H "Authorization: $LVZ_KEY"

Delete a file from storage. Also removes the associated video record, segments, and shared reports if the file was analyzed.

Auth: Required

Query ParamTypeRequiredDescription
keystringYesStorage key of the file to delete

Response:

{
"success": true,
"ok": true
}
Terminal window
curl -X DELETE "https://api.lynxvizion.com/api/storage/files?key=users/550e8400-.../my-video.mp4" \
-H "Authorization: $LVZ_KEY"