PATCH
https://api.us.nylas.com/v3/grants/{grantId}Update a grant
Updates the specified grant's provider settings or scope data.
Common use cases:
- Rotate a refresh token — If you obtain a new
refresh_tokenfrom a provider (for example, after a user re-consents in your own OAuth flow), you can update the grant's stored token without deleting and recreating the grant. Pass the new token insettings.refresh_token. - Update provider settings — For non-OAuth providers such as iCloud and IMAP, you can update the credentials and connection settings stored for the grant.
Omitted top-level fields remain unchanged. Nylas does not deep merge a non-empty settings object
with the grant's stored settings. Include all provider-required fields for the settings update. An empty
settings object is accepted as a no-op. For more information, see
Updating objects.
scopeA list of OAuth scopes to validate for the grant update. When Nylas can read the authoritative scopes from the stored provider grant, it stores and returns those provider-granted scopes instead of the values in this array. This field cannot grant or revoke provider permissions. To change provider permissions, the user must re-authenticate through the provider's OAuth consent flow.