Google gmail api scopres

The Google Gmail API scopes!

The Gmail API uses OAuth 2.0 to authenticate and authorize access to a user's Gmail account. To use the Gmail API, you need to specify the scopes that your application requires. Here are the available scopes for the Gmail API:

Read-only scopes

  1. https://mail.google.com/: This scope allows your application to read the user's Gmail messages, labels, and settings.
  2. https://mail.google.com/mail/feed/: This scope allows your application to read the user's Gmail messages, but only the messages that are visible in the user's inbox.

Read-write scopes

  1. https://mail.google.com/: This scope allows your application to read and write the user's Gmail messages, labels, and settings.
  2. https://mail.google.com/mail/feed/: This scope allows your application to read and write the user's Gmail messages, but only the messages that are visible in the user's inbox.

Additional scopes

  1. https://www.googleapis.com/auth/gmail.modify: This scope allows your application to modify the user's Gmail messages, labels, and settings.
  2. https://www.googleapis.com/auth/gmail.compose: This scope allows your application to compose new emails on behalf of the user.
  3. https://www.googleapis.com/auth/gmail.labels: This scope allows your application to create, update, and delete labels in the user's Gmail account.
  4. https://www.googleapis.com/auth/gmail.settings.basic: This scope allows your application to read and write basic settings in the user's Gmail account, such as the default reply-to address.
  5. https://www.googleapis.com/auth/gmail.settings.sharing: This scope allows your application to read and write sharing settings in the user's Gmail account, such as who can view the user's emails.

When requesting access to the Gmail API, you need to specify the scopes that your application requires. You can do this by adding the scope parameter to your OAuth 2.0 authorization request. For example:

https://accounts.google.com/o/oauth2/v2/auth?
  client_id=YOUR_CLIENT_ID&
  redirect_uri=YOUR_REDIRECT_URI&
  scope=https://mail.google.com/&
  response_type=code&
  state=STATE

In this example, the scope parameter specifies that the application requires access to the user's Gmail account, with read-only permissions.

Remember to always handle the user's consent and authorization carefully, and to only request the minimum set of scopes necessary for your application to function.