The official Kotlin & Java SDK for Nylas β the infrastructure that powers communications
π SDK Guide Β· π API Reference Β· π Sign up Β· π‘ Samples Β· π¬ Forum
The official Kotlin & Java SDK for Nylas β the infrastructure that powers communications. Integrate with Gmail, Microsoft, IMAP, Zoom, and 250+ email, calendar, and meeting providers in 5 minutes. Covers Email, Calendar, Contacts, Scheduler, Notetaker, and Agent Accounts.
This repository is for contributors and anyone installing the SDK from source. If you just want to use the SDK in your app, head straight to the Kotlin & Java SDK guide on developer.nylas.com.
-
Follow the getting started guide to create an application and provision your first API key.
-
Bootstrap a project with the Nylas CLI:
brew install nylas/nylas-cli/nylas nylas init
Requirements: Java 8 or later. Kotlin 1.8 or later.
Kotlin DSL (build.gradle.kts):
implementation("com.nylas.sdk:nylas:2.15.1")Groovy (build.gradle):
implementation 'com.nylas.sdk:nylas:2.15.1'<dependency>
<groupId>com.nylas.sdk</groupId>
<artifactId>nylas</artifactId>
<version>2.15.1</version>
</dependency>git clone https://github.com/nylas/nylas-java.git
cd nylas-java
./gradlew build uberJarThis produces build/libs/nylas-java-sdk-<version>-uber.jar.
Initialize the client with your API key:
import com.nylas.NylasClient;
import com.nylas.models.Calendar;
import com.nylas.models.ListResponse;
NylasClient nylas = new NylasClient.Builder("NYLAS_API_KEY").build();
ListResponse<Calendar> calendars = nylas.calendars().list("GRANT_ID");For step-by-step walkthroughs, see the developer guides:
- Send and receive email
- Read and manage calendar events
- Find available meeting times with Scheduler
- Capture meeting notes with Notetaker
- Manage Agent Accounts
- Subscribe to webhooks and notifications
- Choose a data residency region
Nylas API errors extend AbstractNylasApiError (e.g. NylasApiError, NylasOAuthError). SDK-side errors extend AbstractNylasSdkError (e.g. NylasSdkTimeoutError, NylasSdkRemoteClosedError).
import com.nylas.models.AbstractNylasApiError;
import com.nylas.models.AbstractNylasSdkError;
import com.nylas.models.NylasApiError;
try {
nylas.calendars().list("GRANT_ID");
} catch (NylasApiError e) {
System.err.println("API error " + e.getStatusCode() + ": " + e.getMessage());
System.err.println("Request ID: " + e.getRequestId());
} catch (AbstractNylasSdkError e) {
System.err.println("SDK error: " + e.getMessage());
}The SDK uses SLF4J. The HTTP client exposes three DEBUG-level loggers:
com.nylas.http.Summaryβ one line per request/response (method, URI, status, size, duration)com.nylas.http.Headersβ request/response headers (Authorization redacted by default)com.nylas.http.Bodyβ request/response bodies (first 10 kB by default)
Enable them with your logging framework, e.g. log4j2:
<Logger name="com.nylas" level="DEBUG"/>Customize redaction and body-size limits by passing your own HttpLoggingInterceptor to NylasClient.Builder.
Runnable Java and Kotlin examples live in examples/ (folders, events, messages, large attachments, Notetaker). For full apps, browse Java repos in nylas-samples.
nylas/skills drops Nylas into Claude Code, Cursor, Codex, and other agents that support the skills format:
npx skills add nylas/skills
/plugin marketplace add nylas/skills # Claude CodeThe CLI also installs an MCP server for Claude Desktop, Claude Code, Cursor, Windsurf, or VS Code:
brew install nylas/nylas-cli/nylas
nylas mcp installWalkthrough: give AI agents email access via MCP.
- Kotlin & Java SDK guide
- API reference
- Getting started
- Javadoc / Dokka SDK reference
- Data residency
- Nylas CLI
- Dashboard
See CHANGELOG.md for release notes and UPGRADE.md for migration instructions between major versions.
We welcome questions, bug reports, and pull requests. See Contributing.md for how to get involved, or ask in the Nylas forum.
Found a security issue? Please follow the Nylas vulnerability disclosure policy instead of opening a public issue.
This project is licensed under the terms of the MIT license.