Skip to Content
HomeLink Hub
Wishlist

Toggle a listing in my wishlist

POST
/api/v1/wishlist/toggle

Access: Bearer token required.

Adds the property to the caller's wishlist if it is absent, removes it if it is present. data.added tells you which happened (true = added, false = removed) and data.wishlist is the full list of property ids afterwards. The property must exist (even to remove it), but its status is not checked.

Send the body as JSON with Content-Type: application/json: a request with no parsed body fails with a 500 instead of the 400 below, because the handler reads req.body unguarded. Success responses from the wishlist endpoints do not use the standard envelope: there is no top-level status field, and the message is repeated inside data. Errors do use the standard error envelope.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Access token returned by sign-in. Send it as Authorization: Bearer <token>.

Request Body

application/json
  1. body
propertyId*string

ObjectId of the property.

Response Body

  • The property was not in the wishlist and has been added.
  • The property was in the wishlist and has been removed.
application/json
  1. response
success*boolean
message*string
data*
Example Request
curl -X POST 'http://localhost:4000/api/v1/wishlist/toggle' \  -H 'Content-Type: application/json' \  -d '{  "propertyId": "665f1c2e9b1d4a0012ab34cd"}'
Example Response
{  "success": true,  "message": "Property added to wishlist",  "data": {    "message": "Property added to wishlist",    "added": true,    "wishlist": [      "665f1c2e9b1d4a0012ab34cd"    ]  }}