Only show these results:

Connect an account to Nylas

Before you can do anything with Nylas, you need to connect an account. when you have an account connected, you can make API requests for its data. For demo purposes, you should connect an account that has some email or calendar data (ideally both).

The Nylas Sandbox comes pre-configured with authentication connectors for Google, Microsoft, iCloud, and IMAP, so you can connect almost any email account for testing. This could be a personal account or a dedicated test account, as long as it has some data.

Connected accounts and Grants

To connect an account, you create a grant. A grant is a record of a specific user's account authenticating with their provider, and "granting" Nylas access to parts of the account's email inbox and calendar (represented by authentication "scopes"). A valid grant records a unique ID for the end user, the scopes that they granted during authentication, and some information about access tokens for the Grant.

In Nylas v3, grants replace the concept of connected accounts for API purposes, but you can use either term when talking about how Nylas works.

Create a grant

  1. From your Sandbox application, click Grants in the left navigation menu, then click Add test grant.
    The Grants page on the Nylas Dashboard without any grants.
  2. In the dialog that appears, enter the email address for the account that you want to test with, and click Add test grant. This starts a Hosted auth request with the account's provider. Nylas tries to detect the provider, and sends you to its login page (if one exists).
  3. Complete the authentication process and agree to grant Nylas the scopes used by the Sandbox. Make sure to Select all, then click Continue. (You can only use the Nylas APIs to access data you have granted access to, so don't skip this part!)

Nylas generates a grant ID for your account. You're connected!

The Grants page on the Nylas Dashboard, showing a newly-created grant.

After you authenticate your account, Nylas sends you back to the Grants page and displays the Grant ID for the account you connected. Copy it and keep it handy - You'll use this in API calls to tell Nylas which account's data to look at. (In the documentation code samples, you'd use this as the value for NYLAS_GRANT_ID.) You can always go back to the Grants page to find the Grant ID again.

Did you save the Grant ID? Great!! Let's see what you can do with it.