Upload media from a URL
upload_media_from_urlDownloads a public image (JPEG, PNG, WebP, GIF), video (MP4, MOV, WebM) or PDF into the workspace and returns a media id to put in create_post.media_ids. Media is per workspace and reusable across posts. Shager measures every video itself: width and height as displayed (a rotated phone video counts as portrait) and duration_ms come back in the response, and validate_post checks Reels, Shorts, Stories and TikTok length and shape rules with them (Shorts: vertical or square, up to 3 minutes; Instagram Reels 3 s–15 min; Stories up to 60 s). width, height and duration_ms are optional and only used when a file can't be measured; measured values win. A video that comes back with null width, height or duration_ms couldn't be measured: pass them and upload again before scheduling it. Private, local and credentialed URLs are refused. Size limit: 2 GB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| width | No | Fallback only: used when the video can't be measured. | |
| height | No | Fallback only: used when the video can't be measured. | |
| file_name | No | ||
| duration_ms | No | Fallback only: used when the video can't be measured. | |
| workspace_id | Yes | Workspace id from list_workspaces | |
| idempotency_key | No | Any unique string you choose (REST: the Idempotency-Key header works too). Retrying with the same key and body returns the first result instead of creating a second one. Kept 24 hours. |