---
title: "Update a webhook endpoint"
method: PATCH
path: "/endpoints/{id}"
tags: ["Endpoints"]
---

# Update a webhook endpoint

`PATCH /endpoints/{id}`

Updates an active webhook endpoint. If the URL is changed, the old
endpoint is deactivated and a new one is created (or an existing
deactivated endpoint with the new URL is reactivated).

## Request body

- object
  - `url` string — New webhook URL (triggers endpoint rotation)
  - `enabled` boolean
  - `domain_id` string, uuid, nullable
  - `rules` object

## Response `200`

Updated endpoint

- object
  - `success` true, required
  - `data` object, required
    - `id` string, uuid, required
    - `org_id` string, uuid, required
    - `url` string, nullable
    - `enabled` boolean, required
    - `domain_id` string, uuid, nullable — Restrict this endpoint to emails from a specific domain
    - `rules` object, required — Endpoint-specific filtering rules
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `delivery_count` integer, required — Total webhook deliveries attempted
    - `success_count` integer, required — Successful deliveries
    - `failure_count` integer, required — Failed deliveries
    - `consecutive_fails` integer, required — Current streak of consecutive failures
    - `last_delivery_at` string, date-time, nullable
    - `last_success_at` string, date-time, nullable
    - `last_failure_at` string, date-time, nullable
    - `deactivated_at` string, date-time, nullable
    - `kind` 'http' | 'function' — http: deliver to the webhook URL. function: invoke a Primitive Function.
    - `function_id` string, uuid, nullable — The Function this endpoint invokes, when kind is function.
    - `is_route_target` boolean — When true, this endpoint is reachable only via an explicit recipient route, never as a domain's default destination, and is exempt from the one-endpoint-per-domain rule (so many can share a domain).

## Other responses

- `400` — Invalid request parameters
- `401` — Invalid or missing API key
- `404` — Resource not found

---

[API](https://skmtc.dev/primitive/apis/primitive-api.md) · [All operations](https://skmtc.dev/primitive/apis/primitive-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/primitive/primitive-api/revisions/c2299d28022c/schema)
