inbox.accept_draft
Approve an AI-generated draft, swapping aiLayer to 'manual' (operator chain-of-custody). For stay-bound conversations, delivers the message via the channel dispatcher (real outbound send + message.sent event) and removes the draft row. For loose threads (no stay), flips the draft to state=sent in place (flip-only, no delivery). Optional bodyOverride lets the operator edit the suggestion before sending. A draft that reissues an invoice at stay (irreversible, uses a new number) is accepted only with the permissions of invoices.reissue (owner) and confirmReissue: true; otherwise it stays a draft (keine_berechtigung / bestaetigung_fehlt).
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
draftId | string | yes | |
bodyOverride | string | no | |
confirmReissue | boolean | no |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
messageId | string | yes | |
channel | string | yes | |
delivered | boolean | yes |
inbox.draft_reply
Run the P2.2 AI pipeline (L0 sensitive / L1 rules / L2 LLM) for a given inbound message and persist a draft outbound message row. Returns the resulting draft. NOTE: This writes a draft (not pure read-only) — operators can then send it via inbox.accept_draft.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
messageId | string | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
draftId | string · nullable | yes | |
body | string · nullable | yes | |
aiLayer | string · nullable | yes | |
confidence | number · nullable | yes |
inbox.list_by_stay
List all sent messages (inbound + outbound) for a stay's conversation, oldest-first. Excludes drafts. Read-only.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
stayId | string | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
items | array of object | yes | |
items.messageId | string | yes | |
items.direction | enum | yes | One of: inbound, outbound |
items.channel | enum | yes | One of: whatsapp, email, hospitable, voice, channex, beds24 |
items.sender | string · nullable | yes | |
items.body | string · nullable | yes | |
items.aiLayer | string · nullable | yes | |
items.sentAt | string | yes |
inbox.list_triage
Paginated triage feed of messages across the tenant, newest first. Cursor is the ISO timestamp of the last item from the previous page. filter='all' is the only meaningful value in v1; other values currently return the same data (filter logic lands in P2.2).
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
filter | enum | no | One of: all, mine, sensitive, unanswered — Default: "all" |
limit | integer | no | Default: 25 |
cursor | string | no |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
items | array of object | yes | |
items.messageId | string | yes | |
items.conversationId | string | yes | |
items.channel | string | yes | |
items.direction | string | yes | |
items.sender | string · nullable | yes | |
items.body | string · nullable | yes | |
items.sentAt | string | yes | |
items.aiLayer | string · nullable | yes | |
nextCursor | string · nullable | yes |
inbox.list_unanswered
List up to 50 inbound guest messages where no operator reply has been sent in the same conversation since the inbound. Conversations an operator marked as done („Erledigt“) are left out until the guest writes again. Newest-first. Read-only.
Input parameters
Returns object.
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
items | array of object | yes | |
items.messageId | string | yes | |
items.conversationId | string | yes | |
items.stayId | string · nullable | yes | |
items.channel | enum | yes | One of: whatsapp, email, hospitable, voice, channex, beds24 |
items.sender | string · nullable | yes | |
items.body | string · nullable | yes | |
items.sentAt | string | yes |
inbox.send_reply
Send an outbound reply for a stay's conversation. Channel auto-resolves from the latest message in the thread (email/whatsapp/hospitable). Persists the outbound message and emits the message.sent webhook. Refused with `rechnungsabsicht_offen` when the body is the unedited text of an open invoice-reply draft ("invoice just sent") — approve that draft with inbox.accept_draft instead, which emails the invoice first.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
stayId | string | yes | |
body | string | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
messageId | string | yes | |
channel | enum | yes | One of: email, whatsapp, hospitable, beds24 |
conversationId | string | yes |