# Update a Discord scheduled event

Updates a Discord scheduled event. Fields you leave out keep their current values.

```http
PATCH https://api.pozy.ai/v1/discord/guilds/{guildId}/events/{eventId}
```

- 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

- `guildId` (string, required)
- `eventId` (string, required)

## Request body

Content type: `application/json`

- `accountId`, string, required
- `name`, string: 1 to 100 characters
- `description`, string: Up to 1000 characters
- `startsAt`, string (date-time)
- `endsAt`, string (date-time)
- `location`, string: 1 to 100 characters
- `status`, string: One of `scheduled`, `active`, `completed`, `cancelled`
- `imageDataUri`, string: Matches `^data:image/(png|jpeg|gif);base64,`

## Example request

```bash
curl -X PATCH "https://api.pozy.ai/v1/discord/guilds/69634a35ee7ea3cf0915ebfa/events/60c89d0a2e8d4a8ebed77064" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/discord/guilds/69634a35ee7ea3cf0915ebfa/events/60c89d0a2e8d4a8ebed77064", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accountId: "696e0b682d0a31188e7a2ba9"
  }),
});
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/discord/guilds/69634a35ee7ea3cf0915ebfa/events/60c89d0a2e8d4a8ebed77064",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "accountId": "696e0b682d0a31188e7a2ba9",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `data`, object
  - `id`, string
  - `guild_id`, string
  - `channel_id`, string: Can be null
  - `creator_id`, string: Can be null
  - `name`, string
  - `description`, string: Can be null
  - `scheduled_start_time`, string (date-time)
  - `scheduled_end_time`, string (date-time): Can be null
  - `privacy_level`, integer: One of `2`
  - `status`, integer: One of `1`, `2`, `3`, `4`
  - `entity_type`, integer: One of `1`, `2`, `3`
  - `entity_id`, string: Can be null
  - `entity_metadata`, object: Can be null
    - `location`, string
  - `user_count`, integer
  - `image`, string: Can be null

```json
{
  "data": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "guild_id": "6f7a1e97c67f78e772f7d99c",
    "channel_id": "6b2ec906b12b4a70367908ea",
    "creator_id": "68da2acddb78da9c114f691a",
    "name": "Acme",
    "description": "A short description",
    "scheduled_start_time": "2026-10-02T09:00:00.000Z",
    "scheduled_end_time": "2026-10-02T09:00:00.000Z",
    "privacy_level": 2,
    "status": 1,
    "entity_type": 1,
    "entity_id": "62e9217d133055b4a528ea76",
    "entity_metadata": {
      "location": "string"
    },
    "user_count": 42,
    "image": "string"
  }
}
```
