Skip to main content

How to set up a service account?

This guide will help you integrate Google Workspace with Folderly using a service account for automated mailbox management.

Max Olkhovskyi avatar
Written by Max Olkhovskyi
Updated over a week ago

This feature is available only for adding mailboxes to Folderly. Inbox Insights and Pulse are not supported yet.

Step 1: Access Google Cloud console

  1. Select an existing project or create a new one dedicated to Folderly integration.


Step 2: Enable required APIs

  1. In the Google Cloud Console, navigate to APIs & Services > Library.

  2. Search for Gmail API, select it, and click Enable.

  3. Repeat the same process for the Admin SDK API.

These APIs allow Folderly to interact with Gmail and your user directory.


Step 3: Create a service account

  1. Go to IAM & Admin.

  2. Then select Service Accounts.

  3. Click Create Service Account.

  4. Enter a service account name, such as "folderly-integration".

  5. Click Create and Continue.


Step 4: Assign project roles

  1. In the "Grant this service account access to the project" section, add the Viewer role.

  2. Click Continue, then Done.


Step 5: Enable domain-wide delegation

  1. Click on the newly created service account from the Service Accounts page to open its details.

  2. Click Show Advanced Settings and check the Domain-wide Delegation section, then copy the Client ID shown.

  3. Go to the Google Admin Console, then navigate to Security > Access and Data Control > API Controls. Under Domain-wide Delegation, click Manage Domain-Wide Delegation.

  4. Click Add New and enter the copied Client ID. In the OAuth Scopes field, enter the following scopes:

    https://mail.google.com/,https://www.googleapis.com/auth/admin.directory.user

4. Click Authorize.

This authorizes the service account to act on behalf of users within your domain.


Step 6: Generate and download a JSON Key

  1. Return to IAM & Admin > Service Accounts.

  2. Click the email address of your newly created service account.

  3. Go to the Keys tab.

  4. Click Add Key > Create new key.

  5. Select JSON as the key type and click Create.

The JSON key file will automatically download to your device.


Step 7: Share the service account key

  1. Locate the downloaded JSON file. It typically looks like: @<project-id>.iam.gserviceaccount.com

  2. Send this file securely to your Folderly point of contact.


Step 8: Testing and confirmation

Once we receive the JSON key, our team will test the configuration and confirm that mailbox connection and delegation are functioning properly. You will receive a confirmation once setup is complete.


Security Notice

  • Please don't share your service account key publicly.

  • Use only secure methods to transmit the key file.

  • You can revoke access at any time by deleting the key in the Google Cloud Console.

  • If you need more help, please get in touch with the Folderly Customer Success team.

Did this answer your question?