ChatBedsProgramiści
Hotel features API

Ta strona nie jest jeszcze przetłumaczona, więc czytasz wersję angielską.

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.

The AI manager does jobs for the hotel every hour on its own, inside the owner's limits. It asks only before changing a price. Every action is logged once, and what it earned counts in the hotel's results once paid. It is off until the owner turns it on.

JobWhat it does
pricesRevBot looks at prices once a day. Its suggestions are the questions waiting for a yes
gap_nightsA single free night between sold-out nights is lowered by gap_pct, never under RevBot's floor
win_backAfter a guest from a booking site leaves, a thank-you with a private code (win_back_pct off) for booking direct next time
upsellsSwitches on the extras message before arrival. Extras guests add after it count
chaseA guest who left owing money gets a message with a way to pay, chase_after_days after check-out
reviewsReports the after-stay scores and review invites
weekly_reportOn the owner's day and hour: what it did, what it earned, what needs a yes, on WhatsApp

Every endpoint needs the permission ai_manager.manage (owners and admins), and property_id as a query parameter.

Get the AI manager

GET/api/v1/ai-manager
Permission: ai_manager.manage
Request
curl "https://app.chatbeds.app/api/v1/ai-manager?property_id=6f1c3b2e-8a0d-4f5e-9b7a-2c3d4e5f6a7b" \
  -H "Authorization: Bearer $FIREBASE_ID_TOKEN"
200 OK
{
  "settings": {
    "enabled": true,
    "jobs": {
      "prices": true,
      "gap_nights": true,
      "win_back": true,
      "upsells": true,
      "chase": true,
      "reviews": true,
      "weekly_report": true
    },
    "gap_pct": 15,
    "gap_days": 14,
    "win_back_pct": 10,
    "commission_pct": 15,
    "chase_after_days": 1,
    "report_day": 0,
    "report_hour": 9
  },
  "questions": [
    {
      "id": "7c1e9a3f-2d4b-4e86-a5f0-3b9d1c7e2a64",
      "ref": "7C1E9",
      "room_type_id": "19306340-c7cf-465a-93d3-0b7873a7e85d",
      "room_type": "Deluxe",
      "date": "2026-11-14",
      "current_price": 90.0,
      "suggested_price": 105.0,
      "reason": "Saturday 85% full, 3 weeks out",
      "occupancy": 0.85,
      "status": "OPEN",
      "applied_price": null,
      "currency": "USD",
      "created_at": "2026-10-21T04:00:12+00:00",
      "job": "prices"
    }
  ],
  "actions": [
    {
      "id": "e2b4c6d8-1a3f-4c5e-9b7d-0f2a4c6e8b10",
      "job": "gap_nights",
      "status": "DONE",
      "title": "Deluxe on Tue 28 Oct: a single free night between sold-out nights, lowered from USD 90 to USD 77",
      "detail": null,
      "amount": 77.0,
      "currency": "USD",
      "refs": {},
      "at": "2026-10-21T04:00:13+00:00",
      "decided_by": null
    }
  ],
  "earned": {
    "month": "2026-10",
    "totals": [
      { "currency": "USD", "total": 210.0,
        "by_source": [{ "source": "gap_night", "name": "Gap nights sold", "amount": 90.0 },
                      { "source": "won_back", "name": "OTA guests won back (commission saved)", "amount": 120.0 }] }
    ],
    "lines": []
  },
  "counts": { "prices": 21, "gap_nights": 3, "win_back": 4, "upsells": 1, "chase": 0, "reviews": 0, "weekly_report": 3 }
}
FieldMeaning
settingsThe settings. The values above are the defaults, except enabled, which is false until turned on
questionsRevBot's open price suggestions, waiting for a yes or no
actionsWhat it did in the last 30 days (at most 200, newest first). status: DONE, WAITING, APPROVED or DISMISSED
earnedThis month's results for the hotel: totals by source per currency, and each line
countsActions per job in the last 30 days

Change the settings

PUT/api/v1/ai-manager/settings
Permission: ai_manager.manage

Send only what changes. The answer is the whole settings.

enabled boolean
On or off.
jobs object
Any of prices, gap_nights, win_back, upsells, chase, reviews, weekly_report, each true or false. Jobs left out keep their value.
gap_pct number
0 to 50. How much a gap night is lowered.
gap_days integer
1 to 60. How far ahead gap nights are looked for.
win_back_pct number
0 to 50. The welcome-back code's discount.
commission_pct number
0 to 40. The booking sites' commission, to count what a won-back guest saved.
chase_after_days integer
0 to 14. Days after check-out an unpaid bill is chased.
report_day integer
0 to 6. The weekly report's day, 0 for Monday.
report_hour integer
0 to 23. The weekly report's hour, hotel time. It is sent on the first run from that hour.
Request
curl -X PUT "https://app.chatbeds.app/api/v1/ai-manager/settings?property_id=6f1c3b2e-8a0d-4f5e-9b7a-2c3d4e5f6a7b" \
  -H "Authorization: Bearer $FIREBASE_ID_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"enabled": true, "jobs": {"chase": false}, "gap_pct": 12}'

Answer a price question

POST/api/v1/ai-manager/questions/{alert_id}
Permission: ai_manager.manage

alert_id is a question's id.

yes booleanrequired
true sets the price. false leaves it as it was.
price number
With yes: another price to set instead of the suggested one.
200 OK
{
  "id": "4a6c8e0b-2d4f-4a1c-8e3b-5d7f9a1c3e50",
  "job": "prices",
  "status": "APPROVED",
  "title": "Set Deluxe on Fri 14 Nov at USD 100",
  "detail": null,
  "amount": null,
  "currency": null,
  "refs": { "alert_id": "7c1e9a3f-2d4b-4e86-a5f0-3b9d1c7e2a64" },
  "at": "2026-10-21T09:30:02+00:00",
  "decided_by": "Ayesha Khan"
}

Run it now

POST/api/v1/ai-manager/run
Permission: ai_manager.manage

Does the jobs now instead of waiting for the hourly run. Nothing is done while the AI manager is off, and nothing is done twice (prices are looked at once a day, the report once a week). The answer is the AI manager, as for GET, with done: how many things were done.

Errors

StatusdetailWhen
400The gap-night discount must be between 0% and 50%. and similarA setting out of range
403The role lacks ai_manager.manage
404Question not found.alert_id isn't a question of this property
422A field of the wrong type, or out of the ranges above

Tworzysz coś?

Na tej stronie