Upload content

An asset is a video file you upload to the platform. Each asset has a unique identifier that you can reference across multiple knowledge stores.

Methods

MethodLimitReference
Direct uploads (local file)Up to 200 MBPython SDK | Node.js SDK | API Reference
Direct uploads (public URL)Up to 4 GBPython SDK | Node.js SDK | API Reference
Multipart uploadsUp to 4 GBPython SDK | Node.js SDK | API Reference

Use multipart uploads for automatic retry on failure, upload progress tracking, and better reliability, performance, and observability.

When providing a URL, use direct links to raw media files. Video hosting platforms and cloud storage sharing links are not supported.

Waiting for Processing

Direct uploads under 200 MB return synchronously with status: ready. Larger uploads return with status: processing. Poll until the status is ready:

1import time
2import requests
3
4HEADERS = {"x-api-key": "YOUR_API_KEY"}
5BASE_URL = "https://api.twelvelabs.io/v1.3"
6
7asset_id = asset["_id"]
8while True:
9 response = requests.get(f"{BASE_URL}/assets/{asset_id}", headers=HEADERS)
10 status = response.json()["status"]
11 if status == "ready":
12 break
13 elif status == "failed":
14 raise Exception("Upload processing failed")
15 time.sleep(5)

An asset must reach ready status before you can add it to a knowledge store.

Jupyter notebook

Download the notebook to run this guide interactively.

API Reference