---
title: "Rotate a webhook signing secret"
method: POST
path: "/v1/webhook-subscriptions/{webhook_subscription_id}/rotate-secret"
tags: ["Webhook Subscriptions"]
---

# Rotate a webhook signing secret

`POST /v1/webhook-subscriptions/{webhook_subscription_id}/rotate-secret`

## Request

- Base URL: `https://api.mailrith.com`
- URL: `https://api.mailrith.com/v1/webhook-subscriptions/{webhook_subscription_id}/rotate-secret`
- Auth: HTTP bearer

Invalidates the existing webhook signing secret and returns a replacement once.

## Path parameters

- `webhook_subscription_id` string, required

## Response `200`

Webhook signing secret rotated

- object
  - `data` WebhookSubscriptionCreateResult, required
    - `subscription` WebhookSubscription, required
      - `self` string, required: Stable relative Public API path for retrieving this resource.
      - `id` string, required
      - `name` string, required
      - `url` string, required
      - `status` 'active' | 'disabled', required: Whether Mailrith currently delivers matching events to this destination.
      - `event_patterns` string[], required: Events or wildcard patterns to deliver through this outbound webhook destination.
      - `signing_secret_preview` string, required
      - `delivery_attempts` integer, required
      - `last_delivery_status` 'delivered' | 'failed' | 'null', nullable, required
      - `last_delivery_error` string, nullable, required
      - `last_delivered_at` string, date-time, nullable, required
      - `last_failed_at` string, date-time, nullable, required
      - `created_at` string, date-time, required
      - `updated_at` string, date-time, required
    - `signing_secret` string, required

## Other responses

- `404`: Webhook subscription not found

---

[API](https://skmtc.dev/mailrith/apis/mailrith-api.md) · [All operations](https://skmtc.dev/mailrith/apis/mailrith-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mailrith/apis/mailrith-api/revisions/41f09536f2da?raw)
