API Reference

One endpoint, one POST request. Send JSON to your channel's webhook URL and we handle notifications, formatting, and delivery.

Send Alert

Trigger a new alert in a specific channel. This is the primary endpoint for sending notifications from your application.

POSThttps://zenhook.dev/api/webhook/{token}
Example Request
curl -X POST https://zenhook.dev/api/webhook/abc123def456 \
  -H "Content-Type: application/json" \
  -d '{
    "title": "New User Signup",
    "level": "success",
    "emoji": "🎉",
    "source": "My App",
    "message": "[email protected] just joined your workspace.",
    "linkUrl": "https://myapp.com/admin/users/42",
    "linkText": "View Profile"
  }'

Path Parameters

tokenstringRequired
Your unique channel webhook token. Find it in channel settings.

Request Body

titlestringRequired
A brief summary of the alert. Used as the headline in notifications. Max 200 characters.
levelenum
Severity of the alert: info, success, warning, error. Defaults to info.
messagestring
Detailed body text. Max 5,000 characters.
emojistring
Custom emoji displayed next to the title.
fieldsarray
Key-value objects for structured data. Each object has label and value.
linkUrlstring
URL for a clickable call-to-action link displayed below the title.
linkTextstring
Label for the link button. Defaults to "View" if linkUrl is set.
sourcestring
Author name shown in the alert header (e.g. "GitHub", "Stripe"). Defaults to "Webhook".
metadataobject
Arbitrary JSON object shown as an expandable "Raw Payload" section with copy-to-clipboard. Max 10 KB.

Responses

201 Created

Alert received and queued for delivery.

json
{
  "success": true,
  "alertId": "clx1234567890abcdef",
  "queuedAt": "2024-03-22T12:00:00Z"
}

Structured Data

Use the fields array to include rich metadata displayed in the dashboard and email alerts.

Example with fields
{
  "title": "Build Failed",
  "level": "error",
  "fields": [
    { "label": "Branch", "value": "main" },
    { "label": "Commit", "value": "abc123f" },
    { "label": "Author", "value": "John Smith" },
    { "label": "Error", "value": "npm install timed out after 300s" }
  ],
  "linkUrl": "https://github.com/org/repo/actions/runs/123",
  "linkText": "View Logs"
}