Recipes
Confirm bookings by phone
Call guests the same day, let them confirm or cancel in their own words, and free the table automatically.
A restaurant (or clinic, or workshop) calls guests a few hours before their booking. Guests confirm or cancel by keypress or voice, and your system updates the booking.
1. Create the call
await fetch("https://api.callhuman.es/v1/calls", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CALLHUMAN_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": `booking-${booking.id}-reminder`,
},
body: JSON.stringify({
to: booking.phone,
language: booking.language ?? "en",
message: `Hi! This is La Plaza about your table for ${booking.people} tonight at ${booking.time}.`,
options: [
{ label: "Confirm", reply: "Perfect, see you tonight!" },
{ label: "Cancel", reply: "No problem, your booking is cancelled." },
],
webhook_url: "https://laplaza.example/hooks/callhuman",
metadata: { booking_id: booking.id },
}),
});2. What the guest hears
CallHuman: Hi! This is La Plaza about your table for 4 tonight at 8:30 pm.
CallHuman: Press 1 or say “confirm”. Press 2 or say “cancel”.
Person: “Yes, we'll be there, don't cancel it”
CallHuman: Perfect, see you tonight!
3. Receive the answer
app.post("/hooks/callhuman", express.raw({ type: "application/json" }), async (req, res) => {
if (!isValidSignature(req)) return res.sendStatus(401); // see /docs/webhooks
const call = JSON.parse(req.body.toString("utf8"));
const bookingId = call.metadata.booking_id;
if (call.status === "answered" && call.option_label === "Confirm") await confirmBooking(bookingId);
else if (call.status === "answered" && call.option_label === "Cancel") await cancelBooking(bookingId);
else await flagForStaff(bookingId); // not answered, or nothing chosen
res.sendStatus(200);
});Tips
- Call the same day, 2–4 hours before: that's when no-shows can still be replaced.
- Use the guest's language with
language. - Unanswered calls are retried twice and never count towards your plan.