Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sdurutr436/stay-sidekick/llms.txt

Use this file to discover all available pages before exploring further.

The Apartment Catalog is the master inventory that powers every other Stay Sidekick module. The Heat Map, Late Check-in Notifications, and Contact Sync tools all cross-reference this catalog to match reservation data against your real property list. Keeping it accurate and up-to-date is the single most important step before using any other feature. Each company in the platform maintains its own isolated catalog — data from one tenant is never visible to another.

What the catalog stores

Each apartment record holds the following fields, drawn directly from the Apartamento model:
FieldDescription
nombreHuman-readable property name (required, up to 200 characters)
id_pmsThe property’s unique identifier inside your PMS (e.g. Smoobu property ID). Null for manually-created entries.
id_externoInternal typology or classification code. Multiple apartments can share the same id_externo if they belong to the same property type.
direccionFull street address (optional, up to 300 characters)
ciudadCity (optional, up to 100 characters)
pms_origenHow the record was created: smoobu, manual, or xlsx
activoWhether the apartment is active. Soft-deleted apartments remain in the database with activo = false.
created_at / updated_atUTC timestamps managed automatically
Per-company uniqueness is enforced at the database level: the combination of empresa_id + id_pms must be unique (partial index, only when id_pms is not null). This prevents duplicate PMS properties from being imported more than once.

Adding apartments

There are three ways to add apartments to your catalog. Use whichever fits your workflow — all three methods perform an upsert internally, so running them more than once is always safe.
Use this when you want to add a single apartment by hand. Send a POST request with a JSON body containing at least the nombre field.
curl -X POST http://localhost/api/apartamentos \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Apartamento Sol 3B",
    "id_externo": "SOL-3B",
    "direccion": "Calle Mayor 10, 3º B",
    "ciudad": "Madrid"
  }'
Response (201):
{
  "ok": true,
  "apartamento": {
    "id": "a1b2c3d4-...",
    "nombre": "Apartamento Sol 3B",
    "id_externo": "SOL-3B",
    "id_pms": null,
    "direccion": "Calle Mayor 10, 3º B",
    "ciudad": "Madrid",
    "pms_origen": "manual",
    "activo": true
  }
}
All string fields are sanitized server-side (HTML stripped, whitespace trimmed) before being persisted.

XLSX preview

Before committing an import, you can preview exactly which rows will be created or updated without writing anything to the database. This is useful for catching formatting issues before they affect your live catalog.
curl -X POST http://localhost/api/apartamentos/importacion/preview \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@apartments.xlsx"
Response (200):
{
  "ok": true,
  "preview": [
    {
      "fila": 2,
      "nombre": "Apartamento Mar A1",
      "id_externo": "MAR-A1",
      "accion": "crear"
    },
    {
      "fila": 3,
      "nombre": "Apartamento Sol 3B",
      "id_externo": "SOL-3B",
      "accion": "actualizar"
    }
  ]
}
The preview endpoint is rate-limited to 30 requests per hour and never writes to the database — it is safe to call repeatedly while refining your spreadsheet.

PMS configuration

The Smoobu sync (and the PMS-based data feeds used by Heat Map and Late Check-ins) requires your company’s PMS API key to be stored first. The key is encrypted at rest using Fernet symmetric encryption before being written to the database — it is never returned in plain text. Read current PMS config (key is masked):
curl http://localhost/api/apartamentos/pms \
  -H "Authorization: Bearer $TOKEN"
{
  "ok": true,
  "config": {
    "proveedor": "smoobu",
    "endpoint": null,
    "api_key_masked": "sk-l...****...xQ9z"
  }
}
Create or update the PMS config (upsert):
curl -X PUT http://localhost/api/apartamentos/pms \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "proveedor": "smoobu",
    "api_key": "YOUR_SMOOBU_API_KEY"
  }'
Supported proveedor values: smoobu, beds24, hostaway, cloudbeds. Remove the PMS config:
curl -X DELETE http://localhost/api/apartamentos/pms \
  -H "Authorization: Bearer $TOKEN"

Listing and updating apartments

List all active apartments for your company:
curl http://localhost/api/apartamentos \
  -H "Authorization: Bearer $TOKEN"
Get a single apartment by ID:
curl http://localhost/api/apartamentos/<id> \
  -H "Authorization: Bearer $TOKEN"
Update fields on an existing apartment (partial update):
curl -X PUT http://localhost/api/apartamentos/<id> \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Apartamento Sol 3B (renovado)",
    "ciudad": "Barcelona"
  }'
Only nombre, direccion, and ciudad can be updated. Omitting a field leaves it unchanged.

Soft delete

Deleting an apartment marks it as inactive (activo = false) rather than removing the row. All historical data referencing the apartment is preserved, and the apartment disappears from the active catalog list.
curl -X DELETE http://localhost/api/apartamentos/<id> \
  -H "Authorization: Bearer $TOKEN"
Response (200):
{ "ok": true }

Build docs developers (and LLMs) love