PostZen
Comment Automations

Create a comment automation

POST
/v1/comment-automations

Requires read_write. Limited to 60 creates per hour per user. Per-post automations take priority over account-wide automations. One matching automation wins, and each contact receives at most one pending or successful send per automation and source. Instagram only. A comment permits one private reply ever, within 7 days. Story replies use normal DMs inside the 24-hour messaging window. Buttons and image cards (template) fall back to text with title and URL lines if Meta rejects the template. Reconnect the account on 403 platformCapabilityMissing to grant instagram_business_manage_comments and instagram_business_manage_messages.

Authorization

bearerAuth
AuthorizationBearer <token>

PostZen API key.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Maximum 100 automations per user; at most one active per-post automation for each account and post reference. alsoMatchInDms, clickTag and linkTracking:true return 400 unsupported. Instagram only. A comment permits one private reply ever, within 7 days. Story replies use normal DMs inside the 24-hour messaging window. Buttons and image cards (template) fall back to text with title and URL lines if Meta rejects the template. Reconnect the account on 403 platformCapabilityMissing to grant instagram_business_manage_comments and instagram_business_manage_messages.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/comment-automations" \  -H "Content-Type: application/json" \  -d '{    "accountId": "string",    "name": "string"  }'
{  "message": "string",  "automation": {    "accountId": "string",    "profileId": "string",    "name": "string",    "trigger": "comment",    "platformPostId": "string",    "postId": "string",    "postTitle": "string",    "keywords": [],    "matchMode": "exact",    "excludeKeywords": [],    "typoTolerance": false,    "dmMessage": "string",    "dmMessageVariations": [],    "buttons": [],    "template": {      "type": "generic",      "imageAspectRatio": "horizontal",      "elements": [        {          "title": "string",          "subtitle": "string",          "imageUrl": "http://example.com",          "buttons": []        }      ]    },    "commentReply": "string",    "commentReplyVariations": [],    "dmDelaySeconds": 0,    "commentReplyDelaySeconds": 0,    "isActive": true,    "linkTracking": false,    "id": "string",    "platform": "instagram",    "alsoMatchInDms": false,    "stats": {      "totalTriggered": 0,      "totalSent": 0,      "totalFailed": 0    },    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "audience": {      "followerStatus": "any",      "minFollowerCount": 0,      "whenUnknown": "send"    },    "openingDm": {      "message": "Hey! Thanks so much for your interest 😊\n\nTap below and I'll send you the link ✨",      "buttonLabel": "Send me the link"    },    "followGate": {      "message": "Follow us to get the link, then tap the button below 👇",      "buttonLabel": "I'm following",      "notFollowingMessage": "Looks like you're not following yet. Follow us, then tap the button again."    }  }}
{  "error": "JSON body is required"}
{  "error": "Unauthorized"}
{  "error": "API key requires read_write permission"}
{  "error": "Not found"}
{  "error": "string",  "type": "string",  "code": "string",  "param": "string"}
{  "error": "rate_limited",  "retryAfter": 30}
{  "error": "Failed to create post"}