# Update automation settings

Updates automation settings. Fields you leave out keep their current values.

```http
PATCH https://api.pozy.ai/v1/comment-automations/{automationId}
```

- Area: Automations / Comment Automations
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `automationId` (string, required)

## Request body

Content type: `application/json`

- `name`, string
- `trigger`, string: One of `comment`, `live_comment`, `story_reply`, `story_mention`
- `keywords`, array of string
- `matchMode`, string: One of `exact`, `contains`, `word`
- `excludeKeywords`, array of string
- `typoTolerance`, boolean
- `platformPostId`, string: Can be null
- `postId`, string: Matches `^[a-fA-F0-9]{24}$`. Can be null
- `postTitle`, string: Can be null
- `dmMessage`, string
- `buttons`, array of object: Up to 3 items
  - `type`, string, required: One of `url`, `postback`, `phone`
  - `title`, string, required: Up to 20 characters
  - `url`, string (URL)
  - `payload`, string
  - `phone`, string
- `template`, object
  - one of: Comment Automation Template
    - `type`, string, required: One of `generic`
    - `imageAspectRatio`, string: One of `horizontal`, `square`
    - `elements`, array of object, required: At least 1 item. Up to 10 items
      - `title`, string, required: Up to 80 characters
      - `subtitle`, string: Up to 80 characters
      - `imageUrl`, string (URL)
      - `buttons`, array of object: Up to 3 items
        - `type`, string, required: One of `url`, `postback`
        - `title`, string, required: Up to 20 characters
        - `url`, string (URL)
        - `payload`, string
- `commentReply`, string
- `dmMessageVariations`, array of string: Up to 5 items
- `commentReplyVariations`, array of string: Up to 5 items
- `linkTracking`, boolean
- `clickTag`, string
- `alsoMatchInDms`, boolean
- `dmDelaySeconds`, integer: 0 to 86400
- `commentReplyDelaySeconds`, integer: 0 to 86400
- `audience`, object
  - `followerStatus`, string: One of `any`, `follower`, `non_follower`. Default `any`
  - `minFollowerCount`, integer: At least 0
  - `whenUnknown`, string: One of `send`, `skip`, `verify`. Default `send`
  - `tapToUnlock`, boolean: Default `false`
- `followGate`, object
  - `message`, string: Up to 640 characters
  - `buttonLabel`, string: Up to 20 characters
  - `profileButtonLabel`, string: 1 to 20 characters
  - `notFollowingMessage`, string: Up to 1000 characters
- `isActive`, boolean
- `repeatPolicy`, object
  - `mode`, string, required: One of `once`, `every_comment`. Default `once`
  - `cooldownHours`, integer: 1 to 8760
- `dedupeSameTextHours`, integer: 1 to 8760. Can be null
- `publicReplyPolicy`, string: One of `after_dm`, `always`
- `actions`, object
  - `likeComment`, boolean
  - `hideComment`, boolean
- `quickReplies`, array of object: Up to 13 items. Can be null
- `dmMedia`, object
  - one of: Comment Automation Dm Media
    - `type`, string, required: One of `image`, `video`, `audio`, `file`
    - `url`, string (URL), required

## Example request

```bash
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"
}'
```

```ts
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);
```

```python
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

- `success`, boolean
- `automation`, object
  - `id`, string
  - `name`, string
  - `keywords`, array of string
  - `matchMode`, string: One of `exact`, `contains`, `word`
  - `excludeKeywords`, array of string
  - `typoTolerance`, boolean
  - `dmMessage`, string
  - `buttons`, array of object
    - `type`, string, required: One of `url`, `postback`, `phone`
    - `title`, string, required: Up to 20 characters
    - `url`, string (URL)
    - `payload`, string
    - `phone`, string
  - `template`, object
    - `type`, string, required: One of `generic`
    - `imageAspectRatio`, string: One of `horizontal`, `square`
    - `elements`, array of object, required: At least 1 item. Up to 10 items
      - `title`, string, required: Up to 80 characters
      - `subtitle`, string: Up to 80 characters
      - `imageUrl`, string (URL)
      - `buttons`, array of object: Up to 3 items
        - `type`, string, required: One of `url`, `postback`
        - `title`, string, required: Up to 20 characters
        - `url`, string (URL)
        - `payload`, string
  - `commentReply`, string
  - `dmMessageVariations`, array of string
  - `commentReplyVariations`, array of string
  - `audience`, object
    - `followerStatus`, string: One of `any`, `follower`, `non_follower`. Default `any`
    - `minFollowerCount`, integer: At least 0
    - `whenUnknown`, string: One of `send`, `skip`, `verify`. Default `send`
    - `tapToUnlock`, boolean: Default `false`
  - `followGate`, object
    - `message`, string: Up to 640 characters
    - `buttonLabel`, string: Up to 20 characters
    - `profileButtonLabel`, string: 1 to 20 characters
    - `notFollowingMessage`, string: Up to 1000 characters
  - `alsoMatchInDms`, boolean
  - `repeatPolicy`, object
    - `mode`, string, required: One of `once`, `every_comment`. Default `once`
    - `cooldownHours`, integer: 1 to 8760
  - `dedupeSameTextHours`, integer
  - `publicReplyPolicy`, string: One of `after_dm`, `always`
  - `actions`, object
    - `likeComment`, boolean
    - `hideComment`, boolean
  - `quickReplies`, array of object
    - `title`, string, required: Up to 20 characters
    - `payload`, string, required
    - `imageUrl`, string (URL)
  - `dmMedia`, object
    - `type`, string, required: One of `image`, `video`, `audio`, `file`
    - `url`, string (URL), required
  - `isActive`, boolean
  - `stats`, object
    - `triggered`, integer
    - `dmsSent`, integer
    - `dmsFailed`, integer
    - `uniqueContacts`, integer
    - `trackedSends`, integer
    - `linkClicks`, integer
    - `uniqueClicks`, integer
    - `delivered`, integer
    - `read`, integer
    - `audienceSkipped`, integer
    - `followGateSent`, integer
    - `followGatePassed`, integer
    - `followGateFailed`, integer
  - `updatedAt`, string (date-time)

```json
{
  "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"
  }
}
```
