# Update a webhook endpoint

> Documentation and API reference for Vaartix, the email API for Indian developers.

Source: https://vaartix.com/docs/api/operations/updatewebhook/

PATCH

/webhooks/{id}

```sh
curl --request PATCH \
  --url https://api.vaartix.com/webhooks/wh_4n8x2k7q1m9c3v5d \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "url": "https://example.com", "events": [ "email.sent" ], "status": "enabled" }'
```

Change the URL or events, or turn the endpoint off and on. Turning it off cancels its pending deliveries. Turning it back on resets its failure count.

## Authorizations

-   **[apiKey](https://vaartix.com/docs/api/#apikey)**

## Parameters

### Path Parameters

**id**

required

string

#### Example

```
wh_4n8x2k7q1m9c3v5d
```

## Request Bodyrequired

Media typeapplication/json

**object**

**url**

string format: uri

**events**

Array<string>

\>= 1 items

Allowed values: email.sent email.delivered email.delivery\_delayed email.bounced email.complained email.rejected email.rendering\_failure email.suppressed email.opened email.clicked

**status**

string

Allowed values: enabled disabled

## Responses

### 200

The updated endpoint.

Media typeapplication/json

**object**

**id**

string

**url**

string format: uri

**events**

Array<string>

Allowed values: email.sent email.delivered email.delivery\_delayed email.bounced email.complained email.rejected email.rendering\_failure email.suppressed email.opened email.clicked

**status**

Endpoints are turned off automatically after 5 deliveries in a row fail every attempt.

string

Allowed values: enabled disabled

**createdAt**

string format: date-time

#### Example

```json
{
  "id": "wh_4n8x2k7q1m9c3v5d",
  "events": [
    "email.sent"
  ],
  "status": "enabled"
}
```

### 400

`validation_error`: the request is invalid. The message says which field and why.

Media typeapplication/json

**object**

**error**

required

**object**

**type**

required

Stable, machine-readable error type.

string

Allowed values: validation\_error unauthorized forbidden not\_found conflict rate\_limited daily\_quota\_exceeded domain\_not\_verified invalid\_from\_address account\_paused domain\_needs\_review content\_rejected idempotency\_conflict bad\_request internal\_error

**message**

required

Human-readable explanation, safe to show to developers.

string

#### Example

```json
{
  "error": {
    "type": "validation_error",
    "message": "to: \"priya@\" is not a valid email address."
  }
}
```

### 401

`unauthorized`: the API key is missing, invalid or revoked.

Media typeapplication/json

**object**

**error**

required

**object**

**type**

required

Stable, machine-readable error type.

string

Allowed values: validation\_error unauthorized forbidden not\_found conflict rate\_limited daily\_quota\_exceeded domain\_not\_verified invalid\_from\_address account\_paused domain\_needs\_review content\_rejected idempotency\_conflict bad\_request internal\_error

**message**

required

Human-readable explanation, safe to show to developers.

string

#### Example

```json
{
  "error": {
    "type": "validation_error"
  }
}
```

### 403

`forbidden`: the key cannot do this, for example a send-only key on a management endpoint.

Media typeapplication/json

**object**

**error**

required

**object**

**type**

required

Stable, machine-readable error type.

string

Allowed values: validation\_error unauthorized forbidden not\_found conflict rate\_limited daily\_quota\_exceeded domain\_not\_verified invalid\_from\_address account\_paused domain\_needs\_review content\_rejected idempotency\_conflict bad\_request internal\_error

**message**

required

Human-readable explanation, safe to show to developers.

string

#### Example

```json
{
  "error": {
    "type": "validation_error"
  }
}
```

### 404

`not_found`: no such resource in your team.

Media typeapplication/json

**object**

**error**

required

**object**

**type**

required

Stable, machine-readable error type.

string

Allowed values: validation\_error unauthorized forbidden not\_found conflict rate\_limited daily\_quota\_exceeded domain\_not\_verified invalid\_from\_address account\_paused domain\_needs\_review content\_rejected idempotency\_conflict bad\_request internal\_error

**message**

required

Human-readable explanation, safe to show to developers.

string

#### Example

```json
{
  "error": {
    "type": "validation_error"
  }
}
```
