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

> This endpoint retrieves network traffic usage details for the 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`, and `valid_until` parameters obtained  
from the same response to access traffic data.




## OpenAPI

````yaml post /kvm/v2/get/traffic
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/get/traffic:
    post:
      tags:
        - Collect Information
      summary: Get traffic usage
      description: >
        This endpoint retrieves network traffic usage details for the 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`, and `valid_until` parameters
        obtained  

        from the same response to access traffic data.
      operationId: getTrafficUsage
      requestBody:
        description: >
          Required parameters to fetch traffic data for a KVM VPS.  

          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/get_traffic_body'
        required: true
      responses:
        '200':
          description: Traffic data retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_11'
        '400':
          description: Bad Request - Invalid parameters or missing fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400_7'
        '401':
          description: Unauthorized - The session signature is invalid or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401_7'
        '403':
          description: >-
            Forbidden - The client does not have permission to access this
            resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_403_6'
        '500':
          description: Internal Server Error - An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_500_7'
components:
  schemas:
    get_traffic_body:
      type: object
      properties:
        signature:
          type: string
          description: The session signature obtained from the "Create AUTH-session" call.
          example: session_signature_98765
        kvm_id:
          type: string
          description: |
            The unique identifier of the KVM VPS to retrieve traffic data for.  
            This value is specific to your VPS.
          example: kvm_100200_300400
        valid_until:
          type: string
          description: >
            The expiration timestamp for the session, obtained from the "Create
            AUTH-session" call.  

            Ensure that the session is valid and has not expired.
          example: '1737476000'
    inline_response_200_11:
      type: object
      properties:
        status:
          type: string
          example: success
        data:
          $ref: '#/components/schemas/inline_response_200_11_data'
        chart_daily:
          type: string
          description: JSON string containing daily traffic chart data.
          example: >-
            {"datasets":[{"label":"Daily Traffic
            [GB]","type":"bar","borderWidth":1,"borderColor":"#058","backgroundColor":"#058","yAxisID":"y","data":[0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0]}],"labels":["Jul
            10","Jul 11","Jul 12","Jul 13","Jul 14","Jul 15","Jul 16","Jul
            17","Jul 18","Jul 19","Jul 20","Jul 21","Jul 22","Jul 23","Jul
            24","Jul 25","Jul 26","Jul 27","Jul 28","Jul 29","Jul 30","Jul
            31","Aug 01","Aug 01","Aug 02","Aug 03","Aug 04","Aug 05","Aug
            06","Aug 07","Aug 08"]}
        chart_monthly:
          type: string
          description: JSON string containing monthly traffic chart data.
          example: >-
            {"datasets":[{"label":"Cumulative Traffic
            [GB]","type":"bar","borderWidth":1,"borderColor":"#46A546","backgroundColor":"#46A546","yAxisID":"y","data":[3,3,3,3,3,3,3,3,4,4,4,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3]},{"label":"Included
            Traffic
            [GB]","type":"line","borderWidth":1,"borderColor":"red","backgroundColor":"red","yAxisID":"y","data":[4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000]}],"labels":["Jul
            10","Jul 11","Jul 12","Jul 13","Jul 14","Jul 15","Jul 16","Jul
            17","Jul 18","Jul 19","Jul 20","Jul 21","Jul 22","Jul 23","Jul
            24","Jul 25","Jul 26","Jul 27","Jul 28","Jul 29","Jul 30","Jul
            31","Aug 01","Aug 01","Aug 02","Aug 03","Aug 04","Aug 05","Aug
            06","Aug 07","Aug 08"]}
    inline_response_400_7:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Invalid parameters provided.
    inline_response_401_7:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Unauthorized request.
    inline_response_403_6:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Access forbidden.
    inline_response_500_7:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Internal server error.
    inline_response_200_11_data:
      type: object
      properties:
        included_bytes:
          type: integer
          example: 4294967296000
        days_remaining:
          type: integer
          example: 11
        last_updated:
          type: string
          example: '1660023630'
        rx_bytes:
          type: string
          example: '375246297'
        tx_bytes:
          type: string
          example: '2683044422'
        rx_packets:
          type: string
          example: '2306591'
        tx_packets:
          type: string
          example: '21077614'

````