> ## Documentation Index
> Fetch the complete documentation index at: https://docs.3i.life/llms.txt
> Use this file to discover all available pages before exploring further.

# Delivering Leads from Calendly Funnels

> How lead vendors and agencies using Calendly booking funnels deliver live leads and appointments into 3i CRM.

If your lead generation agency or advertising funnel uses Calendly to let prospects book consultation times, you can deliver those leads directly into 3i CRM in real time.

When a lead books on your Calendly funnel, 3i automatically:

* Creates the lead in the agent's pipeline with `status = 'Scheduled'`.
* Schedules the appointment on the receiving agent's live calendar agenda.
* Intelligently parses your custom questionnaire answers into clean, formatted CRM notes.
* Captures the direct video meeting link (Zoom, Google Meet, Teams) and reschedule URLs.

***

## Two Ways Vendors Can Deliver Calendly Leads

<Tabs>
  <Tab title="Option 1: Forward Raw Calendly Webhook (Zero Code)">
    ### Direct Event Forwarding

    If you want to forward Calendly's native webhook event directly from your Calendly account without writing custom transformation code:

    #### Webhook URL Format

    Because Calendly does not support custom HTTP headers on webhook subscriptions, pass the agent's **`x-source-token`** in the URL path:

    ```http theme={null}
    POST https://api.3i.life/functions/v1/inbound-lead-gateway/v/<AGENT_GATEWAY_TOKEN>
    Content-Type: application/json
    ```

    *(Example: `https://api.3i.life/functions/v1/inbound-lead-gateway/v/06515a86-24ba-4952-9d52-670230196826`)*

    #### Subscribed Events

    * **`invitee.created`** — Dispatched when a prospect books a meeting. 3i creates the lead as `Scheduled`.
    * **`invitee.canceled`** — Dispatched if a meeting is canceled or rescheduled. 3i updates the record accordingly.
  </Tab>

  <Tab title="Option 2: Dispatch Standard 3i JSON Payload">
    ### Standard Webhook Dispatch

    If your backend or automation platform (Make, n8n, custom worker) already processes your Calendly bookings, format your outbound request to our standard gateway schema:

    ```http theme={null}
    POST https://api.3i.life/functions/v1/inbound-lead-gateway
    Content-Type: application/json
    x-source-token: <AGENT_GATEWAY_TOKEN>
    Idempotency-Key: <UNIQUE_UUID>
    ```

    ```json theme={null}
    {
      "name": "Marcus Vance",
      "phone": "5125550188",
      "email": "m.vance@example.com",
      "state": "TX",
      "status": "Scheduled",
      "schedule_type": "appointment",
      "scheduled_at": "2026-09-30T18:00:00.000Z",
      "setter_dialer_name": "Calendly Self-Book",
      "notes": "Appointment: 09/30/2026 01:00 PM CDT\nMeeting Link: https://zoom.us/j/9988776655\n------------------------------\nCoverage Goal: $50,000 Final Expense\nExisting Coverage: No",
      "custom_fields": {
        "join_url": "https://zoom.us/j/9988776655",
        "cancel_url": "https://calendly.com/cancellations/ABC",
        "reschedule_url": "https://calendly.com/reschedulings/ABC"
      }
    }
    ```
  </Tab>
</Tabs>

***

## How 3i Maps Raw Calendly Webhooks

When a vendor forwards a raw `invitee.created` event, 3i's native parser automatically extracts and maps the nested properties:

| Calendly Webhook Property                                | 3i CRM Mapping Target                | System Behavior                                                                                      |
| :------------------------------------------------------- | :----------------------------------- | :--------------------------------------------------------------------------------------------------- |
| `payload.invitee.name`                                   | `leads.name`                         | Contact display name. Split names (`first_name` + `last_name`) are also combined.                    |
| `payload.invitee.email`                                  | `leads.email`                        | Primary email address. Lowercased and indexed.                                                       |
| `payload.invitee.text_reminder_number`                   | `leads.phone`                        | Primary phone number. Normalized to clean 10-digit format.                                           |
| `payload.questions_and_answers`                          | `leads.phone` (fallback)             | If `text_reminder_number` is absent, 3i automatically scans questionnaire answers for phone numbers. |
| `payload.scheduled_event.start_time`                     | `leads.scheduled_at`                 | Canonical UTC ISO-8601 appointment timestamp. Populates calendar agenda.                             |
| `payload.invitee.timezone`                               | `leads.appointment_timezone`         | IANA timezone (e.g. `America/New_York`).                                                             |
| `payload.scheduled_event.event_memberships[0].user_name` | `leads.setter_dialer_name`           | Host name (e.g. `"Calendly: Nicholas Galligan"`).                                                    |
| `payload.scheduled_event.location.join_url`              | `leads.custom_fields.join_url`       | Direct Zoom, Google Meet, or Teams video room link. One-click button in CRM Lead Drawer.             |
| `payload.invitee.cancel_url`                             | `leads.custom_fields.cancel_url`     | Link for the agent to cancel the booking.                                                            |
| `payload.invitee.reschedule_url`                         | `leads.custom_fields.reschedule_url` | Link for the agent to reschedule with the lead.                                                      |
| `payload.scheduled_event.name`                           | `leads.campaign_name`                | Event type name (e.g. *"15-Minute Consultation"*).                                                   |
| `payload.uri` (Invitee URI)                              | `leads.idempotency_key`              | Uniquely stable URI used to prevent duplicate leads on webhook retries within 24h.                   |

***

## Intelligent Q\&A Answer Filtering

When prospects complete your Calendly questionnaire, 3i formats their answers into clean, structured notes while filtering out noise:

<AccordionGroup>
  <Accordion title="Underwriting Answers Preserved" icon="shield-check">
    Answers like `"No"` or `"None"` to critical qualification questions (e.g. *"Do you currently have coverage?"* or *"Any major health conditions?"*) are **strictly preserved** as vital decision data.
  </Accordion>

  <Accordion title="Open-Ended Noise Stripped" icon="filter">
    Answers like `"No"`, `"None"`, or `"N/A"` to open-ended text prompts (e.g. *"Please share anything that will help prepare..."*) are automatically discarded to keep agent briefings clean.
  </Accordion>

  <Accordion title="Phone Prompts Promoted" icon="phone">
    Questions asking for contact phone numbers are promoted to the primary phone field and omitted from the notes section to prevent duplication.
  </Accordion>
</AccordionGroup>

### Formatted Notes Output in the Agent's CRM:

```
CALENDLY APPOINTMENT: 15-Minute Life Insurance Review
Time: 2026-09-30T18:00:00.000Z (America/New_York)
Host: Nicholas Galligan
Join Meeting: https://zoom.us/j/9988776655
Reschedule: https://calendly.com/reschedulings/MNB67890
Cancel: https://calendly.com/cancellations/MNB67890
----------------------------------------
What is your primary coverage goal?
$50,000 Final Expense

Do you currently have coverage?
No
```

***

## Raw Calendly Webhook Delivery Example

Here is the exact JSON structure Calendly dispatches on `invitee.created` that 3i ingests natively:

```json theme={null}
{
  "event": "invitee.created",
  "created_at": "2026-09-22T00:05:00.000000Z",
  "payload": {
    "uri": "https://api.calendly.com/scheduled_events/GBH12345/invitees/MNB67890",
    "name": "Marcus Vance",
    "email": "m.vance@example.com",
    "timezone": "America/New_York",
    "text_reminder_number": "5125550199",
    "cancel_url": "https://calendly.com/cancellations/MNB67890",
    "reschedule_url": "https://calendly.com/reschedulings/MNB67890",
    "questions_and_answers": [
      {
        "question": "What is your primary coverage goal?",
        "answer": "$50,000 Final Expense"
      },
      {
        "question": "Do you currently have coverage?",
        "answer": "No"
      },
      {
        "question": "Please share anything else",
        "answer": "No"
      }
    ],
    "scheduled_event": {
      "uri": "https://api.calendly.com/scheduled_events/GBH12345",
      "name": "15-Minute Life Insurance Review",
      "start_time": "2026-09-30T18:00:00.000000Z",
      "end_time": "2026-09-30T18:15:00.000000Z",
      "location": {
        "type": "zoom_conference",
        "join_url": "https://zoom.us/j/9988776655"
      },
      "event_memberships": [
        {
          "user_name": "Nicholas Galligan",
          "user_email": "nicholas@3i.life"
        }
      ]
    },
    "tracking": {
      "utm_source": "facebook",
      "utm_campaign": "veterans_fe"
    }
  }
}
```

***

## Pre-Flight Testing for Vendors

Test your Calendly webhook forwarder safely by adding `"listen": true` to the payload:

```bash cURL theme={null}
curl -X POST "https://api.3i.life/functions/v1/inbound-lead-gateway/v/YOUR_ASSIGNED_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "invitee.created",
    "listen": true,
    "payload": {
      "uri": "https://api.calendly.com/scheduled_events/TEST1/invitees/TEST2",
      "name": "Calendly Test",
      "email": "calendly.test@example.com",
      "text_reminder_number": "5125550188",
      "timezone": "America/New_York",
      "scheduled_event": {
        "name": "15-Minute Life Review",
        "start_time": "2026-09-30T18:00:00Z"
      }
    }
  }'
```

Returns `HTTP 200 OK`:

```json theme={null}
{
  "success": true,
  "listen": true,
  "message": "Sample received for mapping. Check your Lead Source in the app."
}
```
