The Platform API
Flow: Upload & Process Video
Manage your videos, ask questions, and build applications with the Platform API. Explore the operations below for request details, responses, and examples.
No matching documentation. Try a different search.
Flow: Upload & Process Video
1
Upload video
POST /projects/:projectId/videos/upload (multipart)
2
Poll status until completed
GET /projects/:projectId/videos/:videoId/status every 3-5s
3
Trigger processing (if not auto-started)
Start an Overview scan with POST /projects/:projectId/videos/:videoId/smart-scan, or use .../process to apply the project's processing settings.
4
Ready for analysis
Use agent or Q&A endpoints once status is completed
import requests, time
API_KEY = "svk_..."
BASE = "https://platform.endlessai.com/api/v1"
PROJECT_ID = "your-project-id"
# Step 1: Upload
with open("video.mp4", "rb") as f:
resp = requests.post(
f"{BASE}/projects/{PROJECT_ID}/videos/upload",
headers={"X-Api-Key": API_KEY},
files={"video": ("video.mp4", f, "video/mp4")},
)
video = resp.json()
video_id = video["id"]
print(f"Uploaded: {video_id}")
# Step 2: Poll until complete
while True:
status = requests.get(
f"{BASE}/projects/{PROJECT_ID}/videos/{video_id}/status",
headers={"X-Api-Key": API_KEY},
).json()
print(f"Status: {status['status']}")
if status["status"] == "completed":
break
if status["status"] == "error":
raise RuntimeError("Processing failed")
time.sleep(5)
# Step 3: Ask a question
result = requests.post(
f"{BASE}/projects/{PROJECT_ID}/agent/process",
headers={"X-Api-Key": API_KEY, "Content-Type": "application/json"},
json={"message": "Describe what happens in this video", "sessionId": "s1"},
timeout=300,
).json()
print(result)import { openAsBlob } from "node:fs";
const API_KEY = "svk_...";
const BASE = "https://platform.endlessai.com/api/v1";
const PROJECT_ID = "your-project-id";
// Step 1: Upload
const form = new FormData();
form.append("video", await openAsBlob("video.mp4", { type: "video/mp4" }));
const uploadRes = await fetch(`${BASE}/projects/${PROJECT_ID}/videos/upload`, {
method: "POST", headers: { "X-Api-Key": API_KEY }, body: form
});
const video = await uploadRes.json();
// Step 2: Poll
let status;
do {
await new Promise(r => setTimeout(r, 5000));
const statusRes = await fetch(
`${BASE}/projects/${PROJECT_ID}/videos/${video.id}/status`,
{ headers: { "X-Api-Key": API_KEY } }
);
status = await statusRes.json();
} while (status.status !== "completed");
// Step 3: Analyze
const result = await fetch(`${BASE}/projects/${PROJECT_ID}/agent/process`, {
method: "POST",
headers: { "X-Api-Key": API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ message: "Describe what happens", sessionId: "s1" })
}).then(r => r.json());# Step 1: Upload
VIDEO_ID=$(curl -s -X POST "https://platform.endlessai.com/api/v1/projects/PROJECT_ID/videos/upload" \
-H "X-Api-Key: YOUR_KEY" -F "video=@video.mp4" | jq -r '.id')
# Step 2: Poll
while true; do
STATUS=$(curl -s -H "X-Api-Key: YOUR_KEY" \
"https://platform.endlessai.com/api/v1/projects/PROJECT_ID/videos/$VIDEO_ID/status" | jq -r '.status')
echo "Status: $STATUS"
[ "$STATUS" = "completed" ] && break
sleep 5
done
# Step 3: Analyze
curl -X POST "https://platform.endlessai.com/api/v1/projects/PROJECT_ID/agent/process" \
-H "X-Api-Key: YOUR_KEY" -H "Content-Type: application/json" \
-d '{"message": "Describe what happens", "sessionId": "s1"}'