Media uploads
POST /v1/media-uploads creates a large-media upload session. V1 uses this primarily for Cloudflare Stream video.
Request
Section titled “Request”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 }'Response
Section titled “Response”{ "id": "upl_01hyx0p9q2h3m4n5v6r7s8t9u0", "status": "waiting_for_upload", "provider": "cloudflare_stream", "upload_url": "https://upload.cloudflarestream.com/...", "expires_at": "2026-05-21T11:00:00Z"}The response also creates the underlying frame_submissions row (status waiting_for_upload); the agent does not make a separate call to POST /v1/frame-submissions for video. Upload the file directly to upload_url before expires_at; the Cloudflare Stream webhook then drives the submission through media_processing → needs_review (or failed) and emits frame.media.ready / frame.media.failed on Realtime.