Raven API

Send alerts to WhatsApp, Discord and email with one HTTP call. You need an API key; the project it belongs to decides where alerts go.

Base URL https://raven-api.expresstires.com

Check your key

Paste the key you were given to see the project, channels and destinations it can send to. The key stays in this browser and is only sent to this server.

Authentication

Send the key as a Bearer token on every request. X-Raven-Key: <key> works too.

Authorization: Bearer rvn_live_7Kq2…

Keys start with rvn_live_ and belong to one project. Keep them server-side: anyone with the key can send alerts to the project's destinations. If a key leaks, ask the Raven admin to revoke it; requests with a revoked key get 401.

Quick start

The smallest useful alert. It goes to the project's default destinations.

curl -X POST https://raven-api.expresstires.com/v1/alerts \
  -H "Authorization: Bearer $RAVEN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"level":"warning","subject":"Disk 85%","message":"db-1 /var is at 85%"}'
const res = await fetch("https://raven-api.expresstires.com/v1/alerts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RAVEN_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ level: "warning", subject: "Disk 85%", message: "db-1 /var is at 85%" }),
});
console.log(res.status, await res.json()); // 202 { alertId, deliveries: [...] }
import os, requests

r = requests.post(
    "https://raven-api.expresstires.com/v1/alerts",
    headers={"Authorization": f"Bearer {os.environ['RAVEN_KEY']}"},
    json={"level": "warning", "subject": "Disk 85%", "message": "db-1 /var is at 85%"},
    timeout=3,
)
print(r.status_code, r.json())  # 202 {"alertId": ..., "deliveries": [...]}
body := strings.NewReader(`{"level":"warning","subject":"Disk 85%","message":"db-1 /var is at 85%"}`)
req, _ := http.NewRequest("POST", "https://raven-api.expresstires.com/v1/alerts", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("RAVEN_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req) // 202 Accepted

Raven stores and queues the alert before answering, then delivers it in the background, retrying if a platform is slow or down. A 202 means it's safely queued.


POST /v1/alerts

Send an alert. Only message is required.

FieldDescription
messagerequiredstringThe alert body, up to 64 KB.
levelstringinfo (default), warning or critical. Shown as a color and an emoji, and used by routing.
subjectstringShort title: the email subject, the bold first line in chat apps. Up to 300 characters.
formatstringtext, markdown or html. Defaults to the project's setting. See Formatting.
tagsstring[]Labels like payments. The project's routing rules can send tagged alerts to different places. Up to 20.
metadataobjectKey/value pairs shown as fields under the message, e.g. {"env":"prod","orderId":"A-1029"}.
destinationsstring[]Send only to these destination slugs, skipping routing. Get the slugs from /v1/destinations.
channelsstring[]Keep only destinations on these channels: email, discord, whatsapp.
attachmentsobject[]Files to include. See Attachments.
dedupeKeystringRepeats with the same key inside the project's dedupe window are counted instead of sent. See Retries & duplicates.
expiresInstringDrop the alert if it can't be delivered within this time, e.g. 30m, 2h, 1d. Overrides the project default.

Full example

curl -X POST https://raven-api.expresstires.com/v1/alerts \
  -H "Authorization: Bearer $RAVEN_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2b9e-3d1a-4c55-9f0e-2a7b8c9d0e11" \
  -d '{
    "level": "critical",
    "subject": "Payment sync failed",
    "message": "Stripe webhook returned **500** for 3 attempts.",
    "format": "markdown",
    "tags": ["payments", "stripe"],
    "metadata": { "env": "prod", "orderId": "A-1029" },
    "dedupeKey": "stripe-sync",
    "expiresIn": "2h"
  }'
await fetch("https://raven-api.expresstires.com/v1/alerts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RAVEN_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    level: "critical",
    subject: "Payment sync failed",
    message: "Stripe webhook returned **500** for 3 attempts.",
    format: "markdown",
    tags: ["payments", "stripe"],
    metadata: { env: "prod", orderId: "A-1029" },
    dedupeKey: "stripe-sync",
    expiresIn: "2h",
  }),
});
import os, uuid, requests

requests.post(
    "https://raven-api.expresstires.com/v1/alerts",
    headers={
        "Authorization": f"Bearer {os.environ['RAVEN_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "level": "critical",
        "subject": "Payment sync failed",
        "message": "Stripe webhook returned **500** for 3 attempts.",
        "format": "markdown",
        "tags": ["payments", "stripe"],
        "metadata": {"env": "prod", "orderId": "A-1029"},
        "dedupeKey": "stripe-sync",
        "expiresIn": "2h",
    },
    timeout=3,
)
payload, _ := json.Marshal(map[string]any{
	"level":     "critical",
	"subject":   "Payment sync failed",
	"message":   "Stripe webhook returned **500** for 3 attempts.",
	"format":    "markdown",
	"tags":      []string{"payments", "stripe"},
	"metadata":  map[string]any{"env": "prod", "orderId": "A-1029"},
	"dedupeKey": "stripe-sync",
	"expiresIn": "2h",
})
req, _ := http.NewRequest("POST", "https://raven-api.expresstires.com/v1/alerts", bytes.NewReader(payload))
req.Header.Set("Authorization", "Bearer "+os.Getenv("RAVEN_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", uuid.NewString())
res, err := http.DefaultClient.Do(req)

Response

202 Accepted, with one entry per destination. status is pending (queued) or held (that platform is down; it'll be sent when it reconnects).

202 Accepted
{
  "alertId": "0193b1e2-6e1d-7c45-9a0b-3c4d5e6f7a8b",
  "deduplicated": false,
  "deliveries": [
    { "id": "…", "destination": "ops-group", "channel": "whatsapp", "status": "pending" },
    { "id": "…", "destination": "oncall-email", "channel": "email", "status": "held",
      "note": "connection disconnected; will send on reconnect" }
  ]
}

If the alert was a repeat inside the dedupe window you get 200 OK instead, and nothing is sent:

200 OK
{ "alertId": "<the original alert>", "deduplicated": true, "count": 14 }

GET /v1/destinations

What this key can send to: the project, each channel, and every destination with its slug and live status.

curl https://raven-api.expresstires.com/v1/destinations -H "Authorization: Bearer $RAVEN_KEY"
200 OK
{
  "project": { "slug": "shop-portal", "name": "Shop Portal", "enabled": true, "defaultFormat": "markdown" },
  "channels": [
    { "channel": "whatsapp", "available": true, "destinations": ["ops-group"] },
    { "channel": "email", "available": true, "destinations": ["oncall-email"] }
  ],
  "destinations": [
    { "slug": "ops-group", "name": "Ops group", "channel": "whatsapp", "provider": "whatsapp",
      "isDefault": true, "minLevel": "info", "status": "healthy", "available": true }
  ]
}
  • isDefault: gets alerts that don't name destinations (unless routing rules apply).
  • minLevel: default deliveries below this level are skipped for this destination.
  • available is false while the platform is down. You can still send: those alerts are held and delivered when it reconnects.

GET /v1/alerts/{id}

Where an alert went. Only alerts from this key's project are visible.

curl https://raven-api.expresstires.com/v1/alerts/0193b1e2-6e1d-7c45-9a0b-3c4d5e6f7a8b -H "Authorization: Bearer $RAVEN_KEY"
200 OK
{
  "id": "0193b1e2-…", "level": "critical", "subject": "Payment sync failed", "createdAt": "2026-11-25T14:02:11Z",
  "deliveries": [
    { "destination": "ops-group", "channel": "whatsapp", "status": "sent", "attempts": 1, "sentAt": "2026-11-25T14:02:13Z" },
    { "destination": "oncall-email", "channel": "email", "status": "failed", "attempts": 8, "error": "…" }
  ]
}

Delivery status: pending, sending, held, sent, failed, expired, suppressed (folded into a digest) or cancelled.

GET /v1/ping

Checks a key. Handy in a health check or CI.

curl https://raven-api.expresstires.com/v1/ping -H "Authorization: Bearer $RAVEN_KEY"
# {"ok": true, "project": "shop-portal"}

Formatting

With "format": "markdown", the same message looks right in every channel.

WriteResult
**bold**bold
*italic*italic
~~strikethrough~~strikethrough
`inline code`inline code
``` … ```Code block
> quoteQuote
- item / 1. itemLists
[text](https://…)Link (shown as text (url) in WhatsApp)

Line breaks are kept as written. Discord shows Markdown natively, WhatsApp gets its own formatting, and email gets a styled HTML version plus a plain-text copy. html is sanitized for email and converted to Markdown for chat apps; text is sent as is.

info 🔵 warning 🟠 critical 🔴

Every message ends with a small footer: project, time (UTC) and a short alert ID, so you can find it later.

Attachments

Up to 10 files, 10 MB each and 25 MB per alert by default.

Inline (base64)

"attachments": [
  { "filename": "failed-orders.csv", "contentType": "text/csv", "contentBase64": "b3JkZXJfaWQsYW1vdW50Ci4uLg==" }
]

By URL

Raven downloads the file when the alert arrives. The URL must be public: addresses on private networks are refused, and a broken URL fails the request with 422.

"attachments": [ { "url": "https://files.example.com/report.pdf", "filename": "report.pdf" } ]

Multipart upload

Easier for big files: send the JSON (without attachments) in a payload field and each file as a file part.

curl -X POST https://raven-api.expresstires.com/v1/alerts \
  -H "Authorization: Bearer $RAVEN_KEY" \
  -F 'payload={"level":"critical","subject":"Nightly export failed","message":"Log attached."}' \
  -F "file=@export.log" \
  -F "file=@screenshot.png;type=image/png"

Images show inline on WhatsApp and Discord; other files arrive as documents. If a file is too big for a platform, the message still goes out with a note saying the file was left off.

Where alerts go

Destinations are set up in the Raven dashboard. Your request can narrow them down.

  1. If you pass destinations, exactly those are used. An unknown or disabled slug returns 422.
  2. Otherwise the project's routing rules run, matching on level and tags.
  3. If no rule matches, the project's default destinations are used.
  4. channels, if given, then keeps only those channels, and each destination's minimum level applies.

If nothing is left you get 422 no_destinations.

Retries & duplicates

  • Idempotency. Send an Idempotency-Key header (a UUID) and retry with the same key if a request times out. Raven returns the original alert instead of creating a second one.
  • Dedupe. Alerts with the same dedupeKey inside the project's window (10 minutes by default) are counted, not sent. Use it for things that fire in loops: "dedupeKey": "db-1-disk".
  • Delivery retries. Raven retries failed sends with backoff, up to 8 attempts. If a platform is down, alerts are held and sent when it's back; many held alerts become one summary message.
  • Expiry. Held or retrying alerts older than expiresIn (or the project default) are dropped instead of arriving late.
  • Rate limit. Each project has a per-minute limit (60 by default). Over it you get 429 with a Retry-After header.
Tip: don't let alerting break your app. Use a short timeout (2–3 s), don't wait for delivery, and log instead of crashing when Raven can't be reached. The client libraries below do all of this.

Errors

Errors return a JSON body with a machine-readable code and a human-readable detail.

422 Unprocessable Entity
{ "status": 422, "code": "unknown_destination", "detail": "unknown or disabled destination: ops", "destinations": ["ops"] }
StatusWhenRetry?
400Malformed JSON or an invalid field (invalid_level, invalid_message, …)No, fix the request
401Missing, invalid or revoked keyNo
403The project is pausedNo
413Body or attachments over the size limitNo
415Not JSON or multipartNo
422Nothing to send to, an unknown destination slug, or an attachment URL that couldn't be fetchedNo
429Project rate limit hitAfter Retry-After seconds
5xxRaven had a problemYes, with the same Idempotency-Key

Client libraries

Small, dependency-free clients that never throw by default, time out after 3 s, and retry safely. They live in the Raven repository under clients/; plain HTTP works just as well.

import { Raven } from "@funkyscientist/raven-client"; // clients/ts

const raven = new Raven({ url: "https://raven-api.expresstires.com", key: process.env.RAVEN_KEY! });

await raven.critical("Payment sync failed", "Stripe webhook 500 x3", {
  tags: ["payments"],
  metadata: { orderId: "A-1029" },
  dedupeKey: "stripe-sync",
});
// resolves { ok: false, error } instead of throwing; pass { throwOnError: true } to throw
from raven_alerts import Raven, attach_file  # clients/python

raven = Raven("https://raven-api.expresstires.com", os.environ["RAVEN_KEY"])

raven.critical("Payment sync failed", "Stripe webhook 500 x3",
               tags=["payments"], metadata={"orderId": "A-1029"},
               attachments=[attach_file("failed-orders.csv")])

raven.send_async("warning", "Disk 85%", "db-1 /var at 85%")  # fire and forget
import raven "github.com/FunkyScientist/raven/clients/go"

rv := raven.New("https://raven-api.expresstires.com", os.Getenv("RAVEN_KEY"))

rv.Critical(ctx, "Payment sync failed", "Stripe webhook 500 x3",
	raven.Tags("payments"), raven.Meta("orderId", "A-1029"), raven.Dedupe("stripe-sync"))

rv.Go(raven.Warning, "Disk 85%", "db-1 /var at 85%") // fire and forget

Raven · dev