{
  "id": 21913058,
  "title": "How to Send Images, Videos and Carousels in Instagram DMs With the API (2026)",
  "url": "https://urgent.news/2026/11/26/how-to-send-images-videos-and-carousels-in-instagram-dms-with-the-api",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-26T02:47:50.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/peter11241342/how-to-send-images-videos-and-carousels-in-instagram-dms-with-the-api-2026-3m5i"
  },
  "original_language": "en",
  "account": "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.\n\nTo 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.\n\nMedia 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.\n\nWhen 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.\n\nIf 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.",
  "summary": "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…",
  "key_points": [
    "Instagram API enables automated DMs with images, videos, and carousels.",
    "Media files must be hosted on public HTTPS servers for 24-hour window.",
    "Send rate limited at 10 media messages per second, less than text."
  ],
  "editors_take": "Automating rich media via the Instagram API requires more complex infrastructure and stricter rate management than text-only messaging to avoid service delays and account flags.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}