ChatBedsGeliştiriciler
API başvurusu

Bu sayfa henüz çevrilmedi, bu yüzden İngilizce sürümünü okuyorsunuz.

Guests

Search, read, add and change guest profiles: contact details, nationality, language, company, preferences and notes.

A guest profile is shared by every booking of that guest at the hotel. A credential sees the guests who booked or stayed at its property, and new guests nobody has booked yet (made through the API, say). A guest of another hotel of the same account stays out of its sight: 404.

The guest object

FieldTypeMeaning
iduuid
first_name, last_namestring
email, phonestring or null
nationalitystring or nullAs the hotel records it (country name or code)
languagestring or nullThe guest's language, for messages, such as en or ur
companystring or null
preferencesstring or nullWhat the guest likes ("High floor, feather-free pillows"); shown to the desk at check-in
tagsarray of stringsThe hotel's tags, such as VIP
notesstring or nullThe hotel's notes
do_not_bookbooleanThe hotel marked this guest Do not book: new bookings for them are refused
created_atdatetime

Search guests

GET/guests
Scope guests:readOperation guest.search
q string (query)
Part of the name, email or phone. Empty: the newest guests.
limit integer (query)
1 to 100. Default 20.
Request
curl "https://app.chatbeds.app/partner/v1/guests?q=khan" -H "Authorization: Bearer cbk_••••"
200 OK
{
  "guests": [
    {
      "id": "6d1c2f0a-8a3e-4c51-9b27-1f4e3d5c7a90",
      "first_name": "Sara",
      "last_name": "Khan",
      "email": "sara@example.com",
      "phone": "+923001234567",
      "nationality": "PK",
      "language": "ur",
      "company": null,
      "preferences": "High floor",
      "tags": ["VIP"],
      "notes": null,
      "do_not_book": false,
      "created_at": "2026-10-02T09:14:22.381004+00:00"
    }
  ]
}

Get a guest

GET/guests/{guest_id}
Scope guests:readOperation guest.get

The profile and the guest's latest 20 bookings at this property (id, arrival, departure, status).

200 OK
{
  "guest": { "id": "6d1c2f0a-8a3e-4c51-9b27-1f4e3d5c7a90", "first_name": "Sara", "last_name": "Khan" },
  "reservations": [
    { "id": "a589df05-30ad-4ee5-9832-16ff6c2c1d0e", "arrival": "2026-11-05", "departure": "2026-11-07", "status": "checked_in" }
  ]
}

Add a guest

POST/guests
Scope guests:writeOperation guest.create
first_name stringrequired
Up to 100 characters.
last_name string
Up to 100 characters.
email string
phone string
With the country code, such as +923001234567.
nationality string
language string
Such as en.
company string
preferences string
Up to 1,000 characters.
notes string
Up to 2,000 characters.
Request
r = requests.post(f"{BASE}/guests", headers={**HEADERS, "Idempotency-Key": "CRM-55120"},
                  json={"first_name": "Ali", "last_name": "Raza", "email": "ali@example.com", "preferences": "Quiet room"})
guest = r.json()["guest"]          # 201 Created

A booking made with reservation.create makes or finds its guest by itself; add one here to keep a profile before any booking.

Change a guest

PATCH/guests/{guest_id}
Scope guests:writeOperation guest.update

Send only the fields to change; the others stay as they are. Same fields as Add a guest.

Request
curl -X PATCH "https://app.chatbeds.app/partner/v1/guests/6d1c2f0a-8a3e-4c51-9b27-1f4e3d5c7a90" \
  -H "Authorization: Bearer cbk_••••" -H "Content-Type: application/json" \
  -d '{"phone": "+923009876543", "preferences": "High floor, late check-out"}'

The answer is {"guest": {...}} with the profile as it is now.

Bir şey mi geliştiriyorsunuz?

Bu sayfada