# Update a webhook

Source: https://ampost.io/docs/api/webhooks-update · Full reference: https://ampost.io/llms-full.txt

`PATCH /api/webhooks/endpoints/{webhookId}` · MCP tool `webhooks_update` · scope `webhooks:write` · rate limit `createPost` · success `200`

Change a webhook's URL, events or description, turn it on or off, or rotate its secret (the response then has the new `secret`, the only time it is shown). While a webhook is off no events are queued for it. Turning it back on resets its failure count; events it missed are not sent, so resend the ones you need with webhooks_redeliver. A webhook turned off because its key or app was revoked (`disabledReason: "key_revoked"`) can only be turned on in the dashboard. Changing the URL or rotating the secret ties the webhook to the calling key or app.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `webhookId` | path | string | yes | Webhook id (UUID): `id` from webhooks_list or webhooks_create |
| `url` | body | string | no | Public https URL that receives the events. Private, loopback, internal and Ampost's own hosts are rejected. |
| `events` | body | (post.scheduled \| post.unscheduled \| post.discarded \| post.published \| post.partial \| post.failed \| post.platform.published \| post.platform.failed \| post.platform.deleted \| post.platform.edited \| post.approval_requested \| post.approved \| post.rejected \| account.connected \| account.disconnected \| account.needs_reconnect \| analytics.synced)[] | no | Events to send to this URL |
| `description` | body | string \| null | no | Your note for this webhook, at most 200 characters |
| `enabled` | body | boolean | no | Turn the webhook on or off. Turning it on clears `disabledReason` and the failure count. |
| `rotateSecret` | body | boolean | no | True: replace the signing secret. The old one stops working at once. |

Example request:

```json
{
  "enabled": true
}
```

Example response:

```json
{
  "id": "d3a7c1e9-5b2f-4a8d-9e6c-7f1b3d5a9c21",
  "url": "https://example.com/ampost/webhooks",
  "description": "Production receiver",
  "events": [
    "post.published",
    "post.partial",
    "post.failed",
    "account.needs_reconnect"
  ],
  "secretPreview": "whsec_…nM8q",
  "enabled": true,
  "disabledReason": null,
  "disabledAt": null,
  "consecutiveFailures": 0,
  "lastDeliveryAt": "2026-10-08T15:00:01.000Z",
  "lastSuccessAt": "2026-10-08T15:00:01.000Z",
  "createdAt": "2026-10-01T09:00:00.000Z",
  "updatedAt": "2026-10-01T09:00:00.000Z"
}
```
