Webhook secret - Thread.Replied webhook

HI there!
I have created Nylas v3 application in Development environment. Inside my backend Azure function which is listening for thread.replied webhook events, I am checking the validity of incoming request using webhook secret. But somehow, this webhook secret expires by itself after a week or so.
I also listen for message.opened events and also the first thing I do is checking the validity of incoming request using the webhook secret. I have noticed that this webhook secret does not become invalid.
So how is that possible, that webhooksecret of thread.replied somehow expires and webhooksecret of message.opened do not?

Hi @matej.djurin - thanks for reaching out!

Let me take a look and circle back.

1 Like

Hey @matej.djurin, just want to clarify a few items, so

  1. thread.replied webhook events are failing as the webhook secret expires after a week. Are these secrets the default ones received from Nylas upon webhook creation? Do you happen to have any logs related to this that you can share?
  2. I assume for message.opened it is setup similarly to thread.replied? Same logic for webhook secret validation?

I’ll double check on Nylas webhook secrets being expired, but I’m not aware of them expiring [edit: after a week] to my knowledge.


My apologies for the confusion earlier. The issue isn’t with webhoosecrets. My mistake.

The actual problem is that we do not receive the thread.replied webhook event, even though the mail is sent correctly and quite quickly. The issue is not related to expiring secrets for the thread.replied webhook or the message.opened webhook. While message.opened events always come through, the thread.replied events sometimes do not come at all.
I doubt that the problem is in inactivity of our Azure function, since it is deployed and always running. Do Nylas has some retry logic, so maybe we can handle it?
Thank you very much!

@ram I just replied 3 times. At the start of the code in our Azure function, we are logging events before any logic is processed. After quite some time (around 4 minutes), we received only 2 events (2 events are logged). The event for the first reply message did not come at all.

Can we see if the event was sent from the Nylas app? If so, where and how can we check this?

Ok, I found a way to get messages sent via Nylas using this API call: https://api.eu.nylas.com/v3/grants/grantId/messages.

I found both the reply messages for which I received the webhook event and the one for which I didn’t receive it. There is no property in the message object that indicates something went wrong.

A few items to consider:

  • When creating a Nylas webhook, if you specify notification_email_addresses , we will send an email if the webhooks fail are not accepted (so we have retry logic)
    • This is the only logging we offer (email notifications of webhook failure to receive)
  • So for tracking emails webhooks to work, the messages must be sent via Nylas Email API
  • Consider this support post with possible solutions

Let me know if this helps clarifies what could be happening.

1 Like

I also considered that the problem may be in scopes. We use Custom Authentication. This are the scopes we are requesting from google:
https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/calendar openid https://mail.google.com/

And for example, this are the scopes returned from endpoint https://api.eu.nylas.com/v3/grants/{grantId} for a {grantId} of user which sent initial email through Nylas v3 and did not get all 3 thread.reply events (because there were 3 reply messages):
“grant_status”: “valid”,
“provider”: “google”,
“scope”: [

Are those scopes ok? Probably they are, becuase as said, we do get some thread.reply events for 1 initial message sent via Nylas v3 API, but some aren’t being received.

Hi @matej.djurin, the scopes for using the email API are in our developer docs, double check your provider configuration against this page.

Two follow ups:

  1. To clarify, is the thread.reply not working at all, or just sometimes? For the specific user, I do not see the email scopes as part of their grant.

  2. Also as a test, have you tried using our pre-configured sandbox environment to see if you receive the webhooks?