v2.0.0

Properties API Documentation

Complete API reference for reading and creating property listings. Supports full CRUD operations with multilingual content, images, taxonomies, and booking platform links.

Base URL: https://listings.4u-realestate.org
Auth: x-api-key header
Methods: GET POST PUT DELETE

Table of Contents

Authentication

API Key Required

All requests require a valid API key sent via the x-api-key header.

curl -H "x-api-key: 4u_pk_YOUR_KEY" https://listings.4u-realestate.org/properties

Read Properties

GET /properties List properties with filters & pagination

Retrieve a paginated list of published properties. Supports full-text search, filtering, and sorting.

ParameterTypeDescription
pagenumberPage number (default: 1)
limitnumberResults per page (default: 20, max: 100)
searchstringFull-text search on title & description
featuredbooleanFilter featured properties only
projectstringFilter by project name
propertyTypestringFilter by type (apartments, villas, penthouses...)
purposestringFilter by purpose (for-rent, for-sale, vacation-rentals...)
citystringFilter by city
areastringFilter by area/neighborhood
countrystringFilter by country
minPricenumberMinimum price
maxPricenumberMaximum price
minBedroomsnumberMinimum bedrooms
maxBedroomsnumberMaximum bedrooms
languagestringLanguage filter (en, fr)
sortstringprice_asc, price_desc, newest, oldest (default: title)

Example Request

curl -H "x-api-key: YOUR_KEY" \
  "https://listings.4u-realestate.org/properties?page=1&limit=10&purpose=vacation-rentals&sort=newest"

Example Response

{
  "success": true,
  "properties": [
    {
      "_id": "69b871f7bfe28eae670203cb",
      "title": "Luxury 2BR Ocean View",
      "slug": "luxury-2br-ocean-view",
      "price": 250,
      "priceUnit": "per_night",
      "currency": "USD",
      "bedrooms": 2,
      "bathrooms": 2,
      "surface": 95,
      "featuredImage": { "url": "https://api.4u-realestate.org/uploads/...", "alt": "..." },
      "gallery": [ ... ],
      "propertyType": ["apartments"],
      "purposes": ["vacation-rentals"],
      "features": ["Air Conditioning", "WiFi"],
      "city": "Simpson Bay",
      "country": "Sint Maarten"
    }
  ],
  "total": 179,
  "page": 1,
  "limit": 10,
  "totalPages": 18
}
GET /properties/stats Get aggregated statistics

Returns total count, available purposes, property types, and cities. Cached 5 minutes.

GET /properties/by-slug/:slug Find by URL slug
ParameterTypeDescription
slugstringURL slug of the property (path param, required)
GET /properties/by-lodgify/:lodgifyId Find by Lodgify rental ID
ParameterTypeDescription
lodgifyIdnumberLodgify rental ID (path param, required)
GET /properties/:id Get full property details by ID

Returns the complete property with all detail fields including SEO, garden, balcony, land, zipCode, translationGroup.

Create Property

POST /properties Create a new property

Create a new property listing. Only title is required. The slug is auto-generated from the title if not provided. Newly created properties default to draft status.

The slug must be unique. If a property with the same slug already exists, the API returns a 409 error. If the slug is omitted, it is auto-generated from the title.

Required Fields

FieldTypeDescription
title REQUIREDstringProperty title in English

Content & Multilingual

FieldTypeDescription
title_frstringTitle in French
slugstringURL slug (auto-generated if omitted)
slug_frstringFrench URL slug
descriptionstringFull HTML description (EN)
description_frstringFull HTML description (FR)
shortDescriptionstringShort summary (EN)
shortDescription_frstringShort summary (FR)
languagestringPrimary language: "en" or "fr" (default: "en")
translationGroupstringID to link EN/FR translations together
translationsobject{ "en": "propertyId", "fr": "propertyId" }

SEO

FieldTypeDescription
seoobjectSEO metadata object
seo.titlestringSEO title (EN)
seo.title_frstringSEO title (FR)
seo.metaDescriptionstringMeta description (EN)
seo.metaDescription_frstringMeta description (FR)
seo.focusKeyphrasestringFocus keyphrase (EN)
seo.focusKeyphrase_frstringFocus keyphrase (FR)

Status & Visibility

FieldTypeDescription
statusstring"draft" (default), "published", "archived", "private"
featuredbooleanHighlighted listing (default: false)
showOnMobilebooleanShow on mobile app (default: false)
isFeaturedSlidebooleanShow in featured slider (default: false)
publishedAtISO datePublish date (auto-set when status = published)

Pricing

FieldTypeDescription
pricenumberProperty price
priceUnitstring"per_night" (default), "per_week", "per_month", "total"
currencystringCurrency code (default: "USD")

Dimensions & Capacity

FieldTypeDescription
surfacenumberInterior area
gardennumberGarden area
balconynumberBalcony area
landnumberLand area
areaUnitstring"sqm" (default) or "sqft"
bedroomsnumber|stringNumber of bedrooms or "Studio"
bathroomsnumberNumber of bathrooms
maxGuestsnumberMaximum number of guests
numberOfBedsstringTotal number of beds
sizeOfBedsstringSize of main beds
sizeOfBeds2stringSize of secondary beds
numberOfSofabedstringNumber of sofa beds
sizeOfSofabedstringSize of sofa beds

Beds Detail

FieldTypeDescription
bedsarrayDetailed bed configuration
beds[].roomstringRoom name: "bedroom_1", "bedroom_2", "salon"
beds[].countnumberNumber of beds in this room
beds[].sizestringBed size: "kingsize", "queen", "single", "160 cm"
beds[].typestring"bed" or "sofabed"

Beds Example

"beds": [
  { "room": "bedroom_1", "count": 1, "size": "kingsize", "type": "bed" },
  { "room": "bedroom_2", "count": 2, "size": "single", "type": "bed" },
  { "room": "salon", "count": 1, "size": "queen", "type": "sofabed" }
]

Bedroom Descriptions

FieldTypeDescription
bedroom2DescriptionstringDescription of bedroom 2
bedroom3DescriptionstringDescription of bedroom 3
bedroom4DescriptionstringDescription of bedroom 4

Location

FieldTypeDescription
addressstringStreet address
citystringCity name
areastringArea/neighborhood (Simpson Bay, Cole Bay...)
countrystringCountry
zipCodestringZip/postal code
latitudenumberGPS latitude
longitudenumberGPS longitude

Images

FieldTypeDescription
featuredImageobjectMain property image
featuredImage.urlstringImage URL (absolute URL)
featuredImage.altstringAlt text (EN)
featuredImage.alt_frstringAlt text (FR)
featuredImage.titlestringImage title (EN)
featuredImage.title_frstringImage title (FR)
featuredImage.captionstringCaption (EN)
featuredImage.caption_frstringCaption (FR)
featuredImage.descriptionstringDescription (EN)
featuredImage.description_frstringDescription (FR)
featuredImage.ordernumberDisplay order

Gallery

FieldTypeDescription
galleryarrayArray of gallery images (same structure as featuredImage)

Gallery Example

"gallery": [
  {
    "url": "https://example.com/images/living-room.jpg",
    "alt": "Living room with ocean view",
    "alt_fr": "Salon avec vue sur l'ocean",
    "title": "Living Room",
    "order": 1
  },
  {
    "url": "https://example.com/images/bedroom.jpg",
    "alt": "Master bedroom",
    "alt_fr": "Chambre principale",
    "order": 2
  }
]

Taxonomies & Categories

FieldTypeDescription
propertyTypestring[]["apartments", "villas", "penthouses", "studios", "land", "commercial"]
purposesstring[]["for-rent", "for-sale", "vacation-rentals"]
areasstring[]["Cupecoy", "Mullet Bay", "Maho"]
locationstring[]["Sint Maarten", "Saint Martin"]
housingTypesstring[]["Real Estate"]
projectsstring[]["The Hills Residence", "Aqua Resort"]
buildingsstring[]["Building 1", "Building 2"]
unitNumbersstring[]["A-101", "B-204"]
buildingstringSingle building (legacy)
projectstringSingle project (legacy)
unitNumberstringSingle unit number (legacy)
purposestringSingle purpose (legacy)
stickersstring[]["featured", "new", "exclusive", "reduced"]
shortReferencestringShort reference code (e.g. "THR-A101")

Features, Amenities & Assets

FieldTypeDescription
featuresstring[]["Air Conditioning", "WiFi", "TV", "Washer", "Dryer", "Dishwasher", "Iron"]
amenitiesstring[]["Pool", "Parking", "Gym", "Security", "Elevator", "BBQ"]
assetsstring[]["Ocean View", "Lagoon View", "Restaurants", "Beach Access"]

Media & Links

FieldTypeDescription
videoUrlstringYouTube or video URL
documentsstring[]Array of document URLs (PDF floor plans, etc.)

Booking Platforms

FieldTypeDescription
platformsobjectExternal booking platform links
platforms.airbnbstringAirbnb listing URL
platforms.bookingstringBooking.com listing URL
platforms.expediastringExpedia listing URL
platforms.lodgifystringLodgify booking page URL
platforms.customarrayCustom platforms: [{ "name": "VRBO", "url": "https://..." }]

External IDs

FieldTypeDescription
rentalIdnumberLodgify rental/property ID
websiteIdnumberLodgify website ID
managementCompanyIdstringManagement company MongoDB ID
yearBuiltnumberYear the property was built

Full Creation Example (curl)

curl -X POST "https://listings.4u-realestate.org/properties" \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Luxury 2BR Apartment - Ocean View",
  "title_fr": "Appartement de luxe 2 chambres - Vue Oc\u00e9an",
  "slug": "luxury-2br-ocean-view-simpson-bay",
  "description": "<p>Beautiful apartment with stunning ocean views...</p>",
  "description_fr": "<p>Bel appartement avec vue imprenable sur l\u0027oc\u00e9an...</p>",
  "shortDescription": "Stunning 2BR apartment in Simpson Bay",
  "status": "published",
  "featured": true,
  "showOnMobile": true,
  "price": 250,
  "priceUnit": "per_night",
  "currency": "USD",
  "surface": 95,
  "areaUnit": "sqm",
  "bedrooms": 2,
  "bathrooms": 2,
  "maxGuests": 4,
  "beds": [
    { "room": "bedroom_1", "count": 1, "size": "kingsize", "type": "bed" },
    { "room": "bedroom_2", "count": 1, "size": "queen", "type": "bed" },
    { "room": "salon", "count": 1, "size": "queen", "type": "sofabed" }
  ],
  "address": "45 Beach Road",
  "city": "Simpson Bay",
  "area": "Simpson Bay",
  "country": "Sint Maarten",
  "zipCode": "00000",
  "latitude": 18.0425,
  "longitude": -63.0548,
  "featuredImage": {
    "url": "https://example.com/images/main.jpg",
    "alt": "Ocean view apartment",
    "alt_fr": "Appartement vue oc\u00e9an",
    "title": "Main Photo",
    "order": 0
  },
  "gallery": [
    {
      "url": "https://example.com/images/living.jpg",
      "alt": "Living room",
      "alt_fr": "Salon",
      "order": 1
    },
    {
      "url": "https://example.com/images/bedroom.jpg",
      "alt": "Master bedroom",
      "alt_fr": "Chambre principale",
      "order": 2
    }
  ],
  "propertyType": ["apartments"],
  "purposes": ["vacation-rentals"],
  "areas": ["Simpson Bay"],
  "location": ["Sint Maarten"],
  "projects": ["Aqua Resort"],
  "features": ["Air Conditioning", "WiFi", "TV", "Washer"],
  "amenities": ["Pool", "Parking", "Security"],
  "assets": ["Ocean View", "Beach Access"],
  "videoUrl": "https://youtube.com/watch?v=example",
  "platforms": {
    "airbnb": "https://airbnb.com/rooms/123456",
    "booking": "https://booking.com/hotel/sx/example",
    "lodgify": "https://4urealestate.lodgify.com/luxury-2br",
    "custom": [
      { "name": "VRBO", "url": "https://vrbo.com/123456" }
    ]
  },
  "seo": {
    "title": "Luxury 2BR Ocean View | 4U Real Estate",
    "metaDescription": "Book a luxury 2-bedroom apartment with ocean view in Simpson Bay, Sint Maarten.",
    "focusKeyphrase": "ocean view apartment simpson bay"
  },
  "shortReference": "AQR-201",
  "language": "en",
  "yearBuilt": 2020
}'

Success Response (201 Created)

{
  "success": true,
  "message": "Property created successfully",
  "property": {
    "_id": "668a1b2c3d4e5f6a7b8c9d0e",
    "title": "Luxury 2BR Apartment - Ocean View",
    "slug": "luxury-2br-ocean-view-simpson-bay",
    "status": "published",
    "price": 250,
    "priceUnit": "per_night",
    ...
  }
}

Update Property

PUT /properties/:id Update an existing property

Update any property fields. Only send the fields you want to change. All fields from the create endpoint are supported.

For array fields (gallery, features, amenities, etc.), the entire array is replaced, not merged. Send the complete array.

Example - Update price and add images

curl -X PUT "https://listings.4u-realestate.org/properties/668a1b2c3d4e5f6a7b8c9d0e" \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "price": 300,
  "priceUnit": "per_night",
  "gallery": [
    { "url": "https://example.com/images/new1.jpg", "alt": "New photo 1", "order": 1 },
    { "url": "https://example.com/images/new2.jpg", "alt": "New photo 2", "order": 2 }
  ],
  "features": ["Air Conditioning", "WiFi", "TV", "Washer", "Dryer"]
}'

Example - Publish a draft

curl -X PUT "https://listings.4u-realestate.org/properties/668a1b2c3d4e5f6a7b8c9d0e" \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "status": "published" }'

Success Response

{
  "success": true,
  "message": "Property updated successfully",
  "property": { "_id": "668a1b2c...", "title": "...", "price": 300, ... }
}

Delete Property

DELETE /properties/:id Permanently delete a property
This action is permanent and cannot be undone. Consider archiving (status: "archived") instead.

Example

curl -X DELETE "https://listings.4u-realestate.org/properties/668a1b2c3d4e5f6a7b8c9d0e" \
  -H "x-api-key: YOUR_KEY"

Success Response

{
  "success": true,
  "message": "Property deleted successfully",
  "deletedId": "668a1b2c3d4e5f6a7b8c9d0e"
}

Property Fields Reference

Complete list of all property fields returned by GET endpoints and accepted by POST/PUT.

FieldTypeDescription
_idstringMongoDB ID (read-only)
title / title_frstringProperty title EN / FR
slug / slug_frstringURL slug EN / FR
description / description_frstringFull HTML description EN / FR
shortDescription / shortDescription_frstringShort summary EN / FR
seoobjectSEO metadata (title, metaDescription, focusKeyphrase, *_fr)
statusstringdraft, published, archived, private
featuredbooleanFeatured flag
showOnMobilebooleanMobile visibility
isFeaturedSlidebooleanFeatured slider
pricenumberPrice
priceUnitstringper_night, per_week, per_month, total
currencystringCurrency code
surface / garden / balcony / landnumberArea measurements
areaUnitstringsqm or sqft
bedroomsnumber|stringBedrooms count or "Studio"
bathroomsnumberBathrooms count
bedsarrayBed configuration [{room, count, size, type}]
maxGuestsnumberMax guests
address / city / area / country / zipCodestringLocation fields
latitude / longitudenumberGPS coordinates
featuredImageobjectMain image {url, alt, alt_fr, title, ...}
galleryarrayImage gallery [{url, alt, alt_fr, order, ...}]
propertyTypestring[]Property types
purposesstring[]Property purposes
areasstring[]Area taxonomy
locationstring[]Location taxonomy
projectsstring[]Projects
buildingsstring[]Buildings
unitNumbersstring[]Unit numbers
featuresstring[]Property features
amenitiesstring[]Amenities
assetsstring[]Nearby assets/views
stickersstring[]Tags/stickers
shortReferencestringShort reference code
videoUrlstringVideo URL
documentsstring[]Document URLs
platformsobjectBooking platform links
rentalIdnumberLodgify rental ID
websiteIdnumberLodgify website ID
languagestringen or fr
translationGroupstringTranslation group ID
translationsobject{en: id, fr: id}
managementCompanyIdstringMC MongoDB ID
yearBuiltnumberYear built
publishedAtdatePublish date
createdAt / updatedAtdateTimestamps (read-only)

Code Examples

JavaScript
PHP
Python
cURL
const API = 'https://listings.4u-realestate.org';
const KEY = 'YOUR_API_KEY';
const headers = { 'x-api-key': KEY, 'Content-Type': 'application/json' };

// === LIST PROPERTIES ===
const list = await fetch(`${API}/properties?limit=10&purpose=vacation-rentals`, { headers });
const data = await list.json();
console.log(`Total: ${data.total}`);

// === CREATE PROPERTY ===
const create = await fetch(`${API}/properties`, {
  method: 'POST',
  headers,
  body: JSON.stringify({
    title: 'New Beach Villa',
    status: 'draft',
    price: 500,
    priceUnit: 'per_night',
    bedrooms: 3,
    bathrooms: 2,
    city: 'Simpson Bay',
    propertyType: ['villas'],
    purposes: ['vacation-rentals'],
    features: ['Pool', 'WiFi', 'Air Conditioning'],
    featuredImage: { url: 'https://example.com/villa.jpg', alt: 'Beach Villa', order: 0 },
    gallery: [
      { url: 'https://example.com/pool.jpg', alt: 'Pool', order: 1 },
      { url: 'https://example.com/bedroom.jpg', alt: 'Bedroom', order: 2 }
    ]
  })
});
const created = await create.json();
console.log('Created:', created.property._id);

// === UPDATE PROPERTY ===
const update = await fetch(`${API}/properties/${created.property._id}`, {
  method: 'PUT',
  headers,
  body: JSON.stringify({ status: 'published', price: 550 })
});

// === DELETE PROPERTY ===
const del = await fetch(`${API}/properties/${created.property._id}`, {
  method: 'DELETE', headers
});
$API = 'https://listings.4u-realestate.org';
$KEY = 'YOUR_API_KEY';

// === LIST ===
$ch = curl_init("$API/properties?limit=10");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["x-api-key: $KEY", "Accept: application/json"]
]);
$list = json_decode(curl_exec($ch), true);
curl_close($ch);

// === CREATE ===
$ch = curl_init("$API/properties");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => ["x-api-key: $KEY", "Content-Type: application/json"],
  CURLOPT_POSTFIELDS => json_encode([
    'title' => 'New Beach Villa',
    'status' => 'draft',
    'price' => 500,
    'priceUnit' => 'per_night',
    'bedrooms' => 3,
    'city' => 'Simpson Bay',
    'propertyType' => ['villas'],
    'purposes' => ['vacation-rentals'],
    'features' => ['Pool', 'WiFi'],
    'featuredImage' => ['url' => 'https://example.com/villa.jpg', 'alt' => 'Villa', 'order' => 0]
  ])
]);
$created = json_decode(curl_exec($ch), true);
curl_close($ch);
$id = $created['property']['_id'];

// === UPDATE ===
$ch = curl_init("$API/properties/$id");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_HTTPHEADER => ["x-api-key: $KEY", "Content-Type: application/json"],
  CURLOPT_POSTFIELDS => json_encode(['status' => 'published', 'price' => 550])
]);
curl_exec($ch);
curl_close($ch);

// === DELETE ===
$ch = curl_init("$API/properties/$id");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => ["x-api-key: $KEY"]
]);
curl_exec($ch);
curl_close($ch);
import requests

API = 'https://listings.4u-realestate.org'
HEADERS = {'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json'}

# === LIST ===
r = requests.get(f'{API}/properties', params={'limit': 10}, headers=HEADERS)
data = r.json()
print(f"Total: {data['total']}")

# === CREATE ===
r = requests.post(f'{API}/properties', headers=HEADERS, json={
    'title': 'New Beach Villa',
    'status': 'draft',
    'price': 500,
    'priceUnit': 'per_night',
    'bedrooms': 3,
    'city': 'Simpson Bay',
    'propertyType': ['villas'],
    'purposes': ['vacation-rentals'],
    'features': ['Pool', 'WiFi'],
    'featuredImage': {'url': 'https://example.com/villa.jpg', 'alt': 'Villa', 'order': 0},
    'gallery': [
        {'url': 'https://example.com/pool.jpg', 'alt': 'Pool', 'order': 1}
    ]
})
prop_id = r.json()['property']['_id']

# === UPDATE ===
requests.put(f'{API}/properties/{prop_id}', headers=HEADERS, json={
    'status': 'published', 'price': 550
})

# === DELETE ===
requests.delete(f'{API}/properties/{prop_id}', headers=HEADERS)
# List properties
curl -s -H "x-api-key: YOUR_KEY" \
  "https://listings.4u-realestate.org/properties?limit=10" | jq .

# Create property
curl -s -X POST "https://listings.4u-realestate.org/properties" \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"New Villa","price":500,"bedrooms":3,"status":"draft"}' | jq .

# Update property
curl -s -X PUT "https://listings.4u-realestate.org/properties/PROPERTY_ID" \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"published","price":550}' | jq .

# Delete property
curl -s -X DELETE "https://listings.4u-realestate.org/properties/PROPERTY_ID" \
  -H "x-api-key: YOUR_KEY" | jq .

Error Codes

CodeMeaningSolution
400Invalid input (missing title, bad enum value)Check required fields and valid values
401Missing or invalid API keyAdd x-api-key header with valid key
403API key disabled or expiredContact admin to reactivate
404Property not foundVerify the property ID or slug
409Duplicate slug or unique field conflictUse a different slug or check existing data
429Rate limit exceeded (100 req/min)Wait and retry, implement caching
500Internal server errorContact contact@4u-realestate.org