channels.activate_ota
Set an OTA connection status from 'pending' to 'active' so rate and availability pushes begin. Call after credentials have been stored via credentials.set. Mutating action — requires _confirm: true.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
ota | enum | yes | OTA identifier: 'booking_com' or 'expedia' — One of: booking_com, expedia |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
channels.connect_ota
Add or update an OTA connection for the current tenant. Creates the connection with status='pending' if it does not exist, or updates hotelExternalId and resets status to 'pending' on conflict. Mutating action — requires _confirm: true.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
ota | enum | yes | OTA identifier: 'booking_com' or 'expedia' — One of: booking_com, expedia |
hotelExternalId | string | yes | Hotel ID in the OTA system |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
channels.disconnect_ota
Remove an OTA connection for the current tenant. Deletes the connection row; rate pushes to this OTA will stop immediately. Mutating action — requires _confirm: true.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
ota | enum | yes | OTA identifier: 'booking_com' or 'expedia' — One of: booking_com, expedia |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
channels.list
List the four ingestion channels (email, whatsapp, hospitable, voice) with their current state, last-event timestamp, and last-error string. Read-only.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
channels | array of object | yes | |
channels.key | enum | yes | One of: email, whatsapp, hospitable, voice |
channels.state | enum | yes | One of: live, syncing, error, never, paused |
channels.lastEventAt | string · nullable | yes | |
channels.lastError | string · nullable | yes |
channels.list_ota_connections
List all OTA (Online Travel Agency) connections for the current tenant. Returns booking_com and expedia connections with their status, hotel external ID, last sync time, and last error. Read-only.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
connections | array of object | yes | |
connections.id | string | yes | |
connections.ota | enum | yes | One of: booking_com, expedia |
connections.hotelExternalId | string | yes | |
connections.status | enum | yes | One of: pending, active, error, disabled |
connections.lastSyncedAt | string · nullable | yes | |
connections.lastError | string · nullable | yes | |
connections.createdAt | string | yes | |
connections.updatedAt | string | yes |
channels.list_property_mappings
List the room_type → Hospitable property UUID mappings for the current tenant. Used to configure which Foyer room types map to which Hospitable listings. Read-only.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
mappings | array of object | yes | |
mappings.id | string | yes | |
mappings.roomType | string | yes | |
mappings.propertyUuid | string | yes | |
mappings.createdAt | string | yes | |
mappings.updatedAt | string | yes |
channels.remove_property_mapping
Remove a room_type → Hospitable property UUID mapping. Rate-sync will stop pushing to this Hospitable listing for this room type. Mutating action — requires _confirm: true.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
roomType | string | yes | Foyer room type identifier |
propertyUuid | string | yes | Hospitable property UUID to remove |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
channels.resync
Manually enqueue Hospitable rate-sync jobs for every mapped room type and every rate record in the given date range. Useful after adding new property mappings or re-enabling sync. Returns { ok, enqueued } — enqueued = number of rate-rows submitted. No-ops if sync is disabled or no property mappings exist. Mutating action — requires _confirm: true.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
dateFrom | string | no | Start of range, YYYY-MM-DD (default: today) |
dateTo | string | no | End of range, YYYY-MM-DD (default: today + 90 days) |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | boolean | yes | |
enqueued | number | no | |
reason | string | no |
channels.set_active
Pause or resume a single ingestion channel. active=false sets state to 'paused' (a kill-switch — channel won't auto-recover on next event); active=true clears the pause flag and restores normal state. Mutating action — requires _confirm: true.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
key | enum | yes | One of: email, whatsapp, hospitable, voice |
active | boolean | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
channels.set_property_mapping
Add a mapping from a Foyer room type to a Hospitable property UUID. Required for Hospitable rate-sync to know which Hospitable listing to push rates to. One room type can map to multiple Hospitable UUIDs (for multi-room properties). Idempotent — silently ignores duplicate (roomType, propertyUuid) pairs. Mutating action — requires _confirm: true.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
roomType | string | yes | Foyer room type identifier, e.g. 'Doppelzimmer' |
propertyUuid | string | yes | Hospitable property UUID from app.hospitable.com |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
channels.sync_status
Return the last 24h sync status for a channel (hospitable by default): last sync log row, error count, and the 10 most recent log entries. Read-only.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
channel | enum | no | Which outbound channel to inspect — One of: hospitable, booking_com_native — Default: "hospitable" |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
lastSync | any · nullable | yes | |
errorCount | number | yes | |
recentLogs | array | yes |
channels.toggle_hospitable_rate_sync
Enable or disable automatic Hospitable rate-sync for this tenant. When enabled, every rate change in Foyer enqueues a job that pushes the new price to all mapped Hospitable property UUIDs via the Hospitable API. Requires 'hospitable_api_key' in credentials and at least one property mapping. Mutating action — requires _confirm: true.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
enabled | boolean | yes | true = activate rate-sync, false = deactivate |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
enabled | boolean | yes |