Upload Asset
Assets
Upload Asset
Upload a video, image, or audio file to use in your video projects
POST
Upload Asset
Overview
Upload assets (videos, images, audio files) to Babou’s cloud storage. Uploaded assets can be referenced in your video projects and used across multiple chapters.Maximum file size: 100MB per upload
Request
Headers
string
required
Bearer token with your API key:
Bearer sk-bab-your-api-keystring
required
The MIME type of the file being uploaded (e.g.,
video/mp4, image/png, audio/mpeg)Body
Send the raw binary file data as the request body.binary
required
The raw file content
Supported File Types
Video:video/mp4video/quicktime(.mov)video/x-msvideo(.avi)video/webm
image/pngimage/jpegimage/gifimage/webpimage/svg+xml
audio/mpeg(.mp3)audio/wavaudio/oggaudio/aac
Response
string
Unique identifier for the uploaded asset
string
Asset filename
string | null
S3 URL to access the asset (null until upload completes)
string
MIME type of the uploaded file
number | null
File size in bytes
string
Upload state:
uploading, processing, ready, or errornumber | null
Duration in seconds (for video/audio files, null for images)
number | null
Width in pixels (for image/video files)
number | null
Height in pixels (for image/video files)
string
ISO 8601 timestamp of upload
Examples
Response Example
Error Responses
413
File exceeds 100MB limit
500
S3 upload failed
400
Invalid or missing Content-Type header
Best Practices
Check file size before uploading
Check file size before uploading
Validate that your file is under 100MB before making the request to avoid errors:
Store asset IDs and URLs
Store asset IDs and URLs
Save the returned
id and url in your database to reference the asset later in your video projects.Use appropriate content types
Use appropriate content types
Always set the correct
Content-Type header matching your file format. This ensures proper processing and display.Handle upload errors gracefully
Handle upload errors gracefully
Implement retry logic for failed uploads, especially for large files that may fail due to network issues.
Next Steps
Get Asset
Retrieve asset details by ID
List Assets
View all your uploaded assets
Asset Management Guide
Learn how to use assets in your videos