Appointments API & Webhooks
Send booked appointments into Lead Distro AI from a calendar tool, and update their status from a source or a destination's CRM. Endpoints, fields, and error codes for appointment tracking.
Send appointments from your own calendar
A source can send appointments that are already booked, from GoHighLevel or any other calendar tool, to the same ingest address it uses for leads. On an appointments campaign, a post with appointment_time is a booked appointment: it is delivered right away and marked booked.
curl -X POST https://app.leaddistro.ai/api/v1/ingest \
-H "x-api-key: YOUR_SOURCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"flo_campaign_id": "YOUR_CAMPAIGN_ID",
"flo_supplier_id": "YOUR_SOURCE_ID",
"first_name": "Maria",
"last_name": "Garcia",
"phone": "5551234567",
"appointment_time": "2026-10-21T15:30:00-05:00",
"appointment_timezone": "America/Chicago"
}'To update it later, the same source posts the person's phone or email with appointment_status set to showed, no_show or canceled. Lead Distro AI finds the appointment that source sent and updates it, replying 200 with "updated": true. No new lead is made and the source is not charged again. Sending the same booking twice replies with the first appointment. Step-by-step for GoHighLevel: Send GoHighLevel Appointments to Lead Distro AI.
| Reply | Meaning |
|---|---|
| 201 | A new appointment was created and is being delivered. |
200 with updated | An earlier appointment from this source was updated or moved. |
200 with deduplicated | The same booking was sent again. Nothing changed. |
| 400 | The time could not be read (saved as a Failed lead to fix), or the status word is unknown. |
| 404 | A status was sent, but this source sent no earlier appointment for that phone or email. |
| 409 | Showed or no-show was sent before the appointment was delivered to a destination. |
Post an appointment status from a CRM
The buyer outcome webhook accepts an appointment status alongside everything else it already handles. The buyer authenticates with their own secret, so they can only touch their own leads.
curl -X POST https://www.leaddistro.ai/api/webhooks/buyer-outcome \
-H "X-Buyer-Secret: BUYER_WEBHOOK_SECRET" \
-H "Content-Type: application/json" \
-d '{
"lead_id": "LEAD_UUID",
"appointment_status": "showed"
}'| Field | Type | Required | Notes |
|---|---|---|---|
| lead_id | string | Yes* | The lead to update. Instead of this you may match on phone or email plus campaign_id. |
| appointment_status | enum | Yes* | One of booked, showed, no_show, canceled. Send this or appointment_qualified. |
| appointment_at | ISO 8601 | No | When the appointment is scheduled. Usually sent with booked. Must include a timezone offset. |
| appointment_qualified | enum | No | One of qualified, unqualified. The review call on an appointment that showed up. Only accepted when the campaign tracks qualification, otherwise the call returns 403. |
Send appointment_at with the booking. Without it you know an appointment exists but not when, which makes time-to-appointment and upcoming-appointment views impossible to build later.
Cancels and reschedules from the buyer's calendar
When the lead booked on a Lead Distro AI booking page, the same postback also updates that booking on the calendar. Send canceled and the booking is cancelled: the time opens up again and Lead Distro AI reminders stop. Send booked with a new appointment_at and the booking moves to that time, with the same rep. The new time is taken as is, because the buyer's calendar already moved it. Only a booking made with that buyer changes.
// The appointment was moved in the buyer's CRM (for example a GoHighLevel workflow)
{
"phone": "+15555550123",
"campaign_id": "CAMPAIGN_UUID",
"appointment_status": "booked",
"appointment_at": "2026-09-12T10:30:00-07:00"
}The reply says what happened to the booking in data.booking: cancelled, moved (with previous_start and start_time), or not_changed with a reason, for example when the rep already has another booking at that time. The lead's status is saved either way.
Booking and attendance in one flow
A typical integration sends two calls. The first when the appointment is created, the second when the buyer knows whether it happened.
// 1. When the appointment is booked
{
"lead_id": "LEAD_UUID",
"appointment_status": "booked",
"appointment_at": "2026-09-11T15:00:00-07:00"
}
// 2. After the appointment time passes
{
"lead_id": "LEAD_UUID",
"appointment_status": "showed"
}Sending the same status twice is safe. A repeat of a status the lead already has is recognized and does not bill twice.
Reporting the review
If the buyer pays for appointments that showed up and qualified, a third call reports the review. It is a separate field, not another appointment status, so posting "appointment_status": "qualified" returns 400.
// 3. After someone reviews the appointment
{
"lead_id": "LEAD_UUID",
"appointment_qualified": "qualified"
}The two marks can arrive in either order. If the review lands before the show is reported, nothing bills until the show arrives, and then it bills once. Send unqualified when the review decides the appointment was not worth paying for. If it had already been billed, the charge is reversed.
Call outcomes
If the booking comes out of a phone call rather than a calendar, post it as a call outcome instead. This needs no appointment feature enabled. Use the API key of the Source that sent the lead: a Source's key updates only its own leads.
curl -X POST https://www.leaddistro.ai/api/v1/lead-update \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lead_id": "LEAD_UUID",
"call_outcome": "appointment_set"
}'Outcome stages
Both endpoints also accept a stage field carrying a custom outcome stage key, which is how you record an appointment without the billing add-on.
{
"lead_id": "LEAD_UUID",
"stage": "meeting_booked"
}Run reps and appointments from your own system
With an organization API key (Settings, MCP & API), the Actions API runs the same steps as the Calendars and Appointments pages. Send POST /api/v1/actions/<action> with the action's input as the JSON body. These need Appointments and booking calendars turned on.
| Action | What it does |
|---|---|
list_appointments | The appointment report: each booking with its destination, rep, time, status, what happened (showed, no-show) and what it billed. Filter by campaign, destination, or a date range, 100 per page at most. |
update_lead_outcome | Mark an appointment showed, no_show or canceled with appointment_status. One account key covers every rep. |
transfer_appointment | Move a booked meeting to another rep on the same campaign. dry_run: true first lists who can take it and why not. |
get_appointment_open_times | The times a booked meeting could move to: the open times of the same destination's rep for the next days. |
reschedule_appointment | Move a booked meeting to a new time with the same destination. dry_run: true checks the time and changes nothing. |
get_booking_options | For a lead still waiting to book: every destination on its campaign, whether each can take the lead and every reason it cannot, each rep, and the open times for the next days. |
book_appointment | Book a meeting for a lead: the same as New appointment in the app. Send lead_id and start; add rep_id for one rep, and end with rep_id for a custom time. |
get_destination_wallet | A destination's wallet: billing type, balance, and recent credits and charges. Read only. |
list_reps | Each destination's rep, hours, time off, video link, and whether their calendar is connected. |
add_rep | Add a destination's rep, with optional hours and a calendar connect link emailed to them. |
update_rep | Change a rep's hours, time off, video link, or whether they take bookings. |
send_rep_connect_link | Get a fresh no-login link a rep opens to connect their calendar. It is emailed to the rep unless you send send_email: false. |
update_campaign_buyer | A rep's territory: set filters.states on their destination. |
curl -X POST https://app.leaddistro.ai/api/v1/actions/list_appointments \
-H "Authorization: Bearer ldk_live_..." \
-H "Content-Type: application/json" \
-d '{"campaign_id": "YOUR_CAMPAIGN_ID", "from": "2026-11-01", "to": "2026-11-30", "page_size": 100}'Contact details in list_appointments are masked unless you send include_pii: true. Page through with page until has_more is false. Leads that never booked, and bookings made in an outside calendar, are in get_leads instead.
Book an appointment for a lead
For a lead that is still waiting to book: status New, not yet delivered to a destination. For any other lead get_booking_options answers can_book: false with the reason. First call get_booking_options with the lead_id. It returns destinations (each with can_take_it, and reasons listing every blocker at once: paused, no appointments left, budget used up, wallet balance, filters, no rep), each destination's rep with its rep_id, and days of open times. Then call book_appointment with the lead_id and a start from that list, exactly as given.
rep_idbooks that one rep. Without it, the first free rep in the campaign's order takes it.- A custom time, such as 1:15 PM when the open times are on the half hour: send
start,endandrep_idtogether. It runs 5 minutes to 12 hours. The rep must have no other Lead Distro AI booking then. startandendmust carry their offset (2026-11-20T15:00:00Z). A time with no offset is refused.- The booking delivers the lead to the rep's destination, counts one appointment against its cap, bills by the campaign's rule, and emails both people. Do not resend the lead first: a resent lead is delivered, uses an appointment, and can no longer be booked.
- A repeat is safe: the same lead and time answers success with
already_booked: true. - A refusal carries
error_code.no_destinationandslot_takenreturndestinationswith every blocker, so you can fix them in one pass.already_bookedmeans the lead has a meeting: move it withreschedule_appointmentortransfer_appointment.already_deliveredmeans the lead was already sent to a destination or turned away, so it cannot be booked. The one exception is a delivered lead whose appointment was cancelled: it books again with the same destination, with no second delivery and no second cap use. The reply then carriesbooked_again: true. Others:invalid_time,invalid_input,invalid_timezone,not_found,not_appointments,not_bookable,scope_limited,plan_blocked,calendars_off,error.
Move an appointment to a new time
A booking bot or CRM can move a meeting that was booked on a Lead Distro AI booking calendar. It takes two calls with your organization API key: ask for the open times, then move the meeting to one of them. The meeting stays with the same destination. The same rep keeps it when they are free at the new time; otherwise a free rep of that destination takes it.
# 1. The times this meeting could move to (7 days from today by default)
curl -X POST https://app.leaddistro.ai/api/v1/actions/get_appointment_open_times \
-H "Authorization: Bearer ldk_live_..." \
-H "Content-Type: application/json" \
-d '{"lead_id": "LEAD_UUID", "from": "2026-11-20", "days": 7, "timezone": "America/Chicago"}'
# 2. Move it to one of those times. Send "start" exactly as step 1 returned it.
curl -X POST https://app.leaddistro.ai/api/v1/actions/reschedule_appointment \
-H "Authorization: Bearer ldk_live_..." \
-H "Content-Type: application/json" \
-d '{"lead_id": "LEAD_UUID", "start": "2026-11-21T16:00:00.000Z"}'- Which appointment. Send
lead_idorbooking_id, exactly one.list_appointmentsreturns both. - Open times.
get_appointment_open_timesreturns the meeting's current time, its rep and destination, the meeting length, anddays, each with its opentimes.startandendare in UTC.localis the same time in the reply'stimezone, for showing a person. Optional inputs:from(a date),days(1 to 14) andtimezone(an IANA name). The default zone is the zone of the person who booked. - The new time.
startmust be a full ISO time that says its offset, like2026-11-21T16:00:00Zor2026-11-21T10:00:00-06:00. A time with no offset is refused, never guessed. - What a move does. The rep's calendar event moves, the person who booked and the rep are emailed the new time, and reminders start over. No charge, credit or cap changes, except for a No-show (below).
- Check first.
dry_run: trueruns every check and changes nothing. A time that passes the check can still be taken before the real call. - Safe to retry. Sending the time the meeting already has answers success with
already_at_start: trueand sends no email. - No-shows. Moving a meeting marked
no_showto a new time sets it back tobooked, because the meeting is on again. A destination billed when an appointment is booked is billed again, once (the no-show refunded it), and its cap slot is used again. The reply'sappointment_statussaysbooked. - Canceled or finished meetings. A meeting marked
canceledorshowedis not moved. Set a canceled one back tobookedwithupdate_lead_outcomefirst.
A refused call answers HTTP 400 with code: "tool_error", a plain error sentence, and error_code, a short stable reason your program can branch on. Check the HTTP status and code first. error_code is present on the refusals in this table; a permission problem (403) or a wrongly shaped body (422) carries its own code and no error_code.
| error_code | Meaning | What to do |
|---|---|---|
slot_taken | No rep of this destination is free at that time. | Call get_appointment_open_times and pick another time. |
invalid_time | start has no offset, is not a time, or is in the past. | Send a future ISO time with its offset. |
invalid_timezone | timezone is not an IANA time zone. | Send a name like America/Chicago. |
invalid_input | Neither or both of lead_id and booking_id were sent. | Send exactly one. |
not_found | No such lead or booking in your account. | Find the id with list_appointments. |
no_appointment | The lead never booked. | Nothing to move. |
not_native | The meeting was booked in an outside calendar, so there is no meeting here to move. | Move it in that calendar, then report the new time (a source re-sends appointment_time; a destination's CRM posts appointment_status booked with appointment_at). |
not_confirmed | The booking was cancelled. | Book a new appointment. |
appointment_canceled | The lead is marked canceled. | Set it back to booked with update_lead_outcome, then move it. |
appointment_showed | The meeting already happened. | Book a new appointment for a second meeting. |
conflict | Someone else changed the meeting at the same moment. | Read it again with list_appointments, then retry if still wanted. |
calendars_off | Appointments or booking calendars are not turned on for the account. | Turn them on in Labs. |
error | The move did not go through. Nothing was changed. | Send the same call again. |
A successful move also returns lead_time_updated. It is false only in the rare case where the meeting moved on the calendar but the lead record kept its old time; the reply then carries a warning.
Add a new rep and get their calendar connect link by API
Yes, your own system can add a rep and get back the link they open to connect their calendar. Call add_rep, then send_rep_connect_link with the rep_id it returns. Send send_email: false to get only the url and send it yourself (a CRM email or a text).
# 1. Add the rep to a destination. The reply holds their rep_id.
curl -X POST https://app.leaddistro.ai/api/v1/actions/add_rep \
-H "Authorization: Bearer ldk_live_..." \
-H "Content-Type: application/json" \
-d '{"buyer_id": "DESTINATION_ID", "name": "Jordan Lee", "email": "jordan@example.com"}'
# 2. Get their calendar connect link. The reply holds data.url.
curl -X POST https://app.leaddistro.ai/api/v1/actions/send_rep_connect_link \
-H "Authorization: Bearer ldk_live_..." \
-H "Content-Type: application/json" \
-d '{"rep_id": "REP_ID", "send_email": false}'- The API key. Use an organization API key from Settings → MCP & API that has write access to destinations.
- The link. The rep needs no login. It works once and lasts 14 days. Send
ttl_daysas 7, 14 or 30 to change that. A new link replaces every earlier link for that rep. - Email or not. Leave out
send_email, or sendtrue, and Lead Distro AI also emails the link to the rep.add_repwithsend_connect_link: trueadds the rep and emails the link in one call. - One rep per destination.
add_reprefuses a destination that already has a rep. Change that rep withupdate_repinstead. - Who still needs it.
list_repsshows each rep's calendar asconnected,needs_reconnect,link_sentornever_connected. Send a new link to the last two. - Before they connect. A rep with no connected calendar offers no times, unless
book_without_calendaris turned on withupdate_rep.
Error codes
| Code | Meaning | Fix |
|---|---|---|
| 400 | The appointment status is not one of the four allowed values. | Send exactly booked, showed, no_show, or canceled, lowercase. |
| 400 | The lead has not been accepted yet. | A buyer can only set an appointment on a lead they accepted. Deliver and accept it first. |
| 401 | The buyer secret is missing or wrong. | Send the buyer's secret in the X-Buyer-Secret header. |
| 403 | Appointment tracking is not turned on for the account. | Appointments are on for every account, so this is rare. Contact support if you see it. |
| 404 | No matching lead. | Check the lead id, or that the matching phone or email belongs to a lead assigned to this buyer. |
Frequently Asked Questions
How does a buyer's CRM report that an appointment showed up?
https://www.leaddistro.ai/api/webhooks/buyer-outcome with the buyer's secret in the X-Buyer-Secret header and a body containing the lead id and appointment_status. The four accepted values are booked, showed, no_show, and canceled. Add appointment_at with an ISO timestamp when reporting a booking.Where do I find these fields in the app?
Can my own system or AI book an appointment for a lead?
get_booking_options with the lead id for the open times and for every reason a destination cannot take the lead, then book_appointment with the start you picked. Add rep_id to choose the rep, and end with rep_id for a time that is not in the open slots. Both use your organization API key. See Book an appointment for a lead above.Is there an API endpoint that returns the link for a new rep to connect their calendar?
add_rep with the destination's buyer_id and the rep's name and email, then send_rep_connect_link with the rep_id it returns. Send send_email: false to get only the url back without emailing it. Both use your organization API key. See Add a new rep and get their calendar connect link by API above.Can my own system move an appointment to a new time?
get_appointment_open_times with the lead id for the rep's open times, then reschedule_appointment with the new start. Both use your organization API key. The calendar event moves, both people are emailed, and nothing is billed again. See Move an appointment to a new time above.Does marking an appointment canceled by API cancel the meeting on the rep's calendar?
appointment_status canceled also cancels the meeting on a Lead Distro AI booking calendar. update_lead_outcome with your organization API key marks the lead only, so cancel the meeting itself in the app.Is it safe to send the same appointment status twice?
Why am I getting a 400 saying the lead has not been accepted?
Why am I getting a 403 on the appointment endpoints?
stage value instead to record the same thing through outcome stages.Why am I getting a 403 when I post appointment_qualified?
Why does posting appointment_status of qualified return 400?
appointment_qualified with a value of qualified or unqualified. Keeping them apart is what lets an appointment be Showed and Unqualified at the same time, which is a real and common state.Related Articles
If you have any questions, send us an email at support@leaddistro.ai