Esta página ainda não foi traduzida, então você está lendo a versão em inglês.
Night mode and phone lines
Night mode hands the front desk to Ana by hours and wakes a person only for real problems. Phone lines let Ana answer calls on WhatsApp, a Twilio or Telnyx number, or a SIP line. The settings, the ID check, lines, calls and the carrier webhooks.
Night mode is a switch by hours (for example 23:00 to 07:00, hotel time) that hands the desk to Ana. Late guests check in online or at the reception tablet. Ana answers the phone, the tablet's call button and WhatsApp. She wakes the person on call only for real problems, as far up the ladder as the owner chose. In the morning the owners and managers get a report.
Phone lines let Ana answer calls: on the hotel's WhatsApp number, on a Twilio or Telnyx number, or on a SIP line from the hotel's phone system or a licensed operator. Each call is logged with a transcript and a tag, and goes into the inbox.
Night mode
Get night mode
/api/v1/night-modesettings.manage or front_desk.operate{
"settings": {
"enabled": true,
"start": "23:00",
"end": "07:00",
"on_call": ["3d0c8a52-1f4e-4b7a-9c61-0e2f7b9d4a15"],
"walkins": true,
"id_rule": "remote",
"keys": "instructions",
"key_instructions": "Key box left of the door, code 4821.",
"emergency_numbers": [{ "label": "Doctor on call", "number": "+92 300 1234567" }],
"may_offer": ["A late check-out"],
"remind_hours": 4,
"ladder": {
"housekeeping": "ana",
"desk": "ana",
"maintenance": "message",
"complaint": "message",
"noise": "message",
"lockout": "call",
"medical": "everyone",
"fire": "everyone",
"security": "everyone"
}
},
"on_now": false,
"tonight": { "night": "2026-10-21", "from": "23:00", "to": "07:00", "late_arrivals": 2 },
"team": [{ "id": "3d0c8a52-1f4e-4b7a-9c61-0e2f7b9d4a15", "name": "Bilal", "role": "Manager", "whatsapp": true }],
"problems": { "housekeeping": "Towels, pillows, cleaning", "lockout": "Locked out, or a key that doesn't work" },
"levels": ["ana", "message", "call", "everyone"],
"emergency": [{ "label": "Emergency", "number": "1122" }, { "label": "Doctor on call", "number": "+92 300 1234567" }],
"key_system": false,
"nights": [
{ "night": "2026-10-20", "on_call": ["3d0c8a52-1f4e-4b7a-9c61-0e2f7b9d4a15"], "reminded": 1,
"report": { "arrivals": [], "walkins": 0, "problems": [], "open_problems": 0 }, "reported_at": "2026-10-21T02:00:11+00:00" }
]
}| Field | Meaning |
|---|---|
on_now | Night mode is on and it is night at the hotel now |
tonight | The next (or current) night: its date, hours in hotel time, and arrivals not yet checked in |
team | The hotel's active team. whatsapp: linked on WhatsApp, so they can be on call |
problems | Every kind of problem and its label (trimmed above) |
emergency | The numbers a guest sees at once in an emergency: the country's, the hotel's, then emergency_numbers |
key_system | A key-card system is connected, so keys can be system |
nights | The last 14 nights: who was on call, how many late arrivals were reminded, and the morning report (arrivals, walk-ins, problems, calls, ID checks, money taken) |
Change the settings
/api/v1/night-mode/settingssettings.manageproperty_id is a query parameter. Send only what changes. The answer is the whole night mode, as for GET.
23:00 and 07:00. They must differ.team.kiosk: the ID is checked at the tablet as by day. remote: the person on call approves the ID photo before the key is made.system (the key-card system; it must be connected), on_call (the person on call) or instructions.instructions: how guests get their key at night.{"label", "number"} (40 and 24 characters).0: no reminder.housekeeping, desk, maintenance, complaint, noise, lockout, medical, fire, security): ana (Ana handles it, it's in the report), message (the person on call on WhatsApp), call (also rings their phone) or everyone. medical, fire and security are always everyone.curl -X PUT "https://app.chatbeds.app/api/v1/night-mode/settings?property_id=6f1c3b2e-8a0d-4f5e-9b7a-2c3d4e5f6a7b" \
-H "Authorization: Bearer $FIREBASE_ID_TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled": true, "start": "23:00", "end": "07:00", "on_call": ["3d0c8a52-1f4e-4b7a-9c61-0e2f7b9d4a15"], "id_rule": "remote", "ladder": {"noise": "call"}}'The ID check
With id_rule remote, a guest checking in at night sends an ID photo from the tablet, and the person on call approves it.
/api/v1/night-mode/id-checks/{request_id}front_desk.operate{
"request_id": "9a4e2c10-7b3d-4f8a-8e51-2d6c0b9f3a77",
"status": "open",
"guest": "Sara Brown",
"booking_name_matches": true,
"room_type": "Deluxe",
"arrival": "2026-10-21",
"departure": "2026-10-23",
"photo": "data:image/jpeg;base64,…",
"details": { "full_name": "SARA BROWN", "nationality": "GBR" },
"decided": null,
"decided_by": null
}/api/v1/night-mode/id-checks/{request_id}front_desk.operatetrue: the guest finishes checking in at the tablet. false: the guest is asked to wait for someone, and no key is made.The answer is the ID check, with decided (approved or refused) and decided_by. Deciding again changes nothing. 404 This isn't an ID check. for any other request.
Run the night's jobs now
/api/v1/night-mode/runsettings.manageRuns now what the hourly job would: the late-arrival reminders, telling the people on call that night mode is on, and the morning report once the night has ended. property_id is a query parameter. The answer is the night mode, as for GET, with done: how many things were done.
Phone lines
Get lines and calls
/api/v1/voicesettings.manage or inbox.use{
"lines": [
{
"id": "c2f1e7a4-5b9d-4e3c-8a10-6f2d4b7e9c31",
"route": "twilio",
"number": "+14155550123",
"sip_address": null,
"answer": "no_answer",
"desk_phone": "+14155550199",
"ring_seconds": 20,
"enabled": true,
"ready": true,
"last_call_at": "2026-10-21T01:14:02+00:00"
}
],
"routes": { "whatsapp": true, "twilio": true, "telnyx": false, "sip": true },
"whatsapp_connected": true,
"sip_domain": "chatbeds.sip.twilio.com",
"calls": [
{
"id": "5e8d2b41-0c7a-4f69-b3e2-91a4d6c0f852",
"route": "twilio",
"caller": "+447700900123",
"status": "ended",
"tag": "booked",
"tag_label": "Booked",
"night": true,
"summary": "Booked a Deluxe room for 12 to 14 Nov.",
"seconds": 184,
"transferred_to": null,
"language": "en",
"reservation_id": "a589df05-30ad-4ee5-9832-16ff6c2c1d0e",
"started_at": "2026-10-21T01:14:02+00:00"
}
],
"by_tag": { "booked": 1 },
"tags": { "booked": "Booked", "link_sent": "Booking link sent" }
}| Field | Meaning |
|---|---|
lines[].route | whatsapp, twilio, telnyx or sip |
lines[].sip_address | For sip: the address the hotel's phone system or operator forwards to, <code>@<sip_domain> |
lines[].answer | When Ana answers: always, no_answer (the desk phone rings first for ring_seconds) or night (only in night mode; by day the call goes to the desk phone) |
lines[].ready | ChatBeds' account for this route is set up on the server |
routes | Which kinds of line can be added now |
calls | The last 30 days, at most 100, newest first |
calls[].tag | booked, link_sent, question, request, problem, emergency or missed_opportunity (asked about rooms and prices, and nothing came of it) |
calls[].caller | The caller's number. Ana never reads it out |
Add a line
/api/v1/voice/linessettings.manageproperty_id is a query parameter. The answer is the line.
whatsapp, twilio, telnyx or sip.twilio and telnyx: the number bought for the hotel, with its country code.always (default), no_answer or night. no_answer and night need desk_phone, except on WhatsApp.20.whatsappneeds the hotel's WhatsApp number connected, and turns on the call button on that number. Meta allows calls only on numbers it has cleared for calling.sipmakes a newsip_addressfor the line.
Change or remove a line
/api/v1/voice/lines/{line_id}settings.manageTakes answer, desk_phone, ring_seconds and enabled, and property_id as a query parameter. The answer is the line.
/api/v1/voice/lines/{line_id}settings.manageAnswers {"removed": true}. Removing the WhatsApp line turns the call button off.
Get one call
/api/v1/voice/calls/{call_id}settings.manage or inbox.useThe call as in the list, with transcript and actions (what Ana did during the call). property_id is a query parameter.
Errors
| Status | detail | When |
|---|---|---|
400 | Night mode hours are 24-hour times, like 23:00 and 07:00. | |
400 | Night mode needs at least one person on call who is linked on WhatsApp, … | Turning it on without one |
400 | Connect the key-card system first (Settings → Reception → Key cards). | keys system with no key-card system |
400 | An emergency always wakes everyone on call and the managers. | medical, fire or security set below everyone |
400 | Give the desk phone number: calls go there first (by day, or until nobody answers). | |
400 | The number: a phone number with its country code, like +92 300 1234567. | |
404 | Line not found. | |
409 | Phone lines of this kind aren't set up on ChatBeds yet. WhatsApp calls work now. | The route isn't ready |
409 | Connect the hotel's WhatsApp number first (Settings → WhatsApp). | |
409 | WhatsApp calls are already on for this hotel. | |
409 | That number is already a line at a hotel. | |
409 | WhatsApp didn't turn calls on: … | Meta refused to turn calls on for the number |
Carrier setup
This is for whoever runs the ChatBeds server. Hotels don't set any of this: their Twilio and Telnyx numbers are on ChatBeds' account.
| Setting | |
|---|---|
TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN | ChatBeds' Twilio account. Twilio signs its webhooks with the auth token |
TELNYX_API_KEY, TELNYX_PUBLIC_KEY | ChatBeds' Telnyx account. Telnyx signs with Ed25519; the public key checks it |
VOICE_SIP_DOMAIN | A Twilio SIP domain. SIP lines get <code>@VOICE_SIP_DOMAIN. Needs the Twilio settings too |
PUBLIC_API_URL | The API's public address. Carriers sign the exact address they call |
VOICE_MAX_CALL_MINUTES | The longest call. Default 15 |
Set the webhooks:
| Carrier | Where | Address |
|---|---|---|
| Twilio | Each number's voice webhook, and the SIP domain's voice URL | POST {PUBLIC_API_URL}/api/v1/voice/twilio/incoming |
| Telnyx | A TeXML application for the numbers | POST {PUBLIC_API_URL}/api/v1/voice/telnyx/incoming |
- A request whose signature doesn't match (
X-Twilio-Signature, or Telnyx'stelnyx-signature-ed25519withtelnyx-timestamp, at most 5 minutes old) answers403. - The answer is TwiML (TeXML for Telnyx) that connects the call's audio over
wss://to/api/v1/voice/twilio/streamor/api/v1/voice/telnyx/stream. Allow WebSockets, and a request timeout of at leastVOICE_MAX_CALL_MINUTES. - WhatsApp calls need no carrier: subscribe the Meta app's webhook to the calls field as well as messages.
- The ladder's
callstep rings the person on call from the hotel's Twilio line. With no Twilio line, they get the WhatsApp message only.
Criando algo?
Negotiation
The hotel's limits for private offers, the list of negotiations with the WhatsApp status, and offers made at the desk for a caller. Ana trades rather than discounts, never under the hotel's floor.
AI manager
Jobs the AI manager does for a hotel every day inside the owner's limits, the price questions waiting for a yes, what it did and what it earned. Its settings, answering a question, and running it now.