Instagram error 2534022: DM sent outside the messaging window
Instagram error 2534022, returned with code 10, means a DM was sent when no messaging window was open with that person. Instagram lets a business reply during the standard messaging window, which opens when the person writes and lasts 24 hours for most conversations. Each new message from them opens it again; until then, the API refuses the send.
easyCoexistence replies to Instagram DMs with send_social_dm from Claude, ChatGPT or your own code while the window is open, and forwards new DMs to your endpoint as they arrive, so your system can see when a window opens.
The error code returned with subcode 2534022, whose message reads: This message is sent outside of allowed window.
How long the standard messaging window lasts for most user actions.
How long the window may last when a person's first message follows a click on a Click-to-Direct ad.
Private replies an account can send to one comment, within 7 days of the comment.
What does error 2534022 mean?
The message went out while no messaging window was open with that person. Meta's error reference gives the message as: This message is sent outside of allowed window. Its solution is that apps can only send a message while the applicable standard messaging window is open.
Nothing is wrong with the account or with the message itself. The timing is the problem: the person's last message was too long ago.
How long is the window open?
It depends on what opened it. Meta calls it the standard messaging window, and the person's action sets its length:
- A message from the person: 24 hours, for most user actions.
- A first message sent after clicking a Click-to-Direct ad: up to 7 days from that message.
- Each new message from the person opens the window again, so the time runs from their latest one.
- A separate 7-day Human Agent window exists for replies written by a person and tagged
human_agentby an app with that feature.
How do you reach the person again?
Wait for them to write. A new DM from the person reopens the window, and replying promptly keeps the conversation inside it. For someone who commented on a post or Reel, a private reply is another route: one message per comment, sent within 7 days of the comment, and if they answer it, follow-ups go out within 24 hours of their response.
How do you avoid it?
Track when each person last wrote and check it before sending. Message webhooks carry a timestamp with each DM, so an integration can store when the window opened and hold back any reply that would land after it closes. Replies queued for later, such as a follow-up scheduled for the next day, run into this error easily.
Common mistakes
- Timing the window from the first message in the conversation. It runs from the person's latest message.
- Scheduling a follow-up for the next day. In most conversations, a reply more than 24 hours after the person's last message fails unless they write again.
- Retrying the send. Time does not reopen the window; only a new message from the person does.
- Sending a second private reply to get around it. Meta allows one per comment, and further messages wait for the person to answer.
For commenters, reply_to_comment sends a private reply, and create_comment_rule sets up comment-to-DM rules that send one 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
Why does Instagram say the message was sent outside the allowed window?
No messaging window was open with that person. It opens when they message the account and lasts 24 hours for most conversations, so wait for them to write again.
Can a business message someone on Instagram first?
Not through the API. The person has to message the account first, or comment on a post, which allows one private reply within 7 days.
Does the window restart with each message?
Yes, with each message from the person, which opens a fresh window. Messages the business sends do not extend it.
Is there a longer window?
Two exceptions: up to 7 days after a first message that follows a Click-to-Direct ad, and Meta's separate 7-day Human Agent window for replies a person writes, tagged human_agent.
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