Publishing
POST plain text or JSON to a topic. Titles, priorities, tags, click URLs, action buttons and idempotency.
Plain text
curl -X POST https://your-instance.example.com/api/v1/publish/alerts \
-H "X-API-Key: YOUR_API_KEY" \
-d "The build finished."The request body is the message body. Use -H "Title: …" to add a title. The topic in the path is created on first publish.
Headers
| Header | Example | Notes |
|---|---|---|
| X-API-Key | YOUR_API_KEY | Required. |
| Title | Backup finished | Up to 120 characters. |
| Priority | high | min, low, default, high, max or 1–5. |
| Tags | warning,server | Comma-separated, at most 10 short values. |
| Click | https://… | http(s) URL opened when the message is clicked. |
| Idempotency-Key | backup-2026-01-01 | Repeat-safe publishes, unique per topic. |
curl -X POST https://your-instance.example.com/api/v1/publish/alerts \
-H "X-API-Key: YOUR_API_KEY" \
-H "Title: High CPU usage" \
-H "Priority: high" \
-H "Tags: warning,server" \
-H "Click: https://grafana.example.com/d/server" \
-d "CPU at 98% for 5 minutes."JSON body
Send Content-Type: application/json to set fields in the body instead of headers. body and message are both accepted as the text.
curl -X POST https://your-instance.example.com/api/v1/publish/deploys \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Production deploy failed",
"body": "Version 1.2.3 exited with status 1.",
"priority": "max",
"tags": ["deploy", "error"],
"click": "https://logs.example.com",
"actions": [
{ "action": "view", "label": "Open logs", "url": "https://logs.example.com" }
]
}'Action buttons
Up to three actions may be attached. Only the view action is supported: it opens a URL. Set clear to true to dismiss the notification after it is used.
curl -X POST https://your-instance.example.com/api/v1/publish/deploys \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Deploy failed",
"body": "Rollback is available.",
"actions": [
{ "action": "view", "label": "Open logs", "url": "https://logs.example.com" },
{ "action": "view", "label": "Dismiss", "url": "https://example.com", "clear": true }
]
}'Action URLs must be absolute http(s) URLs. Invalid actions, tags or priorities return 400 rather than being silently dropped.
Idempotency
Retries are common in cron jobs and CI. Send an Idempotency-Key header (or idempotencyKey in JSON) and the same publish is stored only once per topic. Reusing the key with different content is rejected.
curl -X POST https://your-instance.example.com/api/v1/publish/backups \
-H "X-API-Key: YOUR_API_KEY" \
-H "Idempotency-Key: backup-$(date +%F)" \
-d "Nightly backup finished."Topics
A topic must match ^[a-z0-9][a-z0-9_-]{0,63}$: lowercase letters, digits, dashes and underscores, up to 64 characters. There is no separate create call — publishing to a new topic creates it.
# these are three separate topics
curl -X POST https://your-instance.example.com/api/v1/publish/alerts -H "X-API-Key: $KEY" -d "…"
curl -X POST https://your-instance.example.com/api/v1/publish/backups -H "X-API-Key: $KEY" -d "…"
curl -X POST https://your-instance.example.com/api/v1/publish/deploys -H "X-API-Key: $KEY" -d "…"Response
A successful publish returns { "message": { … } } with the stored message, including its id, seq and createdAt. Publishing is CORS-enabled so browser tools can post with an API key.
400 invalid_topic— the topic does not match the pattern.400 invalid_priority/invalid_tags/invalid_title— a header value was rejected.413 payload_too_large— body exceedsBELLCAST_MAX_BODY_BYTES.