AlphornAlphorn Docs

Webhooks

Receive notifications via HTTP webhooks.

Webhooks are the entry point for notifications into Alphorn. Each webhook provides a unique URL that accepts HTTP POST requests.

Creating a Webhook

  1. Navigate to Webhooks in the dashboard
  2. Click Create Webhook
  3. Give it a name (e.g., "Production Alerts")
  4. Copy the generated URL

Sending Notifications

Send a POST request to your webhook URL:

curl -X POST https://app.alphorn.dev/api/webhooks/wh_abc123 \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Server Alert",
    "message": "CPU usage above 90% on web-01",
    "priority": 4,
    "tags": ["infrastructure", "critical"]
  }'

The same request in other languages:

await fetch("https://app.alphorn.dev/api/webhooks/wh_abc123", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    title: "Server Alert",
    message: "CPU usage above 90% on web-01",
    priority: 4,
    tags: ["infrastructure", "critical"],
  }),
});
import requests

requests.post(
    "https://app.alphorn.dev/api/webhooks/wh_abc123",
    json={
        "title": "Server Alert",
        "message": "CPU usage above 90% on web-01",
        "priority": 4,
        "tags": ["infrastructure", "critical"],
    },
)
payload, _ := json.Marshal(map[string]interface{}{
    "title":    "Server Alert",
    "message":  "CPU usage above 90% on web-01",
    "priority": 4,
    "tags":     []string{"infrastructure", "critical"},
})

http.Post(
    "https://app.alphorn.dev/api/webhooks/wh_abc123",
    "application/json",
    bytes.NewBuffer(payload),
)

Payload Format

JSON payload

{
  "title": "Notification title",
  "message": "Notification body text",
  "priority": 3,
  "tags": ["tag1", "tag2"],
  "payload": {
    "any": "data you want"
  }
}
FieldTypeRequiredDescription
titlestringNoShort notification title
messagestringYesNotification body
prioritynumberNoPriority level 1–5 (1 = lowest, 5 = highest)
tagsstring[]NoTags for filtering and routing
payloadobjectNoArbitrary JSON data — forwarded to channels and available for filtering

The payload field

The payload field accepts any JSON object. Use it to attach structured data to your notifications — deployment metadata, error details, metrics, or anything else your system produces.

{
  "title": "Deploy complete",
  "message": "v2.1.0 deployed to production",
  "payload": {
    "environment": "production",
    "version": "2.1.0",
    "service": "api",
    "commit": "a1b2c3d",
    "duration_seconds": 42,
    "deployed_by": "ci"
  }
}

The payload is:

  • Forwarded to channels — channels that support structured data (like Webhook) receive the full payload
  • Available for filtering — use JSON path filters to route based on payload content (e.g., payload.environment == "production")
  • Stored in delivery logs — visible in the dashboard for debugging

This means you can send a single notification and route it differently based on the payload content. For example, route production deployments to PagerDuty but staging deployments to Slack only.

curl -X POST https://app.alphorn.dev/api/webhooks/wh_abc123 \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Health check result",
    "message": "All checks passed",
    "priority": 2,
    "payload": {
      "service": "payments",
      "region": "eu-west-1",
      "checks": {
        "database": "ok",
        "redis": "ok",
        "external_api": "ok"
      },
      "response_time_ms": 145
    }
  }'

Slack-compatible payload

Alphorn also accepts Slack-compatible payloads for easy migration:

{
  "text": "Notification message"
}

Plain text

Send plain text with Content-Type: text/plain:

curl -X POST https://app.alphorn.dev/api/webhooks/wh_abc123 \
  -H "Content-Type: text/plain" \
  -d "Server is back online"

Response

A successful request returns:

{
  "id": "msg_abc123",
  "status": "queued"
}

The notification is queued for delivery to all matching channels.

On this page