Skip to content

Brokerages API

The Brokerages API provides endpoints for managing real estate brokerage firms, including their branding, feature flags, and associated contacts.

Get a paginated list of brokerages.

GET /api/admin/brokerages
Auth Required
ParameterTypeDescription
pageintegerPage number (default: 1)
page_sizeintegerItems per page (default: 20, max: 100)
Terminal window
curl -H "X-API-Key: idx_your_key" \
"https://api.your-domain.com/api/admin/brokerages?page=1&page_size=10"
{
"items": [
{
"id": 1,
"slug": "sample-realty",
"name": "Sample Realty Co.",
"tagline": "Your trusted real estate partner",
"description": "Full-service brokerage in the Magic Valley...",
"address_city": "Twin Falls",
"address_state": "Idaho",
"address_state_abbr": "ID",
"feature_semantic_search": true,
"feature_map_search": true,
"logo_url": "/uploads/brokerages/sample-logo.png",
"primary_color": "#2563eb",
"created_at": "2024-01-01T00:00:00Z"
}
],
"total": 5,
"page": 1,
"page_size": 10,
"total_pages": 1
}

Retrieve a specific brokerage’s details.

GET /api/admin/brokerages/{brokerage_id}
Auth Required
ParameterTypeDescription
brokerage_idintegerBrokerage’s unique ID
{
"id": 1,
"slug": "sample-realty",
"name": "Sample Realty Co.",
"tagline": "Your trusted real estate partner",
"description": "Full-service brokerage...",
"address_street": "123 Blue Lakes Blvd",
"address_city": "Twin Falls",
"address_state": "Idaho",
"address_state_abbr": "ID",
"address_zip": "83301",
"address_country": "US",
"map_center_lat": 42.5569,
"map_center_lng": -114.4602,
"map_zoom": 12,
"map_bounds_north": 43.5,
"map_bounds_south": 42.0,
"map_bounds_east": -113.5,
"map_bounds_west": -115.5,
"feature_semantic_search": true,
"feature_map_search": true,
"feature_favorites": true,
"feature_contact_form": true,
"feature_virtual_tours": false,
"feature_mortgage_calculator": true,
"license_type": "Real Estate Brokerage",
"license_number": "DB-12345",
"logo_url": "/uploads/brokerages/sample-logo.png",
"primary_color": "#2563eb",
"social_facebook": "https://facebook.com/your-brokerage",
"social_instagram": "https://instagram.com/your-brokerage",
"franchise_affiliation": null,
"va_loans": true,
"military_specialist": true,
"website": "https://www.your-domain.com",
"hero_headline": "Find Your Dream Home in Idaho",
"hero_subtitle": "Search thousands of listings with natural language search",
"hero_search_examples": [
"modern kitchen with granite",
"large backyard near schools",
"mountain views"
],
"nav_main": [...],
"nav_footer": [...],
"disabled_at": null,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-12-20T14:22:00Z"
}

Create a new brokerage.

POST /api/admin/brokerages
Admin Only
{
"slug": "new-realty",
"name": "New Realty Group",
"tagline": "Your trusted partner in real estate",
"address_city": "Boise",
"address_state_abbr": "ID",
"feature_semantic_search": true,
"feature_map_search": true,
"primary_color": "#059669"
}
FieldTypeDescription
slugstringURL-friendly unique identifier
namestringBrokerage display name
FieldTypeDescription
address_streetstringStreet address
address_citystringCity
address_statestringFull state name
address_state_abbrstringState abbreviation
address_zipstringZIP code
address_countrystringCountry (default: US)

Returns the created brokerage object.

Update an existing brokerage.

PUT /api/admin/brokerages/{brokerage_id}
Admin Only
{
"tagline": "Updated tagline",
"primary_color": "#dc2626",
"feature_virtual_tours": true
}

All fields are optional. Only provided fields are updated.

Returns the updated brokerage object.

Soft-delete a brokerage (sets disabled_at).

DELETE /api/admin/brokerages/{brokerage_id}
Admin Only
{
"message": "Brokerage deleted successfully"
}

Semantic search for brokerages by specialties and services.

GET /api/admin/search/brokerages?q=military+relocation
Auth Required
ParameterTypeDescription
qstringSearch query (min 2 chars)
limitintegerMax results (default: 10, max: 50)
  • "military relocation specialist"
  • "RE/MAX franchise"
  • "VA loan expert in Boise"
{
"query": "military relocation",
"results": [
{
"id": 1,
"slug": "sample-realty",
"name": "Sample Realty Co.",
"tagline": "Your trusted real estate partner",
"military_specialist": true,
"va_loans": true,
"franchise_affiliation": null,
"logo_url": "/uploads/brokerages/sample-logo.png",
"similarity": 0.89
}
],
"total": 3
}

Broker contacts are the licensed individuals associated with a brokerage who can be contacted for business purposes.

GET /api/admin/broker-contacts
Auth Required
ParameterTypeDescription
brokerage_idintegerFilter by brokerage
pageintegerPage number (default: 1)
page_sizeintegerItems per page (default: 20)
{
"items": [
{
"id": 12,
"brokerage_id": 1,
"name": "John Broker",
"email": "john@example.com",
"phone": "+12085550123",
"phone_display": "(208) 555-0123",
"license_type": "Designated Broker",
"license_number": "DB-12345",
"is_primary": true,
"created_at": "2024-01-15T10:30:00Z"
}
],
"total": 3,
"page": 1,
"page_size": 20,
"total_pages": 1
}
GET /api/admin/broker-contacts/{contact_id}
POST /api/admin/broker-contacts
Broker/Admin Only
{
"brokerage_id": 1,
"name": "Jane Smith",
"email": "jane@example.com",
"phone": "+12085550456",
"license_type": "Associate Broker",
"license_number": "AB-67890",
"is_primary": false
}
PUT /api/admin/broker-contacts/{contact_id}
Broker/Admin Only
DELETE /api/admin/broker-contacts/{contact_id}
Admin Only
GET /api/admin/search/broker-contacts?q=designated+broker
ParameterTypeDescription
qstringSearch query
brokerage_idintegerFilter by brokerage
limitintegerMax results (default: 10)

These endpoints are publicly accessible without authentication.

GET /api/public/brokerage

Returns the brokerage associated with the current domain (based on Host header).

{
"id": 1,
"name": "Sample Realty Co.",
"tagline": "Your trusted real estate partner",
"logo_url": "/uploads/brokerages/sample-logo.png",
"primary_color": "#2563eb",
"address_city": "Twin Falls",
"address_state_abbr": "ID",
"social_facebook": "https://facebook.com/your-brokerage",
"social_instagram": "https://instagram.com/your-brokerage"
}
{
"detail": "Brokerage not found"
}

Status: 404 Not Found

{
"detail": "Slug already exists"
}

Status: 400 Bad Request

{
"detail": "Search service unavailable: connection refused"
}

Status: 503 Service Unavailable