API Reference
Alphorn HTTP API for sending notifications.
Alphorn provides a simple HTTP API. No SDK required — any HTTP client works.
Send Notification
POST /api/webhooks/{webhook_id}Headers
| Header | Value |
|---|---|
Content-Type | application/json, text/plain, or omit for auto-detection |
JSON Body
{
"title": "Notification title",
"message": "Notification body text",
"priority": 3,
"tags": ["tag1", "tag2"],
"payload": {}
}Parameters
| Field | Type | Required | Description |
|---|---|---|---|
title | string | No | Short title for the notification |
message | string | Yes | The notification body |
priority | integer | No | 1 (min) to 5 (max), defaults to 3 |
tags | string[] | No | Array of tags for filtering |
payload | object | No | Arbitrary JSON data, forwarded to channels and available for filtering |
Response
{
"id": "msg_abc123",
"status": "queued"
}Status Codes
| Code | Description |
|---|---|
200 | Notification queued successfully |
400 | Invalid payload |
404 | Webhook not found |
429 | Rate limit exceeded |
Slack-Compatible Format
For easy migration from Slack incoming webhooks:
POST /api/webhooks/{webhook_id}
Content-Type: application/json
{
"text": "Notification message"
}Plain Text
POST /api/webhooks/{webhook_id}
Content-Type: text/plain
Your notification message hereRate Limits
Rate limits depend on your plan:
| Plan | Limit |
|---|---|
| Free | 3,000 messages/month |
| Pro | 25,000 messages/month |
| Business | 500,000 messages/month |
Additional message packs are available on Pro and Business plans.
Examples
cURL
curl -X POST https://app.alphorn.dev/api/webhooks/wh_abc123 \
-H "Content-Type: application/json" \
-d '{"title": "Alert", "message": "Disk space low", "priority": 4}'JavaScript (fetch)
await fetch("https://app.alphorn.dev/api/webhooks/wh_abc123", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
title: "Alert",
message: "Disk space low",
priority: 4,
}),
});Python (requests)
import requests
requests.post(
"https://app.alphorn.dev/api/webhooks/wh_abc123",
json={
"title": "Alert",
"message": "Disk space low",
"priority": 4,
},
)Go
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]interface{}{
"title": "Alert",
"message": "Disk space low",
"priority": 4,
})
http.Post(
"https://app.alphorn.dev/api/webhooks/wh_abc123",
"application/json",
bytes.NewBuffer(payload),
)
}PHP
$ch = curl_init('https://app.alphorn.dev/api/webhooks/wh_abc123');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Alert',
'message' => 'Disk space low',
'priority' => 4,
]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);Ruby
require 'net/http'
require 'json'
uri = URI('https://app.alphorn.dev/api/webhooks/wh_abc123')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = {
title: 'Alert',
message: 'Disk space low',
priority: 4
}.to_json
http.request(request)