Webhooks, Slack and Discord

A webhook sends an HTTP request to a service when an incident starts or clears. Use Slack or Discord to post a message in a channel. Use Generic JSON to send the event to your own application or an automation tool that accepts HTTP POST requests.

You can configure one webhook destination per workspace. Email can remain enabled alongside it. Webhooks use the same incident detection and thresholds as email; they do not require an agent update.

Connect Slack

  1. Open Slack app settings and create an app for your workspace, or choose an existing app.
  2. Open Incoming Webhooks and turn on Activate Incoming Webhooks.
  3. Click Add New Webhook to Workspace, choose the channel, and approve access. Your workspace may require an administrator to approve the app.
  4. Copy the generated webhook URL. It starts with https://hooks.slack.com/services/.
  5. In Cloud, open Alert settings and enable Webhook alerts. Choose Slack and paste the URL.
  6. Click Save.

Slack messages show a status heading with the server name. Resource alerts show the reading and threshold; missing-update alerts show the gap duration while the server is unresponsive. The time appears in each reader's local timezone. Recovery and repeated-alert messages include their explanation, and an Open dashboard button links back to Cloud. The URL chooses the channel; changing channels requires a new URL from Slack. Treat the URL as a password and keep it out of public repositories or screenshots.

Slack's setup guide has details about app creation and workspace permissions.

Connect Discord

  1. In Discord, open the server's Server Settings, then Integrations. You need the Manage Webhooks permission.
  2. Click Webhooks, then New Webhook. Choose the text channel that should receive alerts and, optionally, rename the webhook. Forum and media channels are not supported: Discord rejects webhook messages there unless each one starts a thread.
  3. Click Copy Webhook URL. It starts with https://discord.com/api/webhooks/.
  4. In Cloud, open Alert settings and enable Webhook alerts. Choose Discord and paste the URL.
  5. Click Save.

Discord messages use the same wording as Slack: a coloured status heading with the server name, the reading or missing-update duration, and any explanation. Red marks an alert, orange an advisory or repeated alerts, and green a recovery. The heading links back to the Cloud dashboard, and the time appears in each reader's local timezone. Alerts never mention @everyone, roles or users, even when a server name contains a mention. The URL chooses the channel; to move alerts, edit the webhook's channel in Discord or create a new one. Treat the URL as a password and keep it out of public repositories or screenshots.

Discord's webhook guide has details about permissions and editing webhooks.

Connect a JSON receiver

Your receiver needs a public HTTPS URL on port 443. This can be a POST endpoint in your application or a webhook URL created by your automation tool. Use the production URL, not a temporary local test address. Cloud cannot reach private network addresses and does not follow redirects.

  1. Configure the receiver to accept HTTP POST requests with a JSON body.
  2. In Alert settings, enable Webhook alerts, choose Generic JSON, and paste the receiver URL.
  3. Click Save.
  4. Reopen Alert settings and copy the Signing secret. Use it on the receiver to verify requests as described below.
  5. Return a successful 2xx response after accepting an event. Store or queue the event before responding if further work may take time.

Changing the URL or format creates a new signing secret and cancels queued deliveries to the old destination. Copy the new secret after saving a change.

Check delivery

After saving, a new incident creates a delivery in Incident history → Deliveries on the dashboard. Recovery deliveries require a start queued for the same destination; a cancelled start prevents its recovery delivery too. Enabling a destination does not replay existing incidents. There is no test-send button.

To check the full path without loading a server, you can temporarily set the disk threshold below a monitored disk's current use. Save, wait for a new incident and its delivery, then restore the threshold to clear the incident. Use a server with no active disk incident, record the original threshold first, and remember that thresholds apply to the whole workspace. Other enabled channels can receive this test incident too.

Check Incident history → Deliveries and your receiver logs. Pending waits for delivery or retry. Sent means the receiver returned 2xx. Failed shows the last error. An HTTP 4xx error usually needs a receiver or URL fix; 408 and 429 are retried.

You can also use the sample payload below to test your receiver separately.

JSON payload

Cloud sends version 1 of this event format:

{
  "version": 1,
  "id": "vpscloud-incident-42-opened",
  "type": "incident.opened",
  "occurred_at": "2026-10-06T09:00:00Z",
  "incident_id": 42,
  "server_id": "srv_example",
  "hostname": "web-01",
  "rule": "cpu",
  "value": 95.2,
  "threshold": 90,
  "unit": "percent"
}
Field Meaning
id Stable event ID. Retries keep the same ID and JSON body.
type incident.opened, incident.unstable, or incident.resolved.
occurred_at UTC time of the notification decision, which can precede delivery. Recovery notices follow the healthy confirmation period.
incident_id Identifies the notification anchor; its opening and final recovery share this value. Further detections can be grouped under the same activity.
server_id, hostname Identify the affected server.
rule cpu, memory, disk, offline, cpu_spike, or memory_spike.
value The detector's value at the transition: two-minute CPU/memory average, latest disk percentage, offline duration, or observed peak for spikes.
threshold The configured alert threshold, including in recovery events.
unit percent for resources, seconds for offline events.

Webhook events contain these incident fields. Live processes, incident snapshots, account emails, and agent credentials are not included.

Verify JSON signatures

JSON requests include these headers:

Header Value
Content-Type application/json
X-Vpsmon-Event-ID The event ID from the payload.
X-Vpsmon-Timestamp Unix seconds of this delivery attempt.
X-Vpsmon-Signature sha256= followed by the hexadecimal HMAC-SHA256 signature.

Use the entire signing secret as the UTF-8 HMAC key. Sign the timestamp header, a literal ., and the exact raw request body. Verify before parsing or changing the JSON. Reject timestamps outside a short tolerance, such as five minutes, and compare signatures in constant time.

This Go helper checks the signature of an already-read body:

package receiver

import (
    "crypto/hmac"
    "crypto/sha256"
    "encoding/hex"
    "net/http"
    "strconv"
    "time"
)

func ValidSignature(body []byte, headers http.Header, secret string, now time.Time) bool {
    if secret == "" {
        return false
    }
    timestamp := headers.Get("X-Vpsmon-Timestamp")
    seconds, err := strconv.ParseInt(timestamp, 10, 64)
    if err != nil || seconds < now.Unix()-300 || seconds > now.Unix()+300 {
        return false
    }
    mac := hmac.New(sha256.New, []byte(secret))
    mac.Write([]byte(timestamp + "."))
    mac.Write(body)
    expected := "sha256=" + hex.EncodeToString(mac.Sum(nil))
    return hmac.Equal([]byte(headers.Get("X-Vpsmon-Signature")), []byte(expected))
}

Limit the request body size when reading it, then verify the signature. Save the event ID in your receiver's storage and ignore an ID you have already processed. A valid signature proves who sent the request; storing the ID prevents a retry from repeating your action.

Slack and Discord use their secret webhook URLs and their own message formats. The JSON signing headers apply to Generic JSON receivers.

Retries and pausing

Cloud retries timeouts, network failures, 408, 429, and 5xx responses with increasing delays. It respects Retry-After up to one hour. Other unsuccessful statuses stop that delivery. Each request has a ten-second timeout; automatic retries stop after 12 attempts or 24 hours.

Pending deliveries survive Cloud restarts. Within a workspace, a pending start is attempted before later events. Once it succeeds or fails permanently, later events can proceed. Use occurred_at to order incident changes in your own system.

A receiver can accept an event and lose the response before Cloud receives it. The retry can deliver that event twice, so JSON receivers must deduplicate by ID. Slack and Discord can show a duplicate message in this case.

To pause webhooks, turn off Webhook alerts and click Save. Monitoring continues. Queued deliveries are cancelled and are not replayed on resume. A request already in flight may finish after you pause. The Email alerts switch remains independent.

Receivers should deduplicate retries and validate events before running destructive actions. Email and webhook channels share Cloud’s incident detector; using both does not create independent monitoring.

Repeated spike notifications

Enable CPU spike alerts or Memory spike alerts in Settings → Alerts, and enable the webhook integration. These resource rules apply to all enabled channels. Two distinct excursions to at least 95% within five minutes produce an advisory; usage must fall below 90% between excursions. Each server and resource has one shared 24-hour notification limit across email and webhooks, extended from successful delivery if delayed.

Spike payloads use incident.opened with rule set to cpu_spike or memory_spike, value as the observed peak and threshold as 95. There is no spike incident.resolved delivery. Sustained alerts take precedence and cancel pending redundant spike notices. Changing or toggling a destination does not reset the cooldown.

Shared notification timing

Email and webhooks use the same recovery delays and repeated-alert suppression. CPU and memory each group related spikes and sustained detections into one activity per server. A spike advisory can be followed by one sustained opening. Further detections do not send another opening. Final recovery requires 10 continuous minutes with the two-minute average below the recovery threshold and, when that resource’s spike rule is enabled, no qualifying repeated-spike activity for 10 minutes. These quiet periods run together. Spike-only activity has no recovery delivery.

Disk and missing-update recovery requires five healthy minutes. On the third disk incident or third outage for a server in a rolling hour, Cloud sends incident.unstable and pauses further notices of that type until one continuous healthy hour. The recovery notice then uses incident.resolved. Dashboard detections retain their original timing. Incident history groups CPU/memory activity while preserving the individual events and captures.

The optional summary field explains repeated-alert suppression or confirmed recovery. Receivers should handle the new event type and deduplicate using the stable event ID. Delivery queues, failures and retries remain independent for email and webhooks. Pausing or changing the webhook integration cancels its queued deliveries; enabling it does not replay old events or send recovery for an opening that destination never received.