> ## Documentation Index
> Fetch the complete documentation index at: https://docs.indm.social/llms.txt
> Use this file to discover all available pages before exploring further.

# Instagram's rules

> The platform rules every automation runs inside. Narrower and stranger than they look, and worth knowing before you build.

Instagram decides what an account may send, to whom, and when. inDM works inside those rules, and so does everything you build with this API. They're counter-intuitive in places, so here they are once, plainly.

These are the rules inDM's engine enforces. Each one shows up somewhere in the API, as a field limit, a validation check or an error, and this page links to it.

## A comment earns one private reply

When someone comments on a post, the account may send them **exactly one private reply**, and that reply may carry the link. It needs nothing from the person who commented. This is the DM an automation sends.

Every message **after** that one needs Instagram's **24-hour messaging window**, and the window opens only when the person **messages the account**: a DM, or a reply to a story. A comment doesn't open it, and neither does tapping a link.

So an automation can take one of two shapes:

| Shape | What happens | In the API |
| - | - | - |
| **The link rides the first reply** | The comment earns one DM, and it carries your link. There is no second message. | Set `dm_message` and a link. Leave `opener_message` out. |
| **An opener asks first** | The one free reply asks a question. The fan's answer opens the window, and your link follows in a second message. | Set `opener_message`. `dm_message` becomes the second message. |

You don't need an opener to deliver a link. An opener makes the link follow a yes rather than arrive unasked, and it opens the window for anything you send after it.

It's also why no tool, inDM included, can message everyone who ever commented on a post.

## A follow-up lands inside the window

A follow-up is a second message sent later, from **30 minutes to 20 hours** after the first. The 20-hour ceiling is Instagram's 24-hour window minus headroom. The 30-minute floor is ours, so a follow-up never lands on top of the first message.

Two things follow from the window:

* **A follow-up needs the window open.** It needs an opener or a gate, something the fan answers. Without one, the first reply is the whole conversation and a follow-up could never send: [`followup_unreachable`](https://docs.indm.social/errors#followup_unreachable).
* **It reaches everyone who received the first message.** It can't be held back from people who already tapped the link.

## Three links per message

One message carries **at most three links**. That ceiling is Meta's, on every plan, and no plan lifts it: [`too_many_links`](https://docs.indm.social/errors#too_many_links). How many links a workspace can attach under that ceiling depends on its plan.

Every delivered link goes through inDM's own redirect so clicks can be counted. The destination is kept exactly as you wrote it.

## Keywords

* **Case doesn't matter.** `GUIDE` also matches `guide` and `Guide`.
* **A keyword starts a word.** `LINK` fires on "link please" and "links", but not on "unlink". A keyword of one or two letters, like `ME`, has to be the whole word, so it never fires on "home" or "meet".
* **A keyword belongs to one automation**, not to the account. An automation on a reel and an automation in DMs don't share keywords. If a word should work in both places, that's two automations.

## One live automation per post

A post runs **one live automation at a time**. Two live on the same post would mean a fan who comments once receives two DMs. Setting a second one live is refused with [`live_automation_on_media`](https://docs.indm.social/errors#live_automation_on_media); pause the first, then set the second live.

Drafts and paused automations don't count toward this, so you can prepare the next one while the current one runs.

## Gates fail open

A follow gate asks the fan to follow the account before the link arrives; an email gate asks for an email address. Both need a link to hold back: [`gate_requires_link`](https://docs.indm.social/errors#gate_requires_link).

Both **fail open**: after four asks, inDM delivers the link anyway. A gate that strands a real fan to enforce a rule would cost you the very thing you wanted from them.

## Messages and language

Instagram truncates long messages, which is why `dm_message` stops at 1,000 characters and button labels at 20. An automation sends in whatever language its copy is written in, so write it in the language your audience reads.

## Sending pace

Messages leave each account at a steady rate rather than all at once, because Instagram restricts an account that sends in a burst, and a restriction costs far more than a short wait. When a post takes off, messages queue and drain, and none are dropped. [Get account health](https://docs.indm.social/api-reference/accounts/get-account-health.md) reports the pace and the queue.

## New posts take a moment to appear

inDM pulls posts from Instagram on a schedule rather than the instant they're published. A post from the last few minutes is often missing from [List media](https://docs.indm.social/api-reference/media/list-media.md) while it already exists on Instagram. [Refresh content](https://docs.indm.social/api-reference/accounts/refresh-account.md) fetches it now; the [recipe](https://docs.indm.social/recipes/refresh-then-automate.md) shows the whole flow.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.