{"openapi":"3.1.0","info":{"title":"G-Guest Booking API (by G-Lab)","version":"1.0.0","description":"Book a CONFIRMED slot at a local business in two calls: check availability, then create the booking. No API key needed for booking; be a polite agent and identify yourself with the X-G-Lab-Agent header."},"servers":[{"url":"https://g-lab.studio/api/cal/v1"}],"paths":{"/{slug}":{"get":{"summary":"Business card: services, hours, booking rules","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Business info incl. services and how to book"}}}},"/{slug}/availability":{"get":{"summary":"Real slots for a date (venue-local)","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"party","in":"query","schema":{"type":"integer","default":1}},{"name":"service","in":"query","schema":{"type":"integer"},"description":"service id from the business card"}],"responses":{"200":{"description":"Slots with available flag and start_utc to use when booking"}}}},"/{slug}/bookings":{"post":{"summary":"Create a CONFIRMED booking (instant, no approval step)","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["start","guest"],"properties":{"start":{"type":"string","format":"date-time","description":"start_utc of a slot from /availability"},"service_id":{"type":"integer"},"party_size":{"type":"integer","default":1},"notes":{"type":"string"},"source":{"type":"string","enum":["api"],"description":"set to 'api' if you are an AI assistant"},"guest":{"type":"object","required":["name","phone"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string","description":"always required — the venue's way to reach the guest"},"preferred_channel":{"type":"string","enum":["email","telegram"],"default":"email"}},"description":"phone is always required; email is required too unless preferred_channel is telegram. Delivery channels are email and Telegram only."}}}}}},"responses":{"201":{"description":"Confirmed booking with manage_url; when preferred_channel=telegram and the guest isn't linked yet, also telegram_connect_url (one-tap bot deep link)"},"409":{"description":"Slot just filled; response includes alternatives[]"},"422":{"description":"Validation problem"}}}},"/bookings/{id}":{"get":{"summary":"View a booking (manage token required)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Booking"}}},"patch":{"summary":"Reschedule (body: {start} or {date,time})","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Rescheduled booking"},"409":{"description":"New slot full"}}},"delete":{"summary":"Cancel","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Cancelled"}}}}}}