---
title: "Create an automation"
method: POST
path: "/api/v1/automations"
tags: ["Automations"]
---

# Create an automation

`POST /api/v1/automations`

## Request

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

Create a new comment-to-DM (or story-reply / ad-referral / postback) automation. Great for wiring an automation to a post right after you publish it — scope it with `postIds`. Available on any plan with API access — note that **API access itself requires Pro or Pro+**, and individual fields may need a higher tier (see the request body).

## Request body

- AutomationCreate: Body for creating a comment-to-DM automation. `name`, `igAccountId`, `triggerType`, and `templateText` are required; everything else has a sensible default. Fields marked with a plan (Pro / Pro+ / Growth) return `402 plan_required` if your plan doesn't include them.
  - `name` string, required: A label for this automation (shown in your dashboard).
  - `igAccountId` string, required: 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', required: 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, required: 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 `201`

Automation created

- 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 (e.g. missing templateText, impossible send-window, POSTBACK without postbackMatch)
- `402`: A field in the body needs a higher plan — the response body includes the required `feature`.
- `404`: igAccountId not found or not owned by you

---

[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)
