Skip to main content
POST
/
collection
/
{collection_id}
/
upload
Upload media to collection
curl --request POST \
  --url https://api.videodb.io/collection/{collection_id}/upload \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "url": "https://example.com/video.mp4",
  "name": "My Video",
  "media_type": "video",
  "callback_url": "https://webhook.example.com/callback"
}
'
{
  "success": true,
  "status": "processing",
  "data": {
    "id": "job-123",
    "output_url": "https://api.videodb.io/async-response/job-123"
  }
}
Upload videos, audio files, or images to a collection from URLs or local files.
import videodb

conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()

# Upload from URL
video = coll.upload(url="https://example.com/video.mp4")

# Upload from local file
video = coll.upload(file_path="/path/to/video.mp4")

# Upload with callback for async processing
video = coll.upload(
    url="https://example.com/video.mp4",
    callback_url="https://your-server.com/webhook"
)

print(f"Video ID: {video.id}")
print(f"Stream URL: {video.stream_url}")
  • Supports video, audio, and image files
  • Use media_type parameter to specify type explicitly
  • Large files should use callback_url for async processing

Authorizations

x-access-token
string
header
required

API key for authentication (sk-xxx format)

Path Parameters

collection_id
string
required
Example:

"default"

Body

application/json
url
string
required
Example:

"https://example.com/video.mp4"

name
string
Example:

"My Video"

media_type
enum<string>
Available options:
video,
audio,
image
Example:

"video"

callback_url
string
Example:

"https://webhook.example.com/callback"

Response

200 - application/json

Upload initiated

success
boolean
Example:

true

status
enum<string>
Available options:
processing,
done,
failed
Example:

"processing"

data
object