Automations · Comment Automations
Updates automation settings. Fields you leave out keep their current values.
https://api.pozy.ai/v1/comment-automations/{automationId}Guide: Comment to DM
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
Path parameters
| Name | Type | Notes |
|---|---|---|
automationIdrequired | string |
Request body
application/json, optional
namestringtriggerstringOne of
comment,live_comment,story_reply,story_mention.keywordsarray of stringmatchModestringOne of
exact,contains,word.excludeKeywordsarray of stringtypoTolerancebooleanplatformPostIdstringCan be null.
postIdstringMatches
^[a-fA-F0-9]{24}$. Can be null.postTitlestringCan be null.
dmMessagestringbuttonsarray of objectUp to 3 items.
typestringrequiredOne of
url,postback,phone.titlestringrequiredUp to 20 characters.
urlstring (URL)payloadstringphonestring
templateobjectOne of:
Comment Automation Template (3 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 stringUp to 5 items.
commentReplyVariationsarray of stringUp to 5 items.
linkTrackingbooleanclickTagstringalsoMatchInDmsbooleandmDelaySecondsinteger0 to 86400.
commentReplyDelaySecondsinteger0 to 86400.
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.
isActivebooleanrepeatPolicyobjectmodestringrequiredOne of
once,every_comment. Defaultonce.cooldownHoursinteger1 to 8760.
dedupeSameTextHoursinteger1 to 8760. Can be null.
publicReplyPolicystringOne of
after_dm,always.actionsobjectlikeCommentbooleanhideCommentboolean
quickRepliesarray of objectUp to 13 items. Can be null.
dmMediaobjectOne of:
Comment Automation Dm Media (2 fields)
typestringrequiredOne of
image,video,audio,file.urlstring (URL)required
Example
curl -X PATCH "https://api.pozy.ai/v1/comment-automations/66795db1e7f0419ba4a14e79" \
-H "Authorization: Bearer $POZY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme",
"trigger": "comment",
"keywords": [
"string"
],
"matchMode": "exact"
}'const res = await fetch("https://api.pozy.ai/v1/comment-automations/66795db1e7f0419ba4a14e79", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.POZY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Acme",
trigger: "comment",
keywords: [
"string"
],
matchMode: "exact"
}),
});
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.patch(
"https://api.pozy.ai/v1/comment-automations/66795db1e7f0419ba4a14e79",
headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
json={
"name": "Acme",
"trigger": "comment",
"keywords": [
"string",
],
"matchMode": "exact",
},
timeout=30,
)
resp.raise_for_status()
print(resp.json())Response
200 on success
successbooleanautomationobject24 child fields
idstringnamestringkeywordsarray 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 stringaudienceobject4 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
updatedAtstring (date-time)
{
"success": true,
"automation": {
"id": "6bfebd43ddc270f6d2c56fc5",
"name": "Acme",
"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"
],
"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
},
"updatedAt": "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. |
| 404 | not_found | Nothing with that id exists in your workspace. |
| 429 | rate_limit_error | Too many requests this minute. Wait for Retry-After seconds. |
Every code is listed in Errors.