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

# Create Webhook Subscription

> Create a new webhook subscription for receiving event notifications



## OpenAPI

````yaml post /webhooks/subscriptions
openapi: 3.0.1
info:
  title: ChatDash Webhook API Documentation
  description: API Documentation for the ChatDash Webhook Subscription System
  version: 1.0.0
servers:
  - url: https://api.chat-dash.com/v1/public
security: []
paths:
  /webhooks/subscriptions:
    post:
      tags:
        - Webhooks
      summary: Create Webhook Subscription
      description: Create a new webhook subscription for receiving event notifications
      parameters:
        - name: Authorization
          in: header
          required: true
          description: Client-specific API key for authentication
          schema:
            type: string
            pattern: ^CD\.CL\.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clientId:
                  type: string
                  description: The client ID associated with the subscription
                agentIds:
                  type: array
                  description: The agent IDs associated with the subscription
                  items:
                    type: string
                  minItems: 1
                webhookUrl:
                  type: string
                  description: The URL where event notifications will be sent
                  format: uri
                events:
                  type: array
                  description: List of events to subscribe to
                  items:
                    type: string
                    enum:
                      - call.started
                      - call.missed
                      - call.ended
                      - call.inbound
                  minItems: 1
              required:
                - clientId
                - agentIds
                - webhookUrl
                - events
      responses:
        '200':
          description: Subscription created successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WebhookSubscription'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
components:
  schemas:
    WebhookSubscription:
      type: object
      properties:
        _id:
          type: string
          description: Unique identifier for the subscription
        clientId:
          type: string
          description: The client associated with the subscription
        agentId:
          type: string
          description: The agent associated with the subscription
        webhookUrl:
          type: string
          description: The URL where event notifications will be sent
        events:
          type: array
          description: List of events that trigger notifications
          items:
            type: string
            enum:
              - call.started
              - call.missed
              - call.ended
              - call.inbound
        createdAt:
          type: string
          format: date-time
          description: When the subscription was created
        updatedAt:
          type: string
          format: date-time
          description: When the subscription was last updated

````