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

# Webhook Register

> Registers a new webhook with the provided URL, description, agent(s), and subscribed event(s).



## OpenAPI

````yaml POST /v2/webhooks/register/
openapi: 3.1.0
info:
  title: CloserX.ai API
  description: >-
    The CloserX.ai API provides programmatic access to manage AI-powered calling
    operations, including agent creation, campaign management, contact handling,
    telephony integration, and more. This API enables seamless automation and
    integration with CRM systems, telephony providers, and other third-party
    services for enhanced client communication and business operations.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.closerx.ai/api
security:
  - api_key: []
paths:
  /v2/webhooks/register/:
    post:
      summary: Register Webhook
      description: >-
        Registers a new webhook with the provided URL, description, agent(s),
        and subscribed event(s).
      parameters:
        - name: Company-Name
          in: header
          required: true
          description: Schema name for multi-tenancy
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterWebhookRequest'
            example:
              webhook_url: https://webhook.site/abcdef123456
              description: This is a test webhook to capture call start and end events.
              agent_ids:
                - '549'
              events_to_subscribe:
                - call.started
                - call.ended
      responses:
        '200':
          description: Webhook registered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterWebhookResponse'
        '400':
          description: Invalid data or missing fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    RegisterWebhookRequest:
      type: object
      properties:
        webhook_url:
          type: string
          format: uri
          description: URL to send webhook payloads to
          example: https://webhook.site/abcdef123456
        description:
          type: string
          description: Description of the webhook purpose
          example: This is a test webhook to capture call start and end events.
        agent_ids:
          type: array
          description: List of agent IDs this webhook is associated with
          items:
            type: string
            example: '549'
        events_to_subscribe:
          type: array
          description: List of events to subscribe to (e.g. call.started, call.ended)
          items:
            type: string
            example: call.started
      required:
        - webhook_url
        - description
        - agent_ids
        - events_to_subscribe
    RegisterWebhookResponse:
      type: object
      properties:
        message:
          type: string
          example: Webhook registered successfully!
        data:
          type: object
          properties:
            id:
              type: integer
              example: 25
            webhook_url:
              type: string
              example: https://webhook.site/abcdef123456
            description:
              type: string
              example: This is a test webhook to capture call start and end events.
            agents:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: integer
                    example: 549
                  agent_name:
                    type: string
                    example: vinay dan 2
            events_to_subscribe:
              type: array
              items:
                type: string
                example: call.started
    Error:
      required:
        - success
        - message
        - data
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: api_key

````