# Issue with Nylas API Authentication – Need Help!

**URL:** <https://forums.nylas.com/t/issue-with-nylas-api-authentication-need-help/621>\
**Category:** Question and Answers\
**Created:** [January 29, 2025, 11:57am UTC](https://forums.nylas.com/t/issue-with-nylas-api-authentication-need-help/621 "2025-01-29T11:57:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcellosalas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.nylas.com/marcellosalas/32/254_2.png) [@marcellosalas](https://forums.nylas.com/u/marcellosalas)\
**Post date:** [January 29, 2025, 11:57am UTC](https://forums.nylas.com/t/issue-with-nylas-api-authentication-need-help/621/1 "2025-01-29T11:57:47Z")

</div>

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](https://forums.nylas.com/u/marcellosalas/) [Cissp](https://www.igmguru.com/cyber-security/cissp-certification-training)

---

<div class="post-metadata">

**Author:** ![ram](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.nylas.com/ram/32/3_2.png) [@ram](https://forums.nylas.com/u/ram)\
**Post date:** [January 29, 2025, 9:00pm UTC](https://forums.nylas.com/t/issue-with-nylas-api-authentication-need-help/621/2 "2025-01-29T21:00:02Z")

</div>

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](https://developer.nylas.com/docs/v3/getting-started/quickstart/#email-api) 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.
