Skip to content

Shared credential guides

Google service accounts

Set up Google service accounts with domain-wide delegation for Gmail, Sheets, Drive, Calendar, and other Google services

Google service accounts can access shared resources directly or impersonate a Google Workspace user through domain-wide delegation. This guide covers the JSON key, required APIs, delegation scopes, and credential setup in Sim.

For example, you could build a workflow that iterates through a list of employees, impersonates each one to read their Google Docs, and uploads the contents to a shared knowledge base — all without requiring any of those users to sign in.

Prerequisites

Create the service account and enable its APIs in Google Cloud. Configure the Google Workspace Admin Console only when using domain-wide delegation.

1. Create a service account in Google Cloud

  1. Go to the Google Cloud Console and select your project (or create one)

  2. Navigate to IAM & Admin → Service Accounts

  3. Click Create Service Account, give it a name and description, then click Create and Continue

  4. Skip the optional role and user access steps and click Done

  5. Click on the newly created service account, go to the Keys tab, and click Add Key → Create new key

  6. Select JSON as the key type and click Create. A JSON key file will download — keep this safe

2. Enable the required APIs

In the Google Cloud Console, go to APIs & Services → Library and enable the APIs for the services your workflows will use. See the scopes reference below for the full list of APIs by service.

3. Set up domain-wide delegation

  1. In the Google Cloud Console, go to IAM & Admin → Service Accounts, click on your service account, and copy the Client ID (the numeric ID, not the email)

  2. Open the Google Workspace Admin Console and navigate to Security → Access and data control → API controls

  3. Click Manage Domain Wide Delegation, then click Add new

  4. Paste the Client ID from your service account, then add the OAuth scopes for the services your workflows need. Copy the full scope URLs from the scopes reference below — only authorize scopes for services you plan to use.

  5. Click Authorize

Domain-wide delegation requires a Google Workspace super administrator. Send that administrator the Client ID and required scopes. Changes can take up to 24 hours to propagate.

Scopes reference

The table below lists the Google Workspace and BigQuery services covered by this guide, the API to enable in Google Cloud Console, and the delegation scopes to authorize. Copy the scope string for each service you need and paste it into the Google Workspace Admin Console.

ServiceAPI to EnableDelegation Scopes
GmailGmail APIhttps://www.googleapis.com/auth/gmail.send
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.labels
Google SheetsGoogle Sheets API, Google Drive APIhttps://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
Google DriveGoogle Drive APIhttps://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
Google DocsGoogle Docs API, Google Drive APIhttps://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
Google SlidesGoogle Slides API, Google Drive APIhttps://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
Google FormsGoogle Forms API, Google Drive APIhttps://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/forms.body
https://www.googleapis.com/auth/forms.responses.readonly
Google CalendarGoogle Calendar APIhttps://www.googleapis.com/auth/calendar
Google ContactsPeople APIhttps://www.googleapis.com/auth/contacts
BigQueryBigQuery APIhttps://www.googleapis.com/auth/bigquery
Google TasksTasks APIhttps://www.googleapis.com/auth/tasks
Google VaultVault API, Cloud Storage APIhttps://www.googleapis.com/auth/ediscovery
https://www.googleapis.com/auth/devstorage.read_only
Google GroupsAdmin SDK APIhttps://www.googleapis.com/auth/admin.directory.group
https://www.googleapis.com/auth/admin.directory.group.member
Google MeetGoogle Meet APIhttps://www.googleapis.com/auth/meetings.space.created
https://www.googleapis.com/auth/meetings.space.readonly

The Google Groups entry covers Directory API actions. Get Settings and Update Settings require the Groups Settings API and its https://www.googleapis.com/auth/apps.groups.settings scope, which Sim's current Google Groups scope list does not request. See the Google Groups reference for this compatibility limit.

You only need to enable APIs and authorize scopes for the services you plan to use. When authorizing multiple services, combine their scope strings with commas into a single entry in the Admin Console.

Add the service account to Sim

Once Google Cloud and Workspace are configured, add the service account as a credential in Sim.

  1. Open Integrations from your workspace sidebar

  2. Search for "Google Drive" and open it, or use another Google integration that supports service-account credentials. Click Add to Sim and choose Add service account

  3. Paste the full contents into JSON key, or use Or upload a file to select the JSON key file.

  4. Give the credential a display name (the service account email is used by default)

  5. Click Add service account

The JSON key file is validated for the required fields (type, client_email, private_key, project_id) and encrypted before being stored.

Use delegated access in workflows

When you use a Google block (Gmail, Sheets, Drive, etc.) in a workflow and select a service account credential, an Impersonated Account field appears below the credential selector.

Enter the email address of the Google Workspace user you want the service account to act as. For example, if you enter alice@yourcompany.com, the workflow will send emails from Alice's account, read her spreadsheets, or access her calendar — depending on the scopes you authorized.

Shared access and key rotation

Leave Impersonated Account blank to authenticate as the service account itself. Share supported resources, such as a Sheet, with its service-account email. This does not grant access to a user’s Gmail. A Google Cloud IAM role alone does not grant access to Google Workspace files or mailbox data.

Domain-wide delegation requires a Google Workspace super administrator. It authorizes impersonation within that Workspace domain, subject to the authorized scopes and the impersonated user’s access. Consumer Gmail accounts and users outside that domain cannot be impersonated. Access also depends on the license required by the target service. See Google’s service-account authorization guide.

A credential can serve multiple supported Google services when their APIs and scopes are configured. To rotate its key, create a replacement JSON key, update the credential in Sim, verify access, then delete the old key in Google Cloud.

Was this helpful?
Suggest an edit