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.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
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.
"comment" | "story_reply"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.
"exact" | "contains" | "word"Comments containing one of these never trigger the automation, even when a trigger keyword also matches. Compared using the same matchMode.
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.
Inline DM buttons (1-3). Pass [] to clear all buttons.
items <= 3Product 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.
Alternate DM texts for random rotation (see create). Pass [] to clear.
items <= 5Alternate public replies for random rotation. Pass [] to clear.
items <= 5Wrap link buttons in a tracked redirect to count clicks. Pass false to send links untouched.
Tag applied to a contact when they click a tracked link (requires linkTracking). Empty string clears it.
Seconds to wait after the trigger before sending the DM. Send 0 to clear the delay and reply immediately.
0 <= value <= 86400Seconds to wait before posting the public comment reply. Send 0 to clear it. The reply never goes out before the DM.
0 <= value <= 86400Who 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.
Copy for the follow gate. Sensible defaults are used for any field left empty.
Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.commentautomations.updateCommentAutomation({ path: { automationId: 'automation_abc123', }, body: { name: 'Example', trigger: 'comment', keywords: [ 'string', ], },});console.log(data);{
"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",
"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"
},
"isActive": true,
"updatedAt": "2019-08-24T14:15:22Z"
}
}{
"error": "Unauthorized"
}{
"error": "Not found"
}