Appointments
The Appointments API books appointments for your contacts on your event types, then fetches, lists, updates, cancels or deletes them. It also answers the question that comes first in most booking flows (which times are actually free) and covers the calendar side: listing your connected Google Calendars and importing events already in them. When a Google Calendar connection is active, the matching calendar event is created and kept in sync automatically in the background. Restaurants using Zenchef, Formitable, OpenTable or TheFork can be verified and connected here so the AI Agent books real tables, and appointment businesses running their schedule in Trafft can connect that the same way.
All paths are relative to https://api.dmchamp.com/v1. Every request needs your API key: see Authentication. Shared error codes and pagination are in Errors & Pagination. Field-level detail for every call (request fields, the appointment object, response shapes) is in the API Reference.
How booking works
- Event types vs. appointments. An event type is a bookable slot definition (the kind of meeting, its length, its rooms). An appointment is one booked instance of an event type for one contact. You book by naming the contact and the event type.
- The usual flow: find the free slots on an event type, let the person pick one, then book it. Free slots already account for the event type’s opening hours and slot length, its rooms, existing bookings, bookings on other event types of the same shared calendar, blocked time, and everything blocked on the connected Google Calendars, so a slot that comes back is one you can book.
- Shared calendars and blocked time. Event types take a
shared_schedulename (the same name on several event types makes them share one calendar), and blocked time is added and removed withPOST /events/{eventId}/blocked-timesandDELETE /events/{eventId}/blocked-times/{blockId}; fields are in the API Reference. What both do is explained in Shared Calendars, Blocked Time and Front Desk Booking. - External bookings. Leave out the event type and send a
titleto record a booking made somewhere else (your CRM, a class schedule, another booking tool), so it shows on the Appointments page with the rest. See Recording a booking made somewhere else. - Status is
ConfirmedorCanceled. Cancel keeps the record; delete removes it. - Calendar sync runs in the background. Right after you book or change an appointment,
google_calendar_event_idmay still benullandcalendar_syncedfalse. Fetch it again a moment later to see them filled in.
Endpoints
| Task | Method + path | Explorer |
|---|---|---|
| Find available slots | GET /appointments/available-slots |
Open in API Reference |
| Book an appointment (or record an external one) | POST /appointments |
Open in API Reference |
| Get an appointment | GET /appointments/{appointmentId} |
Open in API Reference |
| List appointments | GET /appointments |
Open in API Reference |
| Update or reschedule | PUT /appointments/{appointmentId} |
Open in API Reference |
| Cancel | POST /appointments/{appointmentId}/cancel |
Open in API Reference |
| Resend the booking confirmation | POST /appointments/{appointmentId}/resend-confirmation |
Open in API Reference |
| Delete | DELETE /appointments/{appointmentId} |
Open in API Reference |
| List connected Google Calendars | GET /appointments/google-calendars |
Open in API Reference |
| Import events from a Google Calendar | POST /appointments/import-calendar-events |
Open in API Reference |
| Poll the import job | GET /appointments/import-calendar-events/{jobId} |
Open in API Reference |
| Zenchef: check a restaurant ID | POST /appointments/zenchef-restaurants/check |
Open in API Reference |
| Zenchef: verify the name | POST /appointments/zenchef-restaurants/verify-name |
Open in API Reference |
| Zenchef: save | POST /appointments/zenchef-restaurants |
Open in API Reference |
| Zenchef: update | PUT /appointments/zenchef-restaurants/{restaurantId} |
Open in API Reference |
| Zenchef: remove | DELETE /appointments/zenchef-restaurants/{restaurantId} |
Open in API Reference |
| Formitable: verify | POST /appointments/formitable-restaurants/verify |
Open in API Reference |
| Formitable: get details | GET /appointments/formitable-restaurants/{restaurantId}/details |
Open in API Reference |
| Formitable: save | POST /appointments/formitable-restaurants |
Open in API Reference |
| Formitable: update | PUT /appointments/formitable-restaurants/{restaurantId} |
Open in API Reference |
| Formitable: remove | DELETE /appointments/formitable-restaurants/{restaurantId} |
Open in API Reference |
| OpenTable: verify | POST /appointments/opentable-restaurants/verify |
Open in API Reference |
| OpenTable: add | POST /appointments/opentable-restaurants |
Open in API Reference |
| OpenTable: update | PUT /appointments/opentable-restaurants/{restaurantId} |
Open in API Reference |
| OpenTable: remove | DELETE /appointments/opentable-restaurants/{restaurantId} |
Open in API Reference |
| TheFork: verify | POST /appointments/thefork-restaurants/verify |
Open in API Reference |
| TheFork: add | POST /appointments/thefork-restaurants |
Open in API Reference |
| TheFork: update | PUT /appointments/thefork-restaurants/{restaurantId} |
Open in API Reference |
| TheFork: remove | DELETE /appointments/thefork-restaurants/{restaurantId} |
Open in API Reference |
| Trafft: connect | POST /appointments/trafft/connect |
Open in API Reference |
| Trafft: connection status | GET /appointments/trafft |
Open in API Reference |
| Trafft: pause, resume or relabel | PUT /appointments/trafft |
Open in API Reference |
| Trafft: disconnect | DELETE /appointments/trafft |
Open in API Reference |
Find available slots
Find the event type’s ID in the app: open it on the Appointments page (Event Types tab) and the edit window shows its Event type ID with a copy button.
curl "https://api.dmchamp.com/v1/appointments/available-slots?event_id=event_xyz789&start_time=2026-06-15T00:00:00.000Z&end_time=2026-06-19T00:00:00.000Z&apiKey=YOUR_API_KEY"
{
"success": true,
"data": [
{
"date": "15/06/2026",
"day": "monday",
"room_name": "Room A",
"available_slots": [
{ "start_time": "10:00", "end_time": "10:30", "available": true },
{ "start_time": "10:30", "end_time": "11:00", "available": true, "spots_left": 2 }
]
}
]
}
- Results are grouped by day, and with rooms, one group per room per day. A day with nothing free does not appear. The whole
end_timeday is included. - Times are local to the event type, not UTC.
date(DD/MM/YYYY),start_timeandend_time(HH:mm) are wall-clock values in the event type’s own timezone (its override, or your account timezone). Booking expects an ISO 8601 UTC instant, so convert the slot before posting it. spots_leftonly appears on event types that take more than one booking per slot.- Missing
event_id,start_timeorend_timeis a400; an event type not on your account is a404.
Book an appointment
curl -X POST "https://api.dmchamp.com/v1/appointments?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contact_id": "contact_abc123", "event_id": "event_xyz789", "start_time": "2026-06-15T10:00:00.000Z", "room_name": "Room A"}'
- On an event type, availability and capacity are respected, the end time comes from the event type’s slot duration, and the appointment syncs to your Google Calendar when one is connected. A
start_timewithout a timezone offset is read in the event type’s timezone (the one set on the event type, otherwise your account’s). - Rooms: a booking on an event type with rooms must be a time Find available slots would offer: inside the room’s hours, outside the notice period, within how far ahead the event type can be booked, on the slot grid, not in the past and not blocked on a connected calendar. Anything else is a
400and nothing is created; so is aroom_namethat matches none of the rooms (the message lists the valid names). Leaveroom_nameout to book the first free room. Buffer times on the event type (Buffer before / Buffer after,buffer_before/buffer_afterin minutes) are kept free around every booking. - Conflicts: a slot that is already full is not a bookable time, so it fails with
400and nothing is created. A409means another booking took the slot at the same moment as yours. - Retrying is safe. If the same contact already has a confirmed booking on the same event type at the same start (in the same room, when you name one), for example because your first request timed out after it went through, you get that booking back with
200and"replayed": trueinstead of a second booking or a409. external_referenceis an idempotency key and your own ID for the booking (up to 255 characters). It is unique on your account: if an appointment already carries it, that appointment comes back with200and"replayed": trueand nothing new is created, even when the retry names a different time or contact, whatever that appointment’s status. Use it for paid bookings (your payment or order ID) and send a new one for a genuinely new booking. It comes back on every read and in the Appointment Booked, Cancelled and Rescheduled webhooks.contact_idandevent_idmust belong to your account.
Recording a booking made somewhere else
Same endpoint without an event type: a title (up to 200 characters, shown on the Appointments page and returned as summary) and a start_time are enough.
curl -X POST "https://api.dmchamp.com/v1/appointments?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contact_id": "contact_abc123", "title": "Beginner guitar class", "start_time": "2026-06-15T10:00:00.000Z", "duration_minutes": 90, "external_reference": "class-slot-4812"}'
- Set the length with
duration_minutes(1 to 1440) orend_time(later thanstart_time), not both. With neither, it lasts 60 minutes. - Send
event_idandtitletogether, or neither, and you get a400; the same for bothend_timeandduration_minutes. - External bookings are ordinary appointments from then on: they show on the Appointments page and in the list, can be rescheduled, cancelled or deleted in the app or here, the booking notification email goes out, and the Appointment booked automation trigger and webhook fire as for any API booking. The only differences: no availability or capacity check, no calendar sync, and
event_idstaysnull.
Read, list and change appointments
curl -X PUT "https://api.dmchamp.com/v1/appointments/aBcD1234eFgH5678?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"start_time": "2026-06-16T10:00:00.000Z", "end_time": "2026-06-16T10:30:00.000Z"}'
- List returns newest first, paged with
limit(1 to 100, default 50) andcursoruntilnext_cursorisnull. Filter bycontact_id(confirmed appointments only), adddate(YYYY-MM-DD) to narrow that to one day, or usestatus(Confirmed/Canceled) withoutcontact_id.datewithoutcontact_id, orstatus=Canceledwithcontact_id, is a400. - Marking attendance on a past appointment (they came or no-show) is an update on the appointment, the same as They came and No-show in the app; a no-show is what lets Booking care send its no-show message. Fields in the API Reference.
- Update is partial; at least one field is required and the end must stay after the start. A time without an offset is read in the event type’s timezone (or your account’s). Changes sync to the calendar event in the background.
- Moving a confirmed booking on an event type (a new
start_timeorroom_name) is conflict-checked like a new booking: a full slot is a409and nothing changes; an unknownroom_nameis a400. Send onlystart_timeand the booking keeps its length. Your opening hours and notice period are not applied on a move, so you can move a booking to any free time. description,summaryandexternal_referencetakenullto clear them. Anexternal_referenceanother appointment already has is a409with"code": "external_reference_taken".
Cancel an appointment
POST /appointments/{appointmentId}/cancel with an optional cancellation_reason. The appointment stays in your account as Canceled and the linked calendar event is removed in the background. Cancelling an already-canceled appointment is a 400. To remove the record entirely, use DELETE /appointments/{appointmentId} (permanent, removes its references too).
Resend the booking confirmation
Sends the contact their booking confirmation again, for example when it never arrived or went to spam. Two parts, both sent unless you switch one off with "email": false or "calendar_invite": false: the confirmation email (the same one sent at booking) and, when the appointment is on your Google Calendar, the Google Calendar invitation. Both go to the email address on the contact.
curl -X POST "https://api.dmchamp.com/v1/appointments/aBcD1234eFgH5678/resend-confirmation?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" -d '{}'
- Each part reports its own outcome:
sent,not_requested,no_contact_email,turned_off_for_event_type(the event type’s Send appointment email to contact switch is off),not_on_google_calendar,imported(appointments imported from your calendar get no confirmation email) orfailed. 200when at least one part was sent, withrecipientset to the address it went to.409for a canceled appointment, one already over, or a booking made through Zenchef, Formitable, OpenTable, TheFork or Trafft (that system sends its own confirmation):codeisappointment_canceled,appointment_in_pastormanaged_by_provider.422when nothing could be sent, with the reason inerror.
Google Calendar: list and import
List connected calendars returns the calendars straight from Google, for a picker or to confirm the connection is live. It needs Google Calendar connected (Settings → Integrations) with calendar-read access; a missing or revoked connection is a 400 telling you to (re)connect. Each entry is Google’s own CalendarListEntry shape, so field names are Google’s camelCase, passed through as-is.
Import pulls the events already in a campaign’s or AI Agent’s connected Google Calendar(s) and turns them into appointments, useful the first time you connect a calendar that already has bookings. Each event goes through extraction to work out who it is for, so it always runs as a background job: you get a job_id to poll.
curl -X POST "https://api.dmchamp.com/v1/appointments/import-calendar-events?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"agent_id": "agent_abc123", "identifier": "EMAIL"}'
- Send exactly one of
agent_id/campaign_id(both or neither is a400); it must belong to your account or you get a404. The response echoes the one you sent; the other isnull. identifieris"EMAIL"or"PHONE_NUMBER": which contact detail to extract from each event to match or create its contact.- Poll
GET /appointments/import-calendar-events/{jobId}:statusisqueuedorprocessing(keep polling),completed(messagehas a short summary) orfailed(errorhas the reason). An unknown job, or one on another account, is a404.
External booking integrations (Zenchef / Formitable / OpenTable / TheFork / Trafft)
Zenchef, Formitable, OpenTable and TheFork are restaurant reservation systems your AI Agent can book real tables through; Trafft is a scheduling platform for appointment businesses, connected once per account rather than per restaurant. Zenchef and Formitable also have a public, unauthenticated booking widget (https://api.dmchamp.com/v1/zenchef-widget/... and https://api.dmchamp.com/v1/formitable-widget/...) that renders in chat for the diner; those are HTML pages for a browser, not JSON endpoints, so they are not covered here. The calls below manage the account side: verify a restaurant, then add, update or remove it.
- Pausing:
is_active: falseon a saved restaurant stops the AI booking there without removing the setup. On OpenTable and TheFork an emptywebsite_urlclears it, andwebsite_urlmust behttp(s)://; it is shown to guests when the AI hands them off to the restaurant.restaurant_nameis a label, and also what the AI calls the restaurant. - Removing a Zenchef or Formitable restaurant makes any event type still referencing it stop offering booking there; a removed OpenTable or TheFork restaurant can be added back any time with the same ID. A
restaurantIdnot on the account is a404on update or delete. - Error shape: on the Zenchef, Formitable, OpenTable and TheFork calls, errors carry the status twice, as the HTTP status and as
error_codein the body, for example{ "success": false, "error": "Restaurant not found", "error_code": 404 }. Checksuccessand readerroras usual.
Zenchef
A two-step verification, so the account holder proves they run the restaurant before it is wired into the bot:
- Check the
restaurant_idexists, without revealing its name.exists: falsemeans no such restaurant. Limited to 10 checks per 5 minutes per account (429beyond that). - Verify the name: the account holder types the restaurant’s name (
user_input_name), compared to the real name case- and whitespace-insensitively.verified: falsemeans no match andrestaurantDetailsis left out; ask them to try again. Limited to 3 attempts per 5 minutes, since this is the actual proof step. An ID that no longer resolves on Zenchef is a404. - Save with
restaurant_id(1 to 64 letters, numbers, underscores or hyphens) and the verifiedrestaurant_name. It is active at once.
Formitable
Formitable IDs are already scoped per business, so one verify call is enough (an unknown ID is a 404; 10 attempts per 5 minutes per account; language defaults to "nl" for the probe). The details lookup, GET /appointments/formitable-restaurants/{restaurantId}/details?language=en (language optional, default "en"), fetches the public profile including the website, to cache website_url while setting it up. Save needs restaurant_id (1 to 64 letters, numbers, underscores or hyphens), restaurant_name and language (an ISO tag such as "en" or "en-GB").
OpenTable
Restaurants are reached through the platform’s OpenTable partner credentials, which only see restaurants that connected the platform’s listing in OpenTable’s Integrations Marketplace. So one verify call is enough: a reachable Restaurant ID (the numeric “RID”, such as 1038007) proves the restaurant exists and connected the integration. verified: false means no restaurant has that ID; a 403 means it exists but has not connected the integration in OpenTable yet. Until the OpenTable partner listing is enabled on the platform, verify answers 503. 10 attempts per 5 minutes per account.
TheFork
Same model as OpenTable through the platform’s TheFork partner credentials: a reachable Restaurant ID proves the restaurant exists and has the platform’s partner enabled. The ID is the UUID from TheFork Manager, sent as a string. partySizes in the verify answer are the party sizes the restaurant takes online over the next 30 days. A 404 or 403 means the ID is wrong or the partner is not enabled on that restaurant yet; a 400 means the ID is not a UUID. Until TheFork has approved the platform as a partner and issued the credentials, verify answers 503: see TheFork. 10 attempts per 5 minutes per account.
Trafft
Trafft is connected once for the whole account: one company address plus the API credentials from the Trafft admin panel (Features & Integrations → API & Connectors, on Trafft’s Business plan). Connect checks the credentials against Trafft before storing anything, so a wrong address, wrong credentials or a plan without API access fails here rather than in a customer conversation.
curl -X POST "https://api.dmchamp.com/v1/appointments/trafft/connect?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subdomain": "acme", "client_id": "YOUR_TRAFFT_CLIENT_ID", "client_secret": "YOUR_TRAFFT_CLIENT_SECRET", "company_name": "Acme Studio"}'
subdomainis the part before.admin.trafft.comin the address you sign in at; a full address is accepted and reduced to the same value. The counts that come back from the check are the quickest way to confirm the credentials point at the account you meant.- The client secret is stored encrypted and never returned by any endpoint, including the status call.
connected: falseon the status call means nothing is set up. PUTpauses (is_active: false, the AI stops booking into Trafft, the connection stays) or resumes it, and changes thecompany_namelabel. To change credentials, connect again.- Disconnect removes the stored credentials only; appointments already in Trafft are untouched.
- Team members need the Appointments edit permission for connect, refresh, update and disconnect, and Appointments view for the status call.
Errors
Besides the shared codes in Errors & Pagination: 400 for a missing or invalid field (a bad start_time, an end_time not after start_time, an invalid filter combination, no fields to update, an already-canceled appointment; when booking, neither or both of event_id and title, both end_time and duration_minutes, a title over 200 characters, a duration_minutes outside 1 to 1440); 404 when the appointment, contact or event type was not found; 409 when the slot is already taken, or on update when the external_reference is used by another appointment.
Use your own Google OAuth client (Calendar consent screen)
When an account connects Google Calendar, Google’s sign-in window names the OAuth client’s project, by default the platform’s. An agency can register its own Google OAuth 2.0 client on the agency account; from then on the calendar connect for that account and every sub-account under it runs through that client, so the consent screen shows the agency’s name and logo. Nothing else changes: the connect flow, the two-way sync and the appointment endpoints above work exactly as before. These calls are not in the API Reference.
Google Calendar only. The Gmail mailbox OAuth for the Email channel is unaffected.
What your client needs first
- An OAuth 2.0 client of type Web application in your Google Cloud project, with the Google Calendar API enabled on that project.
- Every
redirect_urisentry (returned by the endpoints below) added under the client’s Authorized redirect URIs. The first entry is your verifiedapi.domain when you have one (Google only verifies a brand whose redirect lives on a domain you own), followed by the platform’s neutral host as the fallback used until then. - The consent screen with your brand, your domain under Authorized domains, and the two Calendar scopes declared (
scopesin the response). Until the app is published and verified by Google, users see an unverified-app warning and the client is capped at 100 users.
Save your client
PUT /account-config/google-oauth-client with client_id (ends in .apps.googleusercontent.com) and client_secret (verified against Google before it is stored, then encrypted, never returned by any endpoint).
curl -X PUT "https://api.dmchamp.com/v1/account-config/google-oauth-client?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_id": "123456789012-abcdefghijklmnop.apps.googleusercontent.com",
"client_secret": "GOCSPX-your-client-secret"
}'
Response
{
"success": true,
"configured": true,
"client_id": "123456789012-abcdefghijklmnop.apps.googleusercontent.com",
"redirect_uris": [
"https://api.youragency.com/v1/auth-google-callback",
"https://api.dmchamp.com/v1/auth-google-callback"
],
"scopes": [
"https://www.googleapis.com/auth/calendar.events",
"https://www.googleapis.com/auth/calendar.readonly"
],
"setup": ["…"]
}
A wrong secret or an unknown client ID is refused with 400 and Google’s own reason in error, and nothing is stored.
Read or remove it
GET /account-config/google-oauth-client returns the same summary at any time: configured: false plus the redirect_uris and scopes before anything is saved, so you can set up the Google side first. DELETE /account-config/google-oauth-client removes the client: new connects revert to the platform client, and calendars connected through the removed client must be reconnected, because only the client that issued a connection can refresh it.
Team members need Integrations: view for GET and Integrations: edit for PUT / DELETE.
Next steps
- Contacts: create and look up the contacts you book for.
- Messages & Conversations: send a contact a confirmation or reminder.
- Webhooks: get notified when appointments change.