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

# lead.created

Occurs whenever a [lead is created](/docs/api-reference/track/lead).

## Response body parameters

All webhook payloads follow a consistent top-level structure with
event-specific data nested within the `data` object.

**id** `string`

The event ID.
**event** `string`

The event type that triggered the webhook (e.g., `lead.created`).
**createdAt** `string`

ISO 8601 timestamp when the webhook event was created.
**data** `object`

Event-specific data containing detailed information about the event. The
data object for the `lead.created` event contains the following
parameters:

**object parameters**

**eventName** `string`

Name of the tracked event (e.g. `Sign up`).

**customer** `object`

The customer that signed up.

**customer object**

**id** `string`

Unique identifier for the customer.

**name** `string`

Customer name.

**email** `string | null`

Customer email address.

**avatar** `string | null`

URL to the customer's avatar image.

**externalId** `string`

Your external customer ID, if provided when tracking.

**stripeCustomerId** `string | null`

The customer's Stripe customer ID, if linked.

**country** `string | null`

The customer's country code.

**sales** `number | null`

Total number of sales for the customer.

**saleAmount** `number | null`

Total sale amount for the customer in cents.

**createdAt** `string`

ISO 8601 timestamp when the customer was first seen.

**firstSaleAt** `string | null`

ISO 8601 timestamp of the customer's first sale.

**subscriptionCanceledAt** `string | null`

ISO 8601 timestamp when the customer canceled their subscription, if applicable.

**click** `object`

The click event that led to the lead.

**click object**

**id** `string`

Unique identifier for the click.

**timestamp** `string`

ISO 8601 timestamp when the click occurred.

**url** `string`

The destination URL that was visited.

**country** `string`

Country code (e.g. `US`).

**city** `string`

City name.

**region** `string`

Region or region code.

**continent** `string`

Continent code (e.g. `NA`).

**device** `string`

Device type (e.g. `Desktop`, `Mobile`).

**browser** `string`

Browser name (e.g. `Chrome`).

**os** `string`

Operating system (e.g. `Mac OS`).

**ua** `string | null`

User agent string.

**trigger** `string | null`

How the click was triggered (e.g. `link`, `qr`, or `deeplink`).

**referer** `string`

Referrer hostname or `(direct)`.

**refererUrl** `string`

Full referrer URL or `(direct)`.

**qr** `boolean`

Whether the click came from a QR code scan.

**ip** `string`

IP address of the visitor.

**link** `object`

The referral link the lead is associated with (full link object).

**partner** `object | null`

Partner details. Only present when the link is a partner referral link (id, name, email, image, country, groupId, totalClicks, totalLeads, totalConversions, totalSales, totalSaleAmount, totalCommissions, etc.).

**metadata** `object | null`

Optional metadata associated with the lead event.

```json Response theme={null}
{
  "id": "evt_P343bmyae40ALQYr5HT4vRXRd",
  "event": "lead.created",
  "createdAt": "2024-08-30T09:53:50.343Z",
  "data": {
    "eventName": "Sign up",
    "customer": {
      "id": "cus_1K09DJDEACR47NPYC93RM43WF",
      "name": "John",
      "email": "john@example.com",
      "avatar": "https://example.com/john.jpeg",
      "externalId": "",
      "stripeCustomerId": null,
      "country": null,
      "sales": 0,
      "saleAmount": 0,
      "createdAt": "2024-08-30T09:53:50.343Z",
      "firstSaleAt": null,
      "subscriptionCanceledAt": null
    },
    "click": {
      "id": "d0UtZqE0BZuBPrJS",
      "timestamp": "2024-08-30T09:53:50.343Z",
      "url": "https://github.com/dubinc/dub",
      "country": "US",
      "city": "San Francisco",
      "region": "CA",
      "continent": "NA",
      "device": "Desktop",
      "browser": "Chrome",
      "os": "Mac OS",
      "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
      "trigger": null,
      "referer": "(direct)",
      "refererUrl": "(direct)",
      "qr": false,
      "ip": "63.141.57.109"
    },
    "link": {
      "id": "cm0faqkyn0001txvfwjfeq7gl",
      "domain": "dub.sh",
      "key": "79ys3WA",
      "url": "https://github.com/dubinc/dub",
      "trackConversion": true,
      "externalId": null,
      "tenantId": null,
      "partnerId": "pn_1JRB6678XHGBZE95R5PH5QVGS",
      "programId": "prog_CYCu7IMAapjkRpTnr8F1azjN",
      "archived": false,
      "expiresAt": null,
      "expiredUrl": null,
      "disabledAt": null,
      "password": null,
      "proxy": false,
      "title": null,
      "description": null,
      "image": null,
      "video": null,
      "rewrite": false,
      "doIndex": false,
      "ios": null,
      "android": null,
      "geo": null,
      "publicStats": false,
      "folderId": null,
      "tagId": null,
      "tags": [],
      "webhookIds": [],
      "comments": null,
      "shortLink": "https://dub.sh/79ys3WA",
      "qrCode": "https://api.dub.co/qr?url=https://dub.sh/79ys3WA?qr=1",
      "utm_source": null,
      "utm_medium": null,
      "utm_campaign": null,
      "utm_term": null,
      "utm_content": null,
      "userId": "cm022rkcw0000ikt14mscg9sg",
      "workspaceId": "ws_cm022sis60003ikt1syy7kfhl",
      "clicks": 10,
      "lastClicked": "2024-08-30T07:45:09.000Z",
      "leads": 5,
      "conversions": 0,
      "sales": 0,
      "saleAmount": 0,
      "createdAt": "2024-08-29T13:03:59.098Z",
      "updatedAt": "2024-08-30T09:53:49.505Z",
      "projectId": "cm022sis60003ikt1syy7kfhl",
      "testVariants": null,
      "testCompletedAt": null,
      "testStartedAt": null
    },
    "partner": {
      "id": "pn_1JRB6678XHGBZE95R5PH5QVGS",
      "name": "John Smith",
      "email": "john@partner.com",
      "image": "https://example.com/avatar.jpg",
      "payoutsEnabledAt": null,
      "country": "US",
      "groupId": "grp_1K6K3HD0QE7XTX5HSVR77AK5B",
      "totalClicks": 150,
      "totalLeads": 25,
      "totalConversions": 15,
      "totalSales": 10,
      "totalSaleAmount": 50000,
      "totalCommissions": 5000
    },
    "metadata": null
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.