Introduction
The Inmobiliaria API is a RESTful API that provides programmatic access to property listings, user management, metadata, and administrative functions. All API responses are returned in JSON format.Base URL
The API server runs on the following base URL:PORT environment variable (defaults to 3000).
CORS Configuration
The API is configured with CORS to allow cross-origin requests from the frontend application:Available Resources
The API is organized into the following resource categories:Properties
/api/properties
Manage real estate property listings including creation, updates, search, and retrieval.
Users
/api/users
User profile management and user-related operations.
Metadata
/api/metadata
Access metadata such as property types, amenities, and other reference data.
Admin
/api/admin
Administrative functions including statistics and system management (requires admin role).
Contact
/api/contact
Handle contact form submissions and inquiries.
Authentication
/api/auth/*
Handled by Better Auth for user authentication, session management, and OAuth providers.
Health Check Endpoints
The API provides health check endpoints for monitoring:Root Health Check
Database Health Check
200- Database is healthy503- Database is unavailable
Response Format
All API responses follow a consistent JSON structure:Success Response
Error Response
File Uploads
The API supports file uploads with a maximum size limit:- Max file size: Configurable via
MAX_FILE_SIZE_BYTES - JSON body limit: 10MB
- Storage options: Local filesystem or S3
Session Management
The API uses Better Auth for session management. Session data can be retrieved from:Next Steps
- Learn about Authentication
- Understand Error Handling
- Explore specific resource endpoints in the API reference