EstateHub

Customer Notification Preferences API

Base URL: http://localhost:8000/api/v1
Prefix: /accounts/customers
Auth: Bearer JWT
Headers: Content-Type: application/json


1. Get Notification Preferences

Returns the authenticated customer’s notification preferences.

GET/accounts/customers/me/notification-preferences/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}

Success Example

JSON
{
  "success": true,
  "message": "Notification preferences retrieved successfully.",
  "data": {
    "preferences": {
      "conversation": true,
      "appointment": true,
      "property": true,
      "purchase": true,
      "rental": true,
      "payment": true,
      "announcements": true
    }
  }
}

Notes

  • Missing preferences default to true.

  • Only customer accounts can access this endpoint.

  • Add-on categories such as auction, investment, and agent are not supported.


2. Update Notification Preferences

Updates one or more notification preferences for the authenticated customer.

PATCH/accounts/customers/me/notification-preferences/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}

Request Body

JSON
{
  "conversation": false,
  "announcements": false
}

Success Example

JSON
{
  "success": true,
  "message": "Notification preferences updated successfully.",
  "data": {
    "preferences": {
      "conversation": false,
      "appointment": true,
      "property": true,
      "purchase": true,
      "rental": true,
      "payment": true,
      "announcements": false
    }
  }
}

Notes

  • Updates are partial; omitted preferences remain unchanged.

  • Supported preferences are conversation, appointment, property, purchase, rental, payment, and announcements.

  • Unsupported fields return 400 Bad Request.

  • Preferences persist on the customer account across sessions.

  • Notification delivery enforcement is handled separately from preference storage.


Common Success Format

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

Common Error Format

JSON
{
  "success": false,
  "errors": {
    "field": [
      "This field is not supported."
    ]
  }
}