Self-hostable notification relay: subscribe via a Telegram bot, then send notifications to Telegram, Slack, Discord, or any webhook with one API call.
curl -X POST https://your-host/api/v1/notify \
-H "X-API-Key: rn_your-key" \
-H "Content-Type: application/json" \
-d '{"channel": "slack", "data": {"service": "api", "state": "down"}}'
- Multi-channel — Telegram, Slack webhooks, Discord webhooks, generic webhooks (email is a documented extension point).
- Commercially usable — Apache 2.0 licensed, no MongoDB, no Redis, no vendor lock-in; single Postgres dependency.
- Secure by design — API keys stored hashed (sha256 + pepper), shown exactly once; webhook URLs SSRF-validated (private-IP blocking); rate limiting per key. See key protection threat model.
- Production-grade — async FastAPI + SQLAlchemy 2.x, Alembic migrations, structured logs, Docker/compose, full test suite, CI-gated quality (black, isort, mypy, flake8, pytest).
cp .env.example .env # fill BOT_TOKEN + KEY_PEPPER + POSTGRES_PASSWORD
docker compose up --build -d # starts postgres → migrations → api + bot
curl http://localhost:8000/ # API docsThen open your bot in Telegram and send /subscribe — you'll receive your
API key (shown once) and a link to register Slack/Discord/webhook
channels.
- Message
@rapidnotifybot→/subscribe - Copy the API key you receive (it is shown only once).
- Follow the registration link to attach Slack/Discord/webhook channels.
- Send notifications to
/api/v1/notifywith your key.
| Endpoint | Method | Description |
|---|---|---|
/api/v1/notify |
POST |
Send a notification: {"channel": "...", "data": {...}} |
/api/v1/me |
GET |
Account info: id, channels, rate tier |
/api/v1/key/rotate |
POST |
Rotate your key (old key invalidates instantly) |
/api/channels/entry/{token} |
GET |
Channel registration page (single-use token link) |
Auth: X-API-Key: <key> header or Authorization: Bearer <key>.
Full reference: docs/api.md.
Rate limits: sliding window per API key (default 60 requests / 60 s),
stored in Postgres. Response on breach: 429 + Retry-After.
python -m venv venv && source venv/bin/activate
pip install -r requirements/dev.txt
cp .env.example .env # then fill in values
pytest --cov=app # full test suite
black . && isort . && mypy app && flake8 app tests # quality gates
alembic upgrade head # apply migrations
uvicorn app.main:app --reload # API on :8000
python -m app.bot.main # Telegram bot (separate terminal)app/api/— FastAPI app, routes, templates (registration page)app/bot/— Telegram bot process (/subscribe,/help)app/channels/— adapters behind a common interfaceapp/db/— SQLAlchemy models, async engine, Alembic migrationsapp/core/— settings, security (key hashing, SSRF guard), rate limiting
Docs: docs/installation.md,
docs/api.md.
Agent conventions for contributors: AGENTS.md.
PRs welcome — see CONTRIBUTING.md and the
CODE_OF_CONDUCT.md.