WhatsApp · Business Agent
Updates agent settings. Fields you leave out keep their current values.
https://api.pozy.ai/v1/accounts/{accountId}/business-agent/settingsGuide: Business AI agent
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 |
|---|---|---|
accountIdrequired | string |
Query parameters
| Name | Type | Notes |
|---|---|---|
agentId | string |
Request body
application/json, required
rolloutobjectenabledbooleanrequired
handoffobjectenabledbooleanrequiredmessagestringUp to 1024 characters.
message_selectionstringOne of
DEFAULT,AGENT,CUSTOM.
followupobjectenabledbooleanrequiredfollowup_interval_in_secondsintegerOne of
0,300,900,1800,3600,7200,28800,86400.messagestringUp to 1024 characters.
ai_audiencestringOne of
EVERYONE,ALLOWLISTED_ONLY.never_say_phrasesarray of string
Example
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"
}'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);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 on success
agent_idstringrequiredchannelstringrequiredrolloutobjectrequiredenabledbooleanrequired
handoffobjectCan be null.
enabledbooleanmessagestringmessage_selectionstringOne of
DEFAULT,AGENT,CUSTOM.
followupobjectCan be null.
enabledbooleanfollowup_interval_in_secondsintegerOne of
0,300,900,1800,3600,7200,28800,86400.messagestring
ai_audiencestringOne of
EVERYONE,ALLOWLISTED_ONLY. Can be null.never_say_phrasesarray of string
{
"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"
]
}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.