Plan a comment-to-DM automation change
plan_dm_automation_changeUse this when the owner wants people who comment a keyword on an Instagram post or reel to get an automatic DM (an auto-reply with a guide, lead magnet, link or booking page, optionally asking them to follow or for their email or phone), or wants to change, rename or retarget one, or the same for replies to their Instagram Story. Not for follow-up emails, which are the follow-up tools. Create or edit a comment-to-DM rule (Instagram comment→DM, NOT an email sequence). Diffs against what is saved, with warnings and how many people are mid-conversation. Saves NOTHING — returns a change_token to pass to apply_dm_automation_change. Omit automation_id to create a new rule. A rule that will be live (new, or switched from paused to active) needs a free slot in the plan's active-automation allowance (get_plan shows how many may be live at once; paused rules are unlimited); save it with is_active: false to stay under it.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "plan_dm_automation_change"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| client | No | Client website slug (or id). Required for platform-scoped keys. | |
| keywords | No | Matched case-insensitively as a whole word or phrase: "guide" matches "Guide please!" and "the guide." but not "guidebook" or "guides". Required when trigger_type is "keyword"; optional for "story_reply" (empty = any reply). At most 10, each up to 40 characters. | |
| platform | No | Which connected account the rule is saved against. Required when creating if the client has both connected. Where it answers comments is `platforms`. | |
| is_active | No | ||
| platforms | No | Where the rule answers comments. A new rule defaults to the platform of the account it is saved against; an edit keeps what the rule already has. | |
| target_mode | No | "any" = every post, "specific" = one post (pass target_media_id), "next" = the next post published after saving, "keyword_posts" = posts whose caption names the keyword plus the next post published (the safe default for an established account: nobody under an old post gets a DM they were never offered). | |
| button_label | No | Text on the button in the opening DM. Max 20 characters. | |
| trigger_type | No | "any_comment" / "keyword" answer comments on posts. "story_reply" (the console’s "Replies to my Story") answers a reply to ANY of the account’s Instagram Stories instead — with one of `keywords`, or any reply when keywords is empty. Instagram only; it has no post target and no public reply, and the same person gets it at most once a day. The DM flow (gates, delivery, voice note, follow-ups) is the same. | |
| automation_id | No | Omit to create a new automation; pass an id to edit an existing one. | |
| call_on_phone | No | REQUIRES require_phone, and only for accounts with AI calling (refused otherwise). About a minute after the delivery DM, the AI caller (get_ai_caller) rings the number they gave — or at 8am their time if it is outside 8am–9pm there — to check they got it, answer questions and offer to book. Every AI-call refusal still applies (no agent or number set up, do-not-call, the daily cap); a refused call is recorded on the conversation and not retried in a loop. | |
| delivery_link | No | Appended to the delivery message on its own line. | |
| require_email | No | Asks the person to type their email before sending the content. Works on both platforms — unlike require_follow this is not a button, it is a typed reply parsed for an address. If both gates are on, follow is asked first, then email. | |
| require_phone | No | Asks the person to type their phone number before sending the content: after their email when require_email is on, or on its own, where the number alone makes them a lead (follow + phone is a whole rule, and the owner is notified to call them). A reply that is not a valid number gets a fixed re-ask until it is. This sentence is always sent under the prompt and cannot be changed or removed: "By sending your number you agree to get texts and calls, including AI-assisted calls, from <business name>. Msg & data rates may apply. Reply STOP to opt out." — the full DM is stored as their consent to texts AND calls, so they can be AI-called later with plan_ai_call whether or not call_on_phone is on. The number lets text steps in the rule's follow-up (social sequence, channel "sms") reach them from the account's texting number; check get_sms_account. | |
| require_follow | No | Asks the person to follow before sending the content. | |
| opening_message | No | The first DM, sent as soon as they comment. Carries the button. Up to 1000 characters. | |
| target_media_id | No | From list_dm_automation_posts. Only used when target_mode is "specific". | |
| voice_note_text | No | What the voice note says after "Hey <name>,". Written to be HEARD: casual, plain, no greeting or name (added per person), no [tags]. Required when voice_note_enabled is true. Up to 400 characters (about 25 seconds). | |
| delivery_message | No | The payoff — sent once they qualify. Up to 1000 characters. | |
| voice_note_enabled | No | Only on plans that include voice notes. After the delivery DM, also send a voice note in the voice chosen for the account (Settings, Texting, Your voice): "Hey <their first name>," then voice_note_text. Costs 1 credit per person. Where the plan does not include it, the answer says so. | |
| email_prompt_message | No | Sent asking for their email. Required when require_email is true. An invalid reply gets a fixed system re-ask, not this message repeated. Up to 1000 characters. | |
| phone_prompt_message | No | The ask above the consent sentence. Defaults to "Thanks! What's the best number to reach you at?". Up to 500 characters. | |
| follow_prompt_message | No | Sent when they tap and are not following yet. Required when require_follow is true. Up to 1000 characters. | |
| add_to_social_sequence | No | Requires require_email AND social_email_sequence_id. When someone gives a valid email, also save them as a social lead (see list_social_leads — a SEPARATE system from crm_leads/website forms) and enroll them in the chosen email sequence. | |
| comment_reply_messages | No | Optional PUBLIC replies under the comment, e.g. "Check your DMs!". One is picked at random per comment, so several variants avoid looking automated. Up to 5, each up to 300 characters. | |
| social_email_sequence_id | No | Which of the client's named email sequences add_to_social_sequence enrolls them in — an id from list_social_sequences. Required when add_to_social_sequence is true; there is no default to fall back to. |