---
title: "Update an automation"
method: PATCH
path: "/api/v1/automations/{id}"
tags: ["Automations"]
---

# Update an automation

`PATCH /api/v1/automations/{id}`

## Request

- Base URL: `https://replyatlas.com`
- URL: `https://replyatlas.com/api/v1/automations/{id}`
- Auth: HTTP bearer

Change any subset of an automation's settings — for example flip `active`, adjust `dailyCap`, or turn `clickTracking` off. Only the fields you send are modified.

## Path parameters

- `id` string, required

## Request body

- AutomationUpdate: Body for updating an automation. Every field is optional — send only the ones you want to change; omitted fields are left as-is.
  - `name` string: A label for this automation (shown in your dashboard).
  - `igAccountId` string: The connected Instagram account this automation runs on. List IDs via GET /api/v1/ig-accounts.
  - `triggerType` 'COMMENT' | 'STORY_REPLY' | 'LIVE_COMMENT' | 'AD_REFERRAL' | 'POSTBACK' | 'MENTION' | 'DM_KEYWORD': What fires the DM. `COMMENT` = a comment on your post/Reel. `STORY_REPLY` & `LIVE_COMMENT` need **Pro**; `AD_REFERRAL` needs **Pro+**; `POSTBACK` (Ice Breaker / menu button) needs **Pro** and a `postbackMatch`. `DM_KEYWORD` = someone sends you a DM containing one of `includeKeywords` (at least one keyword, or an `intentDescription`, is required).
  - `templateText` string: The DM body. Supports `{{handle}}` and `{{commentText}}` tokens.
  - `includeKeywords` string[]: Only trigger when the comment contains one of these (case-insensitive). Empty = every comment. Max 50.
  - `excludeKeywords` string[]: Never trigger when the comment contains one of these (wins over includeKeywords). Max 50.
  - `actionType` 'TEMPLATE' | 'AI_REPLY': `TEMPLATE` sends `templateText` as-is. `AI_REPLY` generates a personalised reply — needs **Pro+** (and Text format).
  - `dmFormat` 'TEXT' | 'CAROUSEL' | 'MEDIA': `TEXT` = plain message. `CAROUSEL` = image cards with buttons (**Pro**). `MEDIA` = image/video/PDF attachments (**Pro**).
  - `carouselElements` object[], nullable: Card definitions when `dmFormat=CAROUSEL` (2–10 cards: title, imageUrl, optional buttons).
  - `mediaAssetIds` string[]: Ordered media-asset IDs when `dmFormat=MEDIA` (1–10).
  - `adIds` string[]: Restrict `AD_REFERRAL` triggers to these numeric ad IDs.
  - `postIds` string[]: Restrict `COMMENT` triggers to these IG post IDs. Empty = all your posts.
  - `refMatch` string, nullable: Exact match on the ad/m.me `ref` parameter (for `AD_REFERRAL`).
  - `postbackMatch` string, nullable: Exact match on the postback payload. Required when `triggerType=POSTBACK`.
  - `commentShieldHideNegative` boolean: Auto-hide negative comments on the triggering post. Needs **Pro**.
  - `publicReplyText` string, nullable: Also post this as a public reply on the comment. Needs **Pro**.
  - `intentDescription` string, nullable: Plain-language description of the comments to catch (e.g. "people asking for the recipe or link"). Keywords match first; when none match, AI checks the comment against this intent in any language. With no includeKeywords, the automation is intent-only. Text-bearing triggers only. Needs **Pro**.
  - `sentimentRouting` 'ALL' | 'POSITIVE_ONLY' | 'NEGATIVE_QUEUE': Route by comment sentiment. Anything other than `ALL` needs **Pro**.
  - `abTestEnabled` boolean: Split traffic 50/50 between `templateText` and `templateB`. Needs **Growth or higher**.
  - `templateB` string, nullable: The B-variant body. Required when `abTestEnabled=true`.
  - `followerOnlyFilter` boolean: Only DM users who follow you.
  - `askForFollowText` string, nullable: CTA sent to non-followers when `followerOnlyFilter=true`.
  - `followToUnlock` boolean: Gate the reward DM behind a follow. Needs **Pro**.
  - `unlockButtonLabel` string, nullable: Button label for the follow-to-unlock gate.
  - `leadCaptureField` 'NONE' | 'EMAIL' | 'PHONE': Ask for the person's email or phone number in the DM first, and send the reward once they reply with a valid one. Instagram only; not with `followToUnlock`. Needs **Growth or higher**.
  - `leadCapturePrompt` string, nullable: Your own wording for the email/phone ask. Null uses the default.
  - `languageTemplates` object, nullable: Per-language overrides keyed by ISO-639-1 code, e.g. `{"es":"¡Hola!"}`. Needs **Pro**.
  - `dailyCap` integer: Max DMs this automation sends per day.
  - `sendWindowStart` string, nullable: Only send at/after this time each day, `HH:MM` 24h (account timezone).
  - `sendWindowEnd` string, nullable: Only send at/before this time each day, `HH:MM` 24h.
  - `skipPreviousRecipients` boolean: Don't re-DM someone this automation already messaged in the last 30 days.
  - `clickTracking` boolean: Wrap the first link in the DM with a click-tracking redirect (default). Set `false` to send your original link unmodified — useful for affiliate links. Opting out needs a **paid plan**; free plans always track.

## Response `200`

Updated automation

- Automation: A comment-to-DM (or story-reply / AI-intent) rule: what triggers it, what it sends, and how it's throttled. On create/update, `clickTracking` controls whether the first link in the DM body is wrapped in a click-tracking redirect.
  - `id` string
  - `name` string
  - `active` boolean
  - `triggerType` 'COMMENT' | 'STORY_REPLY' | 'AI_INTENT'
  - `includeKeywords` string[]
  - `excludeKeywords` string[]
  - `templateText` string
  - `actionType` 'TEMPLATE' | 'AI_REPLY'
  - `sentimentRouting` 'ALL' | 'POSITIVE_ONLY' | 'NEGATIVE_QUEUE'
  - `abTestEnabled` boolean
  - `followerOnlyFilter` boolean
  - `dailyCap` integer
  - `sendWindowStart` string, nullable
  - `sendWindowEnd` string, nullable
  - `clickTracking` boolean: Wrap the first link in the DM with a click-tracking redirect (default). Set false to send your original link unmodified — useful for affiliate links. Opting out requires a paid plan (see "Send plain links" in the plan matrix); free plans always track.
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `dripStepCount` integer

## Other responses

- `400`: Validation error
- `402`: A changed field needs a higher plan (response includes the required `feature`).
- `404`: Not found

---

[API](https://skmtc.dev/replyatlas/apis/replyatlas-public-api.md) · [All operations](https://skmtc.dev/replyatlas/apis/replyatlas-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/replyatlas/apis/replyatlas-public-api/revisions/0309ccbfa70e?raw)
