Skip to content
Skip to main content

Quickstart: Contacts API

Last updated:

The Nylas Contacts API gives you access to a user’s address book across Google, Microsoft, EWS, hosted IMAP, native iCloud, and native Yahoo grants through one API. Native iCloud and Yahoo grants use CardDAV for the default address_book source; generic hosted IMAP grants keep their existing Contact behavior.

This quickstart walks you through listing, searching, and creating contacts on behalf of a connected user.

You need two things from Nylas to make API calls:

  1. An API key — authenticates your application. You’ll pass it as a Bearer token.
  2. A grant ID — identifies which user’s contacts to access. You get one when you connect an account to Nylas.

If you don’t have these yet, follow one of the setup guides first:

Then install the Nylas SDK for your language:

For Java and Kotlin, see the Kotlin/Java SDK setup guide.

Retrieve contacts from a user’s address book. Replace <NYLAS_GRANT_ID> and <NYLAS_API_KEY> with your values.

Find contacts by email address. Useful for looking up a sender’s details before replying, or checking if a contact exists before creating one.

Add a new contact to a user’s address book.