Send alerts from any script
Anything that can send an HTTP request can send an alert to your Telegram, Discord or Pushover: a failed SQL Server Agent job, a backup that didn't finish, a broken deploy, a cron job or a scheduled task. One request with your project's API key and the text of the message.
Quick start
- Sign in at app.bugsradar.com, create a project and add a channel — the same steps as in Get started.
- Copy the project's API key and send a test message from a terminal.
curl -fsS -H "X-Api-Key: $BUGSRADAR_KEY" \
--data-binary "Hello from $(hostname)" \
https://api.bugsradar.com/api/v3/notify
Invoke-RestMethod -Method Post -Uri 'https://api.bugsradar.com/api/v3/notify' `
-Headers @{ 'X-Api-Key' = $env:BUGSRADAR_KEY } `
-ContentType 'text/plain; charset=utf-8' -Body "Hello from $env:COMPUTERNAME"
The message arrives in every channel of the project within seconds. BUGSRADAR_KEY is an environment variable with your key; the guides use it too.
Windows PowerShell 5.1 doesn't always use TLS 1.2 by itself. If a request fails with “Could not create SSL/TLS secure channel”, add this line before it:
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Request and parameters
POST https://api.bugsradar.com/api/v3/notify?level=warning&category=Nightly+backup
X-Api-Key: <your project API key>
Content-Type: text/plain; charset=utf-8
Backup of shop-db failed: disk is full
- Key — the project's API key in the
X-Api-Keyheader, the same key the NuGet package uses. - Body — the text of the message in UTF-8. Any
Content-Typeis accepted, socurl -dand--data-binarywork as they are.
| Query parameter | Default | Meaning |
|---|---|---|
level | error | critical, error, warning or information; fatal, warn and info work too. The level is shown under the project name. |
category | — | A label under the message, such as the name of the job or the pipeline. |
environment | — | Production, Staging and so on. |
host | — | The machine the message comes from. |
All parameters are optional. Write spaces in them as +.
Responses and limits
| Code | Meaning |
|---|---|
202 | Accepted. Delivery to the channels goes on in the background. |
400 | The body is empty. |
401 | The key is missing or wrong. |
413 | The body is larger than 64 KB. |
429 | The server asks to slow down: wait for the number of seconds in Retry-After. |
Text beyond 8,000 characters is cut. A channel shows the message on one line: line breaks become spaces, and the first 300 characters are shown. With curl -f, curl exits with an error on any of these codes except 202, so a script can tell whether the alert went out.
Repeats and grouping
A message from a script is handled like an error from an application. The first one arrives at once. When the same message comes again, it doesn't send a new message each time: the repeats are counted and arrive as a summary — the first 10 minutes later, then after 30 minutes, an hour, and every 6 hours while they continue.
Numbers, GUIDs, URLs, email addresses and text in quotes don't count when messages are compared: “Backup failed at 03:00” and “Backup failed at 04:00” are the same message. A job that fails once a night sends a full message every night; a job that fails every minute sends one message and then summaries.
What you receive
A sample from Telegram, sent with category=SQL+Server+Agent and host=SQL01:
Nightly jobs
Error
Job Nightly backup failed on SQL01
SQL Server Agent
SQL01 · 2026-09-24 03:00:12 UTC
Nothing is stored: the message stays in memory only until it is delivered to your channels.
Guides
- SQL Server Agent — an alert when a job fails, with the step that failed and its error, without Database Mail.
- Backups — pg_dump, mysqldump and robocopy scripts that report their own failure.
- CI/CD pipelines — GitHub Actions, GitLab CI/CD, Azure Pipelines and Jenkins.
- Cron — one line in crontab, or a wrapper for all jobs.
- Windows Task Scheduler — PowerShell and command-line tasks that report a failure.
- systemd —
OnFailure=for services and the services that timers start.
Keep the key safe
- The key is secret: use it only in scripts and pipelines that run on your servers and in your CI. Never put it in a browser, mobile or desktop app you ship to others: see Keep the API key secret.
- The key only sends messages to its project. Whoever has it can fill your channels with messages, but can't read anything or change settings.
- Keep it in the secrets of your CI system or in an environment variable rather than in the script or the repository. A key written in a SQL Server Agent step is visible to everyone who can open the job.
- If the key leaks, press Regenerate key on the project's page in the web app and put the new key in your scripts and applications.
For applications, use the package for .NET, Node.js or Python: it sends exceptions with their stack traces and doesn't make your code wait for the network.