tenants.anreiseFotoHochladen
Uploads a photo for a step of the arrival guide (Base64) — same storage as the settings page. Returns the `photoKey` (a new key `<step>-<8 hex>.jpg` per upload, downscaled to ≤ 2000 px, metadata removed); then add it as `{ key }` to the step's `fotos` via `tenants.update-arrival-guide-settings` (up to 4 photos). Owner and team, as in the browser. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
stepKey | enum | yes | One of: location, entrance, room, keybox, door_opener, enter, door_exit, rules, wifi |
base64 | string | yes | |
mimeType | string | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
photoKey | string | yes |
tenants.connectStatus
Stripe-Connect status for the current tenant. Returns whether the tenant has connected their Stripe account and is onboarded (payouts-enabled). Used by the /direct surface to render the right state (CTA vs connected-summary). Read-only query.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
connected | boolean | yes | |
onboarded | boolean | yes | |
accountId | string · nullable | yes | |
onboardedAt | string · nullable | yes | |
bookingComRateSyncEnabled | boolean | yes |
tenants.getArrivalGuideSettings
Returns the settings of the guest arrival guide (arrival and access information, Wi-Fi, video links, etc.); an empty object if there is no entry. May contain access credentials. Any signed-in role. Read-only.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
enabled | boolean | no | |
address | string | no | |
entranceCodeName | string | no | |
helpPhone | string | no | |
keyboxCodePattern | string | no | |
weitereZugangscodes | array of string | no | |
wifi | object | no | |
wifi.ssid | string | no | |
wifi.password | string | no | |
steps | object | no | |
steps.location | object | no | |
steps.entrance | object | no | |
steps.room | object | no | |
steps.keybox | object | no | |
steps.door_opener | object | no | |
steps.enter | object | no | |
steps.door_exit | object | no | |
steps.rules | object | no | |
steps.wifi | object | no |
tenants.getBookingHotelId
The property's Booking.com hotel ID. With it Foyer links every Booking.com booking without a phone number to its extranet page — since 28 Sep 2026 Booking.com no longer passes the number on to Beds24. `null` = not set. Read-only query.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
bookingHotelId | string · nullable | yes |
tenants.getBrandVoice
Read the tenant's brand-voice settings. Returns null if unset (the pipeline falls back to a generic "warm professional" default). Read-only query.
Input parameters
Returns object.
Output fields
The whole object may be null.
| Field | Type | Required | Notes |
|---|---|---|---|
description | string | yes | |
tone | enum | yes | One of: warm, professional, casual |
voiceTrainingEnabled | boolean | no |
tenants.getCalendarRoomSort
The property-wide room order in the calendar. Any signed-in user may READ it — the calendar needs it to display rooms, not just the owner. Read-only query.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
sort | enum | yes | One of: floor_number, number, type |
tenants.getPortalLayoutVersion
Pre-arrival portal layout. Returns the current setting so the Settings UI can render the right toggle state. - "v1" = legacy Meldeschein-only wizard - "v2" = new section-based PortalShell (Meldeschein + future hotel-info sections) Existing tenants are pinned to v1; new tenants default to v2. Read-only query.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
version | enum | yes | One of: v1, v2 |
tenants.getRechnungAutoSenden
Rechnungsantwort automatisch senden? Read-only query.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
an | boolean | yes |
tenants.getReviewLinks
read the email section of channel_import_meta for the tenant. Returns the email import status, defaulting to idle when never run. Used by the email import UI in /settings/credentials to render status. Read-only query.
Input parameters
Returns object.
Output fields
The whole object may be null.
| Field | Type | Required | Notes |
|---|---|---|---|
googleMapsUrl | string | no | |
bookingComUrl | string | no | |
tripadvisorUrl | string | no | |
customUrl | string | no | |
customLabel | string | no |
tenants.getReviewRequestSettings
Returns the setting for the automatic review request after check-out: enabled and delayHours (waiting time of 1, 2 or 24 hours); with no entry, off and 1. Any signed-in role. Read-only.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
enabled | boolean | no | |
delayHours | literal | no |
tenants.getServicezeit
The property's service hours: when the team answers guests, in minutes since midnight. Foyer inserts them into texts as `%service_from%` / `%service_until%`. Read-only query.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
serviceVonMin | integer | yes | |
serviceBisMin | integer | yes |
tenants.get_brand_voice_stats
Returns brand-voice training readiness stats for the tenant: number of manual outbound messages eligible as style anchors (length ≥ 30 chars, within 90-day lookback), last anchor timestamp, per-channel breakdown (whatsapp / email / hospitable), and the voiceTrainingEnabled flag. Read-only — no side effects.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
anchorCount | number | yes | |
lastAnchorAt | string · nullable | yes | |
channelBreakdown | object | yes | |
channelBreakdown.whatsapp | number | yes | |
channelBreakdown.email | number | yes | |
channelBreakdown.hospitable | number | yes | |
voiceTrainingEnabled | boolean | yes |
tenants.get_channel_import_meta
Read the current Hospitable (and future channel) import status for the tenant. Returns status ('idle' | 'running' | 'done' | 'error'), lastRunAt, importedCount, and errorMessage if the last run failed. Use this to check import progress before triggering a new import.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
hospitable | object | no | |
hospitable.status | enum | yes | One of: idle, running, done, error |
hospitable.lastRunAt | string · nullable | yes | |
hospitable.importedCount | number | yes | |
hospitable.errorMessage | string | no |
tenants.get_email_import_meta
Read the current email (Postmark inbound) import status for the tenant. Returns status ('idle' | 'running' | 'done' | 'error'), lastRunAt, importedCount, and errorMessage if the last run failed. Use this to check email import progress before triggering a new import via triggerEmailImport.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
status | enum | yes | One of: idle, running, done, error |
lastRunAt | string · nullable | yes | |
importedCount | number | yes | |
errorMessage | string | no |
tenants.get_faq_detection_mode
Read the tenant's FAQ detection mode: 'lexical' (trigger-phrase matching, default), 'openai', or 'voyage' (semantic embeddings). Read-only.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
mode | string | yes |
tenants.qualitaetZustimmung
The property's consent to Annex 3 of the data processing agreement (improving the automatic evaluation, /avv#anlage-3) and the status of the last evaluation run (metrics without personal data). Read-only query.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
zustimmungAm | string · nullable | yes | |
letzterLauf | object · nullable | yes | |
letzterLauf.gelaufenAt | string | yes | |
letzterLauf.aufenthalte | integer | yes | |
letzterLauf.neueFaelle | integer | yes | |
letzterLauf.kennzahlen | object | yes | |
faelle | integer | yes |
tenants.qualitaetZustimmungSetzen
Grants or revokes consent to Annex 3 of the data processing agreement (AVV). Owner only — the owner is the one who concludes the contract. Revoking immediately deletes the property's evaluation set (AVV Annex 3 para. 8); both are recorded in audit_log. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
an | boolean | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
an | boolean | yes | |
geloescht | integer | yes |
tenants.rechnungAutoSendenProtokoll
Who received an automatic reply and who did not — and why. At most ONE “gesendet” (sent) per booking and question; if the guest asks again, this shows “entwurf / schon_automatisch_beantwortet” (draft / already answered automatically). The most recent 100. Read-only query.
Input parameters
Returns object.
Output fields
Returns array of object. Fields of each element:
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
createdAt | string | yes | |
gastName | string · nullable | yes | |
stayId | string | yes | |
conversationId | string · nullable | yes | |
frage | string · nullable | yes | |
ergebnis | enum | yes | One of: geplant, gesendet, entwurf |
grund | string · nullable | yes |
tenants.setBookingHotelId
Set the Booking.com hotel ID or remove it (empty/`null`). Owner only; digits only (the ID is in the extranet address, e.g. `hotel_id=64804`). Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
bookingHotelId | string · nullable | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
bookingHotelId | string · nullable | yes |
tenants.setCalendarRoomSort
Sets it. Owner ONLY: the order applies to all operators, and whoever changes it rearranges the list the front desk clicks on. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
sort | enum | yes | One of: floor_number, number, type |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
sort | enum | yes | One of: floor_number, number, type |
tenants.setRechnungAutoSenden
Turns automatic sending of the invoice reply on or off. Owner only: from then on Foyer writes to guests in the owner's name without anyone reviewing it. The legacy column `tenants.rechnung_auto_senden` is kept in sync but no longer read. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
an | boolean | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
an | boolean | yes |
tenants.setReviewRequestSettings
Turns the automatic review request after check-out on or off (enabled) and sets the waiting time delayHours (1, 2 or 24, default 1). Owner only. Changes data. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
enabled | boolean | yes | |
delayHours | literal | no | Default: 1 |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | boolean | yes |
tenants.setServicezeit
Sets the property's service hours. Owner only: the times then appear in messages to guests. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
serviceVonMin | integer | yes | |
serviceBisMin | integer | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
tenants.setVoiceTrainingEnabled
Toggle voice training (style anchors) on/off for this tenant. When disabled, buildComposeContext() skips the anchor query and the LLM falls back to the static brand-voice description only. Owner-only — affects the AI pipeline. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
enabled | boolean | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | boolean | yes | |
enabled | boolean | yes |
tenants.set_faq_detection_mode
Set the tenant's FAQ detection mode ('lexical' | 'openai' | 'voyage'). Semantic modes need the provider's API key in the server env and embeddings computed via ai_questions.regenerate_embeddings. Owner-only, mutating.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
mode | enum | yes | One of: lexical, openai, voyage |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
mode | string | yes |
tenants.triggerEmailImport
enqueue an async email (Postmark inbound) historical import job. Guards against double-enqueue: if channel_import_meta.email.status is already 'running', returns { ok: false, reason: 'already_running' }. Otherwise sets status to 'running' and enqueues the pg-boss job `channel.import.email` which calls importEmailHistory() and writes the final status back. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
lookbackDays | integer | no | Default: 90 |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | boolean | yes | |
reason | literal | no | One of: already_running |
tenants.update-arrival-guide-settings
Replace the tenant's arrival-guide settings wholesale (address, entrance/keybox code names, weitereZugangscodes (further custom codes that are access data, e.g. Wi-Fi; withheld from bookings without access), wifi ssid/password, and per-step enabled/bodyTranslations/helpTranslations/fotos/videoUrl/nurZimmer for the 9 guide steps; door_opener/door_exit are off unless enabled:true; nurZimmer limits a step to those rooms, empty = all). fotos: up to 4 photos per step, each { key (from tenants.anreiseFotoHochladen, must belong to the step), ausschnitt? { x, y: centre 0..1 of the photo, zoom 1..4 }, ganz? { rand: '#rrggbb', oben?, unten? 0..0.4 } (show the whole photo fitted, the area beside it in that colour; oben/unten trim that share off the top/bottom first; ausschnitt is then ignored), punkte? [{ n 1..9 unique per step, x, y 0..1, b?, h? }] } — point n marks line n of the step's first numbered list; with b and h (width/height 0.02..1 of the photo, x/y = centre, must lie inside the photo) it is drawn as a numbered frame instead of a dot. pfeile? [{ n 1..9, art: 'gerade', x, y (start), zx, zy (tip), length >= 0.02 } | { n, art: 'dreh', x, y (centre), r 0.02..0.5 (radius as share of the photo width, x±r inside the photo), gegen? (true = counter-clockwise) }], max 9 per photo — motion arrows for line n; n may repeat a point's or frame's n. Legacy photoKey alone is still accepted (= fotos[0]). videoUrl must be http(s). Owner-only, mutating — replaces the whole JSONB (read-modify-write happens caller-side; send fotos back unchanged to keep crop, ganz, points and arrows).
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
enabled | boolean | no | |
address | string | no | |
entranceCodeName | string | no | |
helpPhone | string | no | |
keyboxCodePattern | string | no | |
weitereZugangscodes | array of string | no | |
wifi | object | no | |
wifi.ssid | string | no | |
wifi.password | string | no | |
steps | object | no | |
steps.location | object | no | |
steps.entrance | object | no | |
steps.room | object | no | |
steps.keybox | object | no | |
steps.door_opener | object | no | |
steps.enter | object | no | |
steps.door_exit | object | no | |
steps.rules | object | no | |
steps.wifi | object | no |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
tenants.updateBrandVoice
Save brand-voice settings. Owner-only — this is the operator's voice, not staff's. Empty/whitespace description is rejected (would defeat the purpose). The value lands in tenants.brand_voice_settings jsonb and is read on every L2 LLM compose via buildComposeContext(). Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
description | string | yes | |
tone | enum | yes | One of: warm, professional, casual |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | boolean | yes |
tenants.updatePortalLayoutVersion
Flip the pre-arrival portal layout. Reversible — no destructive side effects, no token state touched. The next request to /check-in/[token] picks up the new value through the loader. Owner-only because it changes the public guest-facing surface. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
version | enum | yes | One of: v1, v2 |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | boolean | yes | |
version | enum | yes | One of: v1, v2 |
tenants.updateReviewLinks
Replaces the property's review links (googleMapsUrl, bookingComUrl, tripadvisorUrl, plus a custom link customUrl with customLabel); fields that are omitted or empty are removed. Owner only. Changes data. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
googleMapsUrl | string | literal | no | |
bookingComUrl | string | literal | no | |
tripadvisorUrl | string | literal | no | |
customUrl | string | literal | no | |
customLabel | string | literal | no |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | boolean | yes |
tenants.update_rooms
Update the tenant's room count. Sockel is 30€/mo for ≤2 rooms; each additional room is 10€/mo. The matching Stripe extra-room line item is synced best-effort; the next webhook reconciliation catches any drift. Mutating action — requires _confirm: true.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
rooms | integer | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
stripeSync | any | yes | Raw Stripe sync result, passed through verbatim — shape is Stripe's, not ours. |