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

# Web Chat

> Learn how to use the web chat webhook to integrate your Cloud Employee with your existing systems

Atonom offers several kinds of web chat event types that can be sent to your webhook URLs.

> To learn how to specify webhook URLs for your cloud employees in the Atonom app, please see the [webhook URLs](/get-started/quickstart/#configure-webhook) configuration step in the quickstart guide.

Below you will find an example of the data structure for web chat events.

## Web Chat Structure

<Check>
  **Event Types:**

  * conversation-start: Triggered when a new web chat conversation begins
  * conversation-closed: Triggered when a web chat conversation ends
</Check>

### Webhook Response Structure

When a web chat event occurs, Atonom will send a webhook response with the following structure:

```json theme={null}
{
    "event": "conversation-closed",
    "chat": {
        "transcript": "...",
        "meeting_event": {
            "id": 123,
            "name": "...", 
            "agent_name": "...",
            "date": "1972-01-01",
            "duration_minutes": 120,
            "lead_time_minutes": 10
        },
        "user_emails": {
            "last_routed": "example1@example.com",
            "last_routed_user_id": 1,
            "closed_conversation": "example2@example.com", 
            "closed_conversation_user_id": 2,
            "meeting_scheduled": "example3@example.com",
            "meeting_scheduled_user_id": 3
        },
        "referrer": "Direct",
        "source_type": "Direct Traffic",
        "traffic_source": "Source",
        "traffic_campaign": "Campaign"
    },
    "contact": {
        "tenant_id": 1,
        "first_name": "John",
        "last_name": "Smith",
        "middle_name": "Robert",
        "preferred_name": "Johnny",
        "name": "John Smith",
        "honorific": "Mr.",
        "phone": "+1 (555) 123-4567",
        "home_phone": "+1 (555) 987-6543",
        "mobile_phone": "+1 (555) 234-5678",
        "other_phone": "+1 (555) 876-5432",
        "email": "john.smith@example.com",
        "other_email": "johnny.smith@gmail.com",
        "birthdate": "1985-06-15T00:00:00Z",
        "description": "Senior Software Engineer with 10+ years of experience",
        "title": "Senior Software Engineer",
        "lead_source": "Website Form",
        "lead_score": 85,
        "created_by_user_id": 123,
        "company_name": "TechCorp Inc.",
        "company_website": "https://techcorp.example.com",
        "company_industry": "Technology",
        "company_employee_count": "500-1000",
        "company_revenue": "$10M-$50M",
        "enriched_fields": ["company_name", "title", "linkedin_handle"],
        "enriched_timestamp": "2024-03-20T15:30:00Z",
        "city": "San Francisco",
        "state": "CA",
        "country": "United States",
        "bio": "Experienced software engineer specializing in cloud architecture and microservices",
        "role": "Senior Software Engineer",
        "seniority": "Senior",
        "linkedin_handle": "johnsmith",
        "company_sector": "Enterprise Software",
        "company_phone": "+1 (555) 555-5555",
        "company_description": "Leading provider of cloud-based enterprise solutions",
        "company_location": "San Francisco, CA",
        "company_timezone": "America/Los_Angeles",
        "company_twitter_handle": "techcorp",
        "company_tech": ["Python", "AWS", "Docker", "Kubernetes", "React"],
        "company_linkedin_handle": "techcorp-inc",
        "avatar_url": "https://example.com/avatars/john-smith.jpg",
        "company_avatar_url": "https://example.com/company-logos/techcorp.png",
        "facebook_handle": "john.smith.123",
        "twitter_handle": "johnsmith",
        "instagram_handle": "johnsmith",
        "domain": "example.com",
        "source": "form",
        "source_id": 456,
        "traffic_source": "Google",
        "persona_id": 789,
        "custom_fields": {
            "department": "Engineering",
            "project_interest": "Cloud Migration",
            "budget_range": "$50,000-$100,000",
            "timeline": "Q2 2024"
        }
    }
}
```

<Note>
  Contact will be omitted from the data if the conversation was not with a new/current contact in Atonom.
</Note>

#### Key Fields

| Field                | Description                                                                |
| -------------------- | -------------------------------------------------------------------------- |
| `event`              | The type of web chat event (`conversation-start` or `conversation-closed`) |
| `chat.transcript`    | The full conversation transcript                                           |
| `chat.meeting_event` | Details about any scheduled meeting during the chat                        |
| `chat.user_emails`   | Information about users involved in the conversation                       |
| `contact`            | Contact information if the chat was with a known contact                   |
