# Webhooks (Pro & Enterprise Only)

> Set up webhooks to receive real-time notifications about demo interactions, lead captures, and engagement events. Configure webhook endpoints to integrate HowdyGo events with your own systems and workflows.

The HowdyGo webhook integration allows you to receive real-time notifications about demo interactions and events. Configure webhook endpoints to automatically receive POST requests when specific events occur, enabling seamless integration with your CRM, analytics platforms, or custom applications. For browser-side event handling on [embedded demos](https://docs.howdygo.com/distribute/embedding), see [custom events](https://docs.howdygo.com/integrations/custom-events).

## Overview

Webhooks provide a powerful way to integrate HowdyGo events with your existing systems. When configured events occur (such as lead captures, demo completions, or engagement), HowdyGo sends HTTP POST requests to your specified endpoint with detailed event data.

> [!NOTE]
> **Webhooks** is available on the **Pro** plan and above.

## Setup

To configure webhooks for your account:

1. Navigate to [Settings > Integrations > Webhooks](https://app.howdygo.com/settings/integrations/webhooks)

2. Click **Create Webhook** to add a new webhook endpoint

3. Configure your webhook:
   - **Webhook Endpoint**: Enter the URL where you want to receive webhook notifications (must be `http://` or `https://`)
   - **Events**: Select which events should trigger this webhook (you can select multiple events)

4. Click **Create Webhook** to save your configuration

5. Test your webhook using the **Send test events** option from the webhook menu

## Webhook Configuration

Webhooks are configured at the organization level and apply to all demos in your organization. When an event occurs, HowdyGo sends notifications to all enabled webhooks that match the event type.

## Webhook Payload Structure

All webhook requests are sent as HTTP POST requests with a JSON payload in the following format:

```json
{
  "event": "howdygo_lead_captured",
  "timestamp": "2024-02-01T12:00:00.000Z",
  "data": {
    "demo": {
      "id": "uuid",
      "title": "Demo Title",
      "url": "https://app.howdygo.com/share/demo-id"
    },
    "person": {
      "email": "user@example.com",
      "name": "John Doe",
      "firstname": "John",
      "lastname": "Doe",
      "phone": "+1234567890",
      "company": "Example Corp",
      "country": "United States"
    }
  }
}
```

### Request Headers

Webhook requests include the following headers:

- `Content-Type: application/json`
- `User-Agent: HowdyGo-Webhooks/1.0`

### Response Handling

Your webhook endpoint should return a `2xx` status code to indicate successful receipt. HowdyGo will retry failed requests (non-2xx responses or timeouts) up to the timeout limit (10 seconds).

## Available Events

### Lead Captured

Triggered when a lead submits a form on your demo.

**Event Name**: `howdygo_lead_captured`

**Payload Example**:

```json
{
  "event": "howdygo_lead_captured",
  "timestamp": "2024-02-01T12:00:00.000Z",
  "data": {
    "person": {
      "email": "lead@example.com",
      "name": "Jane Smith",
      "firstname": "Jane",
      "lastname": "Smith",
      "phone": "+1234567890",
      "company": "Acme Inc",
      "country": "United States"
    },
    "demo": {
      "id": "f676df85-1db9-49a3-a61c-da7c39fe3a89",
      "title": "Product Demo",
      "folder": "Sales Demos",
      "submissionUrl": "https://app.howdygo.com/share/f676df85-1db9-49a3-a61c-da7c39fe3a89"
    },
    "replacements": {
      "custom_field": "value"
    },
    "utm": {
      "campaign": "summer2024",
      "content": "banner",
      "medium": "email",
      "source": "newsletter",
      "term": "demo"
    }
  }
}
```

### Demo Engagement

Triggered when a viewer engages with a demo by advancing past the first step.

**Event Name**: `howdygo_demo_engagement`

**Payload Example**:

```json
{
  "event": "howdygo_demo_engagement",
  "timestamp": "2024-02-01T12:00:00.000Z",
  "data": {
    "demo": {
      "id": "f676df85-1db9-49a3-a61c-da7c39fe3a89",
      "title": "Product Demo",
      "url": "https://app.howdygo.com/share/f676df85-1db9-49a3-a61c-da7c39fe3a89"
    },
    "person": {
      "email": "viewer@example.com",
      "name": "",
      "firstname": "",
      "lastname": "",
      "phone": "",
      "company": "",
      "country": ""
    }
  }
}
```

### Demo Completed

Triggered when a viewer completes a demo session.

**Event Name**: `howdygo_player_end`

**Payload Example**:

```json
{
  "event": "howdygo_player_end",
  "timestamp": "2024-02-01T12:00:00.000Z",
  "data": {
    "demo": {
      "id": "f676df85-1db9-49a3-a61c-da7c39fe3a89",
      "title": "Product Demo",
      "url": "https://app.howdygo.com/share/f676df85-1db9-49a3-a61c-da7c39fe3a89"
    },
    "person": {
      "email": "viewer@example.com",
      "name": "",
      "firstname": "",
      "lastname": "",
      "phone": "",
      "company": "",
      "country": ""
    }
  }
}
```

### CTA Clicked

Triggered when a viewer clicks a call-to-action button in the demo.

**Event Name**: `howdygo_cta_click`

**Payload Example**:

```json
{
  "event": "howdygo_cta_click",
  "timestamp": "2024-02-01T12:00:00.000Z",
  "data": {
    "demo": {
      "id": "f676df85-1db9-49a3-a61c-da7c39fe3a89",
      "title": "Product Demo",
      "url": "https://app.howdygo.com/share/f676df85-1db9-49a3-a61c-da7c39fe3a89"
    },
    "person": {
      "email": "viewer@example.com",
      "name": "",
      "firstname": "",
      "lastname": "",
      "phone": "",
      "company": "",
      "country": ""
    }
  }
}
```

## Managing Webhooks

### Enable/Disable Webhooks

You can enable or disable webhooks without deleting them. Disabled webhooks will not receive notifications but can be re-enabled at any time.

### Testing Webhooks

Use the **Send test events** option from the webhook menu to verify your endpoint is working correctly. This sends a test payload to your configured endpoint.

### Editing Webhooks

You can update the webhook URL or selected events at any time. Changes take effect immediately for new events.

## Best Practices

1. **Use HTTPS**: Always use HTTPS endpoints for webhook URLs to ensure secure data transmission
2. **Handle Idempotency**: Your endpoint should be able to handle duplicate events gracefully
3. **Respond Quickly**: Return a response within 10 seconds to avoid timeouts
4. **Validate Events**: Verify the webhook payload structure before processing
5. **Log Events**: Keep logs of received webhooks for debugging and auditing

## Demo

See webhooks in action with this interactive demo:

[Interactive demo](https://app.howdygo.com/embed/f676df85-1db9-49a3-a61c-da7c39fe3a89)

## Use Cases

Webhooks enable powerful integrations:

- **CRM Integration**: Automatically create or update records when leads are captured
- **Marketing Automation**: Trigger email sequences based on demo engagement
- **Analytics**: Send custom events to your analytics platform
- **Slack/Teams Notifications**: Alert your team when important events occur
- **Custom Workflows**: Build custom integrations with your internal systems

## Troubleshooting

### Webhooks Not Receiving Events

1. Verify your webhook is enabled in the settings
2. Check that the selected events match the events you're expecting
3. Ensure your endpoint URL is accessible and returns a 2xx status code
4. Check your server logs for incoming requests

### Timeout Errors

If webhooks are timing out:
- Ensure your endpoint responds within 10 seconds
- Check network connectivity between HowdyGo and your server
- Verify your endpoint can handle POST requests with JSON payloads

### Invalid Payload Errors

- Verify your endpoint accepts `Content-Type: application/json`
- Ensure your endpoint can parse JSON request bodies
- Check that your endpoint handles the expected payload structure
