### Webhook Request Headers Source: https://website.sweepbright.com/docs Example headers for a webhook POST request, including content type and signature for authenticity. ```text Content-Type: application/json X-Hook-Signature: "a9e7db538d4592fa5e7098bfa86d0630651435d3" ``` -------------------------------- ### Get an access token Source: https://website.sweepbright.com/docs Obtain an access token for authenticating API requests. This endpoint is used to generate a Bearer token for subsequent API calls. ```APIDOC ## POST /oauth/token ### Description Obtain an access token for authenticating API requests. This endpoint is used to generate a Bearer token for subsequent API calls. ### Method POST ### Endpoint https://docs.website.sweepbright.com/oauth/token ### Headers #### Header Parameters - **Accept** (string) - Example: application/vnd.sweepbright.v20191206+json ### Responses #### Success Response (200) OK #### Response Example ```json { "token_type": "Bearer", "expires_in": 604800, "access_token": "" } ``` ``` -------------------------------- ### Estate Data Structure (v20210723) Source: https://website.sweepbright.com/docs Example of estate data structure when certain sections are not set, using version 20210723. This version ensures empty objects instead of empty arrays for these fields to prevent validation errors. ```json { "id": "4e7b24e6-6d37-48a9-9249-0880bda99ba0", ... "legal": { "energy": {}, "regulations": {}, "legal_mentions": {}, "property_and_land": {} }, "description": {} ... } ``` -------------------------------- ### Get estate data Source: https://website.sweepbright.com/docs Retrieve detailed data for a specific estate. This endpoint can be used for standalone properties, projects, or individual units within a project. ```APIDOC ## GET /estates/{estate} ### Description Retrieve detailed data for a specific estate. This endpoint can be used for standalone properties, projects, or individual units within a project. It is only callable after the webhook has been triggered for the estate. ### Method GET ### Endpoint https://docs.website.sweepbright.com/estates/{estate} ### Parameters #### Path Parameters - **estaterequired** (string) - Required - The unique identifier of the estate (e.g., 00930234-4f4e-42f1-a42e-206273dd8c53). #### Headers - **Accept** (string) - Example: application/vnd.sweepbright.v20191206+json ### Responses #### Success Response (200) OK ### Notes on Response Structure: - For standalone properties: `is_project` is `false`, `project_id` is `null`, `properties` field is not available. - For projects: `is_project` is `true`, `properties` field is an array of property objects. - For units: `is_project` is `false`, `project_id` is the project's ID, `properties` field is not available. ``` -------------------------------- ### Property Details Sample Source: https://website.sweepbright.com/docs This snippet shows a sample JSON object representing property details. It includes basic information, amenities, sizes, permissions, rooms, images, plans, documents, features, building information, negotiator, agency commission, mandate, internal notes, occupancy status, office, buyers, vendors, settings, legal entity, and source. ```json { "number": "123", "box": "7", "addition": "ABD", "floor": 2, "country": "BE", "formatted": "Street name, Brussels", "formatted_agency": "Formatted Agency", "postal_code": "1000", "hidden": false, "amenities": [ "pool" ], "sizes": { "plot_area": { "size": 100, "unit": "sq_ft" }, "liveable_area": { "size": 100, "unit": "sq_ft" }, "loi_carrez_area": { "size": 100, "unit": "sq_ft" } }, "permissions": { "farming": false, "fishing": false, "planning": false, "construction": false }, "rooms": [ { "type": "living_room", "size_description": "Living room", "size": 100, "unit": "sq_ft", "ordinal": 1 } ], "floors": 0, "images": [ { "id": "1234-5678-9012", "filename": "my-image.jpeg", "description": "My image", "url": "http://absolute-url-to-download-image-from/image.jpg", "url_expires_on": "2017-01-01T12:12:12+00:00", "ordinal": 1 } ], "plans": [ { "id": "1234-5678-9012", "filename": "my-plan.pdf", "description": "My plan", "url": "http://absolute-url-to-download-plan-from/plan.pdf", "url_expires_on": "2017-01-01T12:12:12+00:00" } ], "documents": [ { "id": "1234-5678-9012", "filename": "my-plan.pdf", "description": "My plan", "content_type": "application/pdf", "url": "http://absolute-url-to-download-plan-from/plan.pdf", "url_expires_on": "2017-01-01T12:12:12+00:00" } ], "features": { "energy": { "gas": false, "fuel": false, "electricity": false, "heat_pump": false, "geothermal": false }, "comfort": { "home_automation": false, "water_softener": false, "fireplace": false, "walk_in_closet": false, "home_cinema": false, "wine_cellar": false, "sauna": false, "fitness_room": false, "furnished": false, "accessibility": false }, "ecology": { "double_glazing": false, "solar_panels": false, "solar_boiler": false, "rainwater_harvesting": false, "insulated_roof": false, "septic_tank": false, "triple_glazing": false }, "security": { "alarm": false, "concierge": false, "video_surveillance": false }, "heating_cooling": { "central_heating": false, "floor_heating": false, "air_conditioning": false, "individual_heating": false, "ceiling_heating": false, "wood_stove_standalone": false, "wood_stove_insert": false, "pellets_standalone": false, "pellets_insert": false, "central_heating_building": false, "district_heating": false } }, "building": { "renovation": { "year": 2012, "description": "New windows" }, "construction": { "year": 1970, "architect": "Mr. Architect", "residential_lots": 12 }, "units_of_building": 11, "number_of_floor_building": 17 }, "negotiator": { "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "phone": "+123456789", "photo_url": "http://absolute-url-to-download-photo-from/photo.jpg", "photo_url_expires_on": "2017-01-01T12:12:12+00:00" }, "agency_commission": { "fixed_fee": 500.2, "percentage": 5 }, "mandate": { "start_date": "2018-01-01", "end_date": "2019-01-01", "exclusive": false, "number": "1a2b3c" }, "internal_note": "Internal note", "occupancy": { "occupied": false, "current_rent": { "amount": 100000, "currency": "EUR" }, "available_from": "2018-01-01", "contact_details": "Available next week", "tenant_contract": { "end_date": "2018-12-31", "start_date": "2018-01-01" } }, "office": { "id": "2e8caade-eb1e-4499-994f-4aed28906826", "name": "Team 1" }, "buyers": [ { "first_name": "John", "last_name": "Doe", "email": "john@doe.com", "phone": "+123456789" } ], "vendors": [ { "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "phone": "+123456789" } ], "settings": { "reference": "internal reference" }, "properties": [ {} ], "buyer_percentage": 1, "buyer_fixed_fee": 1000, "vendor_percentage": 3, "vendor_fixed_fee": 1200, "legal_entity": { "id": "5568c79c-4aa9-4c31-a951-40b060549ead", "name": "My Legal Entity" }, "source": { "id": "data-migration", "group": "import", "software": "foobar", "reference": "abc" } } ``` -------------------------------- ### Sample Property Listing Response (200 OK) Source: https://website.sweepbright.com/docs This JSON object represents a successful response for a property listing. It includes comprehensive details about the property, its features, legal information, and pricing. ```json { "id": "69cbfdd6-b3e4-470e-a672-5c9e37fe36e9", "is_project": false, "project_id": "32ed6c2a-716f-4077-9779-2b7794e46257", "type": "apartment", "sub_type": "agricultural", "negotiation": "let", "rent_period": "month", "status": "available", "description": { "en": "Apartment with pool", "fr": "Appartement avec piscine", "nl": "Appartement met zwembad" }, "description_title": { "en": "Luxury Apartment", "fr": "Appartement de luxe", "nl": "Luxe appartement" }, "living_rooms": 1, "kitchens": 1, "bedrooms": 1, "bathrooms": 1, "toilets": 1, "showrooms": 1, "manufacturing_areas": 1, "storage_rooms": 1, "shower_rooms": 1, "kitchen_condition": "good", "bathroom_condition": "good", "garden_orientation": "N", "terrace_orientation": "N", "balcony_orientation": "N", "video_url": "http://my-video-url.be", "virtual_tour_url": "http://my-video-tour-url.be", "appointment_service_url": "http://my-calendar-url.com", "general_condition": "good", "legal": { "energy": { "epc_value": 200, "epc_category": "A++", "epc_reference": "20081101-0000000245-00000015", "total_epc_value": 1000, "energy_dpe": "A", "nabers": { "description": "Historical and current water and energy use", "type": "number", "maximum": 6, "minimum": 0 }, "nathers": { "description": "All features of a building, including location", "type": "number", "maximum": 10, "minimum": 0 }, "co2_emissions": 0, "e_level": 80, "report_electricity_gas": "conform", "report_fuel_tank": "conform", "dpe": "A", "greenhouse_emissions": "A", "estimated_energy_costs": { "minimum": 100, "maximum": 200, "year": 2018 }, "dpe_date": "2018-01-01" }, "regulations": { "building_permit": false, "priority_purchase_right": false, "subdivision_authorisation": false, "urban_planning_breach": false, "as_built_report": null, "expropriation_plan": null, "heritage_list": null, "pending_legal_proceedings": null, "registered_building": null, "site_untapped_activity": null, "urban_planning_certificate": null, "asbestos_certificate": null, "asbestos_certificate_reference": "ref-001", "zone_subject_to_rent_control": false, "renovation_obligation": false, "ongoing_litigation": false, "georisk_zone": false }, "legal_mentions": { "en": "Legal regulations English", "fr": "Legal regulations French", "nl": "Legal regulations Dutch" }, "property_and_land": { "purchased_year": "1987", "cadastral_income": 785, "land_use_designation": "agricultural", "flood_risk": "no_flood_risk_area", "flood_risk_plot_score": "A", "flood_risk_building_score": "A" } }, "auction": { "start_date": "2018-01-01T10:00:00+00:00" }, "open_homes": [ { "start_date": "2018-05-26T10:00:00+00:00", "end_date": "2018-05-26T10:00:00+00:00" } ], "price": { "amount": 100000, "currency": "EUR", "hidden": false }, "price_negotiated": 100000, "price_costs": { "en": "Free text field English", "fr": "Free text field French", "nl": "Free text field Dutch" }, "price_taxes": { "en": "Free text field English", "fr": "Free text field French", "nl": "Free text field Dutch" }, "price_vat_regime": 55, "price_yearly_budgeted_building_costs": { "amount": 100000, "currency": "EUR" }, "price_property_taxes": { "amount": 200000, "currency": "EUR" }, "price_recurring_costs": { "amount": 300000, "currency": "EUR" }, "price_guarantee": { "amount": 300000, "currency": "EUR" }, "price_inventory_report_cost": { "amount": 400000, "currency": "EUR" }, "price_reference_rent": { "amount": 500000, "currency": "EUR" }, "price_base_rent": { "amount": 600000, "currency": "EUR" }, "price_rent_supplement": { "amount": 700000, "currency": "EUR" }, "price_life_annuity": { "advance": { "amount": 800000, "currency": "EUR" }, "applicable": false, "monthly_rent": { "amount": 900000, "currency": "EUR" }, "maximum_duration": 10 }, "custom_price": "Price available on request", "location": { "geo": { "latitude": 1.2345, "longitude": 1.2345 }, "city": "Brussels", "street": "Street name", "street_2": "Street name" } } ``` -------------------------------- ### Access Token Response (v20191206) Source: https://website.sweepbright.com/docs Sample response for obtaining an access token using version 20191206. This token is required for authenticating subsequent API requests. ```json { "token_type": "Bearer", "expires_in": 604800, "access_token": "" } ``` -------------------------------- ### Send owner request Source: https://website.sweepbright.com/docs Creates or updates an owner lead. If an ID or email exists, the owner is updated; otherwise, a new owner lead is created. Requires an Accept header and a JSON request body. ```APIDOC ## Send owner request ### Description Creates or updates an owner lead. If an ID is provided and an existing owner is found (by ID or email), it will be updated. If no ID is provided, a random one will be generated and a new owner lead will be created. ### Method POST (Implied by 'Creates or updates') ### Endpoint (Endpoint not explicitly provided in source, inferred as related to owners) ### Parameters #### Header Parameters - **Accept** (string) - Required - Specifies the desired response format, e.g., `application/vnd.sweepbright.v20191206+json`. #### Request Body schema: application/json - **id** (string) - Optional - The ID of the owner. - **first_name** (string) - Required - **last_name** (string) - Required - **email** (string) - Required - **phone** (string) - Required - **message** (string) - Required - **pronouns** (string or null) - Optional - Enum: "male", "female", "neutral", null. - **office_id** (string) - Optional - The ID of the office. ``` -------------------------------- ### Localized Data Structure (v1) Source: https://website.sweepbright.com/docs This JSON structure shows the localized fields for description and legal mentions as they were in API version 1. It highlights the inconsistent formatting across different property types. ```json "description_title": { "en": "english_title", "fr": "french_title", "nl": "dutch_title" }, "description": { "en": "english_desc", "fr": "french_desc", "nl": "dutch_desc" }, "price_costs": { "en": "english_price_costs", "fr": "french_price_costs", "nl": "dutch_price_costs" }, "price_taxes": { "en": "english_price_taxes", "fr": "french_price_taxes", "nl": "dutch_price_taxes" } "legal_mentions": { "en": "english_legal_mentions", "fr": "french_legal_mentions", "nl": "dutch_legal_mentions" } ``` -------------------------------- ### Send general or property specific leads Source: https://website.sweepbright.com/docs Sends general contact requests or leads for a specific property. Supports various property types and preferences. Requires an Accept header and a JSON request body. ```APIDOC ## POST /contacts ### Description Sends general contact requests or leads for a specific property. If `property_id` is not provided, it's a general request. If `property_id` is provided, it's a request for a specific property. ### Method POST ### Endpoint `/contacts` ### Parameters #### Header Parameters - **Accept** (string) - Required - Specifies the desired response format, e.g., `application/vnd.sweepbright.v20191206+json`. #### Request Body schema: application/json - **first_name** (string) - Required - **last_name** (string) - Required - **email** (string) - Required - **phone** (string) - Required - **message** (string) - Required - **locale** (string) - Optional - Enum: "nl", "fr", "en" - **property_id** (string) - Optional - The ID of the property for a specific lead. - **preferences** (object) - Optional - User preferences. - **location_preference** (object) - Optional - Preferred location details. - **pronouns** (string or null) - Optional - Enum: "male", "female", "neutral", null. - **office_id** (string) - Optional - The ID of the office. ### Request Example ```json { "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "phone": "+123456789", "message": "I am looking for a nice house for my family", "locale": "nl", "property_id": "5803063b-aae6-49b4-8aaa-1c03f0e80cca" } ``` ### Responses #### Success Response (201) Created #### Success Response (202) Accepted #### Error Response (422) Unprocessable Entity. This may occur if the provided data fails validation, for example, if the email field is missing. ``` -------------------------------- ### Request Payload for Sending General or Property Specific Leads Source: https://website.sweepbright.com/docs This JSON payload is used to send leads, either general or for a specific property. It includes contact information and an optional property ID and locale. ```json { "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "phone": "+123456789", "message": "I am looking for a nice house for my family", "locale": "nl", "property_id": "5803063b-aae6-49b4-8aaa-1c03f0e80cca" } ``` -------------------------------- ### Create Contact Payload Source: https://website.sweepbright.com/docs This is the JSON payload structure for creating a new contact. ```json { "id": "078e0819-7574-42df-a2a0-3aa9c9c69bc4", "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "phone": "+123456789", "message": "I want to sell my apartment", "pronouns": "male", "office_id": "ccb1deac-60d5-4ca5-b507-76faa5fef291" } ``` -------------------------------- ### Create Contact Owner Source: https://website.sweepbright.com/docs Creates a new contact owner with the provided details. Supports JSON payload for contact information. ```APIDOC ## POST /contacts/owners ### Description Creates a new contact owner. ### Method POST ### Endpoint https://docs.website.sweepbright.com/contacts/owners ### Parameters #### Request Body - **id** (string) - Required - Unique identifier for the contact. - **first_name** (string) - Required - The first name of the contact. - **last_name** (string) - Required - The last name of the contact. - **email** (string) - Required - The email address of the contact. - **phone** (string) - Optional - The phone number of the contact. - **message** (string) - Optional - A message associated with the contact. - **pronouns** (string) - Optional - The pronouns of the contact. - **office_id** (string) - Required - The ID of the office associated with the contact. ### Request Example { "id": "078e0819-7574-42df-a2a0-3aa9c9c69bc4", "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "phone": "+123456789", "message": "I want to sell my apartment", "pronouns": "male", "office_id": "ccb1deac-60d5-4ca5-b507-76faa5fef291" } ### Response #### Success Response (201) Created #### Error Response (422) Unprocessable Entity { "code": 422, "message": "The given data failed to pass validation.", "errors": { "email": [ "The email field is required." ] } } ``` -------------------------------- ### Unprocessable Entity Response for Setting Estate URL Source: https://website.sweepbright.com/docs This JSON structure represents an error response when the provided data fails validation for setting an estate's URL. It indicates that the 'url' field is required. ```json { "code": 422, "message": "The given data failed to pass validation.", "errors": { "url": [ "The url field is required." ] } } ``` -------------------------------- ### Send contact request for an estate Source: https://website.sweepbright.com/docs Deprecated endpoint for sending contact requests for an estate. Use the `/contacts` endpoint instead. It requires estate ID, contact details, and an Accept header. ```APIDOC ## POST /estates/{estate}/contacts (Deprecated) ### Description Deprecated endpoint for sending contact requests for a specific estate. Please use the `/contacts` endpoint for new implementations. ### Method POST ### Endpoint `/estates/{estate}/contacts` ### Parameters #### Path Parameters - **estaterequired** (string) - Required - The ID of the estate. #### Header Parameters - **Accept** (string) - Required - Specifies the desired response format, e.g., `application/vnd.sweepbright.v20191206+json`. #### Request Body schema: application/json - **first_name** (string) - Required - **last_name** (string) - Required - **email** (string) - Required - **phone** (string) - Required - **message** (string) - Required - **locale** (string) - Optional - Enum: "nl", "fr", "en" ### Request Example ```json { "first_name": "John", "last_name": "Doe", "email": "john.doe.assigned@example.com", "phone": "+349999999", "message": "Hello, I'd like more info about this.", "locale": "nl" } ``` ### Responses #### Success Response (201) Created #### Error Response (422) Unprocessable Entity. This may occur if the provided data fails validation, for example, if the email field is missing. ``` -------------------------------- ### Request Payload for Sending Contact Request (Deprecated) Source: https://website.sweepbright.com/docs This is a sample JSON payload for the deprecated endpoint to send a contact request for an estate. It includes contact details and an optional locale. ```json { "first_name": "John", "last_name": "Doe", "email": "john.doe.assigned@example.com", "phone": "+349999999", "message": "Hello, I'd like more info about this.", "locale": "nl" } ``` -------------------------------- ### Set URL for an estate Source: https://website.sweepbright.com/docs Updates the URL associated with a specific estate. This endpoint requires an estate ID in the path and an Accept header. ```APIDOC ## PUT /estates/{estate}/url ### Description Updates the URL associated with a specific estate. ### Method PUT ### Endpoint `/estates/{estate}/url` ### Parameters #### Path Parameters - **estaterequired** (string) - Required - The ID of the estate. #### Header Parameters - **Accept** (string) - Required - Specifies the desired response format, e.g., `application/vnd.sweepbright.v20191206+json`. ### Responses #### Success Response (204) No Content #### Error Response (422) Unprocessable Entity. This may occur if the provided data fails validation, for example, if the URL field is missing. ``` -------------------------------- ### Webhook for Estate Changes Source: https://website.sweepbright.com/docs Configures a webhook URL to receive notifications for estate changes (added, updated, deleted). ```APIDOC ## Webhooks ### Description A webhook URL can be defined per company, which will be called every time a change of an estate is published. SweepBright will send a `POST` request with JSON metadata to the configured URL. A 200 response is expected. ### Confirming hook authenticity You can confirm the webhook authenticity by calculating a HMAC hash using the SHA-1 hashing algorithm, the JSON payload of the webhook and your OAuth secret key. The calculated hash should be the same as the one found in the `X-Hook-Signature` header. ### Webhook during development When building the integration, SweepBright will ask you to provide a test webhook to set up your test company. Make sure that the webhook you provide is available on the internet and is not a local webhook. Tools like ngrok can be used to tunnel a publicly available link to your localhost. #### Webhook body [POST] ##### Request - **Headers** - Content-Type: application/json - X-Hook-Signature: "a9e7db538d4592fa5e7098bfa86d0630651435d3" - **Body** { "event": "estate-added|estate-updated|estate-deleted", "estate_id": "", "happened_at": "2017-01-01T10:10:10", "company_id": "3186772c-5ab7-42fe-a8cc-ea1ef8c368d3" } ##### Response 200 OK ``` -------------------------------- ### Estate Data Structure (v20191206) Source: https://website.sweepbright.com/docs This JSON snippet shows the updated estate data structure for API version 20191206. It introduces a nested 'legal' object containing more detailed information about energy, regulations, legal mentions, and property specifics. ```json { "id": "4e7b24e6-6d37-48a9-9249-0880bda99ba0", ... "legal": { "energy": { "e_level": "E90", "epc_value": 123, "epc_category": "A+", "co2_emissions": 999, "epc_reference": "this-is-the-epc-ref", "total_epc_value": 1000, "report_fuel_tank": "conform", "report_electricity_gas": "conform" }, "regulations": { "heritage_list": true, "as_built_report": true, "building_permit": true, "expropriation_plan": true, "registered_building": true, "urban_planning_breach": true, "site_untapped_activity": true, "priority_purchase_right": true, "pending_legal_proceedings": true, "subdivision_authorisation": true, "urban_planning_certificate": true }, "legal_mentions": { "en": "English legal mentions", "fr": "Mentions legales francaises", "nl": "Nederlandstalige legale vermeldingen" }, "property_and_land": { "flood_risk": "effective_flood_sensitive_area", "purchased_year": 1987, "cadastral_income": 785, "land_use_designation": "natural_reserve" } }, ... } ``` -------------------------------- ### Unprocessable Entity Response for Contact Request (Deprecated) Source: https://website.sweepbright.com/docs This JSON structure represents an error response when the provided data fails validation for sending a contact request. It indicates that the 'email' field is required. ```json { "code": 422, "message": "The given data failed to pass validation.", "errors": { "email": [ "The email field is required." ] } } ``` -------------------------------- ### Webhook Request Body Source: https://website.sweepbright.com/docs The JSON payload sent in a webhook POST request, containing event details and timestamps. ```json { "event": "estate-added|estate-updated|estate-deleted", "estate_id": "", "happened_at": "2017-01-01T10:10:10", "company_id": "3186772c-5ab7-42fe-a8cc-ea1ef8c368d3" } ``` -------------------------------- ### Estate Data Structure (v20191121) Source: https://website.sweepbright.com/docs This JSON snippet represents the structure of estate data when using API version 20191121. It includes fields like 'epc_value', 'epc_category', and 'regulations'. ```json { "id": "4e7b24e6-6d37-48a9-9249-0880bda99ba0", ... "epc_value": 123, "epc_category": "A+", "epc_reference": "this-is-the-epc-ref", "regulations": { "building_permit": true, "urban_planning_breach": true, "subdivision_authorisation": true, "preemptive_right": true, "flood_risk_area": true }, "cadastral_income": 785, "legal_mentions": { "en": "English legal mentions", "fr": "Mentions legales francaises", "nl": "Nederlandstalige legale vermeldingen" }, ... } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.