This is the REST API for a Real Estate application that supports user registration, authentication, profile management, and CRUD operations on property listings.
http://localhost:6969/api-docs
http://localhost:6969/api
This API uses JWT for authentication.
Include the JWT token in the Authorization header as:
Authorization: Bearer <your_jwt_token>
POST /users/register
Register a new user.
Headers:
- Content-Type: application/json
Body:
{
"username": "bibasjaprel",
"email": "bibashjaprel111@gmail.com",
"password": "securePassword",
"role": "user"
}POST /users/login
Authenticate user and receive JWT token.
Headers:
- Content-Type: application/json
Body:
{
"email": "bibashjaprel111@gmail.com",
"password": "securePassword"
}GET /users/profile
Get the logged-in user's profile information.
Headers:
- Content-Type: application/json
- Authorization: Bearer
<token>
PATCH /users/profile
Update the logged-in user's profile.
Headers:
- Content-Type: application/json
- Authorization: Bearer
<token>
Body:
{
"username": "bibasjaprel_updateds",
"profile_image": "https://www.bibashjaprel.com.np/images/aboutsecphoto%20(2).jpg"
}GET /listings
Retrieve all property listings.
GET /listings/{id}
Retrieve a single listing by its ID.
POST /listings
Create a new property listing.
Headers:
- Content-Type: application/json
- Authorization: Bearer
<token>
Body:
{
"title": "3 BHK Apartment in Jawalakel",
"description": "Spacious 3 bedroom apartment in Lazimpat",
"category": "apartment",
"price": 15000000,
"price_type": "monthly",
"address": {
"city": "Kathmandu",
"street": "Lazimpat",
"house_no": "45A"
},
"latitude": 27.7172,
"longitude": 85.324,
"features": {
"parking": true,
"balcony": true,
"furnished": false
},
"expires_at": "2025-12-31T23:59:59Z"
}PATCH /listings/{id}
Update an existing listing by its ID.
Headers:
- Content-Type: application/json
- Authorization: Bearer
<token>
Body:
{
"title": "Updated 4 BHK Apartment in Kathmanduaaa",
"description": "Updated description for the spacious 8 bedroom apartment in Lazimpat",
"category": "apartment",
"price": 16000000,
"price_type": "monthly",
"address": {
"city": "Kathmandu",
"street": "Lazimpat",
"house_no": "45A"
},
"latitude": 27.7172,
"longitude": 85.324,
"features": {
"parking": true,
"balcony": true,
"furnished": true
},
"expires_at": "2025-12-31T23:59:59Z"
}DELETE /listings/{id}
Delete a listing by its ID.
Headers:
- Content-Type: application/json
- Authorization: Bearer
<token>
- All endpoints that require authentication expect a valid JWT token in the
Authorizationheader. - The
expires_atfield should be a valid ISO 8601 date string. price_typecan be values like"monthly","yearly", or"one-time"depending on your application logic.
For questions or support, contact the developer at:
bibashjaprel111@gmail.com