app2email API Pricing

Documentation

Take appointments from your own website or app

Show free times on your own website or app, book the appointment through the API, move or cancel it, block time and run a waitlist, while Book-and-Pay sends the WhatsApp confirmation and reminders for you.

In this guide your own website or app takes appointments through app2email's Book-and-Pay and Calendar API. Your page shows the services and the free times, the customer picks one, and your server books it with one call.

What the customer sees: they pick a haircut at 9:00 on your website and type their name and WhatsApp number. A few seconds later a WhatsApp message from your business arrives: "You're booked: Haircut on ... at 9:00 AM (30 min). Reference BK-7Q3M2A. Reply CANCEL if your plans change.", with a calendar file to add it to their phone. Before the visit a reminder arrives with Confirm, Reschedule and Cancel buttons.

What you see: the appointment in your connected calendar (Google, Microsoft 365, Apple iCloud, or app2email's own calendar app), an email for each new booking, and webhook events for every booking, move, cancellation and waitlist offer, wherever the booking was made.

You do not send any of the WhatsApp messages yourself. Book-and-Pay writes the confirmation, the reminders, the "moved" and "cancelled" notices, and picks an approved template when the customer's 24 hour window is closed.

How it works

  1. Your server reads the services (GET /bookings/services) and the free times (GET /bookings/availability or GET /bookings/next).
  2. When the customer picks a time, your server can hold it for a few minutes (POST /bookings/holds) while they type their details.
  3. Your server books it (POST /bookings). Book-and-Pay writes the calendar event, sends the WhatsApp confirmation, emails you, and sends booking.created to your webhook.
  4. Later you move it (POST /bookings/{id}/reschedule), change its details (PATCH /bookings/{id}), or cancel it (POST /bookings/{id}/cancel). The customer is told on WhatsApp each time.
  5. You block time off (POST /calendar/blocks) and put customers on the waitlist of a full day (POST /bookings/waitlist). When a time opens, Book-and-Pay offers it to them on WhatsApp.

Every call goes to https://api.app2email.com/v1/YOUR_NUMBER with Authorization: Bearer YOUR_API_KEY. YOUR_NUMBER is your WhatsApp number: country code first, digits only.

What you need

  • Book-and-Pay set up first. The services, opening hours, calendar and message texts come from the dashboard's Book-and-Pay page (https://www.app2email.com/dashboard/app/book). Set it up and switch it on there: see Appointment booking on WhatsApp. Switching it on also creates the utility templates Book-and-Pay uses outside the 24 hour window (Meta reviews them, usually within the hour). Without Book-and-Pay the booking calls answer 403 booking_not_enabled.
  • A WhatsApp number connected to app2email, on a paid plan and live. Without a plan calls answer 403 plan_not_allowed; a paused service answers 403 service_not_live. See Getting started.
  • An API key from the API key page with these scopes:
ScopeWhy you need it
bookings:manageBook, hold, move, change and cancel appointments, block time, the waitlist. It also covers every booking read
messages:readEnough on its own for a key that only reads: services, free times, appointments, the calendar, the waitlist
webhooks:manageRegister the webhook once (POST /webhooks). You can also add it on the API key page under Webhooks, without code

The Default key (made before keys had permissions) does not have bookings:manage. Create a key with that scope, or with Full access (*). GET /v1/YOUR_NUMBER/me shows the scopes of the key you have.

  • A server of your own. The key stays on your server: never put it in a web page or a mobile app. Your page asks your server for the free times and sends the booking to your server, and your server calls app2email.
Tip

Trying it out. The instant sandbox (the demo number 12025550100) has no booking calls: they answer 403 not_in_instant_sandbox. A sandbox key on your own number (a key with the sandbox flag, made on the API key page) reads your real services, free times, appointments, calendar and waitlist, so you can build the whole "pick a time" part with it. Every call that changes something (book, hold, move, cancel, block, waitlist) answers 403 sandbox_key with it. To try a real booking, use a normal key and your own phone number as the customer, then cancel the appointment again. Details: Sandbox.

Book an appointment in four steps

  1. 1. List the services

    GET /bookings/services (scope bookings:manage or messages:read) gives the services a customer can book, with their length, price, description and the staff members who do each one. The id goes into every other call.

    cURL
    curl https://api.app2email.com/v1/YOUR_NUMBER/bookings/services \
      -H "Authorization: Bearer YOUR_API_KEY"
    Node.js
    const API = `https://api.app2email.com/v1/${process.env.NUMBER}`;
    const headers = { Authorization: `Bearer ${process.env.API_KEY}` };
    
    const res = await fetch(`${API}/bookings/services`, { headers });
    const { services, timezone } = await res.json();
    console.log(timezone, services);
    Python
    import os, requests
    
    API = f"https://api.app2email.com/v1/{os.environ['NUMBER']}"
    HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}
    
    res = requests.get(f"{API}/bookings/services", headers=HEADERS, timeout=10)
    print(res.json())

    What you get back:

    {
      "success": true,
      "request_id": "c6sv7",
      "services": [
        { "id": "haircut", "name": "Haircut", "duration_min": 30, "price": "$40", "description": null, "staff": ["maria", "tom"] }
      ],
      "timezone": "Australia/Sydney",
      "enabled": true
    }

    staff is empty when the business has no staff. GET /bookings/staff lists the staff members (provider_id in the other calls) with the services each one does. enabled must be true: Book-and-Pay is switched on.

  2. 2. Find the free times

    GET /bookings/availability (scope bookings:manage or messages:read) gives every day of a range with its free start times, as the customer would see them: the opening hours, closed days, booked appointments, blocked time and the busy time of your connected calendar are already applied.

    QueryWhat to fill in
    service_idThe service from step 1
    from, toThe first and last day, YYYY-MM-DD in the business time zone. Default: today and 6 days on; at most 32 days
    provider_idOne staff member's own times. Left out: anyone available
    addonsA comma list of the service's add-on ids: only times long enough for them
    seatsOn a group service: the places wanted (1 + guests)
    cURL
    curl "https://api.app2email.com/v1/YOUR_NUMBER/bookings/availability?service_id=haircut&from=2026-11-10&to=2026-11-11" \
      -H "Authorization: Bearer YOUR_API_KEY"
    Node.js
    const q = new URLSearchParams({ service_id: "haircut", from: "2026-11-10", to: "2026-11-11" });
    const res = await fetch(`${API}/bookings/availability?${q}`, { headers });
    const { days } = await res.json();
    for (const day of days) console.log(day.date, day.slots.map((s) => s.title));
    Python
    res = requests.get(f"{API}/bookings/availability", headers=HEADERS, timeout=10,
                       params={"service_id": "haircut", "from": "2026-11-10", "to": "2026-11-11"})
    for day in res.json()["days"]:
        print(day["date"], [s["title"] for s in day["slots"]])

    What you get back:

    {
      "success": true,
      "request_id": "a9xw1",
      "timezone": "Australia/Sydney",
      "enabled": true,
      "days": [
        {
          "date": "2026-11-10",
          "slots": [
            { "id": "2026-11-10T09:00", "title": "9:00 AM", "start": "2026-11-09T22:00:00.000Z", "end": "2026-11-09T22:30:00.000Z", "providers": ["maria", "tom"] },
            { "id": "2026-11-10T09:30", "title": "9:30 AM", "start": "2026-11-09T22:30:00.000Z", "end": "2026-11-09T23:00:00.000Z", "providers": ["tom"] }
          ]
        },
        { "date": "2026-11-11", "slots": [] }
      ]
    }
    • Show title to the customer and keep the slot's id: it is the local time in the business time zone (yyyy-MM-ddTHH:mm) that the next calls take as start. start and end are the same time in UTC.
    • providers names the staff members free at that time.
    • A day with an empty slots list is full or closed. A full day is where the waitlist helps.

    Only "the next free times"? GET /bookings/next?service_id=haircut&count=3 gives the next free start times across days (at most 60 days ahead), for a "Next free: tomorrow 9:00" button:

    {
      "success": true,
      "request_id": "c8nx9",
      "slots": [
        { "id": "2026-11-12T09:00", "date": "2026-11-12", "title": "9:00 AM", "start": "2026-11-11T22:00:00.000Z", "end": "2026-11-11T22:30:00.000Z", "providers": ["maria"] }
      ],
      "count": 1,
      "timezone": "Australia/Sydney",
      "enabled": true
    }
  3. 3. Hold the time while the customer types

    Optional, but it saves the customer from "sorry, that time is gone". POST /bookings/holds (scope bookings:manage) keeps a free time for minutes (1 to 30, default 10). While it is held it counts as taken everywhere: in the availability, the calendar and every booking check, also for customers booking on WhatsApp.

    curl -X POST https://api.app2email.com/v1/YOUR_NUMBER/bookings/holds \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: hold-session-8f2c1a" \
      -d '{"service_id": "haircut", "start": "2026-11-10T09:00", "provider_id": "maria", "minutes": 10}'

    What you get back (201 Created):

    {
      "success": true,
      "request_id": "f1hc2",
      "hold": {
        "reference": "BK-7Q3M2A",
        "status": "held",
        "service_id": "haircut",
        "provider_id": "maria",
        "contact": "",
        "name": "",
        "start": "2026-11-09T22:00:00.000Z",
        "end": "2026-11-09T22:30:00.000Z",
        "start_local": "2026-11-10T09:00",
        "end_local": "2026-11-10T09:30",
        "expires": "2026-11-09T04:10:00.000Z",
        "source": "api"
      },
      "note": "The time is kept until hold.expires: nobody else can book it."
    }

    Show a countdown to expires. If the customer leaves, DELETE /bookings/holds/{reference} frees the time at once; otherwise it frees itself at expires. A time that went in the meantime answers 409 booking_slot_taken: read the availability again.

  4. 4. Book it

    POST /bookings (scope bookings:manage) books the appointment.

    FieldWhat to fill in
    contactThe customer's WhatsApp number, country code first, digits only (or their business-scoped user id)
    nameThe customer's name
    service_id, startThe service and the slot id from step 2
    holdThe hold's reference from step 3, if you held the time. The booking takes the hold's reference and frees the hold
    provider_idThe staff member. Left out: the first free one
    email, notesOptional. With an email, the customer can also get the confirmation by email (when customer emails are on in Book-and-Pay)
    answers_qThe answers to the service's own questions, by question id. Required questions must be answered
    notifytrue (the default) sends the WhatsApp confirmation. false books silently
    Header Idempotency-KeyA value unique to this booking, eg your form submission id. The same request with the same key within 24 hours books nothing twice
    cURL
    curl -X POST https://api.app2email.com/v1/YOUR_NUMBER/bookings \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: booking-form-8f2c1a" \
      -d '{
        "contact": "61412345678",
        "name": "John Smith",
        "email": "john@example.com",
        "service_id": "haircut",
        "start": "2026-11-10T09:00",
        "provider_id": "maria",
        "hold": "BK-7Q3M2A",
        "notes": "First visit",
        "notify": true
      }'
    Node.js
    async function book({ formId, phone, name, email, serviceId, slotId, providerId, holdRef }) {
      const res = await fetch(`${API}/bookings`, {
        method: "POST",
        headers: { ...headers, "Content-Type": "application/json", "Idempotency-Key": `booking-${formId}` },
        body: JSON.stringify({
          contact: phone, // digits only, country code first
          name, email,
          service_id: serviceId,
          start: slotId, // eg "2026-11-10T09:00"
          provider_id: providerId,
          hold: holdRef, // leave out when you did not hold the time
          notify: true,
        }),
      });
      const json = await res.json();
      if (res.status === 409 && json.error?.code === "booking_slot_taken") return { taken: true };
      if (!res.ok) throw new Error(`${json.error?.code}: ${json.error?.how_to_fix} (${json.request_id})`);
      return json.booking; // keep booking.id and booking.reference
    }
    Python
    def book(form_id, phone, name, email, service_id, slot_id, provider_id=None, hold_ref=None):
        body = {"contact": phone, "name": name, "email": email, "service_id": service_id,
                "start": slot_id, "notify": True}
        if provider_id:
            body["provider_id"] = provider_id
        if hold_ref:
            body["hold"] = hold_ref
        res = requests.post(f"{API}/bookings", json=body, timeout=10,
                            headers={**HEADERS, "Idempotency-Key": f"booking-{form_id}"})
        data = res.json()
        if res.status_code == 409 and data.get("error", {}).get("code") == "booking_slot_taken":
            return None  # show the free times again
        if not res.ok:
            raise RuntimeError(f"{data['error']['code']}: {data['error']['how_to_fix']} ({data['request_id']})")
        return data["booking"]  # keep booking["id"] and booking["reference"]

    What you get back (201 Created):

    {
      "success": true,
      "request_id": "b2mz7",
      "booking": {
        "id": 42,
        "reference": "BK-7Q3M2A",
        "status": "confirmed",
        "contact": "61412345678",
        "contact_name": "John Smith",
        "contact_email": "john@example.com",
        "service": { "id": "haircut", "name": "Haircut", "duration_min": 30 },
        "start": "2026-11-09T22:00:00.000Z",
        "end": "2026-11-09T22:30:00.000Z",
        "timezone": "Australia/Sydney",
        "source": "api",
        "calendar": { "provider": "google", "event_id": "evt_1a2b3c", "url": "https://calendar.google.com/calendar/event?eid=..." },
        "answers": {},
        "notes": "First visit",
        "provider": { "id": "maria", "name": "Maria" },
        "credits_used": 0,
        "created": "2026-11-06T01:12:09.000Z"
      },
      "note": "Booked. The customer gets the confirmation on WhatsApp (a text inside their 24 hour window, else the booking confirmation template)."
    }

    Keep id and reference with your own record. Every later call takes either one; reference is the short code the customer sees. A repeated request with the same Idempotency-Key gets this same answer again with the header Idempotent-Replayed: true.

    The start must be a slot from step 2. Your own minimum notice is not checked on POST /bookings, so offer the customer only the times the availability gives (what a customer would see).

The result

On WhatsApp:

  1. Within seconds the customer gets the confirmation in your words (the "Messages" part of Book-and-Pay), with a calendar file when you switched that on. If they have not written to your number in the last 24 hours, the confirmation goes out as the booking confirmation template instead, so a customer who has never written to you still gets it.
  2. Before the appointment a reminder arrives with Confirm, Reschedule and Cancel buttons. Reminders usually go out when the 24 hour window is closed, so Book-and-Pay uses its approved utility templates for them.
  3. A tap on Confirm fills the booking's attendance_confirmed with the time. A tap on Cancel, or a reply CANCEL, cancels the appointment and sends booking.cancelled with cancelled.by: "customer". Reschedule lets the customer pick a new time, and you get booking.rescheduled.

For you: the event in your calendar (calendar.url), an email to the address in your Book-and-Pay messages, and this webhook event:

{
  "id": "evt_Bk3k9m2Lw8Rt5Yp1Zs01",
  "type": "booking.created",
  "created": "2026-11-06T01:00:00.000Z",
  "number": "4976659348270",
  "data": {
    "id": 42,
    "reference": "BK-7Q3M2A",
    "status": "confirmed",
    "contact": "61412345678",
    "contact_name": "John Smith",
    "contact_email": "john@example.com",
    "service": { "id": "haircut", "name": "Haircut", "duration_min": 30 },
    "start": "2026-11-09T22:00:00.000Z",
    "end": "2026-11-09T22:30:00.000Z",
    "timezone": "Australia/Sydney",
    "source": "api",
    "calendar": { "provider": "google", "event_id": "evt_1a2b3c", "url": "https://calendar.google.com/calendar/event?eid=..." },
    "answers": {},
    "notes": "First visit",
    "provider": { "id": "maria", "name": "Maria" },
    "credits_used": 0,
    "created": "2026-11-06T01:00:00.000Z",
    "timestamp": "2026-11-06T01:00:00.000Z",
    "hold": true
  }
}

source tells you where the booking came from: api (you), whatsapp_flow (the customer in the WhatsApp booking form), web (the online booking page) or dashboard (your team, also in the calendar app). hold: true means it was made from a held time. If the calendar write failed, calendar.error says why; the booking still stands.

Change, move or cancel an appointment

Find it

  • GET /bookings/{id} takes the id or the reference: GET /bookings/BK-7Q3M2A.
  • GET /bookings?contact=61412345678&upcoming=true lists one customer's confirmed appointments from now on, soonest first, for a "My appointments" page.
  • GET /bookings?from=2026-11-10&to=2026-11-16 lists a range of days (status, provider_id, q and order=desc filter more; page with next_cursor and cursor).

Move it to another time

POST /bookings/{id}/reschedule (scope bookings:manage) moves a confirmed appointment in place: the same id and reference, the calendar event moved, the reminders start again. start must be a free slot from GET /bookings/availability or GET /bookings/next; the appointment's own time counts as free. provider_id changes the staff member too ("any": the first free one).

cURL
curl -X POST https://api.app2email.com/v1/YOUR_NUMBER/bookings/BK-7Q3M2A/reschedule \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: move-BK-7Q3M2A-2026-11-12T10:00" \
  -d '{"start": "2026-11-12T10:00", "notify": true}'
Node.js
const res = await fetch(`${API}/bookings/BK-7Q3M2A/reschedule`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json", "Idempotency-Key": "move-BK-7Q3M2A-2026-11-12T10:00" },
  body: JSON.stringify({ start: "2026-11-12T10:00", notify: true }),
});
console.log(res.status, (await res.json()).booking);
Python
res = requests.post(f"{API}/bookings/BK-7Q3M2A/reschedule", timeout=10,
                    headers={**HEADERS, "Idempotency-Key": "move-BK-7Q3M2A-2026-11-12T10:00"},
                    json={"start": "2026-11-12T10:00", "notify": True})
print(res.status_code, res.json().get("booking"))

What you get back (200; shortened, booking has the same fields as above):

{
  "success": true,
  "request_id": "c0rs2",
  "booking": {
    "id": 42,
    "reference": "BK-7Q3M2A",
    "status": "confirmed",
    "start": "2026-11-11T23:00:00.000Z",
    "end": "2026-11-11T23:30:00.000Z",
    "timezone": "Australia/Sydney",
    "provider": { "id": "maria", "name": "Maria" }
  },
  "note": "Moved. The booking keeps its id and reference. The customer is told on WhatsApp."
}

The customer gets the new time on WhatsApp unless notify is false, and your webhook gets booking.rescheduled. 409 booking_slot_taken: the time is not free, read the availability again.

Change the details

PATCH /bookings/{id} (scope bookings:manage) changes the customer's name or email, the notes, the answers or the staff member (provider_id; the time must be free for them, else 409 booking_slot_taken). The time itself only changes with reschedule. booking.updated is sent with changed naming the fields.

curl -X PATCH https://api.app2email.com/v1/YOUR_NUMBER/bookings/BK-7Q3M2A \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"notes": "Allergic to ammonia", "provider_id": "tom"}'

Cancel it

POST /bookings/{id}/cancel (scope bookings:manage) removes the calendar event, sends booking.cancelled, and tells the customer on WhatsApp (a text inside their 24 hour window, else the cancellation template) unless notify is false.

curl -X POST https://api.app2email.com/v1/YOUR_NUMBER/bookings/BK-7Q3M2A/cancel \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reason": "customer asked by phone", "notify": true}'

What you get back (200; shortened):

{
  "success": true,
  "request_id": "b3nd4",
  "booking": {
    "id": 42,
    "reference": "BK-7Q3M2A",
    "status": "cancelled",
    "cancelled": { "at": "2026-11-07T03:00:00.000Z", "by": "api", "reason": "customer asked by phone" }
  },
  "note": "Cancelled. The customer is told on WhatsApp (a text inside their 24 hour window, else the cancellation template)."
}

Cancelling twice answers 409 booking_cancelled: treat it as done. A cancellation frees the time, and customers on that day's waitlist get offered it.

After the visit

POST /bookings/{id}/status with {"status": "completed"} or {"status": "no_show"} marks the appointment ("confirmed" puts it back). A completed appointment gets the follow-up message (aftercare and the rating buttons) when you switched it on; a rating comes as booking.rated. An appointment you do not mark is completed by itself 24 hours after its end.

Block time

Lunch, a day off, a closed afternoon: POST /calendar/blocks (scope bookings:manage) makes time that no one can book, for one staff member (provider_id) or the whole business (leave it out). Give start and end (local time yyyy-MM-ddTHH:mm, at most 31 days long), or date for one whole day. Existing appointments are not touched.

cURL
curl -X POST https://api.app2email.com/v1/YOUR_NUMBER/calendar/blocks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: lunch-maria-2026-11-14" \
  -d '{"start": "2026-11-14T12:00", "end": "2026-11-14T13:00", "provider_id": "maria", "title": "Lunch"}'
Node.js
const res = await fetch(`${API}/calendar/blocks`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json", "Idempotency-Key": "lunch-maria-2026-11-14" },
  body: JSON.stringify({ start: "2026-11-14T12:00", end: "2026-11-14T13:00", provider_id: "maria", title: "Lunch" }),
});
const { block } = await res.json();
console.log(block.id);
Python
res = requests.post(f"{API}/calendar/blocks", timeout=10,
                    headers={**HEADERS, "Idempotency-Key": "lunch-maria-2026-11-14"},
                    json={"start": "2026-11-14T12:00", "end": "2026-11-14T13:00",
                          "provider_id": "maria", "title": "Lunch"})
print(res.json()["block"]["id"])

What you get back (201 Created):

{
  "success": true,
  "request_id": "c3bk4",
  "block": {
    "id": 3,
    "provider_id": "maria",
    "title": "Lunch",
    "notes": "",
    "start": "2026-11-14T01:00:00.000Z",
    "end": "2026-11-14T02:00:00.000Z",
    "start_local": "2026-11-14T12:00",
    "end_local": "2026-11-14T13:00",
    "source": "api",
    "created_by": "API key Planner",
    "created": "2026-11-11T01:12:09.000Z",
    "updated": "2026-11-11T01:12:09.000Z"
  },
  "note": "Blocked. No one can book that time."
}
  • PATCH /calendar/blocks/{id} changes any of start, end, date, provider_id, title, notes.
  • DELETE /calendar/blocks/{id} removes it: the time can be booked again, and waiting customers can be offered it.
  • GET /calendar/blocks?from=2026-11-14&to=2026-11-20 lists the blocks.
  • GET /calendar gives everything for a range of days in one answer (at most 62 days): appointments, blocks, the busy time of your connected calendar, the times held right now, the opening hours per day, the staff and the services. Good for a staff screen in your own app.

The events are calendar.block.created and calendar.block.deleted.

The waitlist

When a day has no free time left, the customer can wait for one. Switch the waitlist on for the service in Book-and-Pay first (config.services[].waitlist in GET /settings/booking).

POST /bookings/waitlist (scope bookings:manage) puts a customer on the waitlist of a full day:

curl -X POST https://api.app2email.com/v1/YOUR_NUMBER/bookings/waitlist \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contact": "61412345678", "name": "Jane", "service_id": "haircut", "date": "2026-11-20"}'

What you get back (201 Created; shortened):

{
  "success": true,
  "request_id": "w2add",
  "entry": {
    "id": 12,
    "reference": "WL-4HT9XC",
    "status": "waiting",
    "service_id": "haircut",
    "service_name": "Haircut",
    "provider_id": "maria",
    "provider_name": "Maria",
    "date": "2026-11-20",
    "date_label": "Fri 20 Nov 2026",
    "contact": "61412345678",
    "contact_name": "Jane",
    "seats": 1,
    "source": "api",
    "notified_count": 0,
    "appointment_id": null
  },
  "existing": false
}
  • One active entry per customer, service and day: asking again answers 200 with that entry and existing: true, so the call is safe to repeat.
  • provider_id waits for one staff member; left out, anyone. slot_id waits for one full time of a group service, seats for more than one place. email lets the offer go by email when WhatsApp cannot be used.
  • The day must be bookable and have no free time left, else 409 waitlist_not_offered: offer the free times instead. force: true skips the free-time check.

What happens next: when a time opens on that day (a cancellation, a move, a removed block, and a check every 5 minutes), the waiting customers get a WhatsApp message with a link to book it (the waitlist template when their window is closed, or an email). The first one to book gets it. Your webhook gets waitlist.notified with the offer:

{
  "id": "evt_Wl3k9m2Lw8Rt5Yp1Zs02",
  "type": "waitlist.notified",
  "created": "2026-11-13T01:00:00.000Z",
  "number": "4976659348270",
  "data": {
    "id": 12,
    "reference": "WL-4HT9XC",
    "status": "notified",
    "service_id": "haircut",
    "service_name": "Haircut",
    "provider_id": "maria",
    "provider_name": "Maria",
    "date": "2026-11-20",
    "date_label": "Fri 20 Nov 2026",
    "slot_id": "",
    "time_label": "",
    "contact": "61412345678",
    "contact_name": "Jane",
    "contact_email": "",
    "seats": 1,
    "source": "api",
    "notified_count": 1,
    "notified_at": "2026-11-13T01:00:00.000Z",
    "appointment_id": null,
    "note": "Offered Fri 20 Nov 2026 10:30 AM on WhatsApp",
    "created": "2026-11-13T01:00:00.000Z",
    "updated": "2026-11-13T01:00:00.000Z",
    "day": "2026-11-20",
    "slot_local": "",
    "contact_masked": "•••• 5678",
    "created_at": "2026-11-13T01:00:00.000Z",
    "timestamp": "2026-11-13T01:00:00.000Z",
    "offer": {
      "slot_id": "2026-11-20T10:30",
      "start": "2026-11-19T23:30:00.000Z",
      "date_label": "Fri 20 Nov 2026",
      "time_label": "10:30 AM",
      "channel": "whatsapp",
      "manual": false
    }
  }
}

An entry's status is waiting, notified (offered a time, up to 3 offers), booked (the customer booked that service that day; appointment_id is the booking), expired (the day passed), removed, or pending_confirm (joined on your public booking page and not confirmed on WhatsApp yet).

  • GET /bookings/waitlist lists the active entries, soonest day first (from, to, service_id, contact, include_closed=true).
  • POST /bookings/waitlist/{reference}/remove takes a customer off it without a message to them, and sends waitlist.removed.

Booking webhook events

Register a webhook once with POST /webhooks (scope webhooks:manage), or on the API key page. Every webhook of the number gets every event: pick the ones you need by type and answer 2xx to the rest. Build a WhatsApp chatbot with the API shows the registration, the signature check and a test event step by step; POST /webhooks/{id}/test with {"type": "booking.created"} sends that event's sample.

EventWhen
booking.createdAn appointment was booked: in the WhatsApp form, on the online page, on the dashboard, or through the API
booking.rescheduledAn appointment was moved; the old time is in rescheduled_from
booking.cancelledAn appointment was cancelled; cancelled.by is customer, business, api or system
booking.updatedName, email, notes, answers or staff member changed; changed names the fields
booking.ratedThe customer rated a completed appointment
booking.paid, booking.refundedThe online payment or deposit of an appointment was paid, or refunded
booking.note.createdAn internal note was added
calendar.block.created, calendar.block.deletedTime was blocked, or a block removed
waitlist.joined, waitlist.notified, waitlist.removedA customer joined the waitlist, was offered a time, or was taken off

The events come for every booking, not only the ones you made: a customer who books in the WhatsApp form or cancels with a reply also reaches your system. booking.rescheduled looks like this:

{
  "id": "evt_Bk3k9m2Lw8Rt5Yp1Zs03",
  "type": "booking.rescheduled",
  "created": "2026-11-06T01:00:00.000Z",
  "number": "4976659348270",
  "data": {
    "id": 42,
    "reference": "BK-7Q3M2A",
    "status": "confirmed",
    "contact": "61412345678",
    "contact_name": "Sample Contact",
    "contact_email": "sample@example.com",
    "service": { "id": "haircut", "name": "Haircut", "duration_min": 30 },
    "start": "2026-11-09T23:00:00.000Z",
    "end": "2026-11-09T23:30:00.000Z",
    "timezone": "Australia/Sydney",
    "source": "whatsapp_flow",
    "calendar": { "provider": "google", "event_id": "evt_sample_1", "url": "https://calendar.google.com/calendar/event?eid=sample" },
    "answers": { "notes": "Please keep it short" },
    "notes": "Please keep it short",
    "provider": { "id": "maria", "name": "Maria" },
    "credits_used": 0,
    "created": "2026-11-06T01:00:00.000Z",
    "timestamp": "2026-11-06T01:00:00.000Z",
    "rescheduled_from_id": 41,
    "rescheduled_from": { "id": 41, "reference": "BK-2KD8XQ", "start": "2026-11-08T23:00:00.000Z", "end": "2026-11-08T23:30:00.000Z" }
  }
}

A move through the API keeps the id and the reference. A customer who reschedules on WhatsApp gets a new appointment that replaces the old one, as in this sample: find your record by rescheduled_from.id (or its reference) and store the new id and reference.

Deposits and payments

Book-and-Pay takes payments through your own Stripe or PayPal account, connected on its Payments page: a price per service, payment required, optional or none, and a deposit if you want one. To ask for a deposit or another amount on an appointment, POST /payments/links with the appointment's booking_id makes a payment page; with send: true and the customer inside their 24 hour window they also get it in the chat with a Pay button. When the provider confirms it, your webhook gets payment.paid; the appointment's own online payment or deposit (set on the service) reports booking.paid. Step by step: Ask for a payment inside a WhatsApp chat.

Let the customer book by themselves

You do not have to build every screen yourself:

  • A personal booking link: POST /bookings/links with the customer's contact makes a link to the online booking page (switch it on in Book-and-Pay, Online booking tab). purpose book, reschedule (with booking_id) or manage (their upcoming appointments). The answer's link.url is yours to send.
  • The booking form inside WhatsApp: POST /flows/{key}/send with {"contact": "61412345678"} sends the published booking form to a customer who wrote to you in the last 24 hours. The booking comes back as booking.created with source: "whatsapp_flow".

Both end in the same appointments, confirmations, reminders and events as the calls above.

Production checklist

Done

Keep the key on your server. Your web page or app talks to your server, and only your server calls app2email. A key that only shows free times needs messages:read; the key that books needs bookings:manage. A key can be limited to your server's IP addresses, have a daily cap, or expire.

Done

Book each appointment once. Send an Idempotency-Key with POST /bookings, POST /bookings/holds, POST /bookings/{id}/reschedule and POST /calendar/blocks, built from something unique on your side (the form submission id). Same key and same body within 24 hours: the first answer comes back with Idempotent-Replayed: true. Same key, other body: 422 idempotency_key_reused. 409 idempotency_request_in_progress: wait and retry with the same key. POST /bookings/waitlist needs no key: a repeat answers existing: true.

Done

Expect a time to go. Between showing the times and booking, someone on WhatsApp can take the slot. Hold it with POST /bookings/holds, and on 409 booking_slot_taken show the free times again rather than an error page.

Done

Get the time zone right. Slot ids and start in requests are local times in the business time zone (timezone in every answer); start and end in answers and events are UTC. Show the customer title, start_local or the business time zone, not their own browser's.

Done

Verify every event. Check X-App2email-Signature over the raw body with the webhook's whsec_... secret, and refuse a t older than 5 minutes. Answer 2xx within 10 seconds; a failed event is sent again for about 32 hours.

Done

Dedupe on real ids. Drop repeated events by the event id (also in X-App2email-Delivery). Store appointments by their id and reference, and follow rescheduled_from when a customer moves one on WhatsApp. Events can arrive out of order: compare timestamp.

Done

Respect the limits. Every answer has X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and X-RateLimit-Policy. Over the limit: 429 rate_limited with Retry-After; wait that long, then retry. Cache the services and read the availability when the customer opens the page, not on every key press. Ranges: at most 32 days for availability, 62 for calendar. See Limits.

Done

Let Book-and-Pay do the messages. The confirmation, the reminders and the moved and cancelled notices use free text inside the 24 hour window and Book-and-Pay's approved utility templates outside it. Check on the Templates page that Meta approved them before you go live. Send notify: false only when you tell the customer yourself, and tell customers on your form that the confirmation and reminders come on WhatsApp.

Done

Ask before marketing. Confirmations and reminders are about the appointment the customer booked. A "time for your next visit" message is marketing: send it only to customers who agreed to marketing, and the Do Not Call list applies.

If it does not work

What you seeWhyFix
403 booking_not_enabledBook-and-Pay is not set up for this number yetSet it up and switch it on on the Book-and-Pay page (https://www.app2email.com/dashboard/app/book). If it is on and the error stays, write to support@app2email.com with the request_id
403 insufficient_scopeThe key lacks bookings:manage (or messages:read for reads)Make a key with that scope on the API key page; the Default key does not have it
403 sandbox_keyA sandbox key cannot book, hold, move, cancel, block or change the waitlistUse a normal key; keep the sandbox key for the read calls
403 not_in_instant_sandboxThe demo number has no booking callsUse your own number with Book-and-Pay set up
401 missing_api_key, invalid_api_key, api_key_revokedNo key, a wrong key, or an old oneSend Authorization: Bearer YOUR_API_KEY, with the number of that key in the URL
403 plan_not_allowed, service_not_liveNo paid plan, or the service is pausedChoose a plan; a paused service goes live with "Go Live" on the Settings page
400 invalid_serviceservice_id is missing or not a switched-on serviceTake an id from GET /bookings/services
400 invalid_startstart is missing or not a slotSend a slot id (yyyy-MM-ddTHH:mm, business time zone) from GET /bookings/availability
400 invalid_answersA required question of the service is not answeredSend every required question in answers_q
400 invalid_addons, invalid_guestsAn add-on the service does not offer, or too many guests or seatsUse the service's own add-on ids; keep guests within the service's maximum
400 invalid_range, range_too_largefrom is after to, or the range is too longAt most 32 days for availability, 62 for the calendar
400 invalid_blockThe end is not after the start, the block is over 31 days, or the staff member does not existFix the fields the message names; provider_id comes from GET /bookings/staff
404 booking_not_found, block_not_found, hold_not_found, waitlist_not_foundNo such appointment, block, hold or waitlist entry on this numberCheck the id or reference (BK-..., WL-...) and the number in the URL
409 booking_slot_takenThe time is not free any moreRead the availability again and let the customer pick another time
409 hold_expiredThe held time expired, was released, or was already bookedHold the time again, or read the booking it became
409 booking_cancelledThe appointment is already cancelledNothing to do; make a new booking if the customer wants another time
409 waitlist_not_offeredThe service has no waitlist, the day still has free times, is closed or too far ahead, or its waitlist is fullSwitch the waitlist on for the service, pick a full day (or send force: true), or book a free time instead
409 waitlist_not_set_upThe waitlist is not available yet on our sideTry again later
403 link_not_usableA booking link expired, was revoked or used up, or the online booking page is offMake a new link with POST /bookings/links, or switch the online page on
422 idempotency_key_reusedThe same Idempotency-Key with a different bodyUse a new key for a different booking
429 rate_limitedToo many calls for this keyWait Retry-After seconds, then retry
The customer got no WhatsApp confirmationnotify was false, or the booking template is not approved yetCheck the Templates page; message.status and message.failed events show what happened to the message

Every answer has a request_id. GET /requests/{id} shows what was logged for it, and support@app2email.com can find it too. All codes: Errors.

FAQ

Does it work with my staff and their own calendars?

Yes. Staff members are set up in Book-and-Pay, each with their own hours and, if they like, their own calendar. GET /bookings/staff lists them, provider_id asks for one person's times or books with them, and leaving it out means "anyone available". Busy time in a connected calendar is never offered.

Can a customer book a group class or bring someone?

Yes, when the service has places. GET /bookings/availability with seats shows only times with that many places left, and POST /bookings takes guests. A full group time can have its own waitlist (slot_id on POST /bookings/waitlist).

Can an AI agent book appointments instead of my code?

Yes. The MCP servers https://api.app2email.com/mcp/book-and-pay and https://api.app2email.com/mcp/calendar have the same calls as tools (get_booking_availability, create_booking, cancel_booking, find_next_booking_slots, hold_booking_slot, reschedule_booking, create_time_block, add_to_waitlist ...). See Let an AI agent run your WhatsApp with MCP and MCP.

More how-to guides

All how-to guides