Lead Distro AILead Distro AI
DocsAppointmentsAppointments API & Webhooks

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.

Last updated:

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.

ReplyMeaning
201A new appointment was created and is being delivered.
200 with updatedAn earlier appointment from this source was updated or moved.
200 with deduplicatedThe same booking was sent again. Nothing changed.
400The time could not be read (saved as a Failed lead to fix), or the status word is unknown.
404A status was sent, but this source sent no earlier appointment for that phone or email.
409Showed 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"
  }'
FieldTypeRequiredNotes
lead_idstringYes*The lead to update. Instead of this you may match on phone or email plus campaign_id.
appointment_statusenumYes*One of booked, showed, no_show, canceled. Send this or appointment_qualified.
appointment_atISO 8601NoWhen the appointment is scheduled. Usually sent with booked. Must include a timezone offset.
appointment_qualifiedenumNoOne 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.

ActionWhat it does
list_appointmentsThe 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_outcomeMark an appointment showed, no_show or canceled with appointment_status. One account key covers every rep.
transfer_appointmentMove 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_timesThe times a booked meeting could move to: the open times of the same destination's rep for the next days.
reschedule_appointmentMove a booked meeting to a new time with the same destination. dry_run: true checks the time and changes nothing.
get_booking_optionsFor 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_appointmentBook 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_walletA destination's wallet: billing type, balance, and recent credits and charges. Read only.
list_repsEach destination's rep, hours, time off, video link, and whether their calendar is connected.
add_repAdd a destination's rep, with optional hours and a calendar connect link emailed to them.
update_repChange a rep's hours, time off, video link, or whether they take bookings.
send_rep_connect_linkGet 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_buyerA 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_id books 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, end and rep_id together. It runs 5 minutes to 12 hours. The rep must have no other Lead Distro AI booking then.
  • start and end must 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_destination and slot_taken return destinations with every blocker, so you can fix them in one pass. already_booked means the lead has a meeting: move it with reschedule_appointment or transfer_appointment. already_delivered means 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 carries booked_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_id or booking_id, exactly one. list_appointments returns both.
  • Open times. get_appointment_open_times returns the meeting's current time, its rep and destination, the meeting length, and days, each with its open times. start and end are in UTC. local is the same time in the reply's timezone, for showing a person. Optional inputs: from (a date), days (1 to 14) and timezone (an IANA name). The default zone is the zone of the person who booked.
  • The new time. start must be a full ISO time that says its offset, like 2026-11-21T16:00:00Z or 2026-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: true runs 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: true and sends no email.
  • No-shows. Moving a meeting marked no_show to a new time sets it back to booked, 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's appointment_status says booked.
  • Canceled or finished meetings. A meeting marked canceled or showed is not moved. Set a canceled one back to booked with update_lead_outcome first.

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_codeMeaningWhat to do
slot_takenNo rep of this destination is free at that time.Call get_appointment_open_times and pick another time.
invalid_timestart has no offset, is not a time, or is in the past.Send a future ISO time with its offset.
invalid_timezonetimezone is not an IANA time zone.Send a name like America/Chicago.
invalid_inputNeither or both of lead_id and booking_id were sent.Send exactly one.
not_foundNo such lead or booking in your account.Find the id with list_appointments.
no_appointmentThe lead never booked.Nothing to move.
not_nativeThe 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_confirmedThe booking was cancelled.Book a new appointment.
appointment_canceledThe lead is marked canceled.Set it back to booked with update_lead_outcome, then move it.
appointment_showedThe meeting already happened.Book a new appointment for a second meeting.
conflictSomeone else changed the meeting at the same moment.Read it again with list_appointments, then retry if still wanted.
calendars_offAppointments or booking calendars are not turned on for the account.Turn them on in Labs.
errorThe 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_days as 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 send true, and Lead Distro AI also emails the link to the rep. add_rep with send_connect_link: true adds the rep and emails the link in one call.
  • One rep per destination. add_rep refuses a destination that already has a rep. Change that rep with update_rep instead.
  • Who still needs it. list_reps shows each rep's calendar as connected, needs_reconnect, link_sent or never_connected. Send a new link to the last two.
  • Before they connect. A rep with no connected calendar offers no times, unless book_without_calendar is turned on with update_rep.

Error codes

CodeMeaningFix
400The appointment status is not one of the four allowed values.Send exactly booked, showed, no_show, or canceled, lowercase.
400The lead has not been accepted yet.A buyer can only set an appointment on a lead they accepted. Deliver and accept it first.
401The buyer secret is missing or wrong.Send the buyer's secret in the X-Buyer-Secret header.
403Appointment tracking is not turned on for the account.Appointments are on for every account, so this is rare. Contact support if you see it.
404No 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?
It posts to 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?
Open the destination on your campaign and choose Postback Webhook. The spec there lists the appointment fields, shows the booked then showed example, and has two share links so you can hand the whole page to the buyer's developer: Copy developer link includes the secret, and Copy client link leaves it out. The appointment part only appears when that destination is paid per appointment, since that is the only setup where the status changes what gets billed.
Can my own system or AI book an appointment for a lead?
Yes. Call 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?
Yes. Call 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?
Yes, when it was booked on a Lead Distro AI booking calendar. Call 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?
It depends on who sends it. A destination's Postback Webhook with 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?
Yes. Sending a status the lead already has is recognized as a repeat and does not bill the buyer twice, so a CRM that retries on a timeout cannot double-charge anyone.
Why am I getting a 400 saying the lead has not been accepted?
A buyer can only set an appointment on a lead they have accepted, which prevents a buyer marking appointments on leads that were never theirs. Deliver the lead and have it accepted first. Updates you make yourself from the dashboard are not restricted this way.
Why am I getting a 403 on the appointment endpoints?
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. In the meantime, post a stage value instead to record the same thing through outcome stages.
Why am I getting a 403 when I post appointment_qualified?
The lead's campaign does not track qualification. Turn on Track Qualified Shows on that campaign first. Until it is on, there is no review step for the appointment to be in, so the field is refused rather than quietly ignored.
Why does posting appointment_status of qualified return 400?
Qualification is a separate field, not a fifth appointment status. Send 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.

If you have any questions, send us an email at support@leaddistro.ai