> ## Documentation Index
> Fetch the complete documentation index at: https://nango.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Service Account - How do I link my account?

# Overview

To authenticate with Google Service Account, you need:

1. **Service Account Email Address** – The unique email assigned to your service account.
2. **Private Key** – The private key generated when creating a service account key.
3. **Scopes** – A space-separated list of Google API scopes that your application should have access to.
4. **Delegated Access Email Address (optional)** – The user’s email address that the service account should impersonate when domain-wide delegation is [enabled](#step-3-delegate-domain-wide-authority-optional-for-google-workspace).

This guide will walk you through creating and obtaining your **Service Account credentials** in Google Cloud.

### Prerequisites

* If you don’t already have one, sign up for a [Google Cloud account](https://console.cloud.google.com/).

### Instructions

#### Step 1: Create a Service Account

1. Go to the [Service Accounts page](https://console.cloud.google.com/iam-admin/serviceaccounts).
2. Select an existing project, or create a new one.

<img src="https://mintcdn.com/nango/l5TZwDYs4PA8hcOI/integrations/all/google-service-account/projects.png?fit=max&auto=format&n=l5TZwDYs4PA8hcOI&q=85&s=feb0af474581a7357ae017e889e2bb47" width="1920" height="700" data-path="integrations/all/google-service-account/projects.png" />

3. Click **+ Create Service Account**.

<img src="https://mintcdn.com/nango/l5TZwDYs4PA8hcOI/integrations/all/google-service-account/create_service_account.png?fit=max&auto=format&n=l5TZwDYs4PA8hcOI&q=85&s=b23418824c682f529f5e17cda8d5cd5a" width="1920" height="700" data-path="integrations/all/google-service-account/create_service_account.png" />

4. Fill in all the required information, then click **Create and continue**.
5. (Optional) Assign **Permissions** and **Principals with access**.
6. Click **Done**.
7. From your **Service accounts** list, you can obtain your **Service Account Email Address** in the **Email** column.

<img src="https://mintcdn.com/nango/l5TZwDYs4PA8hcOI/integrations/all/google-service-account/emails.png?fit=max&auto=format&n=l5TZwDYs4PA8hcOI&q=85&s=010fdc14c798e5822c1261ac99661475" width="1916" height="679" data-path="integrations/all/google-service-account/emails.png" />

#### Step 2: Generate a Service Account Key

1. From the Service accounts page, click the **Email** address of the service account you created.
2. Navigate to the **Keys** tab.
3. Click **Add key** → **Create new key**.

<img src="https://mintcdn.com/nango/l5TZwDYs4PA8hcOI/integrations/all/google-service-account/create_key.png?fit=max&auto=format&n=l5TZwDYs4PA8hcOI&q=85&s=1c50033d2cf0b8b8455b19eab7e93f36" width="1920" height="700" data-path="integrations/all/google-service-account/create_key.png" />

4. Select **JSON** format and click **Create**.
5. A `.json` key file will be downloaded to your machine. Store it securely — this file contains your **Private Key**.

<Note> ⚠️ Google does not keep a copy of the private key. If you lose it, you’ll need to generate a new one. </Note>

#### Step 3: Delegate Domain-Wide Authority (optional for Google Workspace)

If your application needs to act on behalf of users in your domain (e.g. read all users’ calendars), you must enable domain-wide delegation:

1. From your Google Workspace [Admin console](https://admin.google.com/), go to **Main menu** > **Security** > **Access and data control** > **API Controls**.
2. Under **Domain-wide delegation**, click **Manage Domain Wide Delegation**.
3. Click **Add new**.
4. Enter the **Client ID** of your service account (from the [Service Accounts page](https://console.developers.google.com/iam-admin/serviceaccounts)).
5. In **OAuth scopes**, enter the list of scopes you want to grant, for example: if your application needs domain-wide full access to the Google Drive API and the Google Calendar API, enter: `https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/calendar`.
6. Click **Authorize**.

<Note> Your application now has the authority to make API calls on behalf of users in your Workspace domain (`impersonating` them). You can specify the user to impersonate explicitly in the **Delegated Access Email Address** field. </Note>

#### Step 4: Finding your application's scopes

Ensure you enable the [API library](https://console.cloud.google.com/apis/library) you want access to, then you can find a list of scopes at [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes). This should be a space-separated list.

#### Step 5: Enter credentials in the Connect UI

Once you have all the required credentials:

1. Open the form to authenticate with Google Service Account.
2. Enter your credentials in their respective fields.
3. Submit the form, and you should be successfully authenticated.

<img src="https://mintcdn.com/nango/l5TZwDYs4PA8hcOI/integrations/all/google-service-account/form.png?fit=max&auto=format&n=l5TZwDYs4PA8hcOI&q=85&s=7d6a2416df2c2007c1329990d313923e" style={{maxWidth: "450px" }} width="500" height="700" data-path="integrations/all/google-service-account/form.png" />

You are now connected to Google Service Account.
