Email Webhooks Suddenly Stopped Sending

Hi,

We just finished setting up our app last week, and we’re testing the webhook notifications. At first, we’re seeing some message.opened event in the logs, but since 3 days ago, it has suddenly stopped. Can anyone help me figure out what I should do to keep the webhook notifications sending events to us and log those events? Thanks.

As you can see from the screenshot below, we have been receiving webhooks until it stopped on July 12th. It’s already the 16th, and we have some emails sent since the 14th. By the way, those webhooks failed because we sent them to the wrong URL. The URL has been fixed after that. Thanks.

Welcome to the forums raffi! Based on your description, it sounds like your webhook was likely marked as failed due to the circuit breaker logic Nylas implements. When Nylas cannot deliver webhook notifications to the destination endpoint for 95% of webhooks over a 15-minute period, it marks the endpoint as failing but continues sending notifications. If Nylas cannot deliver 95% of webhook notifications to a failing endpoint over the next 72 hours, it marks the endpoint as failed and stops sending notifications to it.

Nylas does not automatically restart or reactivate failed webhooks. This gives you full control over when your webhook endpoint becomes active again, so you can verify that it’s working as expected before you restart normal webhook traffic.

Since you mentioned the webhook URL has been fixed, you need to manually reactivate your webhook. You can do this through the Nylas Dashboard or by using the Webhooks API.

To reactivate using the Webhooks API, make a PUT /v3/webhooks/<WEBHOOK_ID> request to update the status to active.

Keep in mind that reactivated webhooks don’t send notifications for events that occurred while they were marked as failed. This explains why you’re not seeing message.opened events for emails sent since July 14th.

For future reference, when a webhook’s state changes to either failing or failed, Nylas sends you an email notification about the change. You should add admin-webhook@notifications.nylas.com to your allowlist to ensure these notifications don’t end up in your spam folder.

Regarding message.opened events specifically, there are several reasons why you might not receive these notifications:

  • The email client reads text-based messages only and doesn’t accept HTML
  • The email client strips attachments and replaces them with literal HTML
  • The email client strips image files from HTML messages
  • The email client doesn’t allow image files to be downloaded

Hi Sam,

Thank you so much for your response. I really appreciate it. I followed your instructions, but unfortunately, it still didn’t work. Just to let you know, I ran this https://api.us.nylas.com/v3/webhooks and saw that the status is still active. Not failing or failed like what you mentioned above. I still ran https://api.us.nylas.com/v3/webhooks/v3/webhooks/{{webhook_id}} and passed

{
    "status": "active"
}

It didn’t do anything. I have managed to make it work though, by changing the route of our webhook URL from /nylas/webhooks/messages to /nylas/webhooks/messages2. The problem is, it only sent a notification once, 4 hours after I opened the email. I sent and opened another email today and am still waiting for the webhook notification. It has been an hour since. Is there anything else you can suggest I do to fix this? Thanks.

Also, I can confirm that this https://api.us.nylas.com/v3/webhooks/v3/webhooks/{{webhook_id}} is working because I tried to pause the webhook and run it. It did change the status from paused to active.