Automations · Comment Automations
Creates a comment-to-DM automation.
Request
Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the messages resource group disabled get 403 resource_group_disabled. Authentication
Request body
application/json, required
profileIdstringrequiredaccountIdstringrequiredtriggerstringOne of
comment,live_comment,story_reply,story_mention. Defaultcomment.platformPostIdstringpostIdstringMatches
^[a-fA-F0-9]{24}$.postTitlestringnamestringrequiredkeywordsarray of stringmatchModestringOne of
exact,contains,word. Defaultcontains.excludeKeywordsarray of stringtypoTolerancebooleandmMessagestringbuttonsarray of objectUp to 3 items.
typestringrequiredOne of
url,postback,phone.titlestringrequiredUp to 20 characters.
urlstring (URL)payloadstringphonestring
templateobjecttypestringrequiredOne of
generic.imageAspectRatiostringOne of
horizontal,square.elementsarray of objectrequiredAt least 1 item. Up to 10 items.
4 child fields
titlestringrequiredUp to 80 characters.
subtitlestringUp to 80 characters.
imageUrlstring (URL)buttonsarray of objectUp to 3 items.
4 child fields
typestringrequiredOne of
url,postback.titlestringrequiredUp to 20 characters.
urlstring (URL)payloadstring
commentReplystringdmMessageVariationsarray of stringUp to 5 items.
commentReplyVariationsarray of stringUp to 5 items.
linkTrackingbooleanDefault
true.clickTagstringdmDelaySecondsinteger0 to 86400.
commentReplyDelaySecondsinteger0 to 86400.
alsoMatchInDmsbooleanDefault
false.audienceobjectfollowerStatusstringOne of
any,follower,non_follower. Defaultany.minFollowerCountintegerAt least 0.
whenUnknownstringOne of
send,skip,verify. Defaultsend.tapToUnlockbooleanDefault
false.
followGateobjectmessagestringUp to 640 characters.
buttonLabelstringUp to 20 characters.
profileButtonLabelstring1 to 20 characters.
notFollowingMessagestringUp to 1000 characters.
repeatPolicyobjectmodestringrequiredOne of
once,every_comment. Defaultonce.cooldownHoursinteger1 to 8760.
dedupeSameTextHoursinteger1 to 8760. Can be null.
publicReplyPolicystringOne of
after_dm,always. Defaultafter_dm.actionsobjectlikeCommentbooleanhideCommentboolean
quickRepliesarray of objectUp to 13 items.
titlestringrequiredUp to 20 characters.
payloadstringrequiredimageUrlstring (URL)
dmMediaobjectOne of:
Comment Automation Dm Media (2 fields)
typestringrequiredOne of
image,video,audio,file.urlstring (URL)required
isActivebooleanDefault
true.
Example
curl -X POST "https://api.pozy.ai/v1/comment-automations" \
-H "Authorization: Bearer $POZY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"profileId": "6a0b6573846efc28aaa9a3ff",
"accountId": "696e0b682d0a31188e7a2ba9",
"name": "Acme"
}'const res = await fetch("https://api.pozy.ai/v1/comment-automations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POZY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
profileId: "6a0b6573846efc28aaa9a3ff",
accountId: "696e0b682d0a31188e7a2ba9",
name: "Acme"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);import os
import requests
resp = requests.post(
"https://api.pozy.ai/v1/comment-automations",
headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
json={
"profileId": "6a0b6573846efc28aaa9a3ff",
"accountId": "696e0b682d0a31188e7a2ba9",
"name": "Acme",
},
timeout=30,
)
resp.raise_for_status()
print(resp.json())Response
200 on success
successbooleanautomationobject31 child fields
idstringnamestringplatformstringOne of
instagram,facebook,tiktok,threads,linkedin,youtube.triggerstringOne of
comment,live_comment,story_reply,story_mention.platformPostIdstringkeywordsarray of stringmatchModestringOne of
exact,contains,word.excludeKeywordsarray of stringtypoTolerancebooleandmMessagestringbuttonsarray of object5 child fields
typestringrequiredOne of
url,postback,phone.titlestringrequiredUp to 20 characters.
urlstring (URL)payloadstringphonestring
templateobject3 child fields
typestringrequiredOne of
generic.imageAspectRatiostringOne of
horizontal,square.elementsarray of objectrequiredAt least 1 item. Up to 10 items.
4 child fields
titlestringrequiredUp to 80 characters.
subtitlestringUp to 80 characters.
imageUrlstring (URL)buttonsarray of objectUp to 3 items.
4 child fields
typestringrequiredOne of
url,postback.titlestringrequiredUp to 20 characters.
urlstring (URL)payloadstring
commentReplystringdmMessageVariationsarray of stringcommentReplyVariationsarray of stringlinkTrackingbooleanclickTagstringdmDelaySecondsintegercommentReplyDelaySecondsintegeraudienceobject4 child fields
followerStatusstringOne of
any,follower,non_follower. Defaultany.minFollowerCountintegerAt least 0.
whenUnknownstringOne of
send,skip,verify. Defaultsend.tapToUnlockbooleanDefault
false.
followGateobject4 child fields
messagestringUp to 640 characters.
buttonLabelstringUp to 20 characters.
profileButtonLabelstring1 to 20 characters.
notFollowingMessagestringUp to 1000 characters.
alsoMatchInDmsbooleanrepeatPolicyobject2 child fields
modestringrequiredOne of
once,every_comment. Defaultonce.cooldownHoursinteger1 to 8760.
dedupeSameTextHoursintegerpublicReplyPolicystringOne of
after_dm,always.actionsobject2 child fields
likeCommentbooleanhideCommentboolean
quickRepliesarray of object3 child fields
titlestringrequiredUp to 20 characters.
payloadstringrequiredimageUrlstring (URL)
dmMediaobject2 child fields
typestringrequiredOne of
image,video,audio,file.urlstring (URL)required
isActivebooleanstatsobject13 child fields
triggeredintegerdmsSentintegerdmsFailedintegeruniqueContactsintegertrackedSendsintegerlinkClicksintegeruniqueClicksintegerdeliveredintegerreadintegeraudienceSkippedintegerfollowGateSentintegerfollowGatePassedintegerfollowGateFailedinteger
createdAtstring (date-time)
{
"success": true,
"automation": {
"id": "6bfebd43ddc270f6d2c56fc5",
"name": "Acme",
"platform": "instagram",
"trigger": "comment",
"platformPostId": "637f799b3039e6602e83fa4f",
"keywords": [
"string"
],
"matchMode": "exact",
"excludeKeywords": [
"string"
],
"typoTolerance": true,
"dmMessage": "Hello from Pozy",
"buttons": [
{
"type": "url",
"title": "Launch day",
"url": "https://pozy.ai/media/example-1.jpg",
"payload": "string",
"phone": "+14155550123"
}
],
"template": {
"type": "generic",
"imageAspectRatio": "horizontal",
"elements": [
{
"title": "Launch day",
"subtitle": "string",
"imageUrl": "https://pozy.ai/media/example-1.jpg",
"buttons": [
{
"type": "url",
"title": "Launch day",
"url": "https://pozy.ai/media/example-1.jpg",
"payload": "string"
}
]
}
]
},
"commentReply": "string",
"dmMessageVariations": [
"Hello from Pozy"
],
"commentReplyVariations": [
"string"
],
"linkTracking": true,
"clickTag": "string",
"dmDelaySeconds": 1,
"commentReplyDelaySeconds": 1,
"audience": {
"followerStatus": "any",
"minFollowerCount": 42,
"whenUnknown": "send",
"tapToUnlock": false
},
"followGate": {
"message": "Hello from Pozy",
"buttonLabel": "string",
"profileButtonLabel": "string",
"notFollowingMessage": "Hello from Pozy"
},
"alsoMatchInDms": true,
"repeatPolicy": {
"mode": "once",
"cooldownHours": 1
},
"dedupeSameTextHours": 1,
"publicReplyPolicy": "after_dm",
"actions": {
"likeComment": true,
"hideComment": true
},
"quickReplies": [
{
"title": "Launch day",
"payload": "string",
"imageUrl": "https://pozy.ai/media/example-1.jpg"
}
],
"dmMedia": {
"type": "image",
"url": "https://pozy.ai/media/example-1.jpg"
},
"isActive": true,
"stats": {
"triggered": 1,
"dmsSent": 1,
"dmsFailed": 1,
"uniqueContacts": 1,
"trackedSends": 1,
"linkClicks": 1,
"uniqueClicks": 1,
"delivered": 1,
"read": 1,
"audienceSkipped": 1,
"followGateSent": 1,
"followGatePassed": 1,
"followGateFailed": 1
},
"createdAt": "2026-10-02T09:00:00.000Z"
}
}Errors
Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:
| 400 | invalid_request_error | A parameter or body field is missing or invalid. param names it. |
| 401 | authentication_error | The API key is missing, revoked or expired. |
| 403 | permission_error | The key is read-only, scoped to other profiles, or has this resource group disabled. |
| 429 | rate_limit_error | Too many requests this minute. Wait for Retry-After seconds. |
Every code is listed in Errors.