# Create a Webhook Subscription

Create a webhook subscription for a given company.

Endpoint: POST /webhooks
Version: 1.0.0
Security: api_key

## Security:

  - `api_key` (unknown)
    apiKey in header x-api-key

## Header parameters:

  - `x-managed-company-id` (string)
    Optional: the ID of the managed company on behalf of which the request is made

## Request fields (application/json):

  - `name` (string, required)
    Name of the webhook. Used for internal identification
    Example: Production Webhook

  - `url` (string, required)
    HTTPS URL of the webhook endpoint
    Example: https://example.com/webhook

  - `events` (array, required)
    Event types that trigger the webhook
    Example: ["job.status.changed","sending.event.status.changed"]

## Response 201 fields (application/json):

  - `name` (string, required)
    Name of the webhook. Used for internal identification
    Example: Production Webhook

  - `secret` (string, required)
    Secret key for the webhook. You should store this securely and not expose it publicly.

## Response 400:

  - `400` (unknown)
    Invalid webhook configuration or validation error

## Response 415:

  - `415` (unknown)
    Request Content-Type is not 'application/json'

