# Set webhook URL

> **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).

`PUT https://api.casafari.com/alerts-api/webhooks`

[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

Sets (or replaces) the delivery URL for **all** your alert feeds.

Before saving, a **GET** request is sent to the URL — your server must respond with HTTP **200**, otherwise this endpoint returns **400**.

Alert deliveries themselves arrive as **POST** requests with a JSON array body.

The URL is stored per user: changing it here instantly affects every feed, including alerts already queued for delivery. Feeds cannot be created until the webhook is configured.

A signing secret is provisioned on the first call and returned in `secret` **once**; later calls return `secret: null`. Lost it? Use `POST /webhooks/rotate-secret`.

## Request body

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

- `url` (string (uri), required) 1–2083 characters.

## Example request

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

```bash
curl -X PUT "https://api.casafari.com/alerts-api/webhooks" \
  -H "Authorization: Bearer $CASAFARI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "<url>"
}'
```

## Responses

### 200 Successful Response

Type: `object`.

- `url` (string, required)
- `secret` (string, required)

### 400 Webhook URL verification failed.

Type: `object`.

- `detail` (string, required)

Example from the API description:

```json
{
  "detail": "Webhook URL verification failed: Expected HTTP 200, got 404."
}
```

### 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)
