How to Send Images, Videos and Carousels in Instagram DMs With the API (2026)
Text-only DMs get ignored. Here's how to send rich media through Instagram's API, without tripping the limits. Most Instagram DM automation is just text. A plain "thanks for commenting, here's the link" works, but it reads like a robot wrote it. Add a photo, a short video, or a carousel of options and the DM feels like it came from a person. The API supports all of it, if you know the rules. The…
Instagram's API allows automation of Direct Messages (DMs) with rich media, including images, videos, and carousels. However, sending media has more stringent limits and failure modes compared to text messages. Text messages have a 1,000 character limit, while images can be up to 8 MB, videos and audio up to 25 MB. Media sends are also rate-limited significantly more than text, with roughly 10 media sends per second compared to 100 for text.
To send media, you use an attachment object in the API call, which replaces the text content. The recipient ID is the Instagram-scoped user ID obtained from your webhook, not a username. It's crucial to host the media files yourself on a public, HTTPS-enabled server. The URL must remain accessible for the entire duration of the messaging window, which lasts for 24 hours from the last message received.
Media sends are also subject to strict rate limits. You can send about 10 media messages per second, far fewer than text messages. To avoid overwhelming your account and to comply with rate limits, queue media sends separately from text messages. This ensures that even during a burst of activity, text replies don't get delayed.
When structuring media messages, start with a brief text message followed by the media. This approach makes the communication feel more personal and engaging. However, be cautious about overusing media. Starting an automated conversation with a heavy video can make your account appear more like an advertisement than a helpful service.
If you're building your own system for sending automated DMs, there are a few best practices to follow. Ensure all sends respect the 24-hour messaging window and use publicly accessible URLs for media files. Implement a mechanism to validate URLs before sending, and keep a log of any failures to troubleshoot issues effectively. Consider using a platform like Zextra, which is designed to handle Instagram DM automation using the official Instagram Graph API, ensuring compliance with platform rules and providing interactive features like image previews and carousel options without requiring password sharing.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to