Appointment
resources.
How a connection is set up
1
HueChat approves the account
Scheduling system connections are available to accounts HueChat has
approved during onboarding. Until then, sync requests return
403.2
The account admin creates a key for the system
In HueChat → Account → Developer API, choose the Scheduling system
preset. It grants
appointments:sync, appointments:read and
contacts:read. Create one key per system and give it to that system’s
support team.3
The system sends its bookings
Every booking the system sends is stored exactly as the system has it.
Appointments → Booking settings → Scheduling system connection shows
the last booking received and any booking HueChat could not store.
What HueChat keeps
A booking from the connection is stored as the system has it, withsource: "sync":
- past, same-day and walk-in visits, and times off HueChat’s slot grid or outside its opening hours
- archived doctors, rooms or services
- any lifecycle status
- deliberate double bookings, when a doctor sees two patients at once
Send a booking
PUT /appointments/external/{externalId} creates the booking or updates it to
the version you send. Use your system’s own booking id as externalId.
201. Later requests return 200, and the
X-HueChat-Sync-Result header says what happened:
Order of updates
Sendsource_updated_at: the time your system last changed the booking
(FHIR meta.lastUpdated, HL7 MSH-7). When messages arrive out of order,
HueChat ignores an update older than the one it holds, so a late message never
rolls a booking back. An identical resend with a newer time only records that
time.
Doctors, rooms and services
HueChat matches the resource and the service in this order:- The HueChat id (
resource_id,service_id). - Your own code (
resource_code,service_code), such as a practitioner, location or procedure id. - The name (
resource_name,service_name). Case, spaces and punctuation are ignored, soDr.Sara AlimatchesDr. Sara Ali.
Patients
HueChat links the booking to an existing contact bycontact_id, then by
patient_identifier (the contact’s identifier, such as the MRN), then by phone.
Details missing from the request come from that contact. The sync never
creates contacts; create patients through the Contacts API with
their record number as the identifier when form invitations must reach them.
Statuses
HueChat accepts its own statuses, HL7 FHIR R4Appointment.status and HL7 v2
SIU filler status codes:
Add
cancellation_reason to a cancelled booking to keep your system’s
reason.
Remove a booking
DELETE /appointments/external/{externalId}?reason=… keeps the booking in
HueChat as cancelled, with its history. An unknown id returns 204.
Send many bookings
POST /appointments/sync accepts up to 200 bookings. Each item follows the
same rules as the single request and must carry external_id. Each booking is
stored on its own, so one rejected booking does not hold back the rest.
created,
updated, unchanged, stale and failed totals.
Reconcile
GET /appointments/sync?start=…&end=… lists every booking with an external id
that starts in the window, up to 31 days, ordered by start time. Follow
next_cursor for the next page. Compare it with your own schedule and resend
anything that differs.
Monitor the connection
GET /appointments/sync/status returns:
- the account’s scheduling-system keys and when each was last used
- when a synced booking last changed, and how many changed in the last 24 hours
- bookings HueChat rejected, until a later version of each succeeds
HL7 FHIR R4
Integration engines that already produce FHIR R4 can sendAppointment
resources as they are:
The base URL is
https://app.huechat.ai/api/v2/accounts/{accountId}/fhir/R4.
Add ?source= with a short name for the sending system, such as
?source=oracle-main, so two FHIR systems on one account never share ids. The
booking’s external id becomes <source>:Appointment:<id>.
Errors come back as
OperationOutcome resources. The endpoint is a
write-oriented subset of FHIR, not a general FHIR server.
HL7 v2 SIU
Route SIU messages through your integration engine, such as Rhapsody, Mirth, InterSystems or Cloverleaf, to the REST or FHIR endpoint:
Use
MSH-7 as source_updated_at and the SCH filler status as status.
Security checklist
- Give each system its own key and restrict it to the system’s IP addresses in Developer API.
- Grant only
appointments:sync,appointments:readandcontacts:read. - Rotate the key from Developer API without downtime, and revoke it when the system is retired.
- Send only what reminders and forms need; keep clinical detail out of
notes.

