---
name: kimaai_lead_event
type: action
since: 1.6.0
tier: free
feature: lead-capture
area: leads-customer-centre
summary: Fires when something happened to a lead after it was stored; today, a booked meeting.
parameters:
  - name: lead_id
    type: int
    description: The lead's ID.
  - name: event
    type: string
    description: What happened. Today only meeting_booked.
surfaces: [chatbot]
---

# kimaai_lead_event

## When it fires

When the visitor of a lead booked a meeting in the booking calendar of the chat (Meeting booking, Pro). The calendar reports the booking from the visitor's browser to `POST /kimaai/v1/chatbot/lead`, and KimaAI records it on the conversation's lead, once: a second report, a conversation without a lead and a lead the visitor declined or whose details were erased fire nothing. The report comes from the browser, not from the calendar provider.

KimaAI hooks it itself with Pro: the lead score adds the points of a booked meeting (priority 5), Insights records the meeting as a conversion (10) and the lead sync sends the updated lead to the CRMs and the lead webhook (20).

More events may come: check `$event` and ignore the ones you do not handle, as the example does.

## Example

```php
add_action(
  'kimaai_lead_event',
  function (int $lead_id, string $event): void {
    if ($event !== 'meeting_booked') {
      return;
    }

    // Meetings booked from the chat, per month.
    $key = 'my_theme_meetings_' . wp_date('Y-m');
    update_option($key, (int) get_option($key, 0) + 1, false);
  },
  10,
  2
);
```

## Related

- `kimaai_lead_saved`: fires when the lead was stored.
