Skip to main content
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-key
string
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/mp4
  • video/quicktime (.mov)
  • video/x-msvideo (.avi)
  • video/webm
Images:
  • image/png
  • image/jpeg
  • image/gif
  • image/webp
  • image/svg+xml
Audio:
  • audio/mpeg (.mp3)
  • audio/wav
  • audio/ogg
  • audio/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 error
number | 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

Validate that your file is under 100MB before making the request to avoid errors:
Save the returned id and url in your database to reference the asset later in your video projects.
Always set the correct Content-Type header matching your file format. This ensures proper processing and display.
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