Get All Amenities
Retrieve a list of all active amenities across all communities.Get Amenities by Community
Retrieve all amenities for a specific community. The communityId parameter is optional; if omitted or null, returns amenities without a specific community association.communityId(Guid, optional): Community unique identifier. If omitted or null, returns amenities without community association.
Get Amenity by ID
Retrieve details of a specific amenity by its unique identifier.id(Guid, required): Amenity unique identifier
200 OK- Amenity found and returned404 Not Found- Amenity with specified ID does not exist
Create Amenity
Create a new amenity for a community.201 Created status and a Location header pointing to the new resource.
Status Codes:
201 Created- Amenity created successfully400 Bad Request- Invalid input data or business rule violation (e.g., invalid community ID)
Update Amenity
Update an existing amenity’s information.id(Guid, required): Amenity unique identifier
200 OK- Amenity updated successfully400 Bad Request- Invalid input data or business rule violation404 Not Found- Amenity with specified ID does not exist
Delete Amenity
Soft delete an amenity. This operation marks the amenity as inactive rather than permanently removing it from the database, preserving historical data and relationships.id(Guid, required): Amenity unique identifier
204 No Content on successful deletion.
Status Codes:
204 No Content- Amenity deleted successfully404 Not Found- Amenity with specified ID does not exist
- This operation performs a soft delete by setting the
IsActiveflag to false - The amenity data is retained in the system for historical purposes and reporting
- Deleted amenities will not appear in standard listing queries (GET all amenities)
- Related reservations and booking history are preserved
Error Handling
All endpoints may return the following error responses:400 Bad Request
- Invalid CommunityId (community does not exist)
- Missing required fields
- Invalid data format (e.g., invalid GUID, negative capacity)
- Business rule violations
401 Unauthorized
403 Forbidden
404 Not Found
- Amenity ID does not exist
- Attempting to access a soft-deleted amenity
Best Practices
-
Amenity Creation
- Always validate that the CommunityId exists before creating an amenity
- Provide clear, descriptive names for easy identification by residents
- Include comprehensive rules to set clear expectations
- Use high-quality images (Imagen) for visual recognition in resident apps
-
Capacity Management
- Set CapacidadMaxima based on safety regulations and comfort
- Configure NumeroReservacionesSimultaneas to prevent overbooking
- Consider peak usage times when setting limits
- Review and adjust capacity settings regularly based on usage patterns
-
Cost Configuration
- Leave Costo as null for free amenities
- Set clear, transparent pricing for paid facilities
- Consider maintenance and operational costs when determining pricing
- Communicate cost changes to residents well in advance
-
Update Operations
- Fetch the current amenity data before updating to avoid overwriting recent changes
- Update only the fields that need to change
- Validate business rules before submitting updates
- Include audit information (updatedByUserId) when available
-
Deletion Strategy
- Use soft delete (DELETE endpoint) instead of hard deletion
- Never delete amenities with existing reservations
- Archive inactive amenities rather than removing them permanently
- Maintain historical records for reporting and analytics