> ## 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 Edit

> Updates an existing webhook using the provided ID with new URL, description, subscribed events, and selected agents.



## OpenAPI

````yaml PUT /v2/webhooks/{id}/
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/{id}/:
    put:
      summary: Webhook Edit
      description: >-
        Updates an existing webhook using the provided ID with new URL,
        description, subscribed events, and selected agents.
      parameters:
        - name: id
          in: path
          required: true
          description: The ID of the webhook to update
          schema:
            type: integer
            example: 25
        - 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/EditWebhookRequest'
            example:
              webhook_url: https://webhook.site/abcdefgh123456789
              description: >-
                This edited is a test webhook to capture call start and end
                events.
              agent_ids:
                - '570'
              events_to_subscribe:
                - call.started
                - call.ended
      responses:
        '200':
          description: Webhook updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditWebhookResponse'
        '400':
          description: Invalid webhook ID or payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    EditWebhookRequest:
      type: object
      properties:
        webhook_url:
          type: string
          format: uri
          description: The updated URL where webhook events will be sent
          example: https://webhook.site/abcdefgh123456789
        description:
          type: string
          description: Updated description of the webhook
          example: This edited 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: '570'
        events_to_subscribe:
          type: array
          description: 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
    EditWebhookResponse:
      type: object
      properties:
        message:
          type: string
          example: Webhook updated successfully!
        data:
          type: object
          properties:
            id:
              type: integer
              example: 25
            webhook_url:
              type: string
              example: https://webhook.site/abcdefgh123456789
            description:
              type: string
              example: >-
                This edited is a test webhook to capture call start and end
                events.
            agents:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: integer
                    example: 570
                  agent_name:
                    type: string
                    example: dan 3
            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

````