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

# Create Webhook

> Create a new webhook endpoint

## Body Parameters

<ParamField body="name" type="string" required>
  Webhook name
</ParamField>

<ParamField body="url" type="string" required>
  Endpoint URL
</ParamField>

<ParamField body="events" type="array">
  Events to subscribe to:

  * `incident.created`
  * `incident.updated`
  * `incident.resolved`
  * `service.status_changed`
  * `monitor.down`
  * `monitor.recovered`
</ParamField>

<ParamField body="headers" type="object">
  Custom headers to include with webhook requests
</ParamField>

<ParamField body="secret" type="string">
  Signing secret for HMAC verification. Auto-generated if not provided.
</ParamField>

## Response

Returns the created webhook object including the secret.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://kodostatus.com/api/v1/webhooks" \
    -H "X-API-Key: your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Incident Alerts",
      "url": "https://example.com/webhook",
      "events": ["incident.created", "incident.updated", "incident.resolved"],
      "secret": "whsec_..."
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "webhook": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Incident Alerts",
      "url": "https://example.com/webhook",
      "events": ["incident.created", "incident.updated", "incident.resolved"],
      "is_active": true,
      "headers": {},
      "secret": "whsec_...",
      "created_at": "2026-02-20T08:00:00.000Z",
      "updated_at": "2026-02-20T08:00:00.000Z"
    }
  }
  ```
</ResponseExample>
