# Update a daily watchlist rule

Updates a daily watchlist rule. Fields you leave out keep their current values. Works with Instagram and YouTube accounts.

```http
PATCH https://api.pozy.ai/v1/watchlist/rules/{ruleId}
```

- Area: Analytics / Watchlist
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `ruleId` (string, required)

## Request body

Content type: `application/json`

- `name`, string: Up to 80 characters
- `list`, string: List id or name the rule reads from.. Can be null
- `filter`, object
  - `listId`, string: Can be null
  - `platform`, string: One of `instagram`, `youtube`. Can be null
  - `formats`, array of string: Each item: one of `reel`, `carousel`, `image`, `video`, `short`
  - `minViews`, integer: Can be null
  - `minLikes`, integer: Can be null
  - `minComments`, integer: Can be null
  - `outlierMin`, number: At least 1. Can be null
  - `maxAgeDays`, integer: 1 to 30. Can be null
- `targetAccountIds`, array of string: At least 1 item. Up to 10 items
- `hourUtc`, integer: Default `8`. 0 to 23
- `maxPerRun`, integer: Default `3`. 1 to 10
- `enabled`, boolean: Default `true`

## Example request

```bash
curl -X PATCH "https://api.pozy.ai/v1/watchlist/rules/6cd4059483de62b474d02fe7" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Acme",
  "list": "string",
  "filter": {
    "listId": "64272240067877d9e057f3da",
    "platform": "instagram",
    "formats": [
      "reel"
    ]
  },
  "targetAccountIds": [
    "string"
  ]
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/watchlist/rules/6cd4059483de62b474d02fe7", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "Acme",
    list: "string",
    filter: {
      listId: "64272240067877d9e057f3da",
      platform: "instagram",
      formats: [
        "reel"
      ]
    },
    targetAccountIds: [
      "string"
    ]
  }),
});
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/watchlist/rules/6cd4059483de62b474d02fe7",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "name": "Acme",
        "list": "string",
        "filter": {
            "listId": "64272240067877d9e057f3da",
            "platform": "instagram",
            "formats": [
                "reel",
            ],
        },
        "targetAccountIds": [
            "string",
        ],
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `rule`, object, required
  - `id`, string, required
  - `name`, string, required
  - `filter`, object, required
    - `listId`, string: Can be null
    - `platform`, string: One of `instagram`, `youtube`. Can be null
    - `formats`, array of string: Each item: one of `reel`, `carousel`, `image`, `video`, `short`
    - `minViews`, integer: Can be null
    - `minLikes`, integer: Can be null
    - `minComments`, integer: Can be null
    - `outlierMin`, number: At least 1. Can be null
    - `maxAgeDays`, integer: 1 to 30. Can be null
  - `targetAccountIds`, array of string, required
  - `action`, string: One of `draft`
  - `hourUtc`, integer, required: 0 to 23
  - `maxPerRun`, integer, required: 1 to 10
  - `enabled`, boolean, required
  - `lastRunAt`, string (date-time): Can be null
  - `lastResult`, object: Can be null
  - `createdAt`, string (date-time)

```json
{
  "rule": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "name": "Acme",
    "filter": {
      "listId": "64272240067877d9e057f3da",
      "platform": "instagram",
      "formats": [
        "reel"
      ],
      "minViews": 1,
      "minLikes": 1,
      "minComments": 1,
      "outlierMin": 12.5,
      "maxAgeDays": 1
    },
    "targetAccountIds": [
      "string"
    ],
    "action": "draft",
    "hourUtc": 1,
    "maxPerRun": 1,
    "enabled": true,
    "lastRunAt": "2026-10-02T09:00:00.000Z",
    "lastResult": {},
    "createdAt": "2026-10-02T09:00:00.000Z"
  }
}
```
