Instagram DMs through the API and the 24-hour window
Through Instagram's API, a professional account can reply to anyone who has sent it a DM, during a standard messaging window that lasts 24 hours for most conversations. The person has to write first, and the account must turn on Allow access to messages in the Instagram app before any app can read or send its DMs.
easyCoexistence replies to Instagram DMs with send_social_dm from Claude, ChatGPT or your own code, inside the 24-hour window, and forwards new DMs to your endpoint as they arrive.
The standard window for replying after a person's message, for most user actions.
Meta's separate Human Agent window, for replies a person writes and tags human_agent.
The most text one DM can carry through the API, encoded as UTF-8.
Error subcode, under code 10, for a message sent outside the allowed window.
Inactivity after which a conversation in the Requests folder is no longer returned by the API.
Who can an account message through the API?
Anyone who has messaged it. Conversations begin only when a person writes to the account, from the Feed, a post, a Story mention or elsewhere, and from then on an app can reply to them. A person who comments on a post can also receive one private reply, covered below.
The API has no way to send the first message, and group conversations are not supported: each conversation is between the account and one person.
How long is the messaging window?
24 hours for most conversations. Meta calls it the standard messaging window, and the action that opens it sets its length: a message from the person opens 24 hours, and their next message opens it again. When the first message comes from someone who tapped a Click-to-Direct ad, the window can last up to 7 days.
Meta also has a separate Human Agent window of 7 days, for replies written by a person and tagged human_agent by an app with that feature, meant for issues the standard window cannot cover. A send outside any open window fails with code 10, subcode 2534022.
What is Allow access to messages?
A setting in the Instagram app that lets connected tools read and send the account's direct messages. Meta's guide puts it under Settings, Messages and story replies, Message controls, Connected tools, and an account has to turn it on before an app can manage its DMs. While it is off, sends fail with code 200, subcode 2534041: the account owner has disabled access to Instagram direct messages.
How do private replies to comments work?
A professional account can send one message to a person who commented on its post, Reel or Story, within 7 days of the comment, or on a Live only during the broadcast. The message lands in the person's inbox if they follow the account and in message requests if they do not, and it includes a link to the post. A follow-up has to wait for the person to answer, and then goes out within 24 hours of their response.
Where do API conversations appear in the app?
In the account's normal Instagram inbox, with a few differences worth knowing:
- New conversations from followers start in Primary; from people who do not follow the account, in Requests.
- A conversation replied to through an app moves to the General folder, whatever the inbox settings say.
- Messages delivered to an app are not marked as read in the Instagram app until a reply is sent.
- Requests with no activity for 30 days are no longer returned by the API.
How fast can an account send?
Meta sets messaging rates per Instagram professional account, apart from the app's other API calls:
- Text, links, reactions and stickers: 100 calls per second.
- Audio or video: 10 calls per second.
- Private replies to comments on posts and Reels: 750 calls per hour.
- Conversations API: 2 calls per second.
What can a message contain?
Text, links, images, audio, video, PDF files, stickers, reactions, templates and posts the account owns. Text has to be UTF-8 and no more than 1,000 bytes, which fits fewer characters once accents and emoji are involved. Images can be PNG or JPEG up to 8 MB, and audio, video and PDF files up to 25 MB.
Common mistakes
- Leaving Allow access to messages off. Sends fail with code 200, subcode 2534041, until the account turns it on in the app.
- Counting characters instead of bytes. Accented letters take two bytes in UTF-8 and most emoji four, so text that passes a 1,000-character check can still be refused.
- Sending a second private reply to the same comment. Meta allows one; the next message waits until the person answers.
- Timing the window from the first message of the conversation. It runs from the person's latest message, so each reply from them gives the account more time.
Automations can reply on their own, with a fixed text or AI, and comment-to-DM rules send private replies around the clock. US$ 9 to US$ 0.75 per connection per month, falling as you add connections, with the first 3 days free.
easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.
Frequently asked questions
Can a business send the first DM on Instagram?
Not through the API. The person has to message the account first, or comment on one of its posts, which allows a single private reply within 7 days.
What happens when the 24 hours are over?
The API refuses the send until the person writes again, which opens a new window. Replies written by a person can use Meta's separate 7-day Human Agent window, with the human_agent tag.
How long can an Instagram DM sent through the API be?
Up to 1,000 bytes of UTF-8 text per message. Accents and emoji take more than one byte each, so a message with them fits fewer than 1,000 characters.
Do messages read through the API show as read in the app?
No. A message delivered to an app stays unread in the Instagram inbox until a reply is sent.
Keep reading
Connect your first channel in two minutes.
No platform reviews to wait for. Connect WhatsApp, Instagram, TikTok or another channel, then ask your AI to post, reply or report, and watch it work.
- 3 days free
- Cancel any time
- Official APIs only
- Monitored 24/7
Verified on