Skip to main content
GET
/
api
/
favorites
Get My Favorites
curl --request GET \
  --url https://api.example.com/api/favorites
{
  "success": true,
  "data": [
    {
      "id": "<string>",
      "userId": "<string>",
      "routeId": "<string>",
      "createdAt": "<string>",
      "route": {
        "id": "<string>",
        "name": "<string>",
        "slug": "<string>",
        "image": "<string>",
        "approximateDistance": "<string>",
        "level": [
          {}
        ],
        "description": "<string>",
        "_count": {
          "reviews": 123,
          "routeCalls": 123
        }
      }
    }
  ],
  "count": 123
}
Get all favorite routes for the authenticated user with route details. Users can favorite multiple routes, and this endpoint returns them all ordered by most recently added.

Authentication

This endpoint requires authentication. Include a valid Bearer token in the Authorization header.

Response

success
boolean
required
Indicates if the request was successful
data
array
required
Array of favorite objects with route details
count
integer
required
Total number of favorites

Example Request

curl -X GET https://api.losinmaduros.com/api/favorites \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Example Response

{
  "success": true,
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "userId": "user_2abc123def456",
      "routeId": "987e6543-e21b-12d3-a456-426614174000",
      "createdAt": "2026-02-10T10:00:00Z",
      "route": {
        "id": "987e6543-e21b-12d3-a456-426614174000",
        "name": "Casa de Campo",
        "slug": "casa-de-campo",
        "image": "https://example.com/routes/casa-de-campo.jpg",
        "approximateDistance": "15 km",
        "level": ["INTERMEDIATE"],
        "description": "Beautiful route through Casa de Campo park",
        "_count": {
          "reviews": 25,
          "routeCalls": 12
        }
      }
    }
  ],
  "count": 1
}

Error Responses

401 Unauthorized
Invalid or missing authentication token
{
  "success": false,
  "error": "Unauthorized"
}

Build docs developers (and LLMs) love