Webhooks
Receive real-time event notifications from V2RayTun via webhooks.
Overview
Webhooks let you receive HTTP POST callbacks whenever specific events occur in V2RayTun. Use them to integrate with external systems — billing platforms, monitoring tools, chat bots, or custom automation.
Configuration
- Navigate to Settings → Webhooks in the panel.
- Click Add Webhook.
- Enter the URL that will receive the POST requests.
- Select the events you want to subscribe to.
- Optionally set a secret for payload signature verification.
- Save.
Event Types
| Event | Trigger |
|---|---|
user.created | A new user is created |
user.updated | A user's settings are modified |
user.deleted | A user is deleted |
user.traffic.limit | A user reaches their traffic limit |
user.expired | A user's account expires |
node.online | A node connects to the panel |
node.offline | A node disconnects |
node.created | A new node is created |
node.deleted | A node is deleted |
Payload Format
Every webhook request is a JSON POST with the following structure:
{
"event": "user.created",
"timestamp": "2025-06-10T14:30:00Z",
"data": {
"id": 42,
"username": "alice",
"squadId": 1,
"trafficLimitGB": 50,
"expiresAt": "2025-12-31T23:59:59Z"
}
}Headers
| Header | Value |
|---|---|
Content-Type | application/json |
X-Webhook-Event | Event name (e.g., user.created) |
X-Webhook-Signature | HMAC-SHA256 of the body using your secret |
Signature Verification
If you configured a secret, verify the payload integrity:
import hmac
import hashlib
def verify_signature(body: bytes, signature: str, secret: str) -> bool:
expected = hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
return hmac.compare_digest(f"sha256={expected}", signature)Retry Policy
V2RayTun retries failed deliveries (non-2xx responses) up to 3 times with exponential backoff:
| Attempt | Delay |
|---|---|
| 1st retry | 10 seconds |
| 2nd retry | 60 seconds |
| 3rd retry | 5 minutes |
After three failures the delivery is marked as failed. You can view delivery logs in Settings → Webhooks → Delivery History.
Testing
Use the Test button next to any configured webhook to send a sample ping event and verify your endpoint is reachable.