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

# Traffic Monitor Webhook

> This endpoint allows setting up webhooks for traffic monitoring on a specified KVM VPS.  
The `api_host` parameter, obtained from the **"Create AUTH-session"** response,  
is dynamically set in the URL.  
Provide the `signature`, `kvm_id`, `valid_until`, and webhook configuration details.




## OpenAPI

````yaml post /kvm/v2/hooks/set
openapi: 3.0.0
info:
  title: EDIS Global Management API
  description: >
    Use the API to access and manage your VPS services, including power control,
    rDNS, and VNC management.  

    **Authentication:** Enable API access on any KVM VPS you own. Then use the
    provided credentials to authenticate your requests.
  version: 1.0.0
servers:
  - url: https://{api_host}
    description: Dynamic API host returned from the AUTH session endpoint.
    variables:
      api_host:
        default: api_host.edisglobal.com
        description: >-
          Enter the full API host exactly as returned by /kvm/v2/get/auth (for
          example: 12345.edisglobal.com)
security: []
tags:
  - name: Authentication
    description: Create an AUTH Session
  - name: Power Management
    description: KVM Power Management
  - name: Installation
    description: ISO, Turnkey, Reinstall
  - name: Settings
    description: KVM System Settings
  - name: Collect Information
    description: KVM VPS Details.
  - name: VNC Management
    description: KVM VNC Access
  - name: PTR
    description: KVM Reverse DNS
  - name: Traffic Pool
    description: Traffic Pool Management
  - name: Hooks
    description: KVM Webhook Management
paths:
  /kvm/v2/hooks/set:
    post:
      tags:
        - Hooks
      summary: Set Webhook for Traffic Monitoring
      description: >
        This endpoint allows setting up webhooks for traffic monitoring on a
        specified KVM VPS.  

        The `api_host` parameter, obtained from the **"Create AUTH-session"**
        response,  

        is dynamically set in the URL.  

        Provide the `signature`, `kvm_id`, `valid_until`, and webhook
        configuration details.
      operationId: setKvmHooks
      requestBody:
        description: >
          Required parameters to set a webhook for traffic monitoring.  

          All parameters must be passed in the request body as
          `application/x-www-form-urlencoded`.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/hooks_set_body'
        required: true
      responses:
        '200':
          description: Webhook set successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_26'
        '400':
          description: Bad Request - Missing or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400_7'
        '401':
          description: Unauthorized - Invalid or expired session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401_17'
        '403':
          description: Forbidden - Permission denied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_403_14'
        '500':
          description: Internal Server Error - An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_500_18'
components:
  schemas:
    hooks_set_body:
      type: object
      properties:
        signature:
          type: string
          description: The session signature obtained from the "Create AUTH-session" call.
          example: session_signature_12345
        kvm_id:
          type: string
          description: The unique identifier of the KVM VPS.
          example: kvm_123456_789012
        valid_until:
          type: string
          description: >-
            The expiration timestamp for the session, as obtained from the
            "Create AUTH-session" call.
          example: '1737476000'
        callback_method:
          type: string
          description: The HTTP method to use for the callback (`post` or `get`).
          example: post
        callback_user:
          type: string
          description: (Optional) Username for callback authentication.
          example: callback_user
        callback_pw:
          type: string
          description: (Optional) Password for callback authentication.
          example: callback_password
        type:
          type: string
          description: Type of hook to create (only `traffic` is allowed).
          example: traffic
        trigger_value:
          type: string
          description: |
            Trigger value to activate the webhook.  
            - A percentage value for traffic usage (e.g., `80` for 80%).  
            - Set to `demo` for immediate unique call.
          example: '80'
        callback_url:
          type: string
          description: |
            The callback URL (HTTP or HTTPS) that receives notifications  
            when the trigger value is reached.  
            Example: `https://example.com/yourcallback`.  
            Source IP: `149.154.154.251`
          example: https://example.com/yourcallback
    inline_response_200_26:
      type: object
      properties:
        status:
          type: string
          description: The status of the operation.
          example: success
        hook_id:
          type: string
          description: The ID of the created webhook.
          example: '123'
    inline_response_400_7:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Invalid parameters provided.
    inline_response_401_17:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Unauthorized access.
    inline_response_403_14:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Access denied.
    inline_response_500_18:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: An unexpected server error occurred.

````