openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: Nestora Real Estate Marketplace API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: properties description: Property listing operations - name: locations description: Bangladesh location hierarchy - name: companies description: Real estate company operations - name: agents description: Agent operations - name: developers description: Property developer operations - name: projects description: New property project operations - name: search description: Search and filter operations - name: stats description: Marketplace statistics paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" # ── LOCATIONS ────────────────────────────────────────────────────────────── /locations: get: operationId: listLocations tags: [locations] summary: List locations (filterable by type and parent) parameters: - name: type in: query schema: type: string enum: [country, division, district, upazila, area, road] - name: parentId in: query schema: type: ["integer", "null"] - name: search in: query schema: type: ["string", "null"] responses: "200": description: List of locations content: application/json: schema: type: array items: $ref: "#/components/schemas/Location" /locations/{id}: get: operationId: getLocation tags: [locations] summary: Get a location by ID parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Location details content: application/json: schema: $ref: "#/components/schemas/Location" "404": description: Not found /locations/{id}/children: get: operationId: getLocationChildren tags: [locations] summary: Get child locations of a given location parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Child locations content: application/json: schema: type: array items: $ref: "#/components/schemas/Location" # ── PROPERTIES ───────────────────────────────────────────────────────────── /properties: get: operationId: listProperties tags: [properties] summary: List properties with filters parameters: - name: purpose in: query schema: type: ["string", "null"] enum: [buy, rent, null] - name: type in: query schema: type: ["string", "null"] enum: [apartment, house, plot, commercial, villa, null] - name: locationId in: query schema: type: ["integer", "null"] - name: minPrice in: query schema: type: ["number", "null"] - name: maxPrice in: query schema: type: ["number", "null"] - name: minBeds in: query schema: type: ["integer", "null"] - name: maxBeds in: query schema: type: ["integer", "null"] - name: minArea in: query schema: type: ["number", "null"] - name: maxArea in: query schema: type: ["number", "null"] - name: featured in: query schema: type: ["boolean", "null"] - name: companyId in: query schema: type: ["integer", "null"] - name: agentId in: query schema: type: ["integer", "null"] - name: page in: query schema: type: integer default: 1 - name: limit in: query schema: type: integer default: 20 responses: "200": description: Paginated property list content: application/json: schema: $ref: "#/components/schemas/PaginatedProperties" post: operationId: createProperty tags: [properties] summary: Create a new property listing requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PropertyInput" responses: "201": description: Created property content: application/json: schema: $ref: "#/components/schemas/Property" /properties/featured: get: operationId: getFeaturedProperties tags: [properties] summary: Get featured/premium property listings for homepage parameters: - name: limit in: query schema: type: integer default: 8 responses: "200": description: Featured properties content: application/json: schema: type: array items: $ref: "#/components/schemas/Property" /properties/recent: get: operationId: getRecentProperties tags: [properties] summary: Get most recently added properties parameters: - name: limit in: query schema: type: integer default: 12 responses: "200": description: Recent properties content: application/json: schema: type: array items: $ref: "#/components/schemas/Property" /properties/{id}: get: operationId: getProperty tags: [properties] summary: Get a property by ID parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Property details content: application/json: schema: $ref: "#/components/schemas/Property" "404": description: Not found patch: operationId: updateProperty tags: [properties] summary: Update a property listing parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PropertyUpdate" responses: "200": description: Updated property content: application/json: schema: $ref: "#/components/schemas/Property" delete: operationId: deleteProperty tags: [properties] summary: Delete a property listing parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted /properties/{id}/similar: get: operationId: getSimilarProperties tags: [properties] summary: Get similar properties (same area + type) parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Similar properties content: application/json: schema: type: array items: $ref: "#/components/schemas/Property" # ── COMPANIES ────────────────────────────────────────────────────────────── /companies: get: operationId: listCompanies tags: [companies] summary: List real estate companies parameters: - name: verified in: query schema: type: ["boolean", "null"] - name: search in: query schema: type: ["string", "null"] - name: limit in: query schema: type: integer default: 20 responses: "200": description: List of companies content: application/json: schema: type: array items: $ref: "#/components/schemas/Company" post: operationId: createCompany tags: [companies] summary: Register a new real estate company requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CompanyInput" responses: "201": description: Created company content: application/json: schema: $ref: "#/components/schemas/Company" /companies/top: get: operationId: getTopCompanies tags: [companies] summary: Get top companies by listing count for homepage parameters: - name: limit in: query schema: type: integer default: 8 responses: "200": description: Top companies content: application/json: schema: type: array items: $ref: "#/components/schemas/Company" /companies/{id}: get: operationId: getCompany tags: [companies] summary: Get a company by ID with their listings parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Company details content: application/json: schema: $ref: "#/components/schemas/Company" "404": description: Not found /companies/{id}/agents: get: operationId: getCompanyAgents tags: [companies] summary: Get all agents for a company parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Company agents content: application/json: schema: type: array items: $ref: "#/components/schemas/Agent" /companies/{id}/properties: get: operationId: getCompanyProperties tags: [companies] summary: Get all properties listed by a company parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Company properties content: application/json: schema: $ref: "#/components/schemas/PaginatedProperties" # ── AGENTS ───────────────────────────────────────────────────────────────── /agents: get: operationId: listAgents tags: [agents] summary: List agents parameters: - name: companyId in: query schema: type: ["integer", "null"] - name: search in: query schema: type: ["string", "null"] - name: limit in: query schema: type: integer default: 20 responses: "200": description: List of agents content: application/json: schema: type: array items: $ref: "#/components/schemas/Agent" post: operationId: createAgent tags: [agents] summary: Register a new agent requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AgentInput" responses: "201": description: Created agent content: application/json: schema: $ref: "#/components/schemas/Agent" /agents/top: get: operationId: getTopAgents tags: [agents] summary: Get top agents by listing count parameters: - name: limit in: query schema: type: integer default: 8 responses: "200": description: Top agents content: application/json: schema: type: array items: $ref: "#/components/schemas/Agent" /agents/{id}: get: operationId: getAgent tags: [agents] summary: Get an agent by ID parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Agent details content: application/json: schema: $ref: "#/components/schemas/Agent" "404": description: Not found /agents/{id}/properties: get: operationId: getAgentProperties tags: [agents] summary: Get all properties listed by an agent parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Agent properties content: application/json: schema: type: array items: $ref: "#/components/schemas/Property" # ── DEVELOPERS & PROJECTS ────────────────────────────────────────────────── /developers: get: operationId: listDevelopers tags: [developers] summary: List property developers parameters: - name: verified in: query schema: type: ["boolean", "null"] - name: limit in: query schema: type: integer default: 20 responses: "200": description: List of developers content: application/json: schema: type: array items: $ref: "#/components/schemas/Developer" /developers/{id}: get: operationId: getDeveloper tags: [developers] summary: Get a developer by ID parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Developer details content: application/json: schema: $ref: "#/components/schemas/Developer" /projects: get: operationId: listProjects tags: [projects] summary: List new property projects / launches parameters: - name: developerId in: query schema: type: ["integer", "null"] - name: locationId in: query schema: type: ["integer", "null"] - name: status in: query schema: type: ["string", "null"] enum: [pre_launch, under_construction, ready, null] - name: limit in: query schema: type: integer default: 12 responses: "200": description: List of projects content: application/json: schema: type: array items: $ref: "#/components/schemas/Project" post: operationId: createProject tags: [projects] summary: Create a new project launch requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ProjectInput" responses: "201": description: Created project content: application/json: schema: $ref: "#/components/schemas/Project" /projects/featured: get: operationId: getFeaturedProjects tags: [projects] summary: Get featured projects for homepage parameters: - name: limit in: query schema: type: integer default: 6 responses: "200": description: Featured projects content: application/json: schema: type: array items: $ref: "#/components/schemas/Project" /projects/{id}: get: operationId: getProject tags: [projects] summary: Get a project by ID parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Project details content: application/json: schema: $ref: "#/components/schemas/Project" "404": description: Not found # ── STATS ────────────────────────────────────────────────────────────────── /stats/marketplace: get: operationId: getMarketplaceStats tags: [stats] summary: Get homepage marketplace stats (listings, agents, companies) responses: "200": description: Marketplace statistics content: application/json: schema: $ref: "#/components/schemas/MarketplaceStats" /stats/by-location: get: operationId: getStatsByLocation tags: [stats] summary: Get property count grouped by top areas responses: "200": description: Stats by location content: application/json: schema: type: array items: $ref: "#/components/schemas/LocationStat" /stats/by-type: get: operationId: getStatsByType tags: [stats] summary: Get property count grouped by type responses: "200": description: Stats by property type content: application/json: schema: type: array items: $ref: "#/components/schemas/TypeStat" # ── SEARCH ───────────────────────────────────────────────────────────────── /search/suggestions: get: operationId: getSearchSuggestions tags: [search] summary: Get search suggestions for autocomplete (locations + properties) parameters: - name: q in: query required: true schema: type: string - name: limit in: query schema: type: integer default: 8 responses: "200": description: Search suggestions content: application/json: schema: type: array items: $ref: "#/components/schemas/SearchSuggestion" components: schemas: HealthStatus: type: object properties: status: type: string required: [status] Location: type: object required: [id, name, type, slug] properties: id: type: integer name: type: string nameBn: type: ["string", "null"] type: type: string enum: [country, division, district, upazila, area, road] slug: type: string parentId: type: ["integer", "null"] postalCode: type: ["string", "null"] propertyCount: type: ["integer", "null"] Property: type: object required: [id, title, purpose, type, price, currency, status, locationId, createdAt] properties: id: type: integer title: type: string titleBn: type: ["string", "null"] description: type: ["string", "null"] purpose: type: string enum: [buy, rent] type: type: string enum: [apartment, house, plot, commercial, villa] price: type: number currency: type: string default: BDT priceUnit: type: ["string", "null"] enum: [total, per_sqft, per_month, null] status: type: string enum: [active, pending, sold, rented, inactive] bedrooms: type: ["integer", "null"] bathrooms: type: ["integer", "null"] area: type: ["number", "null"] areaUnit: type: ["string", "null"] enum: [sqft, sqm, katha, bigha, null] floor: type: ["integer", "null"] totalFloors: type: ["integer", "null"] facing: type: ["string", "null"] furnished: type: ["string", "null"] enum: [furnished, semi_furnished, unfurnished, null] parkingSpots: type: ["integer", "null"] yearBuilt: type: ["integer", "null"] locationId: type: integer location: $ref: "#/components/schemas/Location" address: type: ["string", "null"] latitude: type: ["number", "null"] longitude: type: ["number", "null"] images: type: array items: $ref: "#/components/schemas/PropertyImage" amenities: type: array items: type: string featured: type: boolean default: false verified: type: boolean default: false companyId: type: ["integer", "null"] company: $ref: "#/components/schemas/Company" agentId: type: ["integer", "null"] agent: $ref: "#/components/schemas/Agent" viewCount: type: integer default: 0 createdAt: type: string format: date-time updatedAt: type: ["string", "null"] format: date-time PropertyImage: type: object required: [id, url, isPrimary] properties: id: type: integer url: type: string caption: type: ["string", "null"] isPrimary: type: boolean PropertyInput: type: object required: [title, purpose, type, price, locationId] properties: title: type: string minLength: 5 titleBn: type: ["string", "null"] description: type: ["string", "null"] purpose: type: string enum: [buy, rent] type: type: string enum: [apartment, house, plot, commercial, villa] price: type: number minimum: 0 currency: type: string default: BDT priceUnit: type: ["string", "null"] bedrooms: type: ["integer", "null"] bathrooms: type: ["integer", "null"] area: type: ["number", "null"] areaUnit: type: ["string", "null"] floor: type: ["integer", "null"] totalFloors: type: ["integer", "null"] facing: type: ["string", "null"] furnished: type: ["string", "null"] parkingSpots: type: ["integer", "null"] yearBuilt: type: ["integer", "null"] locationId: type: integer address: type: ["string", "null"] latitude: type: ["number", "null"] longitude: type: ["number", "null"] amenities: type: array items: type: string companyId: type: ["integer", "null"] agentId: type: ["integer", "null"] PropertyUpdate: type: object properties: title: type: ["string", "null"] description: type: ["string", "null"] price: type: ["number", "null"] status: type: ["string", "null"] enum: [active, pending, sold, rented, inactive, null] featured: type: ["boolean", "null"] bedrooms: type: ["integer", "null"] bathrooms: type: ["integer", "null"] area: type: ["number", "null"] PaginatedProperties: type: object required: [data, total, page, limit] properties: data: type: array items: $ref: "#/components/schemas/Property" total: type: integer page: type: integer limit: type: integer totalPages: type: integer Company: type: object required: [id, name, slug, createdAt] properties: id: type: integer name: type: string nameBn: type: ["string", "null"] slug: type: string description: type: ["string", "null"] logoUrl: type: ["string", "null"] coverUrl: type: ["string", "null"] phone: type: ["string", "null"] email: type: ["string", "null"] website: type: ["string", "null"] address: type: ["string", "null"] locationId: type: ["integer", "null"] location: $ref: "#/components/schemas/Location" verified: type: boolean default: false established: type: ["integer", "null"] agentCount: type: ["integer", "null"] listingCount: type: ["integer", "null"] rating: type: ["number", "null"] createdAt: type: string format: date-time CompanyInput: type: object required: [name, phone] properties: name: type: string minLength: 2 nameBn: type: ["string", "null"] description: type: ["string", "null"] phone: type: string email: type: ["string", "null"] website: type: ["string", "null"] address: type: ["string", "null"] locationId: type: ["integer", "null"] established: type: ["integer", "null"] Agent: type: object required: [id, name, phone, createdAt] properties: id: type: integer name: type: string nameBn: type: ["string", "null"] phone: type: string email: type: ["string", "null"] photoUrl: type: ["string", "null"] bio: type: ["string", "null"] companyId: type: ["integer", "null"] company: $ref: "#/components/schemas/Company" locationId: type: ["integer", "null"] location: $ref: "#/components/schemas/Location" verified: type: boolean default: false specialization: type: array items: type: string listingCount: type: ["integer", "null"] rating: type: ["number", "null"] reviewCount: type: ["integer", "null"] experience: type: ["integer", "null"] createdAt: type: string format: date-time AgentInput: type: object required: [name, phone] properties: name: type: string nameBn: type: ["string", "null"] phone: type: string email: type: ["string", "null"] bio: type: ["string", "null"] companyId: type: ["integer", "null"] locationId: type: ["integer", "null"] specialization: type: array items: type: string experience: type: ["integer", "null"] Developer: type: object required: [id, name, slug, createdAt] properties: id: type: integer name: type: string nameBn: type: ["string", "null"] slug: type: string description: type: ["string", "null"] logoUrl: type: ["string", "null"] coverUrl: type: ["string", "null"] phone: type: ["string", "null"] email: type: ["string", "null"] website: type: ["string", "null"] address: type: ["string", "null"] locationId: type: ["integer", "null"] location: $ref: "#/components/schemas/Location" verified: type: boolean default: false established: type: ["integer", "null"] projectCount: type: ["integer", "null"] rating: type: ["number", "null"] createdAt: type: string format: date-time Project: type: object required: [id, name, slug, status, locationId, createdAt] properties: id: type: integer name: type: string nameBn: type: ["string", "null"] slug: type: string description: type: ["string", "null"] status: type: string enum: [pre_launch, under_construction, ready] type: type: ["string", "null"] enum: [apartment, villa, mixed, commercial, null] minPrice: type: ["number", "null"] maxPrice: type: ["number", "null"] currency: type: string default: BDT totalUnits: type: ["integer", "null"] availableUnits: type: ["integer", "null"] completionDate: type: ["string", "null"] locationId: type: integer location: $ref: "#/components/schemas/Location" address: type: ["string", "null"] coverUrl: type: ["string", "null"] images: type: array items: type: string amenities: type: array items: type: string developerId: type: integer developer: $ref: "#/components/schemas/Developer" featured: type: boolean default: false latitude: type: ["number", "null"] longitude: type: ["number", "null"] createdAt: type: string format: date-time ProjectInput: type: object required: [name, status, locationId, developerId] properties: name: type: string description: type: ["string", "null"] status: type: string enum: [pre_launch, under_construction, ready] type: type: ["string", "null"] minPrice: type: ["number", "null"] maxPrice: type: ["number", "null"] totalUnits: type: ["integer", "null"] completionDate: type: ["string", "null"] locationId: type: integer address: type: ["string", "null"] developerId: type: integer amenities: type: array items: type: string MarketplaceStats: type: object required: [totalProperties, totalAgents, totalCompanies, totalDevelopers, totalProjects] properties: totalProperties: type: integer totalForSale: type: integer totalForRent: type: integer totalAgents: type: integer totalCompanies: type: integer totalDevelopers: type: integer totalProjects: type: integer totalLocations: type: integer LocationStat: type: object required: [locationId, locationName, propertyCount] properties: locationId: type: integer locationName: type: string propertyCount: type: integer coverUrl: type: ["string", "null"] TypeStat: type: object required: [type, count] properties: type: type: string count: type: integer label: type: ["string", "null"] SearchSuggestion: type: object required: [id, label, type] properties: id: type: string label: type: string sublabel: type: ["string", "null"] type: type: string enum: [location, property, project, company, agent] url: type: ["string", "null"]