Getting the Cloud Storage service account

This page describes how to find the email address of a project's Cloud Storage service account. For an overview of Cloud Storage service accounts, including when they're created and how they're used, see Service Accounts for Cloud Storage. For a general overview of service accounts in Google Cloud, see Service Accounts.

To get the email address of a project's Cloud Storage service account:


  1. Open the Cloud Storage browser in the Google Cloud Console.
    Open the Cloud Storage browser
  2. Click Settings.

  3. In the Project Access tab, the email address appears in the Cloud Storage Service Account section.

Code samples


For more information, see the Cloud Storage C++ API reference documentation.

namespace gcs = google::cloud::storage;
using ::google::cloud::StatusOr;
[](gcs::Client client) {
  StatusOr<gcs::ServiceAccount> account = client.GetServiceAccount();
  if (!account) throw std::runtime_error(account.status().message());

  std::cout << "The service account details are " << *account << "\n";


For more information, see the Cloud Storage Java API reference documentation.


public class GetServiceAccount {
  public static void getServiceAccount(String projectId) {
    // The ID of your GCP project
    // String projectId = "your-project-id";

    Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService();
    ServiceAccount serviceAccount = storage.getServiceAccount(projectId);
        "The GCS service account for project " + projectId + " is: " + serviceAccount.getEmail());


  1. Get an authorization access token from the OAuth 2.0 Playground. Configure the playground to use your own OAuth credentials.
  2. Use cURL to call the JSON API with a GET serviceAccount request:

    curl -X GET -H "Authorization: Bearer OAUTH2_TOKEN" \


    • OAUTH2_TOKEN is the name of the access token you generated in Step 1.
    • PROJECT_ID is the ID of the project containing the buckets you want to list. For example, my-project.