upload_media
Uploads local photos, MP4 videos, or website images to Telegram Ads and returns validated media IDs and metadata for ad creation.
Instructions
Upload a local photo, MP4 video, or website photo to Telegram Ads.
file_path must be an absolute path on the server machine. The file's bytes are transmitted to Telegram. Images are checked with Pillow; video metadata validation requires ffprobe from FFmpeg on PATH.
Returns account_id, kind, photo_id/photo_url or video_id/video_url, and validated media metadata. Reuse the ID only in the same account. Upload retries may create a new media ID; no idempotency key is available.
Omitted account_id uses the configured default or the token owner.
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": {
"file_path": "<file_path>",
"kind": "<kind>"
},
"name": "upload_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | ||
| file_path | Yes | ||
| account_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||