# Hermoso: save_instagram_dm_automation · Hermoso developer docs

> Machine-readable twin of https://hermoso.ai/docs/reference/publish/save_instagram_dm_automation/. Generated from the shipped page. Do not edit by hand.
> Full agent guide: https://hermoso.ai/llms.txt · MCP: https://app.hermoso.ai/mcp

[Docs](https://hermoso.ai/docs/) / [Tool reference](https://hermoso.ai/docs/reference/) / [Publishing & scheduling](https://hermoso.ai/docs/reference/publish/) / save_instagram_dm_automation

# `save_instagram_dm_automation`

Create or edit an Instagram DM automation destructive

Area: INSTAGRAM DM AUTOMATION · [Publishing & scheduling](https://hermoso.ai/docs/reference/publish/). Generated from the running MCP server, like the rest of the [tool reference](https://hermoso.ai/docs/reference/).

## Description

Create (no id) or edit (id) an automation that DMs people automatically: a comment with a keyword on one post / the next post / any post gets a private reply, or a DM / story reply / ig.me link gets an answer. Optional link buttons, public comment replies, follow gate and dry run. Once per person per post; Meta allows private replies within 7 days of the comment. It DMs real people, so confirm the text first. Free, no AI on the send path.

## Parameters

Parameter Type Description

`id` `string` rule id to edit; omit to create a new automation

`name` `string` name of the automation, shown in the list

`account` `string` @handle or id of the Instagram account; omit when only one is connected

`trigger` `object` what starts the rule: {type, keywords, match, scope, ...}; keywords are case-insensitive

`trigger.type` required `"comment" | "dm" | "story_reply" | "ref"` comment (keyword on a post comment), dm (keyword in a DM), story_reply, or ref (ig.me link)

`trigger.keywords` `string[]` case-insensitive words/phrases; empty = any comment/story reply (DM rules need one)

`trigger.match` `"contains" | "exact"` contains (keyword appears in the text) or exact (whole text must equal the keyword)

`trigger.scope` `"post" | "next" | "any"` comment rules: one post (mediaId), the NEXT post you publish, or every post

`trigger.mediaId` `string` the post for scope "post" (list_instagram_media gives ids)

`trigger.mediaType` `"REELS" | "FEED"` scope "next": only the next reel, or only the next feed post

`trigger.ref` `string` ref rules: the ref in ig.me/m/<handle>?ref=<ref>

`message` `object` what the person receives: {text, buttons}; up to 3 link buttons

`message.text` required `string` the DM they receive

`message.buttons` `object[]` up to 3 link buttons

`message.buttons[].title` required `string` up to 20 characters

`message.buttons[].url` required `string` https link

`publicReplies` `string[]` comment rules: public replies under the comment, rotated (e.g. "Sent! Check your DMs")

`followGate` `object` send the content only to followers: they tap a button first

`followGate.enabled` required `boolean` true = non-followers see the follow prompt before the content

`followGate.ask` `string` message asking the person to follow the account

`followGate.notFollowing` `string` message sent to someone who does not follow yet

`followGate.button` `string` label of the button the person taps once they follow

`cooldownHours` `number` DM/story/ref rules: answer one person at most once per this many hours (default 24)

`enabled` `boolean` false pauses the automation without deleting it

`dryRun` `boolean` log what would be sent without sending

## Example call

Every required parameter is shown, filled from the schema where it gives a value and otherwise with a placeholder naming the type. Replace the placeholders with real values. The same call works on the MCP server, the CLI and `POST https://app.hermoso.ai/v1/tools/save_instagram_dm_automation`.

**MCP** (`tools/call`)

`{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"save_instagram_dm_automation","arguments":{}}}`
**CLI**

`hermoso call save_instagram_dm_automation --json '{}'`

## Credits

Credits are spent only on two things: running an AI model (image, video, voice, text, planning, post-production) and Ad Spy research. See [Credits & costs](https://hermoso.ai/docs/credits/).

## Related tools

- [list_instagram_dm_automations](https://hermoso.ai/docs/reference/publish/list_instagram_dm_automations/) Instagram DM automations
- [test_instagram_dm_automation](https://hermoso.ai/docs/reference/publish/test_instagram_dm_automation/) Test an Instagram DM automation
- [delete_instagram_dm_automation](https://hermoso.ai/docs/reference/publish/delete_instagram_dm_automation/) Delete an Instagram DM automation

[All 728 Publishing & scheduling tools](https://hermoso.ai/docs/reference/publish/) · [tools.json](https://hermoso.ai/docs/reference/tools.json)
