Monitor APIs With Telegram Alerts

Schedule daily health checks for your APIs and instantly receive a Telegram alert if any endpoint goes down or returns an error, ensuring maximum uptime and reliability.

API MonitoringUptime CheckTelegram AlertsHealth Check

API Health Checker

This workflow automatically checks the health of your APIs every day and sends you an alert on Telegram if any of them are down. It makes sure you stay informed about your API status without needing to monitor them manually.

It performs the following steps:

  1. Runs a scheduled trigger every day at 9:00 AM UTC.
  2. Defines and lists the APIs you want to monitor.
  3. Sends a request to each API endpoint and collects their responses.
  4. Analyzes the responses, identifies any issues, and sends a detailed alert message to your Telegram chat if problems are found.

What You Need

Ensure you have the following prerequisites ready before running the workflow:

RequirementDescription
Needle AccountAn active account on the Needle platform with access to workflow automation.
Telegram Bot TokenYour bot's token (TELEGRAM_BOT_TOKEN) with permission to send messages.
Telegram Chat IDThe chat ID (TELEGRAM_CHAT_ID) where you want the alerts delivered.
API EndpointsThe list of API URLs you want to monitor.

How the Flow Works

NodePurpose
Scheduled TriggerTriggers the workflow every day at 9:00 AM UTC to start the health check.
API List Code NodeDefines the list of API endpoints to monitor. Each API has a name and a URL.
HTTP Request NodeSends a GET request to each API URL from the list, collecting the response for further analysis.
Analysis Code NodeChecks each API's response status and errors, determining if the API is down or healthy. It compiles a summary message.
Telegram Notification NodeIf there are any API failures, this node sends the alert message to your specified Telegram chat.

Output

At the end of the execution, you will receive a Telegram message in your chosen chat. This message will either confirm all APIs are healthy or list the APIs that are down along with their status codes and error details.

Notes

  1. Customize the list of APIs by editing the first code node where the APIs are defined.
  2. To change the notification schedule, adjust the cron expression in the scheduled trigger.
  3. Keep your Telegram bot token and chat ID secure as workflow variables.
  4. The workflow tolerates request errors and continues running through all APIs to give a complete health picture.

Want to showcase your own workflows?

Become a Needle workflow partner and turn your expertise into recurring revenue.

Try Needle today

Streamline AI productivity at your company today

Join thousands of people who have transformed their workflows.

Agentic workflowsAutomations, meet AI agents
AI SearchAll your data, searchable
Chat widgetsDrop-in widget for your website
Developer APIMake your app talk to Needle
    Needle LogoNeedle
    Like many websites, we use cookies to enhance your experience, analyze site traffic and deliver personalized content while you are here. By clicking "Accept", you are giving us your consent to use cookies in this way. Read our more on our cookie policy .