Skip to main content

One-shot import of a public image or MP4 video URL

POST 

/media/upload-from-url

Fetches the URL server-side and stores it — no presign/PUT/complete dance.

Images (JPEG/PNG/GIF/WebP/HEIC/HEIF, max 25 MB) import synchronously: the response media_id is ready immediately.

Videos (MP4 only, max 500 MB) import ASYNCHRONOUSLY: the response returns instantly with media_status: "uploading" while the file streams in server-side. Poll GET /media/{id} until media_status is ready (typically seconds), then attach via media_ids. If it becomes failed, the poll response's error_message states exactly why (too large, not actually an MP4, storage quota, source URL died). Oversize videos with a Content-Length return 413 up front; storage quota returns 403 storage_quota_exceeded.

30 s fetch timeout to first byte, SSRF-guarded including redirects (no localhost/private addresses, 400 invalid_url). Unreachable or slow URLs return 502/504 fetch_failed. Consumes the media upload quota.

Request

Responses

Imported. Images return media_status "ready"; videos return "uploading" — poll GET /media/{id} until ready before attaching.