---
title: "Replace a webhook rule's signing secret"
method: POST
path: "/alert-rules/{rule_id}/rotate-secret"
tags: ["Alerts"]
---

# Replace a webhook rule's signing secret

`POST /alert-rules/{rule_id}/rotate-secret`

## Request

- Base URL: `https://adslighthouse.com/api/v1`
- URL: `https://adslighthouse.com/api/v1/alert-rules/{rule_id}/rotate-secret`
- Auth: HTTP bearer

Replaces a webhook rule's signing secret and returns the new one, once. The old secret stops working from the next delivery, with no overlap, and a receiver that rejects the new signature with a 4xx is not retried, so update your receiver right away. Only owners and account admins may rotate, as in the app. Requires the write scope; confirm with the user first.

## Path parameters

- `rule_id` string, required: The alert rule id from list_alert_rules.

## Request body

- object

## Response `200`

Replace a webhook rule's signing secret

- object
  - `rule` object, required
    - `id` string, required
    - `project_id` string, nullable, required
    - `project_name` string, nullable, required
    - `brand_name` string, required
    - `type` 'competitor_new' | 'competitor_returning' | 'hijack_detected' | 'affiliate_detected' | 'ranking_drop' | 'nklg_re_enable' | 'ingestion_failed' | 'summary_digest', required
    - `type_label` string, required
    - `channel` 'email' | 'webhook' | 'slack', required
    - `destination` string, nullable, required: Email address, or the host of a webhook or Slack URL (the full URL is never returned). null for an email rule that goes to the account owner.
    - `enabled` boolean, required
    - `filters` object, nullable, required: Which observations the rule watches. null in a dimension means every value; values within a dimension combine with OR, dimensions with AND.
      - `engines` string[], nullable, required
      - `devices` string[], nullable, required
      - `countries` string[], nullable, required
    - `schedule` object, nullable, required: When a scheduled summary (type summary_digest) is sent. Each summary covers the complete local days before its delivery day: the day before (daily) or the seven days before (weekly).
      - `cadence` 'daily' | 'weekly', required
      - `weekday` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday', nullable, required: The day a weekly summary is sent; null for a daily summary.
      - `hour` integer, required: Local hour of delivery, 0 to 23, at minute 00.
      - `time_zone` string, required: The IANA time zone the hour and the covered days use, kept on the rule when someone else edits it.
      - `next_delivery_at` string, nullable, required: When the next summary is sent; null while the rule is paused.
    - `created_at` string, required
  - `signing_secret` string, required
  - `request_id` string

## Other responses

- `400`: Invalid parameters, cursor or body.
- `401`: Missing, invalid, expired or revoked credential.
- `403`: The credential lacks the write scope, the plan does not include the API, or the allowance is used up.
- `404`: Unknown project, keyword or run in this account.
- `409`: The idempotency key was already used for a different request.
- `429`: Rate limit reached. Retry after the Retry-After seconds.
- `503`: The requested service or file is temporarily unavailable.

---

[API](https://skmtc.dev/adslighthouse/apis/ads-lighthouse-api.md) · [All operations](https://skmtc.dev/adslighthouse/apis/ads-lighthouse-api/llms.txt) · [OpenAPI document](https://skmtc.dev/adslighthouse/apis/ads-lighthouse-api/revisions/e1a4a40b11a9?raw)
