Response
Success Response 200
{
"success": true,
"count": 2,
"properties": [
{
"id": "23caeb23-1ef6-4d5d-945f-ac25e0e5d651",
"claimId": "2ab41281-12f8-44a9-a9c7-1cbb00b9b3f2",
"address": "123 Test Street",
"status": "NEW",
...
}
]
}
Error Responses
Validation Error 400
{
"success": false,
"error": "Validation failed",
"details": [...]
}
Unauthorized 401
{
"success": false,
"error": "Unauthorized - Invalid or missing API key"
}
Claim Not Found 404
{
"success": false,
"error": "Claim not found with ID: ..."
}
Example Usage
cURL
Bash
curl -X POST https://app.havnly.ai/api/webhooks/external-properties \
-H "Content-Type: application/json" \
-H "x-api-key: uZMXc8dFLfrifpEXsvLSjG0IhGxjBYxVyCCxuUjv60" \
-d '{
"claimId": "2ab41281-12f8-44a9-a9c7-1cbb00b9b3f2",
"properties": [
{
"externalId": "listing-123",
"source": "zillow",
"address": "123 Main Street",
"city": "Los Angeles",
"state": "CA",
"zipCode": "90001",
"bedrooms": 3,
"bathrooms": 2,
"price": 2500,
"priceType": "monthly",
"contactEmail": "landlord@example.com",
"contactPhone": "+1-555-123-4567"
}
]
}'
JavaScript / Node.js
JavaScript
const response = await fetch('/api/webhooks/external-properties', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'uZMXc8dFLfrifpEXsvLSjG0IhGxjBYxVyCCxuUjv60',
},
body: JSON.stringify({
claimId: '2ab41281-12f8-44a9-a9c7-1cbb00b9b3f2',
properties: [
{
externalId: 'listing-123',
source: 'automation-tool',
address: '123 Main Street',
city: 'Los Angeles',
state: 'CA',
bedrooms: 3,
bathrooms: 2,
price: 2500,
priceType: 'monthly',
contactEmail: 'landlord@example.com',
contactPhone: '+1-555-123-4567',
},
],
}),
});
const data = await response.json();
console.log(data);
Python
Python
import requests
response = requests.post(
'https://app.havnly.ai/api/webhooks/external-properties',
headers={
'x-api-key': 'uZMXc8dFLfrifpEXsvLSjG0IhGxjBYxVyCCxuUjv60',
},
json={
'claimId': '2ab41281-12f8-44a9-a9c7-1cbb00b9b3f2',
'properties': [
{
'externalId': 'listing-123',
'source': 'automation-tool',
'address': '123 Main Street',
'city': 'Los Angeles',
'state': 'CA',
'bedrooms': 3,
'bathrooms': 2,
'price': 2500,
'priceType': 'monthly',
'contactEmail': 'landlord@example.com',
'contactPhone': '+1-555-123-4567',
}
]
}
)
print(response.json())