Automations · Comment Automations

Create comment-to-DM automation

Creates a comment-to-DM automation.

POSThttps://api.pozy.ai/v1/comment-automations
createCommentAutomation

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

Request body

application/json, required

  • profileIdstringrequired
  • accountIdstringrequired
  • triggerstring

    One of comment, live_comment, story_reply, story_mention. Default comment.

  • platformPostIdstring
  • postIdstring

    Matches ^[a-fA-F0-9]{24}$.

  • postTitlestring
  • namestringrequired
  • keywordsarray of string
  • matchModestring

    One of exact, contains, word. Default contains.

  • excludeKeywordsarray of string
  • typoToleranceboolean
  • dmMessagestring
  • buttonsarray of object

    Up to 3 items.

    • typestringrequired

      One of url, postback, phone.

    • titlestringrequired

      Up to 20 characters.

    • urlstring (URL)
    • payloadstring
    • phonestring
  • templateobject
    • typestringrequired

      One of generic.

    • imageAspectRatiostring

      One of horizontal, square.

    • elementsarray of objectrequired

      At least 1 item. Up to 10 items.

      4 child fields
      • titlestringrequired

        Up to 80 characters.

      • subtitlestring

        Up to 80 characters.

      • imageUrlstring (URL)
      • buttonsarray of object

        Up to 3 items.

        4 child fields
        • typestringrequired

          One of url, postback.

        • titlestringrequired

          Up to 20 characters.

        • urlstring (URL)
        • payloadstring
  • commentReplystring
  • dmMessageVariationsarray of string

    Up to 5 items.

  • commentReplyVariationsarray of string

    Up to 5 items.

  • linkTrackingboolean

    Default true.

  • clickTagstring
  • dmDelaySecondsinteger

    0 to 86400.

  • commentReplyDelaySecondsinteger

    0 to 86400.

  • alsoMatchInDmsboolean

    Default false.

  • audienceobject
    • followerStatusstring

      One of any, follower, non_follower. Default any.

    • minFollowerCountinteger

      At least 0.

    • whenUnknownstring

      One of send, skip, verify. Default send.

    • tapToUnlockboolean

      Default false.

  • followGateobject
    • messagestring

      Up to 640 characters.

    • buttonLabelstring

      Up to 20 characters.

    • profileButtonLabelstring

      1 to 20 characters.

    • notFollowingMessagestring

      Up to 1000 characters.

  • repeatPolicyobject
    • modestringrequired

      One of once, every_comment. Default once.

    • cooldownHoursinteger

      1 to 8760.

  • dedupeSameTextHoursinteger

    1 to 8760. Can be null.

  • publicReplyPolicystring

    One of after_dm, always. Default after_dm.

  • actionsobject
    • likeCommentboolean
    • hideCommentboolean
  • quickRepliesarray of object

    Up to 13 items.

    • titlestringrequired

      Up to 20 characters.

    • payloadstringrequired
    • imageUrlstring (URL)
  • dmMediaobject

    One of:

    Comment Automation Dm Media (2 fields)
    • typestringrequired

      One of image, video, audio, file.

    • urlstring (URL)required
  • isActiveboolean

    Default 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"
}'

Response

200 on success

  • successboolean
  • automationobject
    31 child fields
    • idstring
    • namestring
    • platformstring

      One of instagram, facebook, tiktok, threads, linkedin, youtube.

    • triggerstring

      One of comment, live_comment, story_reply, story_mention.

    • platformPostIdstring
    • keywordsarray of string
    • matchModestring

      One of exact, contains, word.

    • excludeKeywordsarray of string
    • typoToleranceboolean
    • dmMessagestring
    • buttonsarray of object
      5 child fields
      • typestringrequired

        One of url, postback, phone.

      • titlestringrequired

        Up to 20 characters.

      • urlstring (URL)
      • payloadstring
      • phonestring
    • templateobject
      3 child fields
      • typestringrequired

        One of generic.

      • imageAspectRatiostring

        One of horizontal, square.

      • elementsarray of objectrequired

        At least 1 item. Up to 10 items.

        4 child fields
        • titlestringrequired

          Up to 80 characters.

        • subtitlestring

          Up to 80 characters.

        • imageUrlstring (URL)
        • buttonsarray of object

          Up to 3 items.

          4 child fields
          • typestringrequired

            One of url, postback.

          • titlestringrequired

            Up to 20 characters.

          • urlstring (URL)
          • payloadstring
    • commentReplystring
    • dmMessageVariationsarray of string
    • commentReplyVariationsarray of string
    • linkTrackingboolean
    • clickTagstring
    • dmDelaySecondsinteger
    • commentReplyDelaySecondsinteger
    • audienceobject
      4 child fields
      • followerStatusstring

        One of any, follower, non_follower. Default any.

      • minFollowerCountinteger

        At least 0.

      • whenUnknownstring

        One of send, skip, verify. Default send.

      • tapToUnlockboolean

        Default false.

    • followGateobject
      4 child fields
      • messagestring

        Up to 640 characters.

      • buttonLabelstring

        Up to 20 characters.

      • profileButtonLabelstring

        1 to 20 characters.

      • notFollowingMessagestring

        Up to 1000 characters.

    • alsoMatchInDmsboolean
    • repeatPolicyobject
      2 child fields
      • modestringrequired

        One of once, every_comment. Default once.

      • cooldownHoursinteger

        1 to 8760.

    • dedupeSameTextHoursinteger
    • publicReplyPolicystring

      One of after_dm, always.

    • actionsobject
      2 child fields
      • likeCommentboolean
      • hideCommentboolean
    • quickRepliesarray of object
      3 child fields
      • titlestringrequired

        Up to 20 characters.

      • payloadstringrequired
      • imageUrlstring (URL)
    • dmMediaobject
      2 child fields
      • typestringrequired

        One of image, video, audio, file.

      • urlstring (URL)required
    • isActiveboolean
    • statsobject
      13 child fields
      • triggeredinteger
      • dmsSentinteger
      • dmsFailedinteger
      • uniqueContactsinteger
      • trackedSendsinteger
      • linkClicksinteger
      • uniqueClicksinteger
      • deliveredinteger
      • readinteger
      • audienceSkippedinteger
      • followGateSentinteger
      • followGatePassedinteger
      • followGateFailedinteger
    • createdAtstring (date-time)
200 response
{
  "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:

400invalid_request_errorA parameter or body field is missing or invalid. param names it.
401authentication_errorThe API key is missing, revoked or expired.
403permission_errorThe key is read-only, scoped to other profiles, or has this resource group disabled.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in Comment Automations