https://api.us.nylas.com/v3/grants/{grantId}Update a grant
Updates the specified grant's display name, provider settings, scope data, or workspace.
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.
- Rename an Agent Account — Set
nameto change the defaultFromname on messages the account sends.
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.
Works with an API key or an IAM API key with the grants.update permission.
nameThe display name stored on the grant. An Agent Account uses it
as the From name on messages that don't set from and on calendar invitations. The next
message uses the new name. An empty string isn't accepted.
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.
workspace_idThe ID of the workspace to move the grant to. The
workspace must belong to the same application as the grant. The workspace's domain doesn't
need to match the grant's email domain. Omit the field to leave the grant's workspace unchanged. This
field can't remove a grant from its workspace. Use remove_grants on the
Update workspace assignments
endpoint instead.