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

# Introduction

> Build integrations with JourneyBee's real-time webhook system

JourneyBee's webhook API enables you to build powerful integrations that receive real-time notifications when partners, leads, deals, and other resources are created or updated in the platform.

## Getting Started

<CardGroup cols={2}>
  <Card title="Creating Integrations" icon="puzzle-piece" href="/webhooks/creating-integrations">
    Set up your integration in the JourneyBee dashboard
  </Card>

  <Card title="Authentication" icon="key" href="/webhooks/authentication">
    Secure your webhook endpoints with JWT token verification
  </Card>
</CardGroup>

<CardGroup cols={1}>
  <Card title="Webhook Events" icon="bolt" href="/webhooks/events/deal_created">
    Complete reference of all available webhook events and their payloads
  </Card>
</CardGroup>

## Event Categories

JourneyBee webhooks are organized into three main categories:

### Partner Events

* `partner_created` - New partnership established
* `partner_updated` - Partnership information changed
* `partner_contact_created` - New contact added to partnership
* `partner_contact_updated` - Partner contact information changed

### Lead Events

* `lead_created` - New lead received
* `lead_updated` - Lead information changed
* `lead_deleted` - Lead archived
* `lead_note_created` - Note added to lead
* `lead_note_updated` - Lead note modified
* `lead_note_deleted` - Note removed from lead

### Deal Events

* `deal_created` - New deal created
* `deal_updated` - Deal information or stage changed
* `deal_deleted` - Deal archived
* `deal_note_created` - Note added to deal
* `deal_note_updated` - Deal note modified
* `deal_note_deleted` - Note removed from deal

### Message Events

* `message_created` - New message in partnership room
* `message_updated` - Message content updated
* `message_deleted` - Message removed

## Integration Flow

1. **Create Integration**: Set up your integration in JourneyBee dashboard
2. **Configure Webhook URL**: Provide your endpoint URL for receiving webhooks
3. **Get Integration UUID**: Use this as your JWT secret for verification
4. **Subscribe to Events**: Choose which events your integration should receive
5. **Handle Webhooks**: Process incoming webhook requests with JWT verification

## Quick Example

```javascript theme={null}
const express = require("express");
const jwt = require("jsonwebtoken");

app.post("/webhook", (req, res) => {
  const token = req.headers.authorization?.split("Bearer ")[1];

  try {
    const decoded = jwt.verify(token, process.env.INTEGRATION_UUID);
    console.log("Event:", decoded.event_id);
    console.log("Company:", decoded.company_uuid);

    // Process webhook payload
    const { lead, deal, partnership } = req.body;

    res.status(200).send("OK");
  } catch (error) {
    res.status(401).send("Invalid token");
  }
});
```

## Next Steps

<CardGroup cols={1}>
  <Card title="Create an Integration" icon="list" href="/webhooks/creating-integrations">
    Learn how to create an integration in JourneyBee
  </Card>
</CardGroup>
