EstateHub

Customer Saved Searches API

Base URL: http://localhost:8000/api/v1
Prefix: /customers
Auth: Customer access token required
Headers: Content-Type: application/json


1. List Saved Searches

Retrieve all saved searches belonging to the authenticated customer.

GET/customers/saved-searches/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}

Success Example

JSON
{
  "success": true,
  "message": "Saved searches retrieved successfully.",
  "data": {
    "saved_searches": [
      {
        "id": "7d9f6b63-2d8e-4d37-ae56-7efb35b4f8a1",
        "name": "Downtown rentals",
        "filters_json": {
          "city": "Austin",
          "area_name": "Downtown",
          "purpose": "rent",
          "min_price": 1500,
          "max_price": 4000,
          "bedrooms": 2,
          "amenities": [
            "parking"
          ]
        },
        "alert_enabled": true,
        "last_alerted_at": null,
        "created_at": "2026-09-24T08:30:00Z",
        "updated_at": "2026-09-24T08:30:00Z"
      }
    ]
  }
}

Create a saved property search with optional alert settings.

POST/customers/saved-searches/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}

Request Body

JSON
{
  "name": "Downtown rentals",
  "filters_json": {
    "city": "Austin",
    "area_name": "Downtown",
    "purpose": "rent",
    "min_price": 1500,
    "max_price": 4000,
    "bedrooms": 2,
    "amenities": [
      "parking"
    ]
  },
  "alert_enabled": true
}

Success Example

JSON
{
  "success": true,
  "message": "Saved search created successfully.",
  "data": {
    "saved_search": {
      "id": "7d9f6b63-2d8e-4d37-ae56-7efb35b4f8a1",
      "name": "Downtown rentals",
      "filters_json": {
        "city": "Austin",
        "area_name": "Downtown",
        "purpose": "rent",
        "min_price": 1500,
        "max_price": 4000,
        "bedrooms": 2,
        "amenities": [
          "parking"
        ]
      },
      "alert_enabled": true,
      "last_alerted_at": null,
      "created_at": "2026-09-24T08:30:00Z",
      "updated_at": "2026-09-24T08:30:00Z"
    }
  }
}

Status Code: 201 Created

Notes

  • name is required.

  • filters_json must be a JSON object.

  • filters_json and alert_enabled are optional.

  • Saved searches only belong to the authenticated customer.


3. Get Saved Search Details

Retrieve one saved search owned by the authenticated customer.

GET/customers/saved-searches/{saved_search_id}/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}

Success Example

JSON
{
  "success": true,
  "message": "Saved search retrieved successfully.",
  "data": {
    "saved_search": {
      "id": "7d9f6b63-2d8e-4d37-ae56-7efb35b4f8a1",
      "name": "Downtown rentals",
      "filters_json": {
        "city": "Austin",
        "purpose": "rent"
      },
      "alert_enabled": true,
      "last_alerted_at": null,
      "created_at": "2026-09-24T08:30:00Z",
      "updated_at": "2026-09-24T08:30:00Z"
    }
  }
}

Update one or more saved-search fields.

PATCH/customers/saved-searches/{saved_search_id}/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}

Request Body

JSON
{
  "name": "Updated Downtown rentals",
  "filters_json": {
    "city": "Austin",
    "area_name": "Downtown",
    "purpose": "rent",
    "max_price": 5000
  },
  "alert_enabled": false
}

Success Example

JSON
{
  "success": true,
  "message": "Saved search updated successfully.",
  "data": {
    "saved_search": {
      "id": "7d9f6b63-2d8e-4d37-ae56-7efb35b4f8a1",
      "name": "Updated Downtown rentals",
      "filters_json": {
        "city": "Austin",
        "area_name": "Downtown",
        "purpose": "rent",
        "max_price": 5000
      },
      "alert_enabled": false,
      "last_alerted_at": null,
      "created_at": "2026-09-24T08:30:00Z",
      "updated_at": "2026-09-24T09:00:00Z"
    }
  }
}

Notes

  • All fields are optional because this endpoint supports partial updates.

  • filters_json, when supplied, must be a JSON object.

  • id, last_alerted_at, created_at, and updated_at are read-only.


Delete one saved search owned by the authenticated customer.

DELETE/customers/saved-searches/{saved_search_id}/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}

Success Example

JSON
{
  "success": true,
  "message": "Saved search deleted successfully.",
  "data": {}
}

6. Get Saved Search Results

Retrieve available properties matching the saved search filters.

GET/customers/saved-searches/{saved_search_id}/results/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}

Query Parameters

ParameterTypeDescription
pageintegerPage number. Defaults to 1.
page_sizeintegerNumber of results per page, up to 50.

Success Example

JSON
{
  "success": true,
  "message": "Saved search results retrieved successfully.",
  "data": {
    "properties": {
      "count": 1,
      "next": null,
      "previous": null,
      "results": [
        {
          "id": "d4f4baf5-2d3f-4d64-8a0e-5f65a6c5c0c2",
          "title": "Modern Apartment in Downtown",
          "slug": "modern-apartment-in-downtown",
          "property_type": "apartment",
          "purpose": "rent",
          "price": "3250.00",
          "currency": "USD",
          "city": "Austin",
          "area_name": "Downtown",
          "bedrooms": 2,
          "bathrooms": 2,
          "area_size": "1250.00",
          "area_unit": "sqft",
          "ownership_verified": true,
          "is_featured": false,
          "is_trending": true,
          "primary_media": null,
          "amenities": [],
          "approved_at": "2026-09-20T10:00:00Z",
          "created_at": "2026-09-18T08:00:00Z"
        }
      ]
    }
  }
}

Notes

  • Results include only available properties for buying or renting.

  • Results are filtered using the saved search’s filters_json.

  • Pagination supports a maximum page size of 50.


7. Toggle Saved Search Alerts

Enable or disable alerts for a saved search.

POST/customers/saved-searches/{saved_search_id}/toggle-alert/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}

Request Body

JSON
{
  "alert_enabled": true
}

Success Example

JSON
{
  "success": true,
  "message": "Saved search alert status updated successfully.",
  "data": {
    "saved_search": {
      "id": "7d9f6b63-2d8e-4d37-ae56-7efb35b4f8a1",
      "name": "Downtown rentals",
      "filters_json": {
        "city": "Austin",
        "purpose": "rent"
      },
      "alert_enabled": true,
      "last_alerted_at": null,
      "created_at": "2026-09-24T08:30:00Z",
      "updated_at": "2026-09-24T09:15:00Z"
    }
  }
}

Notes

  • alert_enabled is required.

  • Accepted values are true or false.

  • This endpoint updates only the alert status.


Common Success Format

JSON
{
  "success": true,
  "message": "Operation completed successfully.",
  "data": {}
}

Common Error Format

JSON
{
  "success": false,
  "message": "Validation failed.",
  "errors": {
    "filters_json": [
      "Saved search filters must be an object."
    ]
  }
}

For an unauthenticated request:

JSON
{
  "success": false,
  "message": "Authentication credentials were not provided.",
  "errors": {}
}

For a missing saved search:

JSON
{
  "success": false,
  "message": "Saved search not found.",
  "errors": {}
}