Import media from a URL
import_media_from_urlDownload an image, video, audio file or PDF document from a public http(s) URL into the media library. Images up to 10 MB, audio up to 25 MB, PDF documents up to 100 MB and videos up to 200 MB; the file type is taken from the file's own bytes, not its URL or extension, and internal/private addresses are refused. A larger video has to be uploaded from the PostRite app, which sends it straight to storage — there is no import path for it here. Audio files and PDF documents are for chat: a post publishes images and videos only and refuses them. Returns the new media record (use the id of an image or a video as a mediaId on a post). Importing the same file twice returns the existing record rather than a copy.
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": {
"url": "<url>"
},
"name": "import_media_from_url"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Public http(s) URL of the image, video, audio file or PDF document | |
| filename | No | Optional filename to store it under | |
| organizationId | No | Organization to act in — an id from list_organizations. Required when this connection was authorized for more than one organization; omit it when there is only one. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Use this as a mediaId on a post | |
| size | No | Bytes | |
| width | No | ||
| height | No | ||
| altText | No | Alternative text published with this file; null when none — set it with update_media | |
| duration | No | Seconds, for video | |
| filename | No | ||
| mimetype | No | ||
| createdAt | No | ||
| duplicate | No | True when an import matched a file already in the library | |
| hasThumbnail | No |