How WhatsApp's 24-Hour Messaging Rule Works and Why Bad Code Silently Fails

WhatsApp's official Cloud API enforces a strict 24-hour rule: businesses can send free-form messages only within 24 hours of a customer's last inbound message, after which only pre-approved templates are permitted. This rule applies uniformly across all integration methods, whether SaaS platforms, Meta's Cloud API, or custom builds on tools like Google Sheets and Apps Script. When the window-checking logic is coded incorrectly, the failure is silent — messages simply never reach the customer, or paid templates are charged unnecessarily. Common coding mistakes include timestamp unit mismatches between milliseconds and seconds, incorrect boundary comparisons, and mistakenly resetting the 24-hour window on outbound rather than inbound messages. A reliable implementation must normalize timestamps to a single unit at the input boundary and default to template mode whenever a timestamp cannot be read, ensuring the system fails safely.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in