Skip to content

Favorites API

All endpoints require authentication.

GET /favorites

Get the current user's saved listings with full listing details and primary image.

Response (200)

json
{
  "listings": [
    {
      "id": "uuid",
      "title": "Bright 3.5 on Plateau",
      "pricePerMonth": 145000,
      "bedrooms": 1,
      "bathrooms": 1,
      "neighborhoodName": "Le Plateau-Mont-Royal",
      "borough": "Le Plateau-Mont-Royal",
      "primaryImage": {
        "listingId": "uuid",
        "url": "/uploads/abc.jpg",
        "altText": "Main photo"
      }
    }
  ]
}

GET /favorites/check

Check which listings from a given set are favorited by the current user. Used by the frontend to show heart icons on listing cards.

Query Parameters

ParamTypeDescription
idsstringComma-separated listing UUIDs

Response (200)

json
{
  "favorited": ["uuid-1", "uuid-3"]
}

Returns an array of listing IDs that are in the user's favorites.

POST /favorites

Save a listing to favorites.

Body

json
{
  "listingId": "uuid"
}

Response (201)

json
{
  "favorite": {
    "id": "uuid",
    "userId": "uuid",
    "listingId": "uuid",
    "createdAt": "2026-02-28T00:00:00.000Z"
  }
}

DELETE /favorites/:listingId

Remove a listing from favorites.

Response (200)

json
{
  "success": true
}