---
title: "Create feed"
method: POST
path: "/alerts-api/feeds"
tags: ["alerts-api---feeds"]
---

# Create feed

`POST /alerts-api/feeds`

## Request

- Base URL: `https://api.casafari.com`
- URL: `https://api.casafari.com/alerts-api/feeds`
- Auth: HTTP bearer

Create a new alert feed that delivers matching real estate events to your webhook URL.

## Alert Delivery Format

Events are delivered as a **POST** request with a single JSON object body:

```json
{
  "alert_id": 100042,
  "url": "https://www.casafari.com/listing/12345",
  "address": "Rua do Exemplo 12, Lisbon",
  "location": "Lisbon",
  "sale_status": "active",
  "sale_price": 250000,
  "sale_price_psqm": 2500.0,
  "sale_currency": "EUR",
  "rent_status": "none",
  "rent_price": 0,
  "rent_period": "none",
  "rent_price_psqm": 0.0,
  "rent_currency": "EUR",
  "thumbnails": [
    "https://cdn.example.com/thumb1.jpg"
  ],
  "matched_feeds": [
    {
      "feed_id": 42,
      "feed_name": "My Alert Feed"
    }
  ]
}
```

Your server must respond with HTTP **200**. Any other status code is treated as a failure.

## Before You Start: Configure Your Webhook

Feeds deliver to your **per-user webhook URL** — one URL for all feeds, managed separately:

1. `PUT /webhooks` — set your delivery URL (it is probed with a GET and must answer 200)
2. Create feeds — this endpoint returns **409** until the webhook is configured

Changing the URL via `PUT /webhooks` instantly affects all feeds, including already-queued alerts.

## Retry Policy

If your server does not respond with HTTP 200 within **5 seconds**, delivery is retried —
**60 seconds** after the first failure, then every **10 minutes** — until the alert expires
(typically 24h). Feeds are never disabled automatically.

## Authentication of deliveries

Every delivery is signed with [Standard Webhooks](https://www.standardwebhooks.com/): each POST
carries `webhook-id`, `webhook-timestamp`, and `webhook-signature` headers. Verify the
HMAC-SHA256 signature over the raw request body using the secret from `PUT /webhooks`
(rotate it via `POST /webhooks/rotate-secret`).

## Request body

- AlertsApiCreateAlertFeedRequestSchema
  - `feed_name` string, required
  - `filters` AlertsApiAlertFeedFiltersSchema, required
    - `location_ids` integer[], nullable
    - `types` AlertsApiEstateTypeEnum[], nullable
    - `business_type` 'sale' | 'rent', required
    - `statuses` union[], nullable
      - union
        - 'active' | 'reserved' | 'sold' | 'hold' | 'none'
        - 'active' | 'reserved' | 'rented' | 'hold' | 'none'
    - `alert_subtypes` AlertsApiAlertSubtypeEnum[], nullable
    - `custom_locations` array[], nullable: List of closed polygons of geo-points to search within. Each polygon must contain at least 4 points. First and last points must match in each polygon. Maximum 4 polygons allowed.
      - AlertsApiCoordinatesDto[]
        - `latitude` number, required
        - `longitude` number, required
    - `private` boolean, nullable
    - `price_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema1
      - `min` integer, nullable
      - `max` integer, nullable
    - `price_psqm_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema2
      - `min` integer, nullable
      - `max` integer, nullable
    - `bathrooms_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema3
      - `min` integer, nullable
      - `max` integer, nullable
    - `bedrooms_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema4
      - `min` integer, nullable
      - `max` integer, nullable
    - `total_area_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema5
      - `min` integer, nullable
      - `max` integer, nullable
    - `new_development` boolean, nullable
    - `bank` boolean, nullable
    - `auction` boolean, nullable
    - `construction_year_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema6
      - `min` integer, nullable
      - `max` integer, nullable
    - `plot_area_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema7
      - `min` integer, nullable
      - `max` integer, nullable
    - `floors` AlertsApiFloorCategoryEnum[], nullable
    - `conditions` AlertsApiConditionEnum[], nullable
    - `orientation` 'exterior' | 'interior'
    - `views` AlertsApiViewEnum[], nullable: A matching listing must have every requested view, not just one.
    - `directions` AlertsApiDirectionEnum[], nullable: A matching listing must face every requested direction, not just one.
    - `characteristics` AlertsApiCharacteristicEnum[], nullable: A matching listing must have every requested characteristic, not just one.
    - `has_phone` boolean, nullable
    - `has_email` boolean, nullable
    - `has_agency_name` boolean, nullable
    - `ref_numbers` string[], nullable
    - `listing_ids` integer[], nullable

## Response `200`

Successful Response

- AlertsApiFeedDetailResponseSchema
  - `feed_id` integer, required
  - `feed_name` string, required
  - `filters` AlertsApiAlertFeedFiltersSchema, required
    - `location_ids` integer[], nullable
    - `types` AlertsApiEstateTypeEnum[], nullable
    - `business_type` 'sale' | 'rent', required
    - `statuses` union[], nullable
      - union
        - 'active' | 'reserved' | 'sold' | 'hold' | 'none'
        - 'active' | 'reserved' | 'rented' | 'hold' | 'none'
    - `alert_subtypes` AlertsApiAlertSubtypeEnum[], nullable
    - `custom_locations` array[], nullable: List of closed polygons of geo-points to search within. Each polygon must contain at least 4 points. First and last points must match in each polygon. Maximum 4 polygons allowed.
      - AlertsApiCoordinatesDto[]
        - `latitude` number, required
        - `longitude` number, required
    - `private` boolean, nullable
    - `price_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema1
      - `min` integer, nullable
      - `max` integer, nullable
    - `price_psqm_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema2
      - `min` integer, nullable
      - `max` integer, nullable
    - `bathrooms_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema3
      - `min` integer, nullable
      - `max` integer, nullable
    - `bedrooms_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema4
      - `min` integer, nullable
      - `max` integer, nullable
    - `total_area_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema5
      - `min` integer, nullable
      - `max` integer, nullable
    - `new_development` boolean, nullable
    - `bank` boolean, nullable
    - `auction` boolean, nullable
    - `construction_year_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema6
      - `min` integer, nullable
      - `max` integer, nullable
    - `plot_area_range` AlertsApisrcStructuresSchemasRangesIntRangeSchema7
      - `min` integer, nullable
      - `max` integer, nullable
    - `floors` AlertsApiFloorCategoryEnum[], nullable
    - `conditions` AlertsApiConditionEnum[], nullable
    - `orientation` 'exterior' | 'interior'
    - `views` AlertsApiViewEnum[], nullable: A matching listing must have every requested view, not just one.
    - `directions` AlertsApiDirectionEnum[], nullable: A matching listing must face every requested direction, not just one.
    - `characteristics` AlertsApiCharacteristicEnum[], nullable: A matching listing must have every requested characteristic, not just one.
    - `has_phone` boolean, nullable
    - `has_email` boolean, nullable
    - `has_agency_name` boolean, nullable
    - `ref_numbers` string[], nullable
    - `listing_ids` integer[], nullable

## Other responses

- `409`: Webhook is not configured.
- `422`: Validation Error

---

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