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

# Subscribe to Webhook

> Subscribe to a webhook to receive real-time notifications for specific events

## Overview

Subscribe to a webhook to receive real-time HTTP POST notifications when specific events occur in your workspace.

## Webhook URL Requirements

* Must use **HTTPS** (HTTP is not supported for security)
* Must be publicly accessible
* Should respond with a 200 status code within 5 seconds
* Should handle duplicate events idempotently

## Available Event Types

Subscribe to one of these event types:

| Event Type                      | Description                      |
| ------------------------------- | -------------------------------- |
| `lead_tagged_interested`        | Lead tagged as "Interested"      |
| `lead_meeting_booked`           | Lead tagged as "Meeting Booked"  |
| `lead_status_matched`           | Lead accepted by screening       |
| `lead_status_discarded`         | Lead discarded by screening      |
| `campaign_completed`            | Campaign finished                |
| `message_received`              | Lead sent a message              |
| `linkedin_account_disconnected` | LinkedIn account disconnected    |
| `connection_request_accepted`   | Lead accepted connection request |
| `campaign_without_leads`        | Active campaign ran out of leads |

## Example Payloads

### Lead Event Payload

```json theme={null}
{
  "leadId": "lead_abc123",
  "campaignId": "campaign_xyz789",
  "campaignName": "Sales Outreach Q1",
  "firstName": "John",
  "lastName": "Doe",
  "email": "john.doe@example.com",
  "phone": "+1234567890",
  "companyName": "Acme Corp",
  "linkedinUrl": "https://www.linkedin.com/in/johndoe",
  "status": "accepted",
  "tag": "Interested"
}
```

### Campaign Event Payload

```json theme={null}
{
  "campaignId": "campaign_xyz789",
  "campaignName": "Sales Outreach Q1",
  "progress": 100,
  "status": "completed"
}
```


## OpenAPI

````yaml POST /v1/hooks/subscribe
openapi: 3.1.0
info:
  title: WaLead API
  description: >-
    WaLead Public API for managing LinkedIn outreach campaigns, leads, and
    analytics
  version: 1.0.0
  contact:
    name: WaLead Support
    url: https://walead.ai
servers:
  - url: https://app-api.walead.ai/api
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /v1/hooks/subscribe:
    post:
      summary: Subscribe to Webhook
      description: >-
        Subscribe to a webhook to receive real-time notifications for specific
        events
      requestBody:
        description: Webhook subscription details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscribeWebhook'
        required: true
      responses:
        '200':
          description: Webhook subscribed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
        '401':
          description: Unauthorized - Invalid API Key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Webhook already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SubscribeWebhook:
      type: object
      required:
        - url
        - type
      properties:
        url:
          type: string
          format: uri
          description: HTTPS URL where webhook notifications will be sent
        type:
          type: string
          enum:
            - lead_tagged_interested
            - lead_meeting_booked
            - lead_status_matched
            - lead_status_discarded
            - campaign_completed
            - message_received
            - linkedin_account_disconnected
            - connection_request_accepted
            - campaign_without_leads
          description: Type of event to subscribe to
    WebhookResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique webhook identifier
        url:
          type: string
          description: Webhook URL
        type:
          type: string
          description: Webhook event type
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp of creation
    Error:
      type: object
      required:
        - statusCode
        - message
      properties:
        statusCode:
          type: integer
          description: HTTP status code
        message:
          type: string
          description: Error message
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Generate from your WaLead dashboard.

````