Overview
The Housing Management API provides endpoints for creating, reading, updating, and deleting housing listings (hotels, accommodations). It also includes endpoints for managing housing tags and images.All endpoints require JWT authentication via the
Authorization: Bearer {token} header.Get All Houses
Retrieve a list of all housing listings in the system.Response
Array of HousingDTO objects
Example Response
Example Response
Status Codes
| Code | Description |
|---|---|
| 200 | Successfully retrieved list of houses |
| 403 | Forbidden - Access denied |
Get House by ID
Retrieve a specific housing listing by its code (ID).Code/ID of the house to retrieve (e.g., 1)
Response
Returns a single HousingDTO object with all housing details.Example Response
Example Response
Status Codes
| Code | Description |
|---|---|
| 200 | Successfully retrieved house |
| 404 | House not found |
| 403 | Forbidden - Access denied |
Create House
Create a new housing listing with the provided details.Request Body
Physical location/address of the accommodation
Name of the housing/hotel
Price per night
Detailed description of the accommodation
Star rating from 1 to 5
Approval status (typically false for new listings, requires admin approval)
Array of Tag objects representing amenities/features
Response
Returns the created housing listing with an auto-generated code.Example Response
Example Response
Status Codes
| Code | Description |
|---|---|
| 201 | House created successfully |
| 400 | Invalid input |
| 403 | Forbidden - Access denied |
Update House
Update an existing housing listing.Code/ID of the house to update (e.g., 1)
Request Body
All HousingDTO fields can be updated (see Create House for field descriptions).Response
Returns the updated housing listing.Example Response
Example Response
Status Codes
| Code | Description |
|---|---|
| 200 | House updated successfully |
| 404 | House not found |
| 400 | Invalid input |
| 403 | Forbidden - Access denied |
Delete House
Delete a housing listing by its code.Code/ID of the house to delete (e.g., 1)
Response
No content is returned on successful deletion.Status Codes
| Code | Description |
|---|---|
| 204 | House deleted successfully |
| 404 | House not found |
| 403 | Forbidden - Access denied |
Get Tags by House ID
Retrieve all tags (amenities/features) associated with a specific house.Code/ID of the house (e.g., 1)
Response
Array of TagDTO objects
Example Response
Example Response
Status Codes
| Code | Description |
|---|---|
| 200 | Successfully retrieved tags |
| 404 | House not found |
| 403 | Forbidden - Access denied |
Housing Images
Get Housing Image
Retrieve the image for a specific housing listing. Endpoint:GET /v1/api/houses/{id}/image
Authentication: JWT required
Housing ID (code)
image/jpeg
Example:
Upload Housing Image
Upload or update the image for a housing listing. Endpoint:PUT /v1/api/houses/{id}/image
Authentication: JWT required (Admin only)
Housing ID (code)
Common Tag IDs
Common tag identifiers used in the Trippins platform:pool- Swimming poolwifi- WiFi internet accessbeach- Beach accessparking- Parking facilitiesgym- Fitness center/gymspa- Spa facilitiesrestaurant- On-site restaurantbar- Bar/loungepets- Pet-friendlybreakfast- Breakfast included
Authentication
All Housing Management endpoints require JWT authentication. Include your token in the Authorization header:Error Responses
Error type
Detailed error message
Example Error Response
Example Error Response
