# Update agent settings

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

```http
PATCH https://api.pozy.ai/v1/accounts/{accountId}/business-agent/settings
```

- Area: WhatsApp / Business Agent
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `accountId` (string, required)

## Query parameters

- `agentId` (string)

## Request body

Content type: `application/json`

- `rollout`, object
  - `enabled`, boolean, required
- `handoff`, object
  - `enabled`, boolean, required
  - `message`, string: Up to 1024 characters
  - `message_selection`, string: One of `DEFAULT`, `AGENT`, `CUSTOM`
- `followup`, object
  - `enabled`, boolean, required
  - `followup_interval_in_seconds`, integer: One of `0`, `300`, `900`, `1800`, `3600`, `7200`, `28800`, `86400`
  - `message`, string: Up to 1024 characters
- `ai_audience`, string: One of `EVERYONE`, `ALLOWLISTED_ONLY`
- `never_say_phrases`, array of string

## Example request

```bash
curl -X PATCH "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/business-agent/settings" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "rollout": {
    "enabled": true
  },
  "handoff": {
    "enabled": true
  },
  "followup": {
    "enabled": true
  },
  "ai_audience": "EVERYONE"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/business-agent/settings", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    rollout: {
      enabled: true
    },
    handoff: {
      enabled: true
    },
    followup: {
      enabled: true
    },
    ai_audience: "EVERYONE"
  }),
});
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/accounts/696e0b682d0a31188e7a2ba9/business-agent/settings",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "rollout": {
            "enabled": True,
        },
        "handoff": {
            "enabled": True,
        },
        "followup": {
            "enabled": True,
        },
        "ai_audience": "EVERYONE",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `agent_id`, string, required
- `channel`, string, required
- `rollout`, object, required
  - `enabled`, boolean, required
- `handoff`, object: Can be null
  - `enabled`, boolean
  - `message`, string
  - `message_selection`, string: One of `DEFAULT`, `AGENT`, `CUSTOM`
- `followup`, object: Can be null
  - `enabled`, boolean
  - `followup_interval_in_seconds`, integer: One of `0`, `300`, `900`, `1800`, `3600`, `7200`, `28800`, `86400`
  - `message`, string
- `ai_audience`, string: One of `EVERYONE`, `ALLOWLISTED_ONLY`. Can be null
- `never_say_phrases`, array of string

```json
{
  "agent_id": "61107e42d7605e217d408f43",
  "channel": "string",
  "rollout": {
    "enabled": true
  },
  "handoff": {
    "enabled": true,
    "message": "Hello from Pozy",
    "message_selection": "DEFAULT"
  },
  "followup": {
    "enabled": true,
    "followup_interval_in_seconds": 0,
    "message": "Hello from Pozy"
  },
  "ai_audience": "EVERYONE",
  "never_say_phrases": [
    "string"
  ]
}
```
