Media Library
Store photos and files for bot messages. Upload to the library or get a Telegram file ID without a paid library.
في هذه الصفحة
If your bot often sends the same course outline or photo, upload the file to the media library and reuse it in messages. Identical files are stored once, even if uploaded several times. The library is included in paid plans that offer file storage (image_storage).
For Telegram, you can also upload through a service chat and get a Telegram file_id without a paid library. Both options and their limits are below.
Your own storage
An uploaded file is stored in GetMyBot and gets an identifier. Select it in a Photo or File message block; the bot will insert the file when sending. For API integrations, upload with POST /api/bots/{id}/media and preview with GET /api/bots/{id}/media/{mediaID}.
Content-based deduplication
If you upload the same file again, GetMyBot finds the existing copy and returns the same identifier. Identical files do not take up space twice. The platform compares files using a SHA-256 checksum; avoiding duplicate copies this way is called deduplication.
Premium access
The media library is a premium feature (image_storage). It is available on a paid plan that includes it; without an active subscription, uploading to the library returns a 402 (payment required) error. Previewing already-stored files works without restrictions.
The maximum file size for library uploads is 2 MiB.
Uploading via Telegram chat (without a paid library)
If the paid library is unavailable, upload the file through a service Telegram chat. GetMyBot returns a file_id that the bot can use to send the file again. This option does not require a paid subscription; the file size limit is also 2 MiB. For developers, the operation is called sink-upload and uses POST /api/bots/{id}/chats/{chatID}/sink-upload.
Which to use
| Task | Best option | Requirements |
|---|---|---|
| Store and reuse the same images, preview them, and avoid duplicates | Media library | Plan with image_storage, file up to 2 MiB |
Get a Telegram file_id without a subscription | sink-upload through a service chat | Telegram chat, file up to 2 MiB |
What's next
- Messages and buttons: "Photo" and "File" blocks in bot responses.
- Payments and balance: plans and premium features.
- Import from SamBot: migrating media from a bundle.
- Chats and operators: service chats for sink-upload.