List comment-to-DM automations
List all comment-to-DM automations for a profile. Returns automations with their stats.
API key authentication - use your Zernio API key as a Bearer token
In: header
Query Parameters
Filter by profile. Omit to list across all profiles
Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.commentautomations.listCommentAutomations();console.log(data);{
"success": true,
"automations": [
{
"id": "string",
"name": "string",
"platform": "instagram",
"trigger": "comment",
"accountId": "string",
"platformPostId": "string",
"postTitle": "string",
"keywords": [
"string"
],
"matchMode": "exact",
"dmMessage": "string",
"buttons": [
{
"type": "url",
"title": "string",
"url": "http://example.com",
"payload": "string",
"phone": "string"
}
],
"commentReply": "string",
"linkTracking": true,
"clickTag": "string",
"isActive": true,
"stats": {
"triggered": 0,
"dmsSent": 0,
"dmsFailed": 0,
"uniqueContacts": 0,
"trackedSends": 0,
"linkClicks": 0,
"uniqueClicks": 0,
"delivered": 0,
"read": 0
},
"createdAt": "2019-08-24T14:15:22Z"
}
]
}{
"error": "Unauthorized"
}List automation logs GET
Paginated list of every comment that triggered this automation, with send status and commenter info.
Create comment-to-DM automation POST
Create a keyword-triggered DM automation on an Instagram or Facebook account. When someone comments a matching keyword (or, with `trigger: story_reply`, replies to your Instagram story with one), they automatically receive a DM. Triggers (`trigger`): * `comment` (default): fires on keyword comments on a post or reel. * `story_reply`: fires when someone replies to your Instagram story with a keyword, and answers them with a DM. Set `platformPostId` to a story media id to scope to one story, or omit it to match replies to any story. Targeting (comment trigger): * Per-post: set `platformPostId` to scope to one specific post (only one active per-post automation is allowed per post). * Account-wide ("any post"): omit `platformPostId` (and `postId`). The automation evaluates every comment on every post on the account. You can stack unlimited account-wide automations, each with its own keyword set, and they all run independently. Per-post automations take priority on their post. Links in the DM's buttons can be click-tracked (`linkTracking`, on by default) and clickers optionally tagged (`clickTag`) for segmentation. Stats returned include delivered, read, and link clicks.