Urgent.News

What's breaking now, across hundreds of outlets.

Tech

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

Read the original at dev.to →

Report a problem with this story

More in Tech

Loss Aversion: The Psychology Principle Behind Every 'Limited Time' Sale

Loss Aversion: The Psychology Principle Behind Every 'Limited Time' Sale "Only 3 left in stock." "Sale ends in 2 hours." "Don't miss out." These phrases aren't creative copywriting.

  • Loss aversion explains why "limited time" sales are effective.
  • Loss aversion causes losses to feel twice as bad as equivalent gains feel good.
  • Marketers exploit loss aversion by framing decisions as potential losses.

The Variable Reward Trap: Why Your Brain Can't Put the Phone Down

The Variable Reward Trap: Why Your Brain Can't Put the Phone Down You pick up your phone to check one notification. Twenty minutes later, you're still scrolling — and you have no idea how it happened.

  • Variable reward mechanism drives addictive behavior in brains
  • Smartphone apps intentionally harness neurological phenomenon
  • Anticipation of reward more addictive than reward itself

Bank of Korea’s Dilemma: The Chip Boom and the Uneven Economic Recovery

The Bank of Korea (BOK) raised its benchmark interest rate from 3.00% to 3.25% on November 26. The central bank also revised its economic growth forecast for 2026 from 3.3% to 3.9% and its 2027…

  • Bank of Korea raises key interest rate to 3.25% on November 26, 2023
  • Predicts 3.9% growth for 2026 and 4.1% for 2027, up from previous forecasts
  • Semiconductor industry drives South Korea's economic recovery

More from Thursday 26 November →