Webhooks (Beta)
Enable real-time notifications instead of polling.
Supported Events
lead.registered- New lead capturedlead.status_changed- Lead status updatedproperty.status_changed- Property listing status changedproperty.price_changed- Price updatedopen_house.scheduled- Open house createdopen_house.cancelled- Open house cancelled
Webhook Setup
- Configure endpoint in Spacio dashboard
- Spacio will POST events to your URL
- Respond with 200 status within 10 seconds
Webhook Payload
{
"event": "lead.registered",
"timestamp": "2024-01-15T14:30:00Z",
"data": {
"registrant_id": "reg_123",
"property_id": "prop_456",
"email": "buyer@example.com"
},
"signature": "sha256_hash"
}
Verification
Verify webhook authenticity:
import hmac
import hashlib
def verify_webhook(payload, signature, secret):
expected = hmac.new(
secret.encode(),
payload.encode(),
hashlib.sha256
).hexdigest()
return hmac.compare_digest(signature, expected)
Retry Policy
Spacio retries failed deliveries:
- First attempt: Immediate
- 2nd-4th attempts: Exponential backoff
- Max 24 hour window
Notification Preferences
Configure which events to receive in dashboard:
- Email notifications
- SMS alerts
- Webhook deliveries
- Frequency preferences
Best Practices
- Respond quickly - 10 second timeout
- Idempotency - Handle duplicate events
- Queue processing - Don't process synchronously
- Verify signature - Ensure authenticity
- Log all webhooks - For debugging