Build the webhook: availability, booking and CRM notes

Intermediate⏱ 28 min
🔒Join free to watch this video lessonFree account · takes 30 seconds · no card neededJoin free & watchAlready a member? Log in
A complete, working Python webhook you can deploy: slot checking, idempotent booking, and writing the call summary to a CRM.

In this lesson you’ll learn to

  • My server runs and passes curl tests
  • Booking is retry-safe
  • A real call booked a slot

Outcome of this lesson

You have a small server your voice platform can call. The sample uses Python and FastAPI with in-memory data so you can run it today; swap the storage for Google Calendar, a CRM API or a database when ready.

Step 1 — Install and run

pip install fastapi uvicorn uvicorn app:app --reload --port 8000 # expose it temporarily for testing with a tunnel tool (e.g. ngrok or Cloudflare Tunnel)

Step 2 — The server (app.py)

import os, uuid from datetime import datetime, timedelta from fastapi import FastAPI, Header, HTTPException from pydantic import BaseModel app = FastAPI() SECRET = os.environ.get("TOOL_SECRET", "change-me") # shared secret with your platform # In-memory stores (replace with calendar/CRM/DB) BOOKINGS = {} # idempotency_key -> booking dict TAKEN = set() # ISO datetimes already booked def auth(token): if

🔓 Unlock the full lesson — free

Create a free account to read the step-by-step guide, see the worked example, take the quiz, download templates and track your progress.

💬 Questions about this lesson?
Ask the community — practitioners and the BFOUNT team answer.
Ask a question
Was this lesson helpful?