# Create webhook subscription

Endpoint: POST /webhook-subscriptions
Version: 3.0.0
Security: bearerAuth, apiKeyAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer Token

  - `apiKeyAuth` (unknown)
    apiKey in header Key

## Request fields (application/json):

  - `name` (string, required)
    The name of the webhook subscription.

  - `description` (string)
    The description of the webhook subscription.

  - `subscriptions` (array)
    The list of webhook types to subscribe to. Either subscriptions or filteredSubscriptions must be provided.

  - `filteredSubscriptions` (array)
    The list of subscriptions with filters. Either subscriptions or filteredSubscriptions must be provided.

  - `filteredSubscriptions.webhookType` (string, required)
    Webhook Type.

  - `filteredSubscriptions.filters` (array)
    Subscription Filters.

  - `filteredSubscriptions.filters.id` (string, required)
    Filter identifier

  - `filteredSubscriptions.filters.type` (string, required)
    Filter type

  - `filteredSubscriptions.filters.checkCondition` (string, required)
    Filter check condition, for example, is, is_not, etc

  - `filteredSubscriptions.filters.values` (array, required)
    Filter values

  - `url` (string, required)
    The URL of the webhook endpoint.

  - `viaProxy` (boolean)
    If true, the webhooks are dispatched via sprinklr proxy

  - `preSharedKey` (string, required)
    An authorization key that can be used to confirm if the request is valid. A valid webhook will have a header

## Response 200:

  - `200` (unknown)
    Success

## Response 200 fields (application/json):

  - `id` (string)
    Subscription ID of the webhook subscription.

  - `name` (string)
    Name of the webhook subscription.

  - `description` (string)
    Description of the webhook subscription.

  - `subscriptions` (array)
    List of Sprinklr Webhook types subscribed.

  - `filteredSubscriptions` (array)
    The list of subscriptions with filters.

  - `filteredSubscriptions.webhookType` (string, required)
    Webhook Type.

  - `filteredSubscriptions.filters` (array)
    Subscription Filters.

  - `filteredSubscriptions.filters.id` (string, required)
    Filter identifier

  - `filteredSubscriptions.filters.type` (string, required)
    Filter type

  - `filteredSubscriptions.filters.checkCondition` (string, required)
    Filter check condition, for example, is, is_not, etc

  - `filteredSubscriptions.filters.values` (array, required)
    Filter values

  - `url` (string)
    The URL of the webhook endpoint.

  - `preSharedKey` (string, required)
    An authorization key that can be used to confirm if the request is valid. A valid webhook will have a header

  - `viaProxy` (boolean)
    If true, the webhooks are dispatched via sprinklr proxy

  - `verified` (boolean)
    True if the webhook subscription is verified.

  - `active` (boolean)
    True if the webhook subscription is active.

  - `lastSuccessTimestamp` (integer)
    Last success timestamp of the webhook

  - `lastFailedTimestamp` (integer)
    Last failed timestamp of the webhook

## Response 400:

  - `400` (unknown)
    Bad request

## Response 400 fields (application/json):

  - `data` (object)

  - `errors` (array)

  - `errors.id` (string, required)
    24-character hex ObjectId

  - `errors.code` (integer, required)

  - `errors.message` (string, required)
    Dotted error key (e.g. account.not.found)

  - `metadata` (object)

## Response 401:

  - `401` (unknown)
    Missing or invalid authentication

## Response 401 fields (application/json):

  - `data` (object)

  - `errors` (array)

  - `errors.id` (string, required)
    24-character hex ObjectId

  - `errors.code` (integer, required)

  - `errors.message` (string, required)
    Dotted error key (e.g. account.not.found)

  - `metadata` (object)

## Response 403:

  - `403` (unknown)
    Insufficient permissions

## Response 403 fields (application/json):

  - `data` (object)

  - `errors` (array)

  - `errors.id` (string, required)
    24-character hex ObjectId

  - `errors.code` (integer, required)

  - `errors.message` (string, required)
    Dotted error key (e.g. account.not.found)

  - `metadata` (object)

## Response 404:

  - `404` (unknown)
    Resource not found

## Response 404 fields (application/json):

  - `data` (object)

  - `errors` (array)

  - `errors.id` (string, required)
    24-character hex ObjectId

  - `errors.code` (integer, required)

  - `errors.message` (string, required)
    Dotted error key (e.g. account.not.found)

  - `metadata` (object)

