{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/casafari/json-schema/casafari-api-alert-documents-v1-schema.json",
  "title": "ApiAlertDocumentsV1",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/casafari-api-alerts-api-openapi.yml#/components/schemas/ApiAlertDocumentsV1",
  "properties": {
    "alert_id": {
      "type": "integer",
      "description": "ID of the alert."
    },
    "listing_id": {
      "type": "integer",
      "description": "ID of the listing (ad)."
    },
    "ref": {
      "type": "string",
      "description": "The reference ID of the listing."
    },
    "alert_type": {
      "type": "string",
      "enum": [
        "sale_price",
        "sale_status",
        "rent_price",
        "rent_status",
        "new"
      ],
      "description": "The type of the alert."
    },
    "alert_subtype": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "new",
        "price_up",
        "price_down",
        "reserved",
        "delisted",
        "sold"
      ],
      "description": "The subtype of the alert."
    },
    "old_value": {
      "type": "string",
      "description": "Value before change."
    },
    "new_value": {
      "type": "string",
      "description": "Value after change."
    },
    "alert_date": {
      "type": "string",
      "format": "date",
      "description": "Date when the alert occurred."
    },
    "alert_date_and_time": {
      "type": [
        "string",
        "null"
      ],
      "description": "Date and time when the alert occurred.",
      "readOnly": true
    },
    "property_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "URL of the property in the CASAFARI website.",
      "readOnly": true
    },
    "listing_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "URL of the listing. Available only for currently active listings.",
      "readOnly": true
    },
    "listing_old_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Old URL of the listing. Available only for currently inactive listings.",
      "readOnly": true
    },
    "listing_uid": {
      "type": "string",
      "description": "Unique ID of the listing on the source site."
    },
    "property_id": {
      "type": "integer",
      "description": "ID of the property to which the listing belongs."
    },
    "title": {
      "type": "string",
      "description": "Listing title."
    },
    "type": {
      "type": "string",
      "enum": [
        "apartment",
        "studio",
        "duplex",
        "penthouse",
        "dachgeschosswohnung",
        "etagenwohnung",
        "erdgeschosswohnung",
        "country_house",
        "house",
        "palace",
        "townhouse",
        "villa",
        "country_estate",
        "chalet",
        "bungalow",
        "family_house",
        "reihenhaus",
        "reihenendhaus",
        "reihenmittelhaus",
        "einfamilienhaus",
        "zweifamilienhaus",
        "landwirtschaftliche_betriebe",
        "retail",
        "office",
        "industrial",
        "warehouse",
        "hotel",
        "other_commercial",
        "restaurant",
        "werkstatt",
        "plot",
        "urban_plot",
        "rural_plot",
        "room",
        "other",
        "garage",
        "parking",
        "apartment_building",
        "office_building",
        "mix_use_building"
      ],
      "description": "Listing property type, as returned by the [GET /api/v1/references/types](/#operation/api__get__v1__references__types) endpoint."
    },
    "type_group": {
      "type": "string",
      "description": "Listing property type group, as returned by the [GET /api/v1/references/types](/#operation/api__get__v1__references__types) endpoint."
    },
    "location": {
      "properties": {
        "location_id": {
          "type": "integer",
          "description": "('Location ID, as returned by the [POST /api/v1/references/locations](/#operation/api__post__v1__references__locations) endpoint.',)"
        },
        "name": {
          "type": "string",
          "description": "Location name."
        },
        "administrative_level": {
          "type": "string",
          "description": "Location administrative level."
        },
        "zip_codes": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "The location zip codes.",
          "default": []
        }
      },
      "type": "object",
      "required": [
        "location_id",
        "name",
        "administrative_level"
      ],
      "description": "Information about property location."
    },
    "locations_structure": {
      "items": {
        "properties": {
          "location_id": {
            "type": "integer",
            "description": "('Location ID, as returned by the [POST /api/v1/references/locations](/#operation/api__post__v1__references__locations) endpoint.',)"
          },
          "name": {
            "type": "string",
            "description": "Location name."
          },
          "administrative_level": {
            "type": "string",
            "description": "Location administrative level."
          },
          "zip_codes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "description": "The location zip codes.",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "location_id",
          "name",
          "administrative_level"
        ]
      },
      "type": "array",
      "description": "Information about all the parent locations (including property location) up to the country."
    },
    "address": {
      "type": "string",
      "description": "Property address."
    },
    "zip_code": {
      "type": [
        "string",
        "null"
      ],
      "description": "The location zip code."
    },
    "cadastral_reference": {
      "type": [
        "string",
        "null"
      ],
      "description": "Cadastral reference of the estate."
    },
    "coordinates": {
      "properties": {
        "latitude": {
          "type": "number",
          "description": "Latitude."
        },
        "longitude": {
          "type": "number",
          "description": "Longitude."
        }
      },
      "type": [
        "object",
        "null"
      ],
      "required": [
        "latitude",
        "longitude"
      ],
      "description": "Property coordinates."
    },
    "condition": {
      "type": "string",
      "enum": [
        "used",
        "ruin",
        "very-good",
        "new",
        "other"
      ],
      "description": "Property condition, as returned by the [GET /api/v1/references/conditions](/#operation/api__get__v1__references__conditions) endpoint."
    },
    "contacts_info": {
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The owner name. Only for FSBO listings."
        },
        "email": {
          "type": [
            "string",
            "null"
          ],
          "format": "email",
          "description": "The email contact."
        },
        "phone": {
          "type": [
            "string",
            "null"
          ],
          "description": "The phone contact."
        }
      },
      "type": "object",
      "required": [
        "name",
        "email",
        "phone"
      ],
      "description": "Information about listing contacts."
    },
    "total_area": {
      "type": "integer",
      "description": "Total area."
    },
    "living_area": {
      "type": "integer",
      "description": "Living area."
    },
    "plot_area": {
      "type": "integer",
      "description": "Plot area."
    },
    "terrace_area": {
      "type": "integer",
      "description": "Terrace area."
    },
    "bedrooms": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of bedrooms."
    },
    "rooms": {
      "type": "integer",
      "description": "Number of rooms."
    },
    "bathrooms": {
      "type": "integer",
      "description": "Number of bathrooms."
    },
    "features": {
      "properties": {
        "floor": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "no_floor",
            "ground",
            "middle",
            "top"
          ],
          "description": "Floor type."
        },
        "orientation": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "exterior",
            "interior"
          ],
          "description": "Property view orientation."
        },
        "view": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "water",
            "landscape",
            "city",
            "golf",
            "park"
          ],
          "description": "View from the property. <br/><strong>This field is deprecated and will be removed in the next major update.</strong><br/><strong>Please, use `views` field instead.</strong>"
        },
        "views": {
          "items": {
            "type": "string",
            "enum": [
              "water",
              "landscape",
              "city",
              "golf",
              "park"
            ]
          },
          "type": [
            "array",
            "null"
          ],
          "description": "List of views from the property."
        },
        "direction": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "north",
            "south",
            "east",
            "west"
          ],
          "description": "Cardinal direction the property faces. <br/><strong>This field is deprecated and will be removed in the next major update.</strong><br/><strong>Please, use `directions` field instead.</strong>"
        },
        "directions": {
          "items": {
            "type": "string",
            "enum": [
              "north",
              "south",
              "east",
              "west"
            ]
          },
          "type": [
            "array",
            "null"
          ],
          "description": "List of cardinal directions the property faces."
        },
        "characteristics": {
          "items": {
            "type": "string",
            "enum": [
              "balcony",
              "elevator",
              "no_elevator",
              "garage",
              "garden",
              "parking",
              "storage",
              "swimming_pool",
              "terrace",
              "rental_license",
              "furniture",
              "rented_out",
              "life_annuity"
            ]
          },
          "type": [
            "array",
            "null"
          ],
          "description": "Property characteristics."
        }
      },
      "type": "object",
      "required": [
        "floor",
        "orientation",
        "view",
        "views",
        "direction",
        "directions",
        "characteristics"
      ],
      "description": "Property features, as returned by the [GET /api/v1/references/features](/#operation/api__get__v1__references__features) endpoint."
    },
    "construction_year": {
      "type": "integer",
      "description": "Construction year."
    },
    "operations": {
      "items": {
        "type": "string",
        "enum": [
          "sale",
          "rent"
        ]
      },
      "type": "array",
      "description": "Operation types for which listing property is available."
    },
    "is_bank_property": {
      "type": "boolean",
      "description": "Whether the listing property is a bank property."
    },
    "is_auction_property": {
      "type": "boolean",
      "description": "Whether the listing property is an auction property."
    },
    "is_new_development_property": {
      "type": "boolean",
      "description": "Whether the listing property is a new development property."
    },
    "is_private_property": {
      "type": "boolean",
      "description": "Whether the property is listed by a private individual, as opposed to an agent or a professional."
    },
    "sale_status": {
      "type": "string",
      "enum": [
        "active",
        "reserved",
        "hold",
        "sold",
        "none"
      ],
      "description": "Current sale status of the listing."
    },
    "sale_currency": {
      "type": "string",
      "description": "Sale price currency code."
    },
    "sale_price_base": {
      "type": "integer",
      "description": "Current sale price, in Euros."
    },
    "sale_price": {
      "type": "integer",
      "description": "Current sale price, in the currency of the listing (specified by the `sale_currency` field)."
    },
    "sale_price_per_sqm": {
      "type": "number",
      "description": "Current sale price per square meter, in the currency of the listing (specified by the `sale_currency` field)."
    },
    "sale_price_per_sqm_base": {
      "type": "number",
      "description": "Current sale price per square meter, in Euros."
    },
    "rent_status": {
      "type": "string",
      "enum": [
        "active",
        "reserved",
        "hold",
        "rented",
        "none"
      ],
      "description": "Current rent status of the listing."
    },
    "rent_currency": {
      "type": "string",
      "description": "Rent price currency code."
    },
    "rent_price_base": {
      "type": "integer",
      "description": "Current rent price, in Euros."
    },
    "rent_price": {
      "type": "integer",
      "description": "Current rent price, in the currency of the listing (specified by the `rent_currency` field)."
    },
    "rent_price_per_sqm": {
      "type": "number",
      "description": "Current rent price per square meter, in the currency of the listing (specified by the `rent_currency` field)."
    },
    "rent_price_per_sqm_base": {
      "type": "number",
      "description": "Current rent price per square meter, in Euros."
    },
    "rent_period": {
      "type": "string",
      "enum": [
        "day",
        "week",
        "fortnight",
        "month",
        "year",
        "none"
      ],
      "description": "Rent period."
    },
    "agency_legal_id": {
      "type": "string",
      "description": "Agency legal identifier specified on the source. Only for France and its overseas territories(DROM and COM)."
    },
    "agency": {
      "type": "string",
      "description": "The company that manages the listing."
    },
    "agent": {
      "type": "string",
      "description": "The agent that manages the listing."
    },
    "source_name": {
      "type": "string",
      "description": "The name of the source."
    },
    "description": {
      "type": "string",
      "description": "Listing description."
    },
    "thumbnails": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "description": "List of the thumbnail image URLs.",
      "readOnly": true
    },
    "pictures": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "description": "List of the original picture image URLs.",
      "readOnly": true
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the alert was created (UTC)."
    },
    "created_at_with_photos": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Date and time (UTC) when the alert was created and its photos were processed. Can be `null` if photo processing has not finished yet.\nIf the listing has no photos but the system has finished the processing, this field will contain its date and time."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the alert data was updated (UTC)."
    },
    "energy_certificate": {
      "type": "string",
      "description": "Energy certificate classification that attests to the energy efficiency of a listing. <br/><strong>This field is deprecated and will be removed in the next major update.</strong><br/><strong>Please, use `energy_rating` field instead.</strong>"
    },
    "energy_rating": {
      "type": "string",
      "description": "Energy rating that attests to the energy efficiency of a listing."
    },
    "heating_type": {
      "type": "string",
      "description": "Type of heating."
    },
    "available_from": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "The date the listing property becomes available for occupancy. The start of the availability window."
    },
    "available_to": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "The date the listing property stops being available. The end of the availability window."
    }
  },
  "type": "object",
  "required": [
    "alert_id",
    "listing_id",
    "ref",
    "alert_type",
    "alert_subtype",
    "old_value",
    "new_value",
    "alert_date",
    "listing_uid",
    "property_id",
    "title",
    "type",
    "type_group",
    "location",
    "locations_structure",
    "address",
    "zip_code",
    "cadastral_reference",
    "coordinates",
    "condition",
    "contacts_info",
    "total_area",
    "living_area",
    "plot_area",
    "terrace_area",
    "bedrooms",
    "rooms",
    "bathrooms",
    "features",
    "construction_year",
    "operations",
    "is_bank_property",
    "is_auction_property",
    "is_new_development_property",
    "is_private_property",
    "sale_status",
    "sale_currency",
    "sale_price_base",
    "sale_price",
    "sale_price_per_sqm",
    "sale_price_per_sqm_base",
    "rent_status",
    "rent_currency",
    "rent_price_base",
    "rent_price",
    "rent_price_per_sqm",
    "rent_price_per_sqm_base",
    "rent_period",
    "agency_legal_id",
    "agency",
    "agent",
    "source_name",
    "description",
    "created_at",
    "created_at_with_photos",
    "updated_at",
    "energy_certificate",
    "energy_rating",
    "heating_type",
    "available_from",
    "available_to"
  ]
}