# Change a webhook endpoint

URL: https://docs.fxapis.com/api-reference/webhooks/change-a-webhook-endpoint

> Change a webhook endpoint. Change its url, events or description.

`PATCH https://api.fxapis.com/v1/webhooks/{id}`

Change its `url`, `events` or `description`. The secret stays the same.

Authentication: `Authorization: Bearer <API key>`.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes |  |

#### Request body (application/json, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string | no | HTTPS on port 443, a public host, no credentials. Example: `"https://example.com/fxapis/webhooks"` |
| `events` | "order.filled" \| "order.rejected" \| "order.unresolved" \| "order.resolved" \| "order.cancelled" \| "position.opened" \| "position.closed" \| "account.state_changed" \| "wave.settled"[] | no | The events this endpoint receives. Empty means every event. |
| `description` | string \| null | no |  |

#### Responses

- `200`
- `400`
- `401`
- `403`
- `404`

Failures return `{ "error": { "code", "message" } }`; every code is listed at https://docs.fxapis.com/errors.

#### 200 response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | object | no |  |
| `data.id` | string (uuid) | no |  |
| `data.url` | string | no | Example: `"https://example.com/fxapis/webhooks"` |
| `data.description` | null \| string | no | Example: `"Copier"` |
| `data.events` | "order.filled" \| "order.rejected" \| "order.unresolved" \| "order.resolved" \| "order.cancelled" \| "position.opened" \| "position.closed" \| "account.state_changed" \| "wave.settled"[] | no | The events this endpoint receives. Empty means every event. |
| `data.enabled` | boolean | no | Whether events are being sent. False when you disabled it, or when we did after 20 failed deliveries in a row — see `disabledReason`. |
| `data.disabledAt` | null \| string (date-time) | no | When we switched it off for failing. Null when you disabled it yourself. |
| `data.disabledReason` | null \| string | no | Example: `"20 deliveries in a row failed"` |
| `data.consecutiveFailures` | integer | no | Failed deliveries since the last success. |
| `data.secretHint` | null \| string | no | The signing secret's last characters, to tell secrets apart. Example: `"whsec_…Qx4w"` |
| `data.previousSecretExpiresAt` | null \| string (date-time) | no | After a rotation, deliveries are signed with the old secret too until this time. |
| `data.createdAt` | string (date-time) | no |  |
| `data.updatedAt` | string (date-time) | no |  |