Skip to main content
Version: 4.2

Webhooks

VirtFusion webhooks can be used to automatically send data in real-time when certain events occur.

Webhooks require a HTTP endpoint that accepts POST requests.

Webhooks are commonly used for a variety of purposes, such as:

  • Automated notifications and alerts
  • Real-time data synchronization
  • Triggering automated actions or workflows
  • Integrating with third-party services and APIs

Authentication

Webhooks optionally support authentication using a Authorization: Bearer <token> header. The token will always be sent base64 encoded.

Requests

Headers

All webhook requests will include the following headers:

HeaderDescription
X-VirtFusion-HookThe ID of the webhook.
X-VirtFusion-CreatedISO8601 zulu date string. 2023-04-07T07:18:15.316192Z
X-VirtFusion-Hook-EventThe ID of the webhook event.
X-VirtFusion-EventThe event name. server.create etc...
X-VirtFusion-Event-StatusThe event status. success, fail etc...
User-AgentVirtFusion-Hookshot/57HE28D3RT
Content-Typeapplication/json
Acceptapplication/json

If authentication is enabled on the webhook, the following extra headers are included:

HeaderDescription
AuthorizationBearer <token> The Token will be automatically base64 encoded on each request.

Body

All requests will contain at least the following in the JSON body:

{
"event": "<event.name>",
"created": "<date string>",
"hookId": "<id>",
"hookEventId": "<id>",
"eventStatus": "<status>",
"controlDomain": "<control domain>",
"controlName": "<control name>",
"controlSupportLink": "<control support link>",
"data": {
"errors": [],
...
}
}

The data property will always contain data specific to the type of event triggered.

Events

Catch All

IDEventStatus TriggersData Body Includes
1000catch.allsuccess fail any-

Server

IDEventStatus TriggersData Body Includes
1server.createsuccess fail anyserver object/false args object allocation object/false
2server.destroysuccess fail anyserver object/false
3server.buildsuccess fail anyserver object/false
4server.assign.ipv6success fail anyserver object ipv6.block object/false ipv6.subnet object/false ipv6.ip object/false ipv6.routeBlock object/false ipv6.routeSubnet object/false
5server.unassign.ipv6success fail anyserver object ipv6.block object/false ipv6.subnet object/false ipv6.ip object/false ipv6.routeBlock object/false ipv6.routeSubnet object/false
6server.poweroffsuccess fail anyserver object/false
7server.bootsuccess fail anyserver object/false
8server.restartsuccess fail anyserver object/false
9server.shutdownsuccess fail anyserver object/false
10server.suspendsuccess fail anyserver object/false
11server.unsuspendsuccess fail anyserver object/false
12server.insert.cdsuccess fail anyserver object/false
13server.eject.cdsuccess fail anyserver object/false
14server.change.boot.ordersuccess fail anyserver object/false
15server.enable.vncsuccess fail anyserver object/false
16server.disable.vncsuccess fail anyserver object/false
17server.reset.passwordsuccess fail anyserver object/false
18sserver.disk.trimsuccess fail anyserver object/false
19server.assign.ipv4success fail anyserver object/false ipv4.block object/false ipv4.ip object/false
20server.unassign.ipv4success fail anyserver object/false ipv4.block object/false ipv4.ip object/false
21server.migratesuccess fail anyserver object/false
22server.migrate.completesuccess fail anyserver object/false
23server.migrate.revertsuccess fail anyserver object/false
31server.migrate.livesuccess fail anyserver object/false
32server.migrate.live.cancelsuccess fail anyserver object/false
33server.migrate.live.abortsuccess fail anyserver object/false

User

IDEventStatus TriggersData Body Includes
25user.createsuccess anyuser object/false
26user.modifysuccess anyuser.before object/false user.after object/false
27user.deletesuccess anyuser object/false

System

IDEventStatus TriggersData Body Includes
28system.backup.localsuccess fail anylog object/false
29system.backup.scpsuccess fail anylog object/false
30system.monitor.hypervisorsuccess fail anytype string hypervisor object/false

Integrations

A simple PHP application can be found here that supports Slack, Discord, Google Chat, Pushover and Telegram notifications.