Create a campaign
campaigns_createCreates a comment-to-DM campaign. The campaign watches an Instagram post, story or inbox for the keywords you give it and automatically sends the DM you write here to whoever matches. Unless you pass isActive: false it goes live immediately and starts messaging real people on its own, so say what it will do before you create it. Reversible: campaigns_pause switches it off again and keeps everything it has collected. Counts against the customer's plan exactly as creating one in the dashboard does — a paid-only feature (story triggers, the follow gate, lead capture, follow-up messages) or one live campaign too many is refused with a sentence naming the plan, which you should repeat to the customer as it is written.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adId | No | AD only. The id of the one ad to watch. | |
| goal | No | One line on what the campaign is for. Shown to the customer only. | |
| name | Yes | What the customer will see this campaign called in their dashboard. | |
| postId | No | The Instagram media id of the one post or reel to watch. | |
| postUrl | No | The public permalink of that post, so the dashboard can show it. | |
| isActive | No | False to save the campaign without switching it on. Left out, it goes live straight away and starts answering comments. | |
| keywords | No | The words that trigger the DM, up to ten. Not needed when matchAnyWord or matchAnyReply is true. | |
| dmMessage | No | The direct message sent to whoever comments. | |
| matchAnyAd | No | AD only. True to answer comments on any ad. | |
| triggerType | No | What starts the campaign. POST (the default) is a comment on a post or reel. STORY_REPLY is a reply to a story, STORY_MENTION a story that mentions the account, DM a direct message, LIVE a comment on a live video, AD a comment on an ad. | |
| matchAnyLive | No | LIVE only. True to answer every live video rather than the current one. | |
| matchAnyPost | No | True to watch every post on the account instead of one. | |
| matchAnyWord | No | True to DM everyone who comments, whatever they wrote. | |
| matchAnyReply | No | True to answer any story reply. | |
| requireFollow | No | True to ask a non-follower to follow before the DM is sent. A paid feature on some plans. | |
| wholeWordMatch | No | True (the default) matches a keyword only as a whole word, so PRICE does not fire on 'pricey'. | |
| followUpEnabled | No | True to send a second message later. A paid feature on some plans. | |
| followUpMessage | No | That second message's text. | |
| linkButtonLabel | No | The label on the button under the DM, at most 50 characters. | |
| pendingNextReel | No | True to attach the campaign to the next reel the customer posts, before that reel exists. | |
| instagramAccountId | No | Which connected Instagram account this runs for. Leave it out and the most recently connected account is used. | |
| leadCaptureEnabled | No | True to ask for an email address in the DM. A paid feature on some plans. | |
| publicReplyEnabled | No | True to also reply publicly under the comment. | |
| publicReplyMessage | No | The public reply's text. | |
| followUpDelayMinutes | No | How long to wait before the follow-up, in minutes. At most 1440, because Instagram closes the messaging window after a day. | |
| trackedDestinationUrl | No | Where that button goes. Clicks on it are counted. |