---
title: "Update a Webhook"
method: PATCH
path: "/webhooks/{webhook_id}"
---

# Update a Webhook

`PATCH /webhooks/{webhook_id}`

Updates a webhook. Send only the fields you want to change, including the state and any rotated secret.

## Path parameters

- `webhook_id` string, required

## Request body

- WebhookUpdateInput
  - `account_id` string, uuid, required — The unique identifier of the account the webhook belongs to.
  - `name` string — Your name for the webhook. It must be unique within the account.
  - `state` 'ACTIVE' | 'INACTIVE' — Set it to `INACTIVE` to stop the deliveries while keeping the configuration, and back to `ACTIVE` to resume them.
  - `url` string — The endpoint Yuno sends the notifications to. It must be an `http` or `https` URL that resolves to a public, routable address.
  - `api_key` string — Replaces the `x-api-key` Yuno sends on every delivery.
  - `secret` string — Replaces the `x-secret` Yuno sends on every delivery.
  - `hmac_client_secret` string — Replaces the key Yuno signs the payload with.
  - `oauth2_authentication_url` string — Your token endpoint. It must use HTTPS. Send `oauth2_authentication_url`, `oauth2_client_id`, `oauth2_client_secret` and `oauth2_grant_type` together.
  - `oauth2_client_id` string — The client identifier Yuno authenticates with. Send `oauth2_authentication_url`, `oauth2_client_id`, `oauth2_client_secret` and `oauth2_grant_type` together.
  - `oauth2_client_secret` string — The client secret Yuno authenticates with. Send `oauth2_authentication_url`, `oauth2_client_id`, `oauth2_client_secret` and `oauth2_grant_type` together.
  - `oauth2_grant_type` string — The grant type Yuno requests the token with. Send `oauth2_authentication_url`, `oauth2_client_id`, `oauth2_client_secret` and `oauth2_grant_type` together.
  - `oauth2_scope` string — The scope Yuno requests the token with.
  - `oauth2_authorization_name` string — The header Yuno sends the token in. Defaults to `Authorization`.
  - `oauth2_include_client_id` boolean — Send the client identifier as a header on the token request as well.
  - `enrollment_triggers` string[] — Replaces the enrollment events the webhook subscribes to.
  - `payment_triggers` string[] — Replaces the payment events the webhook subscribes to.
  - `report_triggers` string[] — Replaces the report events the webhook subscribes to.
  - `subscription_triggers` string[] — Replaces the subscription events the webhook subscribes to.
  - `onboarding_triggers` string[] — Replaces the onboarding events the webhook subscribes to.
  - `renewal_days` integer — How many days before a renewal Yuno sends the `CLOSE_TO_RENEWAL` notification. It must be 1 or more. Send it on its own, not together with `clear_renewal_days`.
  - `clear_renewal_days` boolean — Set it to `true` to remove `renewal_days`. Send it on its own, not together with `renewal_days`.

## Response `200`

The updated webhook.

- Webhook
  - `id` string — The unique identifier of the webhook.
  - `account_id` string, uuid — The unique identifier of the account the webhook belongs to.
  - `name` string — Your name for the webhook.
  - `state` 'ACTIVE' | 'INACTIVE' — `ACTIVE` webhooks receive notifications, `INACTIVE` ones do not. A webhook starts out `ACTIVE`.
  - `url` string — The endpoint Yuno sends the notifications to.
  - `api_key` string — Masked as `***`, or `null` when you have not configured it.
  - `secret` string — Masked as `***`, or `null` when you have not configured it.
  - `hmac_client_secret` string — Masked as `***`, or `null` when you have not configured it.
  - `oauth2_authentication_url` string — Your token endpoint.
  - `oauth2_client_secret` string — Masked as `***`, or `null` when you have not configured it.
  - `oauth2_client_id` string — The client identifier Yuno authenticates with.
  - `oauth2_grant_type` string — The grant type Yuno requests the token with.
  - `oauth2_scope` string — The scope Yuno requests the token with.
  - `oauth2_authorization_name` string — The header Yuno sends the token in.
  - `oauth2_include_client_id` boolean — Whether Yuno also sends the client identifier as a header on the token request.
  - `enrollment_triggers` string[] — The enrollment events the webhook subscribes to.
  - `payment_triggers` string[] — The payment events the webhook subscribes to.
  - `report_triggers` string[] — The report events the webhook subscribes to.
  - `subscription_triggers` string[] — The subscription events the webhook subscribes to.
  - `onboarding_triggers` string[] — The onboarding events the webhook subscribes to.
  - `renewal_days` unknown
  - `created_at` string, date-time — The date and time the webhook was created, in ISO 8601.
  - `updated_at` string, date-time — The date and time the webhook was last updated, in ISO 8601. It matches `created_at` until you update the webhook for the first time.

## Other responses

- `400` — The request is invalid. The `code` tells you which rule it broke.
- `401` — Your API credentials are missing or invalid.
- `404` — There is no webhook with that identifier on the account.
- `409` — The account already has a webhook with that name, or one with the same URL that listens to one of the same events.
- `502` — The webhook service is temporarily unavailable.

---

[API](https://skmtc.net/y/apis/ai-caller.md) · [All operations](https://skmtc.net/y/apis/ai-caller/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/y/ai-caller/revisions/05b629819b49/schema)
