Nylas Authentication APIs API

Nylas provides two ways to handle authentication: - **Bring Your Own (BYO) Authentication**, which uses the [`/v3/connect/custom` endpoint](/docs/reference/api/manage-grants/byo_auth/). In BYO Authentication, you already have refresh tokens for your users, and you just need to create grants for them in Nylas. This endpoint is also used for [virtual calendars](/docs/v3/calendar/virtual-calendars/), [IMAP auth](/docs/v3/auth/imap/), and [bulk auth grants](/docs/v3/auth/bulk-auth-grants/). - **Hosted OAuth**, where the user completes an OAuth process on the provider, and the provider returns an access token. Depending on your needs, you can use either the user's access token or a Nylas API key to authorize requests after you complete the OAuth flow. See the [Authentication documentation](/docs/v3/auth/) for more information. ## Hosted authentication with OAuth OAuth is the modern industry-standard protocol for authorization, and is used by major technology companies like Google, Apple, Microsoft, and others. Nylas supports authentication using the [OAuth 2.0 protocol](https://oauth.net/2/) and an additional option to use PKCE for extra security. [PKCE is an extension of the OAuth 2.0 protocol](https://oauth.net/2/pkce/) that prevents authorization code interception attacks, and makes OAuth 2.0 more secure on mobile devices and client-side applications. During the OAuth 2.0 authentication flow, the user provides the account that they want to authenticate to Nylas, and they're prompted to allow your application's "scopes" (for example, `https://www.googleapis.com/auth/gmail.readonly` or `https://www.googleapis.com/auth/userinfo.profile`). Nylas always returns the fully-qualified Google scopes when you make an Authentication request that references a Google grant. For grants authenticated with other providers, Nylas returns the truncated scopes. ### Using Hosted OAuth To use Hosted OAuth you first need to create a Nylas application in the Nylas Dashboard, then create a [connector](/docs/reference/api/connectors-integrations/) in that application for each authentication provider. This allows Nylas to get and store each provider's settings, and configure a set of default scopes to apply. Nylas can detect which provider a user is authenticating with and redirect them to the correct provider's authentication system. If the user decides to choose different provider settings for an OAuth 2.0 authorization protocol, Nylas allows them to override the default provider connector's settings. A successful OAuth authorization results in a [grant](/docs/reference/api/manage-grants/) with the scopes that the user allowed. See [Create grants with OAuth 2.0 and PKCE](/docs/v3/auth/hosted-oauth-accesstoken/#create-grants-with-oauth-2.0-and-pkce) for more information. ### Adding the "Sign in with Google" button Your Google provider auth app must have a "Sign in with Google" button that meets [Google's branding guidelines](https://developers.google.com/identity/branding-guidelines). This applies to the OAuth flow for both personal Gmail (`@gmail.com`) and Workspace email addresses. For Hosted authentication, Nylas recommends you do one of the following: - Configure the OAuth login prompt by setting the `prompt` parameter with `select_provider` or `detect,select_provider`. For more information, see [Configure the OAuth login prompt](/docs/v3/auth/customize-login-prompt/). ⚠️ If you add a login_hint that is a personal Gmail or Workspace email address, and you don't configure a prompt during the Hosted auth flow, the user is directed immediately to the Google OAuth page without clicking the "Sign in with Google" button. This can result in delays or failure in verification. - Use the pre-approved "Sign in with Google" button along with the "Connect your account" button (or other provider login buttons) in your application. For more information, see Google's official [Sign in with Google branding guidelines](https://developers.google.com/identity/branding-guidelines). For Bring Your Own Authentication, use the pre-approved "Sign in with Google" button along with the "Connect your account" button (or other provider login buttons) in your application. Learn more about [Google verification and security assessment](/docs/provider-guides/google/google-verification-security-assessment-guide/).

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /v3/connect/auth Start a hosted OAuth authorization · Hosted OAuth - Authorization Request #
Ask an LLM
“How do I send a user to Nylas to connect their email account?”
“Can I prefill the user's email address on the hosted login page?”
Tell an agent
Start hosted OAuth for client {client_id} redirecting to {redirect_uri} with response type {response_type}.
Build a hosted login URL for {client_id} back to {redirect_uri}, response {response_type}, prefilled with {login_hint}.
POST /v3/connect/token Exchange an OAuth code or refresh token · Hosted OAuth - Token exchange #
Ask an LLM
“How do I trade the authorization code from hosted auth for an access token?”
“Can I use a refresh token to get a new access token?”
Tell an agent
Exchange the authorization code from hosted OAuth for tokens.
Refresh my access token using the refresh token grant.
POST /v3/connect/revoke Revoke an OAuth access token · Hosted OAuth - Revoke OAuth token #
Ask an LLM
“Does revoking an access token also revoke the user's grant?”
“How do I invalidate a leaked access token?”
Tell an agent destructive · confirm first
Revoke access token {token}.
Invalidate OAuth token {token} right away.
GET /v3/connect/tokeninfo Inspect an OAuth token · OAuth Token Info #
Ask an LLM
“What grant and scopes does a given access token belong to?”
“Can I decode an ID token to see who it was issued for?”
Tell an agent
Show info for access token {access_token}.
Inspect ID token {id_token}.
POST /v3/connect/custom Create a grant with your own OAuth tokens · Bring Your Own Authentication #
Ask an LLM
“Can I create a grant from a refresh token I already obtained myself?”
“How do I migrate existing users without sending them through hosted auth again?”
Tell an agent
Create a grant using my own OAuth refresh token.
Register a grant through Bring Your Own Authentication.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/nylas:nylas-authentication-apis-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

nylas-authentication-apis-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nylas Authentication APIs API
  version: v3
  summary: The complete Nylas v3 API — Email, Calendar, Contacts, Notetaker, Scheduling, Administration, and Migration.
  description: The Nylas API is designed using the REST ideology to provide simple and predictable URIs to access and modify objects. Requests support standard HTTP methods like `GET`, `PUT`, `POST`, and `DELETE`, and standard status codes. Response bodies are always UTF-8 encoded JSON objects, unless explicitly documented otherwise. You can use the Nylas Postman collection to quickly start using the Nylas APIs. For more information, check out the Nylas Postman collection documentation.
  contact:
    url: https://www.nylas.com/
servers:
- url: https://api.us.nylas.com
  description: U.S.
- url: https://api.eu.nylas.com
  description: E.U.
security:
- ACCESS_TOKEN: []
- NYLAS_API_KEY: []
tags:


# --- truncated at 32 KB (80 KB total) ---
# Full source: https://artifacts.apis.io/nylas/openapi/nylas-authentication-apis-api-openapi.yml