Guides
Schedule WhatsApp follow-up messages with your own timer
To schedule a WhatsApp follow-up with HelloHop, run your own timer. Store a due time on each lead, select the leads that are due and have not replied, save each message under its own key, then send it with that key as the Idempotency-Key. HelloHop has no send-at field, sequence or scheduler.
Facts (as of October 2026, API v1)
- The send route has no schedule field. A timer you run (cron, a loop, n8n's Wait node or your CRM) decides when to call it.
- The unified POST
/v1/sessions/{channel}/messagesroute accepts an Idempotency-Key of up to 255 characters. Repeating the same key and body within 24 hours returns the first result without another send, with the response header Idempotent-Replayed: true. - A 504 send_unconfirmed, a timeout, a 409 idempotency_uncertain or a 503 with ambiguous true means the message may have gone out. Treat it as possibly delivered and look at the chat before you send it again.
- Build the key from the lead id and the step, for example lead-12-followup-1, so each step is sent once and a rerun of the timer finds the same row.
- The free sandbox channel allows 180 messages sent a day and 10 new chats a month, counted in Bangkok time. That is enough to build and test the whole flow before you pay.
Steps
- Store a due time. Save follow_up_at (Unix ms) and a follow-up count on each lead when you capture it.
- Select the due leads. On each tick, select leads with no reply, a stage that allows a follow-up, a count below your limit and a due time in the past.
- Advance and queue together. In one transaction, add one to the count, move the due time forward and insert the message row under its key.
- Send and record. Claim the row, send with the key as the Idempotency-Key, and record the result: sent, queued, unknown or failed. A retry goes back to pending with the time it is next due.
The due-rows query
This is the timer query from the lead pipeline page, written for SQLite. Run it every minute from cron or a loop. The count and the due time move in the same transaction that inserts the message row, so a tick that runs twice queues one message. On another database, replace INSERT OR IGNORE with its own form, such as ON CONFLICT DO NOTHING in PostgreSQL.
-- leads: id, phone, name, stage, replied (0 or 1), follow_ups, follow_up_at (Unix ms)
-- Due follow-ups: no reply yet, an open stage, under two follow-ups, due time passed, and the step before it sent or queued.
SELECT id, phone, name, follow_ups FROM leads
WHERE replied = 0 AND stage IN ('new_lead', 'contacted') AND follow_ups < 2 AND follow_up_at <= :now
AND EXISTS (SELECT 1 FROM sends WHERE key = 'lead-' || leads.id || '-' || CASE leads.follow_ups WHEN 0 THEN 'welcome' ELSE 'followup-' || leads.follow_ups END AND state IN ('sent', 'queued'));
-- For each row, in one transaction: advance the lead, then insert the message once.
UPDATE leads SET follow_ups = :n, follow_up_at = :next_due, stage = 'contacted'
WHERE id = :id AND follow_ups = :old_count AND replied = 0 AND stage IN ('new_lead', 'contacted');
-- Only when that UPDATE changed one row:
INSERT OR IGNORE INTO sends (key, lead_id, to_phone, body) VALUES ('lead-' || :id || '-followup-' || :n, :id, :phone, :text);What the timer does with each send result
| Send result | What your handler does |
|---|---|
| 200 server_ack | WhatsApp acknowledged the send. Mark it sent and save id; this is not a delivery receipt. |
| 202 queued | Persisted in the queue, not delivered. A channel that queues its sends (for example while accepted sends drain) answers every text send this way, with id, status queued, position and expires_at. Mark it queued and save id. Observe the result through webhooks without resending. |
| 429, or 503 with ambiguous false or code upstream_unavailable, hopsmart_settings_unavailable or operator_unresolved | Refused before sending. Honor Retry-After, keep the same key and body, and retry later. The Node helper waits at most 30 seconds before returning retry with a retryAt time, and the pages that keep a due time skip the row until then; the other Node timer pages retry on their next run. The Flask, Python reminder and PHP samples return the time to retry instead of waiting; the Sheets helper saves next_attempt_at and skips the row until then. |
| 504 send_unconfirmed, 409 idempotency_uncertain, 503 with ambiguous true, a timeout or a lost response | Possibly delivered. Mark it unknown and look at the chat before any resend. Never force a resend of an uncertain key with a new key. |
| 409 idempotency_conflict | The same key was used for a different message. Fix how you build the key. The first message is unchanged. |
| Any other 409 | Mark it failed. Fix the channel before scheduling another attempt. |
| Other 4xx | The request is wrong and a retry will not fix it. Log it and move on. |
Subscribe to message and message.status webhooks and verify their signatures. The result of a queued send arrives as a message event: match the saved response id to payload.id. message.status reports delivered or read for each id in payload.ids. A send held by HopSmart™ expires 72 hours after acceptance, and the 202 carries expires_at. If no event arrives, read the job with GET /hopsmart/jobs/{id}. Save event ids to deduplicate. Do not resend queued work while waiting for a result.
Timers in practice
Cron or a loop in your receiver is the simplest timer. In n8n, a Wait node holds an execution for a set time, and you check for a reply before the next send. A CRM workflow works too: let it call the send route with the same key rules. In every case the delay is kept on your side, because the send route has no field for a send time.
Questions
- Can I pass a send time to HelloHop?
- No. The send route has no schedule field. Your timer calls it when the message is due.
- How do I stop a follow-up after a reply?
- Set a replied flag on the lead when the message webhook arrives, and filter on it in the due-rows query.
- What if the timer runs twice?
- The count and due time move in one transaction with the insert of the message row, and the row key is unique, so a second run finds nothing due.
- What if a send times out?
- Treat it as possibly delivered, mark it unknown and look at the chat before any resend.
Free sandbox, forever. Upgrade when you're ready.
Start freeKeep going
HelloHop is an independent WhatsApp API for developers: send and receive messages, automate groups and communities, and get signed webhooks. Not affiliated with WhatsApp or Meta. You link your own number.