Outbound messaging through Meta's Cloud API — business account required, strict session window, send-only.
🟢 Runtime-ready — posts via Meta Cloud API v21 directly, no SDK. No streaming edits: Cloud API's edit window is only 15 minutes and rate limits are strict, not worth the complexity. The helper buffers tokens and sends once at finalize time.
What you get
- Send messages to any WhatsApp number (E.164 format) from a verified Meta Business number
- Per-message recipient override via
channel - 4 096-char limit per message (same as the helper default)
What you need before you start
WhatsApp is not a casual-setup provider. You'll need:
- A Meta Business Portfolio (business.facebook.com)
- A WhatsApp Business phone number verified on that portfolio (any number you control by SMS / voice)
- A Meta Developer App (developers.facebook.com) with the WhatsApp product added
- For production messaging beyond your test numbers: complete business verification in Meta Business Suite (takes hours → days)
If you just want to try it: the Developer App ships with 5 free test recipient numbers you can verify via SMS in the app's WhatsApp panel.
Setup
1. Get the access token
- developers.facebook.com → your app → WhatsApp → API Setup
- Copy the Temporary access token (24h) for initial testing, or
generate a System User access token for long-lived use:
business.facebook.com →
Settings → Users → System Users → create one →
Generate new token (scope:
whatsapp_business_messaging+whatsapp_business_management)
2. Get the phone number id and recipient
- Same API Setup page — From dropdown shows your business
phone. The numeric Phone number ID below it is what Minara
needs (not the
+...number itself) - Under To, add and verify the recipient via SMS. Copy the
E.164 number (
+12025551234) intoWHATSAPP_RECIPIENT
3. Configure Minara
minara auth messaging add whatsappOr directly in your project .env file:
WHATSAPP_ACCESS_TOKEN=EAAxxx...
WHATSAPP_PHONE_NUMBER_ID=1234567890
WHATSAPP_RECIPIENT=+120255512344. Test
minara auth messaging test whatsappThe 24-hour session window
This is the trap everyone hits once:
Meta only lets a business send free-form messages to a user within 24 hours of that user's last inbound message. Outside the window, you must send a pre-approved template message.
For agent alerts this is fine during an active conversation but inconvenient for unsolicited notifications (e.g. an overnight autopilot trade). Workarounds:
- User sends anything to your business number before walking away — their ping resets the 24-hour window
- Approved templates — register an alert template like
{{1}} — {{2}} ({{3}}) triggered at {{4}}in Meta Business Suite; outbound template sends have no window restriction (separate per- template rate limits apply) - Use a different provider for unsolicited alerts — Email, Telegram, or Signal
Minara currently sends plain text only; template support is a future enhancement.
Overriding the recipient
send_message({
provider: "whatsapp",
channel: "+12025559999",
text: "Critical: position liquidation imminent",
})The override number must still be verified on the Meta Developer App (for test numbers) or reachable from a verified business sender (for production).
Troubleshooting
"Recipient not in allowed list"
- You're on the test tier and the override recipient isn't one of the 5 verified test numbers. Add it in the Developer App's WhatsApp panel
"Token expired"
- Temporary tokens last 24h. Swap in a System User token for anything production-like
"Message failed — outside 24h window"
- See the session-window section above. Have the user send any message to the business number to reopen the window, or register a template for unsolicited sends
"Rate limit exceeded"
- New accounts are throttled to ~50 business-initiated conversations per day. Scales with business verification tier; see Meta's scaling docs