# Create webhook

Create a new outgoing webhook for your organization

Endpoint: POST /v1/settings/webhooks
Version: v1
Security: x-api-key

## Security:

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

## Request fields (application/json):

  - `url` (string, required)
    The URL to call for this webhook. Must use the `https` scheme.
    Example: https://example.com/webhook

  - `customHeaders` (array)
    Custom headers to include when calling the URL. Up to 10 entries are allowed, and keys must be unique (case-sensitive).

  - `customHeaders.key` (string, required)
    Must contain only letters, numbers, and dashes.
    Example: X-Custom-Header

  - `customHeaders.value` (string, required)
    Example: custom-value

  - `events` (object)
    Filters controlling which events are sent to this webhook.

  - `events.objects` (array)
    Filter webhook events by these types. An empty array (or omitting this field) represents all types. Each value must be a currently supported webhook event type.
    Example: ["API_KEY_ADDED","CONTROL_RULE_UPDATED"]

  - `events.categories` (array)
    Filter webhook events by these categories. An empty array (or omitting this field) represents all categories. Each value must be a currently supported webhook event category.
    Example: ["AUDIT","CONTROL"]

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `id` (string)
    Unique identifier for this object
    Example: 2a2197de-ad2c-47e4-8dcb-fb0f04cf83e0

  - `url` (string)
    The URL called by this webhook
    Example: https://example.com/webhook

  - `enabled` (boolean)
    Whether the webhook is enabled
    Example: true

  - `events` (object)
    The events that are sent from this webhook.

  - `events.objects` (array)
    This webhook only sends events of these types. An empty array represents all types.
    Example: ["API_KEY_ADDED","CONTROL_RULE_UPDATED"]

  - `events.categories` (array)
    This webhook only sends events of these categories. An empty array represents all categories.
    Example: ["AUDIT","CONTROL"]

  - `customHeadersConfigured` (boolean)
    Whether the webhook has custom headers configured
    Example: false

  - `creationTimestamp` (integer)
    When the webhook was created, formatted as a UNIX timestamp (in seconds)
    Example: 1698064423

  - `lastUpdatedTimestamp` (integer)
    When the webhook was last updated, formatted as a UNIX timestamp (in seconds)
    Example: 1698064423

  - `signingSecret` (string, required)
    The signing secret for this webhook. This is only ever returned once, at creation time.
    Example: psws_2a2197dead2c47e48dcbfb0f04cf83e0

## Response 400:

  - `400` (unknown)
    Bad Request

