# Update Discord settings

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

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

- Area: Messaging / Discord
- Auth: Authorization: Bearer pz_live_...
- Coming soon: Discord accounts cannot be connected yet (GET /v1/connect/discord returns 403 feature_not_available)

## Path parameters

- `accountId` (string, required)

## Request body

Content type: `application/json`

- `webhookUsername`, string
- `webhookAvatarUrl`, string
- `channelId`, string

## Example request

```bash
curl -X PATCH "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/discord-settings" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "webhookUsername": "acme",
  "webhookAvatarUrl": "https://pozy.ai/media/example-1.jpg",
  "channelId": "6750a975638e9df035530f04"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/discord-settings", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    webhookUsername: "acme",
    webhookAvatarUrl: "https://pozy.ai/media/example-1.jpg",
    channelId: "6750a975638e9df035530f04"
  }),
});
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/discord-settings",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "webhookUsername": "acme",
        "webhookAvatarUrl": "https://pozy.ai/media/example-1.jpg",
        "channelId": "6750a975638e9df035530f04",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `message`, string
- `account`, object
  - `_id`, string
  - `platform`, string
  - `username`, string
  - `displayName`, string
  - `profilePicture`, string
  - `channelId`, string
  - `channelName`, string
  - `channelType`, string
  - `guildId`, string
  - `webhookUsername`, string: Can be null
  - `webhookAvatarUrl`, string: Can be null

```json
{
  "message": "Hello from Pozy",
  "account": {
    "_id": "635d87e261ae344ef27fd1df",
    "platform": "instagram",
    "username": "acme",
    "displayName": "Acme",
    "profilePicture": "string",
    "channelId": "6750a975638e9df035530f04",
    "channelName": "Acme",
    "channelType": "string",
    "guildId": "69634a35ee7ea3cf0915ebfa",
    "webhookUsername": "acme",
    "webhookAvatarUrl": "https://pozy.ai/media/example-1.jpg"
  }
}
```
