Nylas Manage Grants API

Grants are the main objects that power Nylas, because they _grant_ your Nylas application specific scopes of access (for example, permission to read email messages) to the user's resources and data on their provider. They also represent access granted to your application for certain resources. There are several ways to create grants: - Using [Hosted OAuth and an API key](/docs/v3/auth/hosted-oauth-apikey/). - Using [Hosted OAuth and an access token](/docs/v3/auth/hosted-oauth-accesstoken/), with [optional PKCE](/docs/v3/auth/hosted-oauth-accesstoken/#create-grants-with-oauth-2.0-and-pkce) for additional security. - Using [Bring Your Own Authentication](/docs/v3/auth/custom/). - Using a special [bulk auth grant](/docs/v3/auth/bulk-auth-grants/) (also called a "service account"). You can re-authenticate grants using any of these methods, and Nylas handles all the re-authentication logic internally. ## Grant expiry Grants, and their access tokens and refresh tokens are controlled by the provider, not Nylas. Nylas can request that the provider invalidate or revoke a grant, but can't prevent the provider from expiring a grant. Usually when a provider expires a grant it is after a period of inactivity, and the provider expires the associated access token for security reasons. To prevent grants from expiring, encourage users to actively engage with their accounts and regularly refresh the access token with a valid refresh token. ## Re-authentication and notifications Grants can become invalid for many reasons (for example, the user changing their password). When a grant becomes invalid, the user must re-authenticate to access your application. When a grant becomes invalid, Nylas loses access to the affected user's data and stops sending notifications about changes to its objects. When the user re-authenticates, Nylas looks at when their grant last authenticated successfully. If it was less than 72 hours ago, Nylas looks for any changes that happened since the last successful sync and sends you notifications about those events. This can be _a lot_ of notifications. If the grant was out of service for more than 72 hours, Nylas doesn't send backfill notifications. When this happens, look for the `grant.expired` and `grant.updated` notifications and query the Nylas APIs for objects that changed between those timestamps. ⚠️ If message tracking events occur while a grant is out of service for more than 72 hours, you cannot backfill the notifications. This includes message.opened, message.link_clicked, and thread.replied notifications. ## Grant limitations When working with grants, keep the following limitations in mind: - You can re-authenticate a grant to add new scopes, remove scopes, or extend its expiry date. - Each grant belongs to a specific Nylas connector (because they come from a specific provider), in a specific Nylas application. A grant cannot be associated with multiple connectors or applications. - Grants expire after a pre-defined period of time. When this happens, they must be re-authenticated. ## Grant notifications You can subscribe to the following triggers so Nylas notifies you about changes to your users' data: - `grant.created` - `grant.updated` - `grant.deleted` - `grant.expired` For more information, see the [Grant notification schemas](/docs/reference/notifications/#grant-notifications).

Operations 10

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

POST /v3/connect/custom Create a grant from my own OAuth refresh token · Bring Your Own Authentication #
Ask an LLM
“If I run the OAuth flow myself, how do I connect a user's account with their refresh token?”
“Can I migrate existing users by handing over tokens instead of re-authenticating them?”
Tell an agent
Create a grant using Bring Your Own Authentication.
Connect this user's account with the refresh token from my own OAuth flow.
GET /v3/grants List connected user accounts (grants) · Return all grants #
Ask an LLM
“How do I list every user account connected to my application?”
“Can I find grants that are invalid and need re-authentication?”
Tell an agent
List grants with status {grant_status}.
Find the grant for {email}.
GET /v3/grants/{grantId} Look up one connected account · Get a grant #
Ask an LLM
“How can I tell whether a specific user's grant has expired?”
“Can I see the email aliases on a particular grant?”
Tell an agent
Get grant {grantId}.
Check the status of connected account {grantId}.
PATCH /v3/grants/{grantId} Rotate a grant's refresh token or scopes · Update a grant #
Ask an LLM
“Can I store a new refresh token on a grant without recreating it?”
“Does updating a grant's scope list change what the provider actually allows?”
Tell an agent
Replace the settings on grant {grantId} with {settings}.
Update the stored scopes on grant {grantId} to {scope}.
DELETE /v3/grants/{grantId} Disconnect a user's account (delete grant) · Delete a grant #
Ask an LLM
“What happens if I delete a grant and the user later signs in again?”
“How do I disconnect a user's email account from my app?”
Tell an agent destructive · confirm first
Delete grant {grantId}.
Disconnect user account {grantId} from my application.
GET /v3/grants/{grant_id}/settings Get grant settings #
GET /v3/grants/{grant_id}/settings/{setting_name} Get a grant setting #
PUT /v3/grants/{grant_id}/settings/{setting_name} Create or replace a grant setting #
DELETE /v3/grants/{grant_id}/settings/{setting_name} Delete a grant setting #
GET /v3/grants/me Identify the grant behind my access token · Get current grant #
Ask an LLM
“Which grant does the access token I'm using belong to?”
“Can I look up the current user's grant without knowing its ID?”
Tell an agent
Show the grant for my current access token.
Tell me which connected account this token represents.

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-manage-grants-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-manage-grants-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nylas Manage Grants 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 (75 KB total) ---
# Full source: https://artifacts.apis.io/nylas/openapi/nylas-manage-grants-api-openapi.yml