# Update HubSpot account settings

Updates HubSpot account settings. Fields you leave out keep their current values.

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

- Area: Accounts & connections / Accounts
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `accountId` (string, required)

## Request body

Content type: `application/json`

- `syncContacts`, boolean
- `logMessages`, boolean
- `reportDeals`, boolean

## Example request

```bash
curl -X PATCH "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/hubspot-settings" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "syncContacts": true,
  "logMessages": true,
  "reportDeals": true
}'
```

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

## Response 200

- `message`, string
- `account`, object
  - `_id`, string, required
  - `platform`, string, required: One of `hubspot`
  - `hubId`, string, required
  - `hubDomain`, string, required: Can be null
  - `scopes`, array of string, required
  - `syncContacts`, boolean, required
  - `logMessages`, boolean, required
  - `reportDeals`, boolean, required

```json
{
  "message": "Hello from Pozy",
  "account": {
    "_id": "635d87e261ae344ef27fd1df",
    "platform": "hubspot",
    "hubId": "6aa008996e22fdf9f74c382e",
    "hubDomain": "string",
    "scopes": [
      "string"
    ],
    "syncContacts": true,
    "logMessages": true,
    "reportDeals": true
  }
}
```
