Ad account health bot: rejections, limits and payments in Slack or Telegram

A rejected ad, a spend limit used up at the reseller or a failed payment stops your ads without any warning. Meta will send an email or a Business Suite notification, but among a dozen ad accounts, or when you work through an anti-detect browser, it’s easy to miss. The problem gets noticed hours later, when the campaign has already been down for half a day.

I built a bot that checks the ad accounts every 30 minutes and posts to the team channel as soon as something goes wrong. For me, the time from a problem to a reaction went from several hours to 10–30 minutes. Details are in the case study.

The code is open source: decontracte/ad-health-bot on GitHub, MIT license, English and Russian messages. Below you can get the full setup guide for your email.

What the bot checks

  • Rejected ads with Meta’s reason and a link straight to the ad.
  • The account spend limit. How much is left and how many days it lasts at the current pace. This is usually what a reseller balance looks like.
  • Payments. Unpaid balance and the grace period after a failed payment.
  • Account status. Disabled with the reason, risk review, closure.
  • Campaign spend limits at 90% and 98%.
  • Access itself. If the Meta token stops working, the bot says so instead of staying silent as if all were fine.

What the alerts look like

Ad Health#ad-health · 14:32

Critical

Stridely EU: Ad rejected: "UGC 03"
Campaign "Trials EU". Reason: misleading offer.

Stridely MENA: Payment failed, there is an unpaid balance

Attention

Northwind Shop: Account spend limit runs out in 2 days
200 USD left at ~100 USD a day.

✅ Resolved: Stridely LatAm, campaign spend limit "Black Friday"

An example with fictional ad accounts. Every item has an “Open” link straight to the right place in Ads Manager or in billing.

Without a hundred annoying alerts

  • Only what matters. Minor “ads with issues” are off by default and can be turned on with one command.
  • No repeats. A new problem arrives at once, an unresolved one repeats every 12 hours, a fixed one arrives as “Resolved”.
  • A morning summary. A short total across all accounts every morning, which also shows the bot is alive.

Controlled from the channel

Settings change right from Slack or Telegram, without touching the server:

Command What it does
status Current problems
check Check the accounts right now
accounts Which ad accounts are monitored
add act_123 · remove act_123 Add or remove an account
tz Europe/Berlin Time zone for the morning summary
summary 9 · summary off Summary time, or turn it off
mute act_123 24h Mute an account for a while
issues on · issues off Whether to send minor ad issues

In Slack the commands start with /adhealth, for example /adhealth status; in Telegram just /status.

What you need

  • A read-only Meta token (ads_read) from a system user in your business portfolio.
  • Slack or Telegram. A Slack app from a ready manifest, or a separate Telegram bot.
  • A server with Node.js 22: the simplest VPS will do. The bot barely loads the server or the Meta API.

Setup takes an evening. The step-by-step guide and all the code are below, free for your email.

What I’ll add next

  • A draft appeal for a rejected ad, written by Claude.
  • Google Ads and TikTok Ads in the same alerts.
  • Separate channels for different agency clients.
Free with your email

Step-by-step setup guide

A step-by-step setup: a Slack app or a Telegram bot, the Meta token, the server and the commands. I use this exact version every day.

  • 4 Node.js files with no external dependencies, plus a test on a mocked Meta API
  • A ready Slack app manifest and the Telegram bot setup
  • Server setup as a systemd service, step by step
  • The errors I got stuck on during launch, and how to fix them
No newsletters without your permission.