Field Schema
The schema API has two endpoints: a base schema that returns all possible types and constraints, and a contextual schema that returns the exact fields and options for a specific property type combination.
Why You Need the Schema
- Validation — verify data before submission to avoid rejected requests
- Correct payloads — know exactly which fields and values are accepted for each property type
- Up-to-date — always get current constraints and options directly from the API
Get Base Schema
GET /api/v1/reference/schema/base
Returns the general structure: listing types, property categories, all form fields, and constraints. No parameters required. Use this to initialize your form and understand the data model.
const response = await fetch('https://crm.rentix.md/api/v1/reference/schema/base', {
headers: { 'Authorization': 'ApiKey YOUR_API_KEY' }
});
const schema = await response.json();
// Available property types for rental
console.log(schema.propertySecondaryType.rent.residential);
// → ["apartment", "house", "room", "other"]
curl https://crm.rentix.md/api/v1/reference/schema/base \
-H "Authorization: ApiKey YOUR_API_KEY"
$ch = curl_init('https://crm.rentix.md/api/v1/reference/schema/base');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: ApiKey YOUR_API_KEY']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$schema = json_decode($response, true);
{
"announcementType": ["rent", "sale"],
"propertyType": ["residential", "commercial", "parking"],
"propertySecondaryType": {
"rent": {
"residential": ["apartment", "house", "room", "other"],
"commercial": ["office", "trade", "warehouse", "..."],
"parking": ["underground-parking", "open-parking", "..."]
},
"sale": { "..." }
},
"announcementCurrency": ["EUR", "USD", "MDL"],
"announcementStatus": ["draft", "active", "pending_active", "publish_failed", "expired", "hidden", "completed", "blocked"],
"formFields": [
"propertyType", "propertySecondaryType", "propertyQuantitySize",
"propertyArea", "propertyFloorNumber", "propertyCoordinates",
"announcementType", "announcementValue", "announcementCurrency",
"announcementDescription", "fileIds"
// ...and other fields
],
"constraints": {
"propertyArea": { "min": 1, "max": 50000, "step": 0.01 },
"propertyFloorNumber": { "min": -10, "max": 100, "step": 1 },
"announcementValue": { "min": 1, "max": 1000000000, "step": 1 },
"announcementDescription": { "minLength": 40, "maxLength": 2000 },
"propertyCoordinates": { "lat": { "min": -90, "max": 90 }, "lng": { "min": -180, "max": 180 } },
"fileIds": { "minItems": 3, "maxItems": 20, "maxVideoFiles": 2, "maxVideoDuration": 300 }
// ...and other fields
}
}
Base Schema Fields
| Field | Description |
|---|---|
announcementType | Available listing types (rent, sale) |
propertyType | Property categories (residential, commercial, parking) |
propertySecondaryType | Nested map: announcementType → propertyType → subtypes |
announcementCurrency | Supported currencies for prices |
announcementStatus | All listing statuses |
formFields | All form field keys |
constraints | Numeric bounds for constrained fields |
Get Contextual Schema
GET /api/v1/reference/schema
Pass a specific combination of listing type, property type, and subtype to get the complete field definition. Each field includes its type, whether it's required, and the available options or constraints. Fields that don't apply to the given combination are returned as null.
const params = new URLSearchParams({
announcementType: 'rent',
propertyType: 'residential',
propertySecondaryType: 'apartment'
});
const response = await fetch(
`https://crm.rentix.md/api/v1/reference/schema?${params}`,
{ headers: { 'Authorization': 'ApiKey YOUR_API_KEY' } }
);
const schema = await response.json();
// Check if a field is available
if (schema.fields.propertyVisualState) {
console.log(schema.fields.propertyVisualState.options);
// → ["classic-renovation", "euro-renovation", "design-renovation"]
}
curl "https://crm.rentix.md/api/v1/reference/schema?announcementType=rent&propertyType=residential&propertySecondaryType=apartment" \
-H "Authorization: ApiKey YOUR_API_KEY"
$url = 'https://crm.rentix.md/api/v1/reference/schema?' . http_build_query([
'announcementType' => 'rent',
'propertyType' => 'residential',
'propertySecondaryType' => 'apartment'
]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: ApiKey YOUR_API_KEY']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$schema = json_decode($response, true);
Parameters
| Parameter | Type | Description |
|---|---|---|
announcementType | enum | rent or sale |
propertyType | enum | residential, commercial, or parking |
propertySecondaryType | enum | Subtype (must be valid for the given combination) |
{
"context": {
"announcementType": "rent",
"propertyType": "residential",
"propertySecondaryType": "apartment"
},
"fields": {
"propertyQuantitySize": {
"type": "enum",
"required": true,
"options": ["apartment-studio", "custom-value"]
},
"propertyQuantitySizeValue": {
"type": "number",
"required": false,
"constraints": { "min": 1, "max": 100, "step": 1 }
},
"propertyArea": {
"type": "number",
"required": true,
"constraints": { "min": 1, "max": 50000, "step": 0.01 }
},
"propertyLandArea": null,
"propertyCoordinates": {
"type": "coordinates",
"required": true,
"constraints": { "lat": { "min": -90, "max": 90 }, "lng": { "min": -180, "max": 180 } }
},
"propertyAvailabilityDate": {
"type": "date",
"required": true,
"format": "YYYY-MM-DD"
},
"propertyAttributes": {
"type": "enum-array",
"required": false,
"options": ["animals-allowed", "conditioner", "balcony", "wifi", "..."]
},
"announcementValue": {
"type": "number",
"required": true,
"constraints": { "min": 1, "max": 1000000000, "step": 1 }
},
"announcementPayPeriod": {
"type": "enum",
"required": true,
"options": ["monthly", "daily", "hourly"]
},
"fileIds": {
"type": "number-array",
"required": false,
"constraints": { "minItems": 3, "maxItems": 20, "maxVideoFiles": 2, "maxVideoDuration": 300 }
}
// ...and other fields
}
}
null field value means it is not available for the given context. Non-required fields can be omitted or sent as null.Field Types
Each field in the contextual schema has a type that determines its structure:
| Type | Properties | Description |
|---|---|---|
enum | required, options | Single value from a list |
enum-array | required, options | Multiple values from a list |
number | required, constraints (min, max, step) | Numeric value within bounds |
string | required, constraints (minLength, maxLength) | Text with length limits |
date | required, format | Date in the specified format |
coordinates | required, constraints (lat, lng with min/max) | Geographic coordinates |
number-array | required, constraints (minItems, maxItems, maxVideoFiles, maxVideoDuration) | Array of numeric IDs (media files) |
Field Reference
Property Fields
These fields depend on the selected propertySecondaryType — they may be null for some combinations.
| Field | Type | Description |
|---|---|---|
propertyQuantitySize | enum | Room type (apartment-studio, custom-value) |
propertyQuantitySizeValue | number | Custom room count (when custom-value is selected) |
propertyVisualState | enum | Renovation condition (euro-renovation, design-renovation, ...) |
propertyHousingMarket | enum | Market type (secondary, new-build) |
propertyBuildingMaterial | enum | Construction material (brick, monolithic, panel, ...) |
propertyLayout | enum | Layout/series (102, brezhnevka, cheska, ...) |
propertyParkingSpace | enum | Parking type (underground, open, garage, covered) |
propertyFloorNumber | number | Floor number |
propertyFloorsTotal | number | Total floors in the building |
propertyArea | number | Total area in m² |
propertyLandArea | number | Land area in m² (houses and land plots) |
propertyCeilingHeight | number | Ceiling height in meters |
propertyAttributes | enum-array | Amenities and rules (pets, WiFi, balcony, ...) |
propertyCoordinates | coordinates | Map location (latitude, longitude) |
propertyAddress | string | Street address, geocoded to coordinates (CRM-only, max 500 chars). Either propertyCoordinates or propertyAddress is required. Recommended format: City, Street Block (e.g. Chișinău, str. Columna 81/1) |
propertyAvailabilityDate | date | Available from date (YYYY-MM-DD) |
Announcement Fields
These fields are always present (never null), though some apply only to rent listings.
| Field | Type | Description |
|---|---|---|
announcementStatus | enum | Listing status (draft, active, hidden, ...) |
announcementValue | number | Price |
announcementCurrency | enum | Price currency (EUR, USD, MDL) |
announcementDescription | string | Listing description text |
announcementBargain | enum | Bargain allowed (yes, no) |
announcementPayPeriod | enum | Payment period, rent type (monthly, daily, hourly) |
announcementMinRentPeriod | number | Minimum rent period in hours (720 = 1 month), rent type |
announcementPrepayment | enum | Prepayment option, rent type |
announcementPrepaymentValue | number | Custom prepayment amount, rent type (when custom-amount) |
announcementRentDeposit | enum | Deposit option, rent type |
announcementRentDepositValue | number | Custom deposit amount, rent type (when custom-amount) |
fileIds | number-array | Media file IDs attached to the listing |
Property Types
Residential
| Value | Description |
|---|---|
apartment | Apartment |
house | House |
room | Room |
residential-land | Land plot (sale only) |
other | Other |
Commercial
| Value | Description |
|---|---|
office | Office |
trade | Retail space |
warehouse | Warehouse |
free-purpose | Multi-purpose |
production | Production |
business | Ready business |
commercial-land | Commercial land |
legal-address | Legal address |
other | Other |
Parking
| Value | Description |
|---|---|
underground-parking | Underground parking |
open-parking | Open parking |
garage | Garage |
covered-parking | Covered parking |
other | Other |