tawk.to webhooks in production: duplicates, ordering, retries and timeouts
This guide covers the problems tawk.to webhooks cause in production and how to handle each one. What tawk.to sends and how it works is on the tawk.to webhooks overview, the four events are on tawk.to webhook events, and signature verification code is on Verify tawk.to webhooks.
At a glance
| Problem | What to do | With Event Gateway |
|---|---|---|
| Timeouts | Return a 2xx within 30 seconds; process in a background job | Accepts the delivery at once, then queues it for your service |
| Duplicates | Deduplicate on X-Hook-Event-Id | Can drop repeats before they reach your handler |
| Ordering | Tie events together with the chat ID and compare time | Logs every event and attempt, so you can see arrival order when debugging |
| Retries | Fix outages inside 12 hours; expect no resend after that | Accepts deliveries while your service is down and replays them |
| Choosing events | Subscribe to what you handle; route on the event field | Filters and routes events by type |
| Testing | Forward to localhost and run real chats and tickets | Forwards to localhost and replays past events |
| Other limits | Plan for the webhook limit, no replay protection and personal data | Verifies the signature and fans one URL out to many services |
tawk.to webhook timeouts and slow handlers
Return a 2xx within 30 seconds, and do the work in a background job.
Why it happens: tawk.to waits 30 seconds for a response. If none arrives, the call counts as a failure and is retried, even if your handler later finishes the work.
Fix it in your handler:
- Verify the signature, store the raw body and return
200. - Process it in a worker. See why to process webhooks asynchronously.
- Keep calls to your CRM, ticketing system and other services out of the request path.
With Event Gateway: Hookdeck accepts each tawk.to delivery immediately, then queues it and delivers to your service at a rate it can handle. A slow handler doesn't cause tawk.to to retry.
Duplicate tawk.to webhooks
A retry repeats the event with the same X-Hook-Event-Id, so deduplicate on that header.
Why it happens: tawk.to retries after any non-2xx response or timeout, so a handler that did the work and then failed to respond in time gets the event again. tawk.to's own advice is to make sure your system can handle duplicate requests safely.
Fix it in your handler:
- Save each
X-Hook-Event-Idunder a unique constraint before you process the event, and skip any you've seen. See how to implement webhook idempotency. - If two webhooks subscribe to the same event, don't assume they share an event ID, because the docs don't say. Key side effects on
chatId,chat.idorticket.idas well.
With Event Gateway: Hookdeck's deduplication can drop repeated deliveries with the same X-Hook-Event-Id before they reach your service, and you choose the fields it compares.
Out-of-order tawk.to webhooks
tawk.to doesn't document delivery order, so don't build logic that needs chat:start to arrive before chat:end.
Why it happens: Nothing in the docs rules out a retried delivery arriving after a newer event, and the spacing between retries isn't published.
Fix it in your handler:
- Tie chat events together with
chatId, which ischat.idonchat:transcript_created. - Compare the
timefield, which holds when the event was generated, with the last one you applied to that chat. - Accept a
chat:endfor a chat you haven't seen, and create the record from itsvisitorandpropertyfields.
With Event Gateway: Hookdeck logs every event and delivery attempt, so you can see the order things arrived in while you debug. It doesn't put events back in order, so your handler still needs these checks.
tawk.to webhook retries
tawk.to retries for up to 12 hours, so an outage longer than that can lose events for good.
Why it happens: Anything other than a 2xx, or no response within 30 seconds, is retried. tawk.to doesn't publish the spacing between attempts, and its docs describe no attempts after the 12 hours and no way to resend an event.
Fix it in your handler:
- Monitor the endpoint so that outages are fixed well inside 12 hours.
- Return a non-
2xxonly when you want a retry. Acknowledge events you've chosen to ignore. - Don't count on a later event to make up for a lost one.
chat:transcript_createdis a webhook delivery too, so a long outage can lose it along withchat:end.
With Event Gateway: Hookdeck accepts deliveries while your service is down, retries to your service on a schedule you set, and lets you replay anything that failed, so tawk.to's 12 hours aren't what you depend on.
Choosing tawk.to events
Subscribe each webhook to the events it handles, and route on the body's event field, because no header names the event.
Why it happens: There are four events, and each covers less than its name might suggest. chat:start covers only the first message from a visitor or agent, whispers and system notifications such as triggers don't count, and no event is documented for later messages. chat:end has no messages. The conversation comes in chat:transcript_created, which tawk.to sends after 3 minutes of inactivity once all chats with the customer have ended. The two payloads with messages also describe senders differently: chat:start uses message.sender.type with agent, visitor or system, and the transcript uses sender.t with a, v or s.
Fix it in your handler:
- Use
chat:transcript_createdfor anything that needs the messages, such as archiving or analysis, and usechat:startfor alerts. - Switch on
event, and log and acknowledge anything you don't recognise, rather than returning an error that triggers retries. - If one receiver handles several properties, check
property.id, since webhooks are set up per property.
With Event Gateway: Hookdeck filters and routes events by the event field, so each one can go to the service that handles it.
Testing tawk.to webhooks
Point a webhook at your machine and run real chats and tickets through it.
Why it's awkward: tawk.to's docs describe no test button. Its examples are JavaScript object literals, with unquoted keys, single-quoted strings and one trailing comma, so they won't parse as JSON if you paste them into a test. They also differ from the field tables: the ticket:create example has a requester.type the table doesn't list, and the transcript sample in tawk.to's help center leaves out domain and referrer.
How to test:
- Forward deliveries to your machine with
hookdeck listen, and use the URL it prints as the webhook's endpoint. - Start a chat on a page with your widget, or create a ticket. tawk.to also suggests running a few test chats before you go live.
- For
chat:transcript_created, leave the chat inactive for 3 minutes. - Build fixtures from real deliveries, and treat any field the tables don't list as optional.
With Event Gateway: The CLI forwards events to localhost, and you can replay past events to your handler while you work on it, so you don't have to start another chat.
Other tawk.to limits
A few other things catch people out in production: the webhook limit, the lack of replay protection, and the personal data these payloads carry.
Why it happens: A property can have up to 10 webhooks, and the endpoint URL must support HTTPS. The signature covers only the body and no timestamp is sent, so a captured request still verifies if it's sent again. tawk.to publishes no source IP list. The visitor's email is optional, and transcripts can contain personal information and attachment URLs.
Fix it in your handler:
- Treat your record of
X-Hook-Event-Idvalues as your replay protection. - Match visitors to CRM records by email only when one is present. tawk.to's examples show a visitor name like
V1561719148780935, so don't assumenameis a real name. - Decide what you keep from each transcript, whether you fetch and store attachments, and who can read them.
With Event Gateway: Hookdeck verifies the signature, gives tawk.to one stable URL however your services change, and fans events out to as many destinations as you need, so you don't use up a property's 10 webhooks.
Conclusion
tawk.to gives you 30 seconds to respond and 12 hours of retries, with no documented way to resend after that. Return quickly, deduplicate on X-Hook-Event-Id, route on the event field, and use chat:transcript_created when you need the conversation.
Hookdeck Event Gateway sits in front of your receiver, verifies every tawk.to signature and holds each event until your service has processed it.
Get started with Hookdeck for free and handle tawk.to webhooks reliably in minutes.
Keep a long outage from losing your tawk.to events.
tawk.to retries for up to 12 hours and documents no way to resend. Hookdeck Event Gateway accepts each delivery, verifies its signature, queues it and retries to your service on your schedule, so you can replay anything that failed.