# Rotate signing secret

> **Casafari is the AI agent-native real estate data intelligence platform.** The most complete property index in Europe: a deduplicated, cleaned property graph of residential and commercial property, for sale and for rent, in 16 countries. Every property is one record with its full price and market history. [How the property graph is built](/docs/property-graph).

`POST https://api.casafari.com/alerts-api/webhooks/rotate-secret`

[Alerts](/docs/alerts) · [REST API](/docs/rest/alerts). Send `Authorization: Bearer $CASAFARI_TOKEN`; see [how to get a token](/docs/rest#get-a-token).

Over MCP: no tool does this. See [MCP and REST compared](/docs/parity#alerts).

## Description

Issues a new current signing secret. By default the previous secrets stay valid for a **24-hour grace window** so you can install the new key before removing the old one. Pass `{"immediate": true}` to revoke all previous secrets right away — use this only when a secret is compromised.

## Request body

Content type `application/json`. Required. Type: `object`.

- `immediate` (boolean, optional): When false (default), the previous secrets keep working for a 24-hour grace window so you can switch the new secret before the old one stops signing; deliveries carry a signature for each active secret meanwhile. When true, the previous secrets are revoked immediately and only the new one signs — use this only when a secret is compromised. default false.

## Example request

Placeholders only: replace the token and the values with your own.

```bash
curl -X POST "https://api.casafari.com/alerts-api/webhooks/rotate-secret" \
  -H "Authorization: Bearer $CASAFARI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "immediate": false
}'
```

## Responses

### 200 Successful Response

Type: `object`.

- `secret` (string, required)

### 422 Validation Error

Type: `object`.

- `detail` (object[], optional)
  - `loc` ((string | integer)[], required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any, optional)
  - `ctx` (object, optional)

## Questions about this

- [Can I get alerts (new properties, price cuts, sales) over Casafari MCP?](/docs/faq/alerts-over-mcp)
- [How do I get alerts delivered to a webhook?](/docs/faq/alerts-webhook)
