---
title: "Rotate Secret Key"
method: PATCH
path: "/api/v1/webhook-subscriptions/{id}/rotate-secret"
tags: ["Webhook Subscriptions"]
---

# Rotate Secret Key

`PATCH /api/v1/webhook-subscriptions/{id}/rotate-secret`

Generate a new secret key for webhook signature verification. The old key becomes invalid immediately.

## Response `200`

Secret key rotated successfully

- WebhookSubscriptionResponse
  - `id` string — Unique identifier for the webhook subscription
  - `type` 'webhookSubscription' — Type of the resource
  - `attributes` object
    - `url` string, uri — HTTPS URL that will receive webhook events
    - `secretKey` string — Secret key used to sign webhook payloads
    - `enabled` boolean — Whether the webhook subscription is active
    - `scopeType` 'organisation' | 'entity' — Scope type for the webhook subscription
    - `scopeName` string — Name of the scope
    - `subscribedEvents` string[] — List of events subscribed to

## Other responses

- `401` — Unauthorized - Invalid API key
- `404` — Not Found - Webhook subscription not found

---

[API](https://skmtc.net/passentry/apis/passentry-api.md) · [All operations](https://skmtc.net/passentry/apis/passentry-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/passentry/passentry-api/versions/2c7dc0306b04/schema)
