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, except that a video file is deleted 7 days after the time of the posts that use it (a still stays): to post it again later, upload it again. 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). A file that doesn't fit a network needn't be re-made: set fit_shape and/or fit_length on the post and Shager makes a fitting copy for each network (validate_post lists them in fits). 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspace_id": "<workspace_id>",
"url": "<url>"
},
"name": "upload_media_from_url"
}
}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. |