Webhook Payload Format Reference

Server Scout sends webhook notifications as HTTP POST requests with JSON payloads whenever alerts are triggered, resolved, or repeated. Understanding the payload structure allows you to integrate Server Scout with various notification systems and build custom handlers.

Payload Structure

Server Scout sends a standardised JSON payload to your webhook endpoint using Content-Type: application/json. The payload contains the following fields:

  • text: Human-readable summary of the alert
  • color: Hex colour code indicating severity
  • server_name: Name of the monitored server
  • metric: The monitored metric (CPU, memory, disk, etc.)
  • current_value: Current value that triggered the alert
  • threshold: Configured threshold that was breached
  • operator: Comparison operator (>, <, >=, <=)
  • severity: Alert severity level (warning, critical)
  • status: Alert status (fired, resolved, reminder)
  • timestamp: ISO 8601 timestamp when the alert occurred

Colour Coding

The color field uses the following hex codes based on alert status:

  • Green (#36a64f): Resolved alerts
  • Orange (#ff9500): Warning severity
  • Red (#d63638): Critical severity

Example Payloads

Fired Alert

{
  "text": "Critical Alert: CPU usage on web-server-01 is 95.2% (threshold: >= 90%)",
  "color": "#d63638",
  "server_name": "web-server-01",
  "metric": "CPU usage",
  "current_value": "95.2%",
  "threshold": "90%",
  "operator": ">=",
  "severity": "critical",
  "status": "fired",
  "timestamp": "2024-01-15T14:30:22Z"
}

Resolved Alert

{
  "text": "Resolved: CPU usage on web-server-01 is now 45.1% (was 95.2%)",
  "color": "#36a64f",
  "server_name": "web-server-01",
  "metric": "CPU usage",
  "current_value": "45.1%",
  "threshold": "90%",
  "operator": ">=",
  "severity": "critical",
  "status": "resolved",
  "timestamp": "2024-01-15T14:45:18Z"
}

Platform Integration

Slack

Server Scout's webhook payload is designed to be Slack-compatible. Simply use your Slack Incoming Webhook URL directly in Server Scout's webhook configuration. The text field becomes the message content, and the color field provides visual coding in Slack channels.

Discord

Discord supports Slack-compatible webhooks with a simple URL modification. Append /slack to your Discord webhook URL:

Original: https://discord.com/api/webhooks/123456/abcdef
Modified: https://discord.com/api/webhooks/123456/abcdef/slack

Microsoft Teams

Teams doesn't natively support Slack-format webhooks, but you can use connectors that accept Slack-format payloads. Look for "Incoming Webhook" connectors in the Teams App Store that specifically mention Slack compatibility.

PagerDuty

For PagerDuty integration, you'll need to create a middleware service that maps Server Scout's webhook payload to PagerDuty's Events API v2 format. The key mappings are:

  • status: "fired"event_action: "trigger"
  • status: "resolved"event_action: "resolve"
  • textsummary
  • severityseverity

Custom Implementations

When building custom webhook handlers, remember that Server Scout sends POST requests with the JSON payload in the request body. Your endpoint should:

  1. Accept POST requests
  2. Parse JSON from the request body
  3. Handle the Content-Type: application/json header
  4. Respond with a 2xx status code to acknowledge receipt

The standardised payload format makes it straightforward to route alerts to multiple systems, create custom dashboards, or integrate with existing monitoring workflows. All fields are consistently present in every webhook, making parsing reliable and predictable.

Frequently Asked Questions

How do I set up ServerScout webhooks for Slack?

ServerScout's webhook payload is designed to be Slack-compatible. Simply use your Slack Incoming Webhook URL directly in ServerScout's webhook configuration. The text field becomes the message content, and the color field provides visual coding in Slack channels.

What fields are included in ServerScout webhook payloads?

ServerScout webhook payloads include text (summary), color (hex code), server_name, metric, current_value, threshold, operator, severity, status, and timestamp. All fields are consistently present in every webhook, making parsing reliable and predictable.

Why am I not receiving webhook notifications from ServerScout?

Ensure your endpoint accepts POST requests with Content-Type: application/json and responds with a 2xx status code to acknowledge receipt. ServerScout sends JSON payloads in the request body, so your handler must parse JSON correctly.

How does ServerScout color coding work in webhook payloads?

ServerScout uses hex color codes based on alert status: green (#36a64f) for resolved alerts, orange (#ff9500) for warning severity, and red (#d63638) for critical severity. This provides consistent visual indicators across platforms.

Can I integrate ServerScout webhooks with Discord?

Yes, Discord supports Slack-compatible webhooks with a simple URL modification. Append /slack to your Discord webhook URL. For example, change https://discord.com/api/webhooks/123456/abcdef to https://discord.com/api/webhooks/123456/abcdef/slack.

What webhook payload statuses does ServerScout send?

ServerScout sends three webhook statuses: 'fired' for new alerts, 'resolved' when alerts clear, and 'reminder' for repeated alerts. Each status includes the same payload structure with different values for the status field.

How do I integrate ServerScout webhooks with PagerDuty?

PagerDuty integration requires a middleware service to map ServerScout's payload to PagerDuty's Events API v2 format. Map status 'fired' to event_action 'trigger', status 'resolved' to event_action 'resolve', and use the text field for summary.

Was this article helpful?