Skip to content

Manage contacts with Kotlin/Java

This page explains how to use the Nylas Kotlin/Java SDK and Contacts API to manage your end users’ contacts. For more information, see the Contacts documentation.

Before you begin

Before you start, you must have done the following tasks:

List contacts

This section walks through how to return information about an end user’s contacts, including their first and last names, email addresses, and IDs.

The following code snippets set a limit on the number of contacts Nylas returns: a maximum of 10.

Next, iterate through the list of Contact objects to get their first and last names, their primary email address, and their id. You can use the ids to modify contacts later.

For more information about the attributes a Contact object includes, see the Contacts references.

The examples below combine the previous steps to list the first 10 contacts in an end user’s account, and their details.

Create a contact

The following examples show how to create a contact and assign its values using the Nylas Kotlin/Java SDK. After you create a contact and save it to Nylas, Nylas syncs it to the end user’s provider.