> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs-dev.iclosed.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Contact Created Webhook

> Webhook event triggered when a new contact is created in iClosed.io

## Overview

The **Contact Created** webhook is triggered whenever a new contact is created in your iClosed.io account. This event provides comprehensive information about the newly created contact, including their personal details, event information, tracking data, and any associated calls.

## Event Details

* **Event Type**: `newContactCreated`
* **Trigger**: When a contact is created through any channel (form submission, manual creation, API, etc.)
* **Payload**: Complete contact object with all associated data

## Webhook Payload

The webhook payload contains the full contact object with the following structure:

```json theme={null}
[
  {
    "id": 5,
    "userId": 4,
    "accountId": 3,
    "firstName": "Raya",
    "lastName": "Fleming",
    "email": "zogiji@example.com",
    "phoneNumber": null,
    "secondary_email": null,
    "secondary_phoneNumber": null,
    "status": "QUALIFIED",
    "createdAt": "2025-05-09T15:28:40.783Z",
    "previewId": "contact_-d9DGyd9xHK_",
    "timeZone": "Asia/Karachi",
    "joinedTime": "2025-05-09T15:28:40.783Z",
    "country": "PK",
    "ipAddress": "::1",
    "updatedAt": "2025-05-09T15:28:41.385Z",
    "updatedAttributes": [],
    "questionsAndAnswers": {
      "1_question": "Phone Number",
      "1_response": "+1234567890",
      "2_question": "Email Address",
      "2_response": "zogiji@example.com",
      "3_question": "Full Name",
      "3_response": "Raya Fleming",
      "4_question": "Additional Information Question 1",
      "4_response": "Additional Information Response 1",
      "5_question": "Additional Information Question 2",
      "5_response": "Additional Information Response 2",
      "6_question": "Additional Information Question 3",
      "6_response": "Additional Information Response 3",
      "7_question": "Additional Information Question 4",
      "7_response": "Additional Information Response 4",
      "Phone Number": "+1234567890",
      "Email Address": "zogiji@example.com",
      "Full Name": "Raya Fleming",
      "Additional Information Question 1": "Additional Information Response 1",
      "Additional Information Question 2": "Additional Information Response 2",
      "Additional Information Question 3": "Additional Information Response 3",
      "Additional Information Question 4": "Additional Information Response 4"
    },
    "event": {
      "id": 2,
      "name": "Discovery Event",
      "linkPrefix": "example/discovery-event",
      "color": "#0099FF",
      "eventType": "DISCOVERY_EVENT"
    },
    "tracking": {
      "first_utm_term": "",
      "first_utm_source": "",
      "first_utm_medium": "",
      "first_utm_content": "",
      "first_utm_campaign": "",
      "utm_term": "",
      "utm_source": "",
      "utm_medium": "",
      "utm_content": "",
      "utm_campaign": "",
      "utmKey_0": "",
      "utmValue_0": "",
      "utmKey_1": "",
      "utmValue_1": "",
      "utmKey_2": "",
      "utmValue_2": "",
      "utmKey_3": "",
      "utmValue_3": "",
      "utmKey_4": "",
      "utmValue_4": ""
    },
    "internal_configuration": {
      "question_answers": []
    },
    "Referrer_Url_Embed": "http://localhost:3000/app/example/discovery-event",
    "previewUrl": "http://localhost:3000/app/global-data/contacts?preview=contact_-d9DGyd9xHK_",
    "latestCall": {
      "id": 9,
      "dateTime": "2025-05-13T10:15:00.000Z",
      "timeZone": "Asia/Karachi",
      "duration": 30,
      "durationUnit": "MINUTES",
      "user": {
        "id": 4,
        "firstName": "test",
        "lastName": "",
        "email": "test@iclosed.io",
        "phoneNumber": null
      }
    },
    "disqualifyingGroup": [
      {
        "statement": "Additional Information Question 1",
        "operator": "AND",
        "value": "Additional Information Response 1",
        "condition": "IS",
        "disqualificationGroupId": 1
      },
      {
        "statement": "Additional Information Question 2",
        "operator": "AND",
        "value": "Additional Information Response 2",
        "condition": "IS",
        "disqualificationGroupId": 1
      },
      {
        "statement": "Additional Information Question 3",
        "operator": "AND",
        "value": "Additional Information Response 3",
        "condition": "IS",
        "disqualificationGroupId": 1
      }
    ],
    "hookType": "Contact created"
  }
]
```

## Key Fields Explained

### Basic Contact Information

* **`id`**: Unique contact identifier
* **`firstName`**, **`lastName`**: Contact's name
* **`email`**: Primary email address
* **`phoneNumber`**: Primary phone number
* **`secondary_email`**, **`secondary_phoneNumber`**: Additional contact methods
* **`status`**: Contact qualification status (e.g., "QUALIFIED")

### Event Information

* **`event`**: Details about the event the contact was created from
  * `id`: Event identifier
  * `name`: Event name
  * `linkPrefix`: Event URL prefix
  * `color`: Event color code
  * `eventType`: Type of event (e.g., "DISCOVERY\_EVENT")

### Questions and Answers

* **`questionsAndAnswers`**: All form responses from the contact
  * Contains both numbered format (`1_question`, `1_response`) and direct key-value pairs
  * Includes all custom fields and form questions

### Tracking Data

* **`tracking`**: UTM parameters and tracking information
  * `utm_source`, `utm_medium`, `utm_campaign`: Marketing attribution
  * `first_utm_*`: Original UTM parameters
  * `utmKey_*`, `utmValue_*`: Custom tracking parameters

### Call Information

* **`latestCall`**: Details about any scheduled calls
  * `dateTime`: Scheduled call time
  * `duration`: Call duration in minutes
  * `user`: Call host information

### Disqualification Logic

* **`disqualifyingGroup`**: Any disqualifying conditions that apply
  * Contains logic statements that determine contact qualification

## Use Cases

This webhook is useful for:

* **CRM Integration**: Automatically create contacts in your CRM system
* **Email Marketing**: Add new contacts to email campaigns
* **Analytics**: Track contact creation sources and patterns
* **Lead Scoring**: Evaluate contact quality based on responses
* **Workflow Automation**: Trigger follow-up actions for new contacts

## Response Requirements

Your webhook endpoint should:

* Return a **2xx status code** to acknowledge receipt
* Respond within **5 seconds** to avoid retries
* Handle duplicate events (idempotency)
* Log the contact ID for debugging purposes
