---
title: "Update automation settings"
method: PATCH
path: "/v1/comment-automations/{automationId}"
tags: ["Comment Automations"]
---

# Update automation settings

`PATCH /v1/comment-automations/{automationId}`

Update an automation's keywords, DM message, inline buttons, comment reply, or active status.
Pass `buttons: []` to clear all buttons. When `buttons` is non-empty, `dmMessage` (the new
one if you're changing it, otherwise the stored one) must be 640 characters or less.

## Path parameters

- `automationId` string, required

## Request body

- object
  - `name` string
  - `trigger` 'comment' | 'story_reply' — What fires the automation. Changing it detaches the automation from its bound post or story (a post id and a story id are different objects), unless this same request sets a new binding. 'story_reply' is Instagram only.
  - `keywords` string[]
  - `matchMode` 'exact' | 'contains' | 'word' — How a keyword is compared with the comment. 'contains' (default) matches anywhere, even inside another word (keyword 'app' fires on 'happy'). 'word' matches the keyword only as a standalone word. 'exact' requires the whole comment to be exactly the keyword.
  - `excludeKeywords` string[] — Comments containing one of these never trigger the automation, even when a trigger keyword also matches. Compared using the same matchMode.
  - `typoTolerance` boolean — Only with matchMode=word: also fire on close misspellings of a keyword (one edit for 4-7 character keywords, two from 8 up). Keywords shorter than 4 characters are never fuzzy-matched.
  - `dmMessage` string
  - `buttons` DmButton[] — Inline DM buttons (1-3). Pass [] to clear all buttons.
    - `type` 'url' | 'postback' | 'phone', required
    - `title` string, required — Button label (20 chars max)
    - `url` string, uri — Target URL (required when type is url)
    - `payload` string — Postback payload delivered via the messaging_postbacks webhook (required when type is postback)
    - `phone` string — Phone number, e.g. +14155551234 (required when type is phone; Facebook only)
  - `template` CommentAutomationTemplate — A Meta generic template (product card) sent as the automation's first DM. It REPLACES the plain `dmMessage` bubble: a Meta message carries one body shape, and a comment gets exactly one private reply, so the card and the text cannot both be delivered. Put your selling copy in `subtitle`. Mutually exclusive with `buttons` (sending both is a 400). Works on both the `comment` and `story_reply` triggers. Up to 10 elements, rendered as a horizontally swipeable carousel. Rendering confirmed on the Instagram and Messenger mobile apps.
    - `type` 'generic', required
    - `elements` CommentAutomationTemplateElement[], required
      - `title` string, required — Card headline (80 chars max). Also used as the Inbox preview for the sent DM.
      - `subtitle` string — Card description, e.g. the price or a short pitch (80 chars max).
      - `imageUrl` string, uri — Publicly reachable http(s) image rendered large above the card.
      - `buttons` object[] — Up to 3 card buttons. A generic template has NO phone button, on either platform. `url` buttons are click-tracked when linkTracking is on.
        - `type` 'url' | 'postback', required
        - `title` string, required
        - `url` string, uri — Target URL (required when type is url)
        - `payload` string — Postback payload delivered via the messaging_postbacks webhook (required when type is postback)
  - `commentReply` string
  - `dmMessageVariations` string[] — Alternate DM texts for random rotation (see create). Pass [] to clear.
  - `commentReplyVariations` string[] — Alternate public replies for random rotation. Pass [] to clear.
  - `linkTracking` boolean — Wrap link buttons in a tracked redirect to count clicks. Pass false to send links untouched.
  - `clickTag` string — Tag applied to a contact when they click a tracked link (requires linkTracking). Empty string clears it.
  - `alsoMatchInDms` boolean — Also fire these keywords on a plain inbound DM. Enabling it requires the automation to end up with at least one keyword (this request's keywords if you send them, otherwise the stored ones) and is rejected on story_reply automations.
  - `dmDelaySeconds` integer — Seconds to wait after the trigger before sending the DM. Send 0 to clear the delay and reply immediately.
  - `commentReplyDelaySeconds` integer — Seconds to wait before posting the public comment reply. Send 0 to clear it. The reply never goes out before the DM.
  - `audience` CommentAutomationAudience — Who a comment automation answers. Instagram only - Meta exposes the follow relationship on no other platform, and only for people who have MESSAGED the account (a comment grants no consent). `whenUnknown` is therefore the important setting: it decides what happens for a first-time commenter.
    - `followerStatus` 'any' | 'follower' | 'non_follower'
    - `minFollowerCount` integer — Skip commenters with fewer followers than this. Omit for no size rule.
    - `whenUnknown` 'send' | 'skip' | 'verify' — What to do when Instagram will not reveal the follow relationship. * `send` (default) - deliver the DM anyway (fails open). * `skip` - stay silent. * `verify` - send `followGate.message` with a confirm button. Tapping it is a message, which grants consent, so the re-check on the tap resolves and the real DM (or `followGate.notFollowingMessage`) follows automatically.
  - `followGate` CommentAutomationFollowGate — Copy for the follow gate. Sensible defaults are used for any field left empty.
    - `message` string — Confirmation DM sent when whenUnknown=verify.
    - `buttonLabel` string — Confirm button label. Defaults to "I'm following".
    - `notFollowingMessage` string — Sent to a commenter we know does not follow (followerStatus=follower). Omit to stay silent on a keyword comment; a confirm tap always gets an answer.
  - `isActive` boolean

## Response `200`

Automation updated

- object
  - `success` boolean
  - `automation` object
    - `id` string
    - `name` string
    - `keywords` string[]
    - `matchMode` 'exact' | 'contains' | 'word' — How a keyword is compared with the comment. 'contains' (default) matches anywhere, even inside another word (keyword 'app' fires on 'happy'). 'word' matches the keyword only as a standalone word. 'exact' requires the whole comment to be exactly the keyword.
    - `excludeKeywords` string[] — Comments containing one of these never trigger the automation, even when a trigger keyword also matches. Compared using the same matchMode.
    - `typoTolerance` boolean — Only with matchMode=word: also fire on close misspellings of a keyword (one edit for 4-7 character keywords, two from 8 up). Keywords shorter than 4 characters are never fuzzy-matched.
    - `dmMessage` string
    - `buttons` DmButton[] — Inline DM buttons (up to 3). Omitted when none are set.
      - `type` 'url' | 'postback' | 'phone', required
      - `title` string, required — Button label (20 chars max)
      - `url` string, uri — Target URL (required when type is url)
      - `payload` string — Postback payload delivered via the messaging_postbacks webhook (required when type is postback)
      - `phone` string — Phone number, e.g. +14155551234 (required when type is phone; Facebook only)
    - `template` CommentAutomationTemplate — A Meta generic template (product card) sent as the automation's first DM. It REPLACES the plain `dmMessage` bubble: a Meta message carries one body shape, and a comment gets exactly one private reply, so the card and the text cannot both be delivered. Put your selling copy in `subtitle`. Mutually exclusive with `buttons` (sending both is a 400). Works on both the `comment` and `story_reply` triggers. Up to 10 elements, rendered as a horizontally swipeable carousel. Rendering confirmed on the Instagram and Messenger mobile apps.
      - `type` 'generic', required
      - `elements` CommentAutomationTemplateElement[], required
        - `title` string, required — Card headline (80 chars max). Also used as the Inbox preview for the sent DM.
        - `subtitle` string — Card description, e.g. the price or a short pitch (80 chars max).
        - `imageUrl` string, uri — Publicly reachable http(s) image rendered large above the card.
        - `buttons` object[] — Up to 3 card buttons. A generic template has NO phone button, on either platform. `url` buttons are click-tracked when linkTracking is on.
          - `type` 'url' | 'postback', required
          - `title` string, required
          - `url` string, uri — Target URL (required when type is url)
          - `payload` string — Postback payload delivered via the messaging_postbacks webhook (required when type is postback)
    - `commentReply` string
    - `dmMessageVariations` string[] — Alternate DM texts rotated at random with dmMessage. Omitted when none.
    - `commentReplyVariations` string[] — Alternate public replies rotated at random with commentReply. Omitted when none.
    - `audience` CommentAutomationAudience — Who a comment automation answers. Instagram only - Meta exposes the follow relationship on no other platform, and only for people who have MESSAGED the account (a comment grants no consent). `whenUnknown` is therefore the important setting: it decides what happens for a first-time commenter.
      - `followerStatus` 'any' | 'follower' | 'non_follower'
      - `minFollowerCount` integer — Skip commenters with fewer followers than this. Omit for no size rule.
      - `whenUnknown` 'send' | 'skip' | 'verify' — What to do when Instagram will not reveal the follow relationship. * `send` (default) - deliver the DM anyway (fails open). * `skip` - stay silent. * `verify` - send `followGate.message` with a confirm button. Tapping it is a message, which grants consent, so the re-check on the tap resolves and the real DM (or `followGate.notFollowingMessage`) follows automatically.
    - `followGate` CommentAutomationFollowGate — Copy for the follow gate. Sensible defaults are used for any field left empty.
      - `message` string — Confirmation DM sent when whenUnknown=verify.
      - `buttonLabel` string — Confirm button label. Defaults to "I'm following".
      - `notFollowingMessage` string — Sent to a commenter we know does not follow (followerStatus=follower). Omit to stay silent on a keyword comment; a confirm tap always gets an answer.
    - `alsoMatchInDms` boolean — Whether these keywords also fire on a plain inbound DM.
    - `isActive` boolean
    - `updatedAt` string, date-time

## Other responses

- `401` — Unauthorized
- `404` — Resource not found

---

[API](https://skmtc.net/zernio/apis/zernio-api.md) · [All operations](https://skmtc.net/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zernio/zernio-api/versions/f81ca70ea6b9/schema)
