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

# Create Webhook

> Create a new webhook subscription.

<Note>
  Retrieve your API Key from your [VozAgent Dashboard](https://app.vozagent.ai/settings/api).
</Note>

## Body parameters

<ParamField body="name" type="string" required>
  A display name for the webhook subscription.
</ParamField>

<ParamField body="url" type="string" required>
  The HTTPS endpoint URL to receive webhook events.
</ParamField>

<ParamField body="events" type="string[]" required>
  Array of event types to subscribe to.
</ParamField>

## Available Events

| Event                     | Description                       |
| ------------------------- | --------------------------------- |
| `contact.created`         | New contact created.              |
| `call.started`            | Call initiated.                   |
| `call.completed`          | Call ended.                       |
| `lead.qualified`          | Lead marked as qualified.         |
| `appointment.booked`      | Appointment booked during a call. |
| `appointment.rescheduled` | Appointment rescheduled.          |

## Response

Returns the created webhook with its signing secret. Store the secret securely -- it won't be shown again. Status code: `201`.

<RequestExample>
  ```bash theme={null}
  curl -X POST https://api.vozagent.ai/v1/webhooks \
    -H "Authorization: Bearer <token>" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "My Webhook",
      "url": "https://yourapp.com/webhooks",
      "events": ["contact.created", "call.completed"]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": "wh-new-a1b2c3d4-e5f6-a7b8",
    "url": "https://yourapp.com/webhooks",
    "events": ["contact.created", "call.completed"],
    "is_active": true,
    "secret": "whsec_abc123xyz456...",
    "created_at": "2024-01-15T12:00:00Z"
  }
  ```
</ResponseExample>
