Zernio
Zernio
API Reference

Comment Automations

List automation logsGETList comment-to-DM automationsGETCreate comment-to-DM automationPOSTGet automation detailsGETUpdate automation settingsPATCHDelete automationDELETE
Dashboard
llms.txtOpenAPI
OverviewPlatformsAPI ReferenceResources
Comment Automations

Update automation settings

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.


PATCH
/v1/comment-automations/{automationId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

In: header

Path Parameters

automationId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

{  "success": true,  "automation": {    "id": "string",    "name": "string",    "keywords": [      "string"    ],    "matchMode": "exact",    "excludeKeywords": [      "string"    ],    "typoTolerance": true,    "dmMessage": "string",    "buttons": [      {        "type": "url",        "title": "string",        "url": "http://example.com",        "payload": "string",        "phone": "string"      }    ],    "template": {      "type": "generic",      "imageAspectRatio": "horizontal",      "elements": [        {          "title": "string",          "subtitle": "string",          "imageUrl": "http://example.com",          "buttons": [            {              "type": "url",              "title": "string",              "url": "http://example.com",              "payload": "string"            }          ]        }      ]    },    "commentReply": "string",    "dmMessageVariations": [      "string"    ],    "commentReplyVariations": [      "string"    ],    "audience": {      "followerStatus": "any",      "minFollowerCount": 0,      "whenUnknown": "send"    },    "followGate": {      "message": "string",      "buttonLabel": "string",      "notFollowingMessage": "string"    },    "alsoMatchInDms": true,    "isActive": true,    "updatedAt": "2019-08-24T14:15:22Z"  }}
Was this page helpful?

Get automation details

Returns an automation with its configuration, stats, and recent trigger logs.

Delete automation

Permanently delete an automation and all its trigger logs.

name?string
trigger?string

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.

Value in

  • "comment"
  • "story_reply"
keywords?array<string>
matchMode?string

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.

Value in

  • "exact"
  • "contains"
  • "word"
excludeKeywords?array<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?array<>

Inline DM buttons (1-3). Pass [] to clear all buttons.

Itemsitems <= 3
template?|

Product card sent instead of the plain dmMessage bubble. Pass null to clear it and fall back to dmMessage. Mutually exclusive with buttons, including with the buttons already stored on the automation.

commentReply?string
dmMessageVariations?array<string>

Alternate DM texts for random rotation (see create). Pass [] to clear.

Itemsitems <= 5
commentReplyVariations?array<string>

Alternate public replies for random rotation. Pass [] to clear.

Itemsitems <= 5
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.

Range0 <= value <= 86400
commentReplyDelaySeconds?integer

Seconds to wait before posting the public comment reply. Send 0 to clear it. The reply never goes out before the DM.

Range0 <= value <= 86400
audience?

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.

followGate?

Copy for the follow gate. Sensible defaults are used for any field left empty.

isActive?boolean