# Favorites

User favorite management (requires authentication). Users can save their favorite places for quick access.

## Add/remove place from favorites 🔒

> Add or remove a place from the authenticated user's favorites list.\
> \
> \*\*Idempotent:\*\* Calling this endpoint with the same favorite status multiple times has the same effect as calling it once.\
> \
> Returns updated favorite count for the place and current user status.<br>

```json
{"openapi":"3.0.3","info":{"title":"Decentraland Places API","version":"1.0.0"},"tags":[{"name":"Favorites","description":"User favorite management (requires authentication).\nUsers can save their favorite places for quick access.\n"}],"servers":[{"url":"https://places.decentraland.org/api","description":"Production server"},{"url":"http://localhost:4000/api","description":"Development server"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Decentraland authentication token obtained from the Decentraland SDK or auth services.\n\nTo authenticate:\n1. Use Decentraland's authentication SDK in your application\n2. Get the auth token from the SDK\n3. Include in requests: `Authorization: Bearer <token>`\n"}}},"paths":{"/places/{place_id}/favorites":{"patch":{"tags":["Favorites"],"summary":"Add/remove place from favorites 🔒","description":"Add or remove a place from the authenticated user's favorites list.\n\n**Idempotent:** Calling this endpoint with the same favorite status multiple times has the same effect as calling it once.\n\nReturns updated favorite count for the place and current user status.\n","operationId":"updateFavorite","parameters":[{"name":"place_id","in":"path","required":true,"description":"UUID of the place","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["favorites"],"properties":{"favorites":{"type":"boolean","description":"Set to true to add place to favorites, false to remove.\nIdempotent - safe to call multiple times.\n"}}}}}},"responses":{"200":{"description":"Favorite status updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"data":{"type":"object","properties":{"favorites":{"type":"integer","minimum":0,"description":"Updated total favorite count for the place"},"user_favorite":{"type":"boolean","description":"Current user's favorite status"}}}}}}}},"401":{"description":"Unauthorized - Missing or invalid authentication token","content":{"application/json":{"schema":{"type":"object","description":"Standard error response","properties":{"ok":{"type":"boolean","description":"Always false for errors"},"error":{"type":"string","description":"Human-readable error message"}}}}}},"404":{"description":"Resource not found - Place/world doesn't exist or is disabled","content":{"application/json":{"schema":{"type":"object","description":"Standard error response","properties":{"ok":{"type":"boolean","description":"Always false for errors"},"error":{"type":"string","description":"Human-readable error message"}}}}}}}}}}}
```
