Skip to content

Event webhooks for automation

Pro plan and above

Event webhooks send a JSON request to a URL of yours whenever something happens in NexoVirt: a server is created or deleted, a plan is suspended, an alert fires, and so on. Use them to drive your own automation, billing sync or chat notifications.

GroupEvents
ServerServer created, Server reinstalled, Server password reset, Server deleted, Server power action
PlanPlan suspended, Plan deleted, Plan resumed, Plan expiry warning
AccountWelcome email, Password reset
AlertsAlert fired, Alert resolved

Open Settings → Event webhooks and choose New hook. Each hook listens to one event:

  • Name and Event.
  • URL (http or https) and Method (POST or PUT).
  • Headers: optional custom headers, for example an API key for your endpoint.
  • Secret: after the first save, Generate secret creates a signing secret. It is shown once.
  • Enabled.
  • Body (JSON): the request body, with {Variable} placeholders. Click a variable chip to insert it. {Event} and {Timestamp} are always available; the others depend on the event (for example {GuestName}, {Vmid}, {Ipv4}, {PlanName}, {AlertTitle}, {Severity}).
{
"event": "{Event}",
"guest": "{GuestName}",
"vmid": "{Vmid}",
"ip": "{Ipv4}"
}

The Preview pane renders the body with sample data as you type, and the body must be valid JSON to save. Test send makes one real request with sample data and shows the HTTP status and response.

Every delivery is sent with these headers (custom headers cannot override them):

HeaderValue
Content-Typeapplication/json
X-Nexo-EventThe event key, for example server_created
X-Nexo-DeliveryThe delivery id (0 for a test send)
X-Nexo-HookThe hook id
X-Nexo-Signaturesha256=<hex>, only when a secret is set

The signature is the HMAC-SHA256 of the exact raw request body, keyed with the hook’s secret. Verify it on your endpoint before trusting a payload:

import hmac, hashlib
def is_valid(secret: str, raw_body: bytes, header: str) -> bool:
expected = "sha256=" + hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, header)

Deliveries are queued and sent every minute by hooks:flush. Any 2xx response counts as sent. A failed attempt is retried after 1, 5, 15 and 30 minutes; after the fifth failed attempt the delivery is marked failed. Requests time out after 10 seconds.

The Deliveries tab lists every delivery with its event, hook, status (pending, sent, failed) and HTTP code. Open one to see the body, attempts and last error, and retry a failed delivery from there. Finished deliveries are kept for 30 days (hooks.retention_days).

A hook’s secret and custom headers are stored encrypted. Deleting a hook also deletes its delivery history. Every create, change, delete, test, retry and secret regeneration is written to the audit log.