Instagram API Errors We Hit Building a Comment-to-DM Tool
I run InboxLoop, a small tool that sends an Instagram DM when someone comments a keyword on a post or Reel. Most of the bugs that hurt us this year were not bugs in our code. They were Instagram API errors we didn't understand yet. This is what each one meant and what we changed.
By YogeshFounder, InboxLoopIf you landed here from Google with an error code in your clipboard, skip to the section for your code. Each one has the exact error message, what it means in plain words, and what worked for us. There's a short table at the end too.
One lesson before we start, because it applies to all of them: don't read the message field and decide what to do. Look at the code and the error_subcode. The message can be misleading, and Instagram sometimes sends it in the account owner's language, so matching on English text breaks for half your users.
Code 2, subcode 1545133: "Service temporarily unavailable"
This one fooled us. A creator's Reel picked up, and roughly 150 people commented the keyword. None of them got past our first message. Meta was returning this:
{
"error": {
"message": "Service temporarily unavailable",
"code": 2,
"error_subcode": 1545133
}
}"Service temporarily unavailable" sounds like Meta is down and you should retry. It wasn't, and retrying doesn't help. The real signal is subcode 1545133: Instagram refused the private reply we sent as the opening message. Ours had a button in it.
Meta doesn't say why. Other tool makers report that it happens when the first DM to someone who doesn't follow the account has a button, card or media in it. That matches what we saw, though we haven't proven it for every case.
What fixed it for us: when the button version gets this error, we switch that Instagram account to a plain text opening for the next 24 hours: "Thanks for commenting! Reply YES and I'll DM you the link." When the person replies YES, the rest of the flow continues as normal. We don't send a second private reply to the same comment, because you only get one.
A small trap we fell into: if the send times out and your code retries, make sure the retry sends the same version as the first try. Otherwise someone can get a button and then a text message for the same comment.
"The comment is invalid for a private reply" (code 100, subcode 2534025)
This means Instagram won't let you privately reply to that particular comment. It's different from replying twice to the same comment, which comes back as subcode 2534023.
The error doesn't tell you the reason. Common causes that other platforms list are a deleted comment, a comment older than 7 days, or a comment on a Live that has ended. Meta's own docs confirm the 7-day limit for private replies.
What fixed it for us: nothing to fix, really. We used to log a full error and retry. Now we stop that one send, mark it as failed, and move on. Retrying an ineligible comment only fills your logs.
"Your account has been temporarily blocked from taking this action" (code 368, subcode 1404169)
This was the worst one to see. One account suddenly couldn't send anything. A DM with a button went through, and the follow-up 30 minutes later failed with code 368, subcode 1404169 and the message "Based on previous use of this feature, your account has been temporarily blocked from taking this action".
It looks like a rate limit, but it isn't one. A normal rate limit is about your app and usually comes with a hint about when to retry. This block is on the Instagram account itself, and it comes with no retry information at all. Developers at other tools say continuing to send while blocked can make it last longer, so we treat it as a stop sign.
What fixed it for us: when we see this exact pair, we pause sending for that one account for a few hours and retry the waiting messages after that. Other accounts keep working, and reading posts and profiles still works for the blocked one. In the dashboard we show a calm "your messages are being paced" notice with a time, not the word "blocked". People panic at that word, and it doesn't help them do anything.
In our case the account was sending again the next morning. Meta doesn't publish how long these blocks last, so whatever pause you choose is a guess. Keep it easy to change.
"Error validating access token: The session has been invalidated" (code 190)
This one is simple once you know it. The creator changed their Instagram or Facebook password, or Meta reset the session for security, and the token you have stopped working:
{
"error": {
"message": "Error validating access token: The session has been invalidated because the user changed their password or Facebook has changed the session for security reasons.",
"type": "OAuthException",
"code": 190,
"error_subcode": 0
}
}We saw subcode 0. You may also see 460 for the same situation. Either way, the only fix is for the account owner to reconnect through Meta's login screen.
Our mistake was quieter. Some parts of our system noticed code 190, and some didn't. So a creator could change their password and have their DMs stop for days without anyone telling them.
What fixed it for us: any 190 during a send now marks the account as needing a reconnect, stops its automations, and sends the owner one email (not one per failed message) asking them to reconnect. The email never asks for a password. After reconnecting, the owner turns their automations back on themselves, so nothing restarts by surprise.
Instagram API rate limits that don't return HTTP 429
If your code only checks for HTTP 429, you'll miss most rate limits. Meta often sends HTTP 400 with a rate-limit code in the body instead. We now treat codes like 4, 17, 32, 613 and the 800xx range as "slow down", whatever the HTTP status says.
When one part of your system hits a limit, every other part that talks to Meta needs to know straight away. Otherwise you keep hammering the API from somewhere else and make it worse. And cap your retries. A message that waits a while is fine. A message that retries forever is a bug.
One more habit: don't log known errors as errors
After that viral Reel, our error tracker was full of failures we already understood. It made the new, actually unknown problems hard to spot. Now known Instagram failures are logged as warnings with their code and subcode, and only unexpected responses show up as errors.
Also, a handled error is still a failed message. We never mark those runs as sent, so the numbers creators see in their dashboard stay true.
How we protect the Instagram accounts we send from
Every error above taught us the same thing. The thing our customers can least afford to lose is their Instagram account. A missed DM is annoying. A restricted account can cost a creator weeks of reach. So account protection is the first thing we design for, and speed comes second.
Here is what that looks like in practice. None of it is exotic, but all of it had to be built on purpose, because the API will happily let you send until Instagram says no.
We stay under Meta's limits, not at them
Meta publishes limits for different kinds of requests, like how many private replies an account can send per hour. We don't treat those numbers as a target. We hold every account to about 90% of each limit, and we count before sending, not after. If an account is close to its budget, the next message waits a little instead of going out and getting rejected.
One account's problem stays with that account
Limits are tracked per Instagram account and per kind of action. If one account hits a limit on sending images, it can still send text, and every other account on InboxLoop carries on as normal. One creator's viral Reel should never slow down someone else's automations, and the system is built so it doesn't.
When Instagram says slow down, everything slows down at once
The moment any part of InboxLoop gets a rate limit for an account, every other part that sends for that account knows about it and stops calling Instagram until the cooldown ends. That matters more than it sounds. Without it, one process backs off while another keeps sending, and the account looks even more like spam.
If Meta tells us how long to wait, we wait that long. If it doesn't, we wait a bit longer on each retry, with some randomness added so retries don't all land at the same second. And there is always a cap on how many times we try.
We watch the warning signs, not just the errors
Meta includes usage information in many of its responses, even successful ones. We record it, so we can see an account getting busy before it turns into a block, instead of only finding out after something fails.
Replies don't have to go out in the same second
A reply that lands the instant someone comments looks like a machine. Every InboxLoop workspace can add a delay of up to 60 seconds before an automation starts, either a fixed number or a random one each time. It makes the conversation feel more natural for the person on the other side. To be clear, it doesn't lift Meta's limits and it isn't a way to hide that a reply is automated.
One person, one conversation
People often comment twice, or comment and then reply to a Story. We allow only one active run per automation per person, so a second comment doesn't trigger a second DM. Duplicate messages annoy people and are exactly the kind of repetition Instagram watches for.
Official API only
Everything goes through Meta's official API, with the permissions the account owner approves on Meta's own screen. We never ask for an Instagram password, and we never log in as the user.
I'll be honest about the limit of all this. No tool, including ours, can promise that Instagram will never restrict an account. What we can do is stay well inside the rules, react quickly when Instagram pushes back, and never keep pushing against a block. Our automation safety guide goes into more detail on what any tool can and can't do.
Quick reference
| Code / subcode | Meaning | What to do |
|---|---|---|
| 2 / 1545133 | First DM refused, often one with a button or media | Send a plain text opening instead, don't retry the same message |
| 100 / 2534025 | This comment can't get a private reply | Stop that send, no retry |
| 2534023 | You already replied privately to this comment | Skip it |
| 368 / 1404169 | Account temporarily blocked from sending | Pause that account for a few hours, then retry |
| 190 (subcode 0 or 460) | Token invalid after a password change or security reset | Ask the owner to reconnect, stop automations |
| 4, 17, 32, 613, 800xx | Rate limit, often with HTTP 400 | Back off everywhere, cap retries |
What we still don't know
We don't know exactly when Instagram applies 1545133, how long a 368 block really lasts, or why a given comment is invalid for a private reply. Our handling is built around not knowing: fall back, pause, or stop cleanly, and keep anything unfamiliar visible. If you've figured out more about any of these, I'd like to hear it.
Not a developer?
You don't need any of these codes. If your auto DMs stopped after a password change, reconnect Instagram in your automation tool. If messages are being paced, let the pause finish instead of pushing more trigger posts. Our auto DM troubleshooting guide covers the non-technical fixes, and the automation safety guide explains what no tool can promise. New to this? Start with what comment-to-DM automation is.
Frequently Asked Questions
What does Instagram API error subcode 1545133 mean?
It comes with code 2 and the message "Service temporarily unavailable", but it isn't an outage. Instagram refused the first private reply, often one with a button or media sent to someone who doesn't follow the account. Retrying the same message won't work. Send a plain text message instead.
How do I fix "The comment is invalid for a private reply"?
You usually can't. Code 100, subcode 2534025 means that comment can't receive a private reply, for example because it was deleted or is older than 7 days. Stop that send and move on.
What is Instagram error code 368, subcode 1404169?
The Instagram account is temporarily blocked from sending messages. It's account-level, not an app rate limit, and has no retry hint. Stop sending from that account for a few hours instead of retrying.
Why did my Instagram automation stop after I changed my password?
A password change or a security reset by Meta invalidates the connection, and Meta returns error code 190. Reconnect Instagram in your tool through Meta's login screen, then turn your automations back on.
Does the Instagram API always return HTTP 429 for rate limits?
No. Rate limits often come back as HTTP 400 with a code such as 4, 17, 32, 613 or one in the 800xx range. Check the code in the response body.
How does InboxLoop protect my Instagram account?
InboxLoop uses Meta's official API, keeps each account at about 90% of Meta's published limits, tracks limits per account and per kind of action, backs off everywhere at once when Instagram asks it to, and pauses an account that Instagram has temporarily blocked. No tool can guarantee an account will never be restricted.
Can I send two private replies to the same Instagram comment?
No. Instagram allows one private reply per comment, within 7 days. A second attempt fails with subcode 2534023.

About the author
Yogesh
Founder, InboxLoop
I'm Yogesh, a software engineer and the founder of InboxLoop. I build and run the product myself, and I write these guides from what I see while helping creators and businesses automate their Instagram DMs. Spotted a mistake or have a question? Message me on X.
Related features: Instagram DM automation, comment to DM, Instagram auto reply and Story reply automation.
Don't want to deal with these yourself?
InboxLoop handles comment-to-DM, Story replies and DM auto replies through Meta's official API, including the errors in this post.
Free to start, with a 14-day trial and a Free plan. Instagram's messaging rules and limits still apply.
