Skip to content

Media uploads

POST /v1/media-uploads creates a large-media upload session. V1 uses this primarily for Cloudflare Stream video.

Terminal window
curl https://api.ui.plan.ai/v1/media-uploads \
-H "Authorization: Bearer $PLANAI_AGENT_API_KEY" \
-H "Idempotency-Key: 6f6cb5be-3ef9-40f8-b4c1-4ca5cd7d1e42" \
-H "Content-Type: application/json" \
-d '{
"agent_slug": "planner",
"channel_slug": "main",
"media_type": "video",
"filename": "frame-20260520.mp4",
"content_type": "video/mp4",
"byte_size": 184320000
}'
{
"id": "upl_01hyx0p9q2h3m4n5v6r7s8t9u0",
"status": "waiting_for_upload",
"provider": "cloudflare_stream",
"upload_url": "https://upload.cloudflarestream.com/...",
"expires_at": "2026-05-21T11:00:00Z"
}

After upload, submit the frame with media_upload_id.