# updateWebhookEndpoint — Postify API

`PATCH /v1/webhook-endpoints/{id}`

Update a webhook endpoint. Updates the URL (re-validated through the SSRF gauntlet), the event-type subscription list, and/or `enabled`. Setting `enabled: true` on an auto-disabled endpoint clears its failure ladder and resumes deliveries.

- Required scope: `webhooks:write`
- Auth: `Authorization: Bearer postify_live_…` or `x-api-key` header

## Parameters

- `id` (path, string, required) — Webhook endpoint id.

## Request body

Partial update — at least one field is required.

- `url` (string) — Replacement delivery URL — re-validated through the same SSRF gauntlet as creation.
- `event_types` (array of "post.published" | "post.failed" | "channel.connected" | "channel.reauth_required" | "delivery.failed") — Replacement event-type subscription list.
- `enabled` (boolean) — Enable or disable deliveries. Setting `true` on an auto-disabled endpoint clears its failure state and resumes deliveries.

## Responses

- `200` — The updated endpoint. (schema: `WebhookEndpoint`)
- `400` — [`invalid_request`](https://usepostify.com/docs/api/problems/invalid-request.md), [`validation_failed`](https://usepostify.com/docs/api/problems/validation-failed.md)
- `401` — [`authentication_required`](https://usepostify.com/docs/api/problems/authentication-required.md), [`invalid_api_key`](https://usepostify.com/docs/api/problems/invalid-api-key.md)
- `403` — [`insufficient_scope`](https://usepostify.com/docs/api/problems/insufficient-scope.md), [`feature_not_enabled`](https://usepostify.com/docs/api/problems/feature-not-enabled.md)
- `404` — [`resource_not_found`](https://usepostify.com/docs/api/problems/resource-not-found.md)
- `409` — [`resource_conflict`](https://usepostify.com/docs/api/problems/resource-conflict.md)
- `429` — [`rate_limited`](https://usepostify.com/docs/api/problems/rate-limited.md), [`quota_exhausted`](https://usepostify.com/docs/api/problems/quota-exhausted.md)
- `500` — [`internal_error`](https://usepostify.com/docs/api/problems/internal-error.md)

Errors are RFC 9457 `application/problem+json` with a stable `code` and a `request_id`. Full schemas: [interactive reference](https://usepostify.com/docs/api-reference) · [OpenAPI spec](https://app.usepostify.com/v1/openapi.json).

## Example (curl)

```bash
curl -X PATCH https://app.usepostify.com/v1/webhook-endpoints/post_9x2y3z0001 \
  -H "Authorization: Bearer postify_live_XXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": true
}'
```

## Example (TypeScript)

```ts
const res = await fetch("https://app.usepostify.com/v1/webhook-endpoints/post_9x2y3z0001", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.POSTIFY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
      "enabled": true
    }),
});

if (!res.ok) {
  // RFC 9457 problem+json: branch on the stable `code`.
  const problem = await res.json();
  throw new Error(`${problem.code}: ${problem.detail ?? problem.title}`);
}
const data = await res.json();
```
