Skip to main content
POST
/
kvm
/
v2
/
hooks
/
set
Set Webhook for Traffic Monitoring
curl --request POST \
  --url https://{api_host}/kvm/v2/hooks/set \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data signature=session_signature_12345 \
  --data kvm_id=kvm_123456_789012 \
  --data valid_until=1737476000 \
  --data callback_method=post \
  --data callback_user=callback_user \
  --data callback_pw=callback_password \
  --data type=traffic \
  --data trigger_value=80 \
  --data callback_url=https://example.com/yourcallback
import requests

url = "https://{api_host}/kvm/v2/hooks/set"

payload = {
"signature": "session_signature_12345",
"kvm_id": "kvm_123456_789012",
"valid_until": "1737476000",
"callback_method": "post",
"callback_user": "callback_user",
"callback_pw": "callback_password",
"type": "traffic",
"trigger_value": "80",
"callback_url": "https://example.com/yourcallback"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}

response = requests.post(url, data=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
signature: 'session_signature_12345',
kvm_id: 'kvm_123456_789012',
valid_until: '1737476000',
callback_method: 'post',
callback_user: 'callback_user',
callback_pw: 'callback_password',
type: 'traffic',
trigger_value: '80',
callback_url: 'https://example.com/yourcallback'
})
};

fetch('https://{api_host}/kvm/v2/hooks/set', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{api_host}/kvm/v2/hooks/set",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "signature=session_signature_12345&kvm_id=kvm_123456_789012&valid_until=1737476000&callback_method=post&callback_user=callback_user&callback_pw=callback_password&type=traffic&trigger_value=80&callback_url=https%3A%2F%2Fexample.com%2Fyourcallback",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://{api_host}/kvm/v2/hooks/set"

payload := strings.NewReader("signature=session_signature_12345&kvm_id=kvm_123456_789012&valid_until=1737476000&callback_method=post&callback_user=callback_user&callback_pw=callback_password&type=traffic&trigger_value=80&callback_url=https%3A%2F%2Fexample.com%2Fyourcallback")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://{api_host}/kvm/v2/hooks/set")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("signature=session_signature_12345&kvm_id=kvm_123456_789012&valid_until=1737476000&callback_method=post&callback_user=callback_user&callback_pw=callback_password&type=traffic&trigger_value=80&callback_url=https%3A%2F%2Fexample.com%2Fyourcallback")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{api_host}/kvm/v2/hooks/set")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "signature=session_signature_12345&kvm_id=kvm_123456_789012&valid_until=1737476000&callback_method=post&callback_user=callback_user&callback_pw=callback_password&type=traffic&trigger_value=80&callback_url=https%3A%2F%2Fexample.com%2Fyourcallback"

response = http.request(request)
puts response.read_body
{
  "status": "success",
  "hook_id": "123"
}
{
"status": "error",
"message": "Invalid parameters provided."
}
{
"status": "error",
"message": "Unauthorized access."
}
{
"status": "error",
"message": "Access denied."
}
{
"status": "error",
"message": "An unexpected server error occurred."
}

Body

application/x-www-form-urlencoded

Required parameters to set a webhook for traffic monitoring.
All parameters must be passed in the request body as application/x-www-form-urlencoded.

signature
string

The session signature obtained from the "Create AUTH-session" call.

Example:

"session_signature_12345"

kvm_id
string

The unique identifier of the KVM VPS.

Example:

"kvm_123456_789012"

valid_until
string

The expiration timestamp for the session, as obtained from the "Create AUTH-session" call.

Example:

"1737476000"

callback_method
string

The HTTP method to use for the callback (post or get).

Example:

"post"

callback_user
string

(Optional) Username for callback authentication.

Example:

"callback_user"

callback_pw
string

(Optional) Password for callback authentication.

Example:

"callback_password"

type
string

Type of hook to create (only traffic is allowed).

Example:

"traffic"

trigger_value
string

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
string

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"

Response

Webhook set successfully.

status
string

The status of the operation.

Example:

"success"

hook_id
string

The ID of the created webhook.

Example:

"123"

Last modified on December 17, 2025