-
Notifications
You must be signed in to change notification settings - Fork 0
Lead
The Lead API is a service that integrates property valuation data with Vitec CRM, enabling automated lead generation from RealAI property valuations. When a customer receives a property valuation, their information along with property details is sent to real estate agents via the Vitec CRM system.
| Field name | Type | Example | Description | Used for | Importance |
|---|---|---|---|---|---|
| customer_id | string | 'ABC123' | Unique identifier for the Vitec customer account | All | Necessary |
| lead_id | string | 'LEAD456' | Lead source identifier in Vitec CRM | All | Necessary |
| Field name | Type | Example | Description | Used for | Importance |
|---|---|---|---|---|---|
| first_name | string | 'Erik' | First name of the lead contact | All | Necessary |
| last_name | string | 'Andersson' | Last name of the lead contact | All | Necessary |
| string | 'erik.andersson@example.com' | Email address of the lead contact | All | Necessary | |
| phone | string | '+46701234567' | Phone number of the lead contact | All | Necessary |
| address | string | 'Storgatan 12' | Street address of the property | All | Necessary |
| zip_code | string | '11422' | Postal code of the property | All | Necessary |
| city | string | 'Stockholm' | City where the property is located | All | Optional |
| custom_field | string | 'Bortrest till 1 mars' | Optional text message to the agent | All | Optional |
| qualification | string | 'Angett flytt inom 12 mån' | Information about how the lead is qualified. Use standard text, see below! | All | Necessary |
| Field name | Type | Example | Description | Used for | Importance |
|---|---|---|---|---|---|
| valuation | int | 5500000 | Valuation amount in SEK from Real AI AVM | All | Necessary |
| property_sub_type | string | 'SingleFamilyResidence' | Building structure type. Accepted values are 'Apartment', 'SingleFamilyResidence', 'Townhouse', 'Duplex', 'Terraced' | All | Necessary |
| living_area | float | 150.0 | Living area of home in square meters | All | High |
| rooms | string | '4' | Number of rooms in home | Apartments | Medium |
| secondary_area | float | 40.0 | Secondary area (e.g., basement) in square meters | Houses | Medium |
| lot_size_area | float | 800.0 | Lot area in square meters | Houses | Medium |
| year_built | string | '1992' | Building construction year | All | Medium |
| occupant_type | string | 'Owner' | Ownership type. Accepted values are 'Owner', 'TenantOwnership' | All | Medium |
| association_fee | float | 3500.0 | Monthly co-operation member fee in SEK | TenantOwnership | Medium |
The API follows the same property type classification as Real AI's AVM:
- Apartment (lägenhet): Apartment units
- SingleFamilyResidence (villa): Detached single-family homes
- Townhouse (radhus): Row houses
- Terraced (kedjehus): Chain houses (connected by a garage or similar structure)
- Duplex (parhus): Semi-detached houses
This is a required message to the agent, with information on how the lead is qualified. We have chosen to use a string format to be flexible, but this might change later. The text is sent as it is to the agent, so at the moment we have to use Swedish for consistency with the end users.
We recommend you to use one of these two alternatives:
- 'Har angett att försäljning är trolig inom 12 mån.'
- 'Har inte angett att försäljning är trolig inom 12 mån.'
If you want to, you can also use a qualifier for this, but it is not necessary at the moment:
- 'Ska sälja snart och vill anlita en mäklare'
The API automatically generates a Swedish-language message sent to the Vitec CRM. The message includes:
- Lead source notification from Real AI
- Customer name and valuation amount
- Valuation date
- Property type in Swedish
- Living area (and number of rooms if provided)
- Secondary area and lot size (for houses)
- Monthly association fee (for tenant ownership)
- Construction year (if provided)
Example message:
Du har fått ett lead från Real AI. Erik Andersson fick en värdering på 5 500 000 kr den 2026-01-27 av en villa med 150.0 m² boarea. Biarean är 40.0 m² och tomtarean 800.0 m². Byggåret är 1992.
Creates a new lead in Vitec CRM with customer, person, and property information.
Response:
{
"status": "OK",
"message": "Response from Vitec API"
}import requests
import json
# API Configuration
API_URL = "https://api.modelmarket.io/v1/models/normal/realai/lead"
# Prepare lead data
lead_data = {
"customer": {
"customer_id": "M12198",
"lead_id": "LET5NSWK7L2KKNJDVJH98"
},
"person": {
"first_name": "Erik",
"last_name": "Andersson",
"email": "erik.andersson@example.com",
"phone": "+46701234567",
"address": "Storgatan 12",
"zip_code": "11422",
"city": "Stockholm"
},
"property": {
"valuation": 5500000,
"property_sub_type": "SingleFamilyResidence",
"living_area": 150.0,
"secondary_area": 40.0,
"lot_size_area": 800.0,
"year_built": "1992",
"occupant_type": "Owner",
"rooms": None,
"association_fee": None
}
}
# Send lead
response = requests.post(
f"{API_URL}",
headers={
'accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + "{ACCESS_TOKEN}"
},
json=lead_data
)
# Print result
result = response.json()
print("Status:", result['status'])
print("Message:", result['message'])-
Getting Started
-
Models
- General Model Description*
- Prediction models
-
Data
-
Widget
-
Legal