Skip to content
Talk to an Engineer Dashboard

Gmail

Gmail is Google's cloud based email service that allows you to access your messages from any computer or device with just a web browser.

Gmail is Google’s cloud based email service that allows you to access your messages from any computer or device with just a web browser.

Gmail logo

Supports authentication: OAuth 2.0

Register your Scalekit environment with the Gmail connector so Scalekit handles the authentication flow and token lifecycle for you. The connection name you create will be used to identify and invoke the connection programmatically. Then complete the configuration in your application as follows:

  1. Set up auth redirects

    • In Scalekit dashboard, go to Agent Auth → Create Connection.

    • Find Gmail from the list of providers and click Create.

    • Click Use your own credentials and copy the redirect URI. It looks like https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback.

      Configure Gmail Connection with redirect URI
    • Navigate to Google Cloud Console’s APIs & Services > Credentials

    • Select + Create Credentials, then OAuth client ID

    • Choose Web application from the Application type menu

      Selecting Web Application in Google OAuth
    • Under Authorized redirect URIs, click + Add URI, paste the redirect URI, and select Create.

      Adding Google redirect URI for OAuth
  2. Enable Gmail API

    • In Google Cloud Console, go to APIs & Services > Library

    • Search for “Gmail” in the API Library

    • Select Gmail API

      Choosing the Gmail API in the Google Cloud Console Dashboard
    • Press the blue Enable button

  3. Get client credentials

    Google provides your Client ID and Client Secret credentials after you create the OAuth client ID in step 1.

  4. Add credentials in Scalekit

    • In Scalekit dashboard, go to Agent Auth → Connections and open the connection you created.

    • Enter your credentials:

    • Click Save.

Fetch emails from a connected Gmail account using search filters. Requires a valid Gmail OAuth2 connection.

NameTypeRequiredDescription
formatstringNoFormat of the returned message.
include_spam_trashbooleanNoWhether to fetch emails from spam and trash folders
label_idsarray<string>NoGmail label IDs to filter messages
max_resultsintegerNoMaximum number of emails to fetch
page_tokenstringNoPage token for pagination
querystringNoSearch query string using Gmail’s search syntax (e.g., ‘is:unread from:user@example.com’)
schema_versionstringNoOptional schema version to use for tool execution
tool_versionstringNoOptional tool version to use for execution

Retrieve a specific attachment from a Gmail message using the message ID and attachment ID.

NameTypeRequiredDescription
attachment_idstringYesUnique Gmail attachment ID
file_namestringNoPreferred filename to use when saving/returning the attachment
message_idstringYesUnique Gmail message ID that contains the attachment
schema_versionstringNoOptional schema version to use for tool execution
tool_versionstringNoOptional tool version to use for execution

Fetch a list of contacts from the connected Gmail account. Supports pagination and field filtering.

NameTypeRequiredDescription
max_resultsintegerNoMaximum number of contacts to fetch
page_tokenstringNoToken to retrieve the next page of results
person_fieldsarray<string>NoFields to include for each person
schema_versionstringNoOptional schema version to use for tool execution
tool_versionstringNoOptional tool version to use for execution

Retrieve a specific Gmail message using its message ID. Optionally control the format of the returned data.

NameTypeRequiredDescription
formatstringNoFormat of the returned message.
message_idstringYesUnique Gmail message ID
schema_versionstringNoOptional schema version to use for tool execution
tool_versionstringNoOptional tool version to use for execution

List draft emails from a connected Gmail account. Requires a valid Gmail OAuth2 connection.

NameTypeRequiredDescription
max_resultsintegerNoMaximum number of drafts to fetch
page_tokenstringNoPage token for pagination
schema_versionstringNoOptional schema version to use for tool execution
tool_versionstringNoOptional tool version to use for execution

Search people or contacts in the connected Google account using a query. Requires a valid Google OAuth2 connection with People API scopes.

NameTypeRequiredDescription
other_contactsbooleanNoWhether to include people not in the user’s contacts (from ‘Other Contacts’).
page_sizeintegerNoMaximum number of people to return.
person_fieldsarray<string>NoFields to retrieve for each person.
querystringYesText query to search people (e.g., name, email address).
schema_versionstringNoOptional schema version to use for tool execution
tool_versionstringNoOptional tool version to use for execution