Publish API
Send one notification request, derive one public channel code, and verify delivery without leaving the docs page.
/<publishKey> or generated on /POST /<publishKey>, POST /, GET / (CLI)Smallest useful mental model
Keep the workflow tight: key in, request out, channel page for verification.
A channelCode is derived from the publishKey.
With no content-type header, the server tries JSON first, then form-urlencoded, then plain text.
POST /<publishKey> sends directly with a known key. POST / generates a random publish key, sends once, and returns it in the response. GET / returns a bootstrap payload for CLI user agents such as curl.
severity, show, ring, and level only matter for behavior overrides.
First successful publish
curl -X POST https://alrim.io/<publishKey> \
-H 'Content-Type: application/json' \
-d '{
"title": "Server deploy",
"body": "v1.2.3 shipped",
"data": {
"severity": "warning",
"ring": "force",
"level": "2"
}
}'- 1. Paste a
publishKeybetween32and256characters using only lowercase letters and digits. - 2. Start with the path route so the key and payload stay visible in one request.
- 3. Open the derived channel page after success to confirm delivery.
Path auth first, headers optional
Path-based: POST /<publishKey> is the most direct route when you already know the publish key.
Root route: POST / generates a random publish key and returns it alongside the send result. GET / returns a CLI bootstrap envelope only for curl-like user agents.
Content type: you do not have to define a content-type header for these examples. With no header, the server tries JSON first, then form-urlencoded, then plain text.
Header-based: still works via X-Alrim-Key or Authorization: Bearer if your integration prefers hidden keys.
Validation: trimmed keys must be at least 32, at most 256, and use only lowercase letters a-z plus digits 0-9.
X-Alrim-Key: <publishKey> Authorization: Bearer <publishKey>
Path and root route examples
Accepts JSON, form-urlencoded, or plain text. Plain text defaults the title to alrim and uses the raw request body as body.
curl -X POST https://alrim.io/<publishKey> \
-H 'Content-Type: application/json' \
-d '{
"title": "Smoke test",
"body": "publish key in path"
}'JSON body with an explicit application/json content-type header.
curl -X POST https://alrim.io/<publishKey> \
-H 'Content-Type: application/json' \
-d '{
"title": "Smoke test",
"body": "publish key in path"
}'Generates a random publish key, sends the notification once, and returns both the send result and the generated publish URL.
curl -X POST https://alrim.io/ \
-H 'Content-Type: application/json' \
--data-binary '{"title":"Server deploy","body":"v1.2.3 shipped"}'When the request user agent looks like a CLI tool such as curl, the root GET route returns a bootstrap JSON payload with a generated publish key and ready-to-copy curl commands.
curl https://alrim.io/
JSON payload shape
Keep the top level small: title, body, and optional data. The server injects a few internal fields before FCM delivery.
{
"title": "Server deploy",
"body": "v1.2.3 shipped",
"data": {
"severity": "warning",
"show": "1",
"ring": "force",
"level": "2"
}
}Auto injected: channel_code, title, body, alrim_created_at_ms, notification_id
Headers: not required for the path-based examples on this page. With no header, the server tries JSON first, then form-urlencoded, then plain text.
App aware: severity, show, ring, level
Response envelopes
POST /<publishKey> returns the direct notify result. POST / adds generated publish key metadata on top of the send result. GET / for CLI user agents returns only the generated publish key bootstrap payload.
{
"ok": true,
"channel_code": "3ba3f5f43b92602683c19aee62a20342",
"channel_url": "https://alrim.me/3ba3f5f43b92602683c19aee62a20342",
"notification_id": "d6d5f95b3bbd4fb4b8d98f7bc8e89c17",
"created_at_ms": 1712345678901
}{
"ok": false,
"error": "publishKey must use only lowercase letters (a-z) and digits (0-9). See https://alrim.io/doc for publishKey rules and examples."
}{
"ok": true,
"publish_key": "5765aff90d6e4d2e169b3b496c418cc9",
"publish_url": "https://alrim.io/5765aff90d6e4d2e169b3b496c418cc9",
"channel_code": "3ba3f5f43b92602683c19aee62a20342",
"channel_url": "https://alrim.me/3ba3f5f43b92602683c19aee62a20342",
"notification_id": "d6d5f95b3bbd4fb4b8d98f7bc8e89c17",
"created_at_ms": 1712345678901,
"curl": "curl -X POST "https://alrim.io/5765aff90d6e4d2e169b3b496c418cc9" ..."
}{
"ok": true,
"publish_key": "5765aff90d6e4d2e169b3b496c418cc9",
"publish_url": "https://alrim.io/5765aff90d6e4d2e169b3b496c418cc9",
"curl": "curl -X POST "https://alrim.io/5765aff90d6e4d2e169b3b496c418cc9" ...",
"curl_json": "curl -X POST "https://alrim.io/5765aff90d6e4d2e169b3b496c418cc9" ...",
"curl_form": "curl -X POST "https://alrim.io/5765aff90d6e4d2e169b3b496c418cc9" ...",
"curl_text": "curl -X POST "https://alrim.io/5765aff90d6e4d2e169b3b496c418cc9" ..."
}Copy-ready requests
curl -X POST https://alrim.io/<publishKey> \
-H 'Content-Type: application/json' \
-d '{
"title": "Server deploy",
"body": "v1.2.3 shipped",
"data": {
"severity": "warning",
"ring": "force",
"level": "2"
}
}'curl -X POST https://alrim.io/<publishKey> \
-H 'Content-Type: application/json' \
-d '{
"title": "Smoke test",
"body": "publish key in path"
}'