Gmail API
- URL
-
https://gmail.googleapis.com/gmail/v1 - Docs
- https://developers.google.com/workspace/gmail/api
Authorization: Bearer <credential> Create or select a Google Cloud project, enable the Gmail API, configure the OAuth consent screen, then create an OAuth client ID in Google Cloud Console Credentials. Google Workspace's Create access credentials guide covers creating the client, and Gmail's server-side authorization guide states Gmail API requests must be authorized with OAuth 2.0 credentials. Use the client to obtain user access tokens with the Gmail scopes you need from Choose Gmail API scopes.
Authorization: Bearer <credential> For server-to-server access, create a service account in Google Cloud Console Service Accounts, then use Google's service-account OAuth flow described in Using OAuth 2.0 for Server to Server Applications. For Gmail data, this is typically used with Google Workspace domain-wide delegation so the service account can impersonate users after an admin grants the required Gmail scopes.