# Update project webhook

> Change the URL, the events, or whether the webhook is active. The webhook must already exist.

`PATCH https://api.zavu.dev/v1/invitations/webhook`

Change the URL, the events, or whether the webhook is active. The webhook must already exist.

## Body

- `url` (string<uri>)
- `events` (string[]) One of: `invitation.status_changed`, `broadcast.status_changed`, `domain.verified`, `domain.failed`.
- `active` (boolean)

## Responses

### 200

Webhook updated. The secret is not returned.

- `webhook` (object, required): The project-level webhook. It receives project events such as `invitation.status_changed` for this project only: a parent project does not receive its sub-accounts' events, so configure one per sub-account with that sub-account's API key.
  - `url` (string<uri>, required)
  - `events` (string[], required) One of: `invitation.status_changed`, `broadcast.status_changed`, `domain.verified`, `domain.failed`.
  - `secret` (string): Signing secret for `X-Zavu-Signature`. Returned only by `POST /v1/invitations/webhook`.
  - `active` (boolean, required)

### 400

No project webhook is configured, or an invalid event was sent.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 401

Unauthorized.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

## Example

```bash
curl -X PATCH "https://api.zavu.dev/v1/invitations/webhook" \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "string"
}'
```

```typescript
import Zavudev from "@zavudev/sdk";

const zavu = new Zavudev({ apiKey: process.env.ZAVUDEV_API_KEY });

const result = await zavu.invitations.webhook.update({
  url: "string",
});

console.log(result);
```
