The 24-hour window
Templates and replies
A template is a message approved by Meta in advance, with placeholders you fill in. You can send one at any time, which is why order updates, reminders and OTPs are templates. Send them with Send a template message.
A reply is anything else: free text, buttons, a list, a file. You can only send replies for 24 hours after the person last messaged you. Each new message from them restarts the 24 hours.
| Template | Reply | |
|---|---|---|
| When | Any time | Within 24 hours of their last message |
| Content | Fixed wording, placeholders filled in | Anything |
| Endpoint | POST /messages | POST /messages/text, /messages/interactive, /messages/media |
Check before you reply
If you are not sure whether the window is open, ask. windowOpen tells you, and expiresAt says until when:
# macOS, Linux or Git Bash, with WAMAFY_API_KEY set. The quoting does not work in Windows cmd or PowerShell.
curl "https://api.wamafy.com/api/v1/public/window?to=%2B919876543210" \
-H "Authorization: Bearer $WAMAFY_API_KEY"If you send a reply anyway and the window has closed, you get 400 NO_OPEN_CONVERSATION and nothing is sent. Send a template to reopen the conversation; once the person answers, you can reply freely again.
A typical pattern
- A customer writes to you. You hear about it on the message.inbound webhook.
- Your system replies with text or buttons straight away, inside the window.
- Days later the order ships. The window has long closed, so you send the shipping update as a template.
Payment requests
Ask for a payment follows the same rule and chooses for you: inside the window it sends Review and pay as a message, outside it the Review and pay template you name in templateName. Without one, a closed window is 400 WINDOW_CLOSED, so pass templateName every time and it is used only when needed.
Cost
Meta charges for templates by category (marketing, utility, authentication). Replies inside the window are free up to 1,000 a month for each of your numbers. Your plan and the billing page in the dashboard show the rates that apply to you.