Issue with Nylas API Authentication – Need Help!

Hey everyone,

I am having trouble with Nylas API authentication and I would really appreciate some help. I followed the documentation to set up OAuth for email integration but I keep getting an “Invalid Grant” error when trying to exchange the authorization code for an access token.

Here’s what I have done so far:

Created an app in the Nylas dashboard.
Set up OAuth redirect URL properly.
Received the authorization code successfully.
When I try to exchange it for an access token, I get the error.

Has anyone faced this issue before: ?? Am I missing something in the request headers or body: ?? Also, does Nylas require any specific permissions that I might have overlooked: ??

Any insights would be super helpful !!

Thanks in advance.

With Regards,
Marcelo Cissp

Hi @marcellosalas thanks for reaching out - few follow ups:

  1. Are you able to connect an account via the Dashboard using the add test grant functionality? This will help ensure everything is configured and working before trying to build out this functionality on the dashboard

  2. Consider taking a look at our Quickstart that have this functionality built out in GitHub code samples in different languages

  3. Can you share a screen shot where you see Invalid Grant, I assume this is on the dashboard or are you receiving an error response.