Manage Essential Contacts

This page describes the available methods for viewing, adding, modifying, or removing Essential Contacts and configuring notification categories for them.

If you are an Organization Admin, you can manage your Essential Contacts by using the Google Cloud console, the Google Cloud CLI, or the REST API. Follow best practices for managing Essential Contacts.

If you are an essential contact, ask your administrator to send you a test email to verify reception for the specific notification category. If you are not receiving notifications, verify the following:

  • Check your email spam or junk folder.
  • Verify that the email address registered as a contact is correct and can receive external emails.
  • Make sure your contact information is assigned to the relevant notification categories.

Before you begin

To receive notifications, the contact must be able to receive emails from Google.

If you want to manage contacts by using the gcloud CLI or the REST API, enable the Essential Contacts API. If you only want to manage contacts by using the Google Cloud console, you don't need to enable the API.

Roles required to enable APIs

To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

Enable the API

Required roles

To get the permissions that you need to manage contacts, ask your administrator to grant you the following IAM roles on the project, folder, or organization where the contact is assigned:

For more information about granting roles, see Manage access to projects, folders, and organizations.

These predefined roles contain the permissions required to manage contacts. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to manage contacts:

  • To view contacts:
    • essentialcontacts.contacts.get
    • essentialcontacts.contacts.list
  • To edit, delete, and create contacts:
    • essentialcontacts.contacts.create
    • essentialcontacts.contacts.delete
    • essentialcontacts.contacts.update

You might also be able to get these permissions with custom roles or other predefined roles.

View contacts

Child resources, which refer to folders and projects, inherit contacts from their ancestors, which can be organizations and other folders. When viewing contacts from a child resource, you can also view contacts inherited from its ancestor if you have the corresponding permissions for the ancestor. To gain this ability, obtain a role on the ancestor resource that includes the required permissions to view contacts. When you view contacts from an organization or top-level folder, you don't see contacts from their child resources.

To view the list of all Essential Contacts in your project, folder, or organization, do the following:

Console

  1. In the Google Cloud console, go to the Essential Contacts page.

    Go to the Essential Contacts page

  2. Make sure the name of your project, folder, or organization appears in the resource selector of the page. The resource selector lets you select the project, folder, or organization from which you want to view Essential Contacts.

  3. Next to View by, you can choose one of the following options:

    • To view the list of contacts by category, select Category.
    • To view the list of contacts alphabetically, select Contact.

gcloud

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. With the Google Cloud CLI, you can either list the contacts that are defined on a resource or list all contacts and inherited contacts for a resource.

    List contacts defined on a resource

    To view Essential Contacts defined on a specific project, folder, or organization, use the gcloud essential-contacts list command:

    gcloud essential-contacts list --RESOURCE_TYPE="RESOURCE_ID"

    Replace the following:

    • RESOURCE_TYPE: the resource type that you want to list contacts from. Use the value project, folder, or organization.
    • RESOURCE_ID: your Google Cloud project number, organization ID, or folder ID. Project numbers, folder IDs, and organization IDs are numeric, like 123456789012. For projects, you must use the numeric project number. Alphanumeric project IDs are not supported.

    Alternatively, if you don't specify a resource type or ID, the gcloud CLI lists contacts from the current project.

    The response is similar to the following example:

    ---
    email: my-contact-1@example.com
    languageTag: en-US
    name: projects/my-projects/contacts/1
    notificationCategorySubscriptions:
    - ALL
    ---
    email: my-contact-2@example.com
    languageTag: en-US
    name: projects/my-projects/contacts/2
    notificationCategorySubscriptions:
    - BILLING
    ---
    

    List contacts and inherited contacts

    If you want to list all contacts from a resource and its inherited contacts from an ancestor, you must have a role on the ancestor resource that includes the required permissions to view contacts. Then, use the gcloud essential-contacts compute command:

    gcloud essential-contacts compute --notification-categories="NOTIFICATION_CATEGORY" \
      --RESOURCE_TYPE="RESOURCE_ID"

    Replace the following:

    • NOTIFICATION_CATEGORY: a comma-separated list of the notification categories that you want to view contacts for. The list can contain any of the following values:

      • billing
      • legal
      • product-updates
      • security
      • suspension
      • technical
      • all
      • notification-category-unspecified

      For more information, see Notification categories.

    • RESOURCE_TYPE: the resource type that you want to view contacts from. Use the value project, folder, or organization.

    • RESOURCE_ID: your Google Cloud project number, organization ID, or folder ID. Project numbers, folder IDs, and organization IDs are numeric, like 123456789012. For projects, you must use the numeric project number. Alphanumeric project IDs are not supported.

    If you don't specify a resource type and ID, the gcloud CLI lists contacts for the current project.

    The response is similar to the following example:

    ---
    email: my-contact-1@example.com
    languageTag: en-US
    name: projects/my-projects/contacts/1
    notificationCategorySubscriptions:
    - ALL
    ---
    email: my-contact-2@example.com
    languageTag: en-US
    name: projects/my-projects/contacts/2
    notificationCategorySubscriptions:
    - BILLING
    ---
    email: my-organization-contact@example.com
    languageTag: en-US
    name: organizations/my-organization/contacts/1
    notificationCategorySubscriptions:
    - ALL
    ---
    

REST

With the Essential Contacts REST API, you can either list the contacts that are defined on a resource or list all contacts and inherited contacts for a resource.

List contacts defined on a resource

To view the contacts defined on a specific project, folder, or organization, use the Essential Contacts API's contacts.list method.

Request:

GET essentialcontacts.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID/contacts?pageSize=PAGE_SIZE&pageToken=NEXT_PAGE_TOKEN

Replace the following:

  • RESOURCE_TYPE: the resource type that you want to list contacts from. Use the value projects, folders, or organizations.
  • RESOURCE_ID: your Google Cloud project number, organization ID, or folder ID. Project numbers, folder IDs, and organization IDs are numeric, like 123456789012. For projects, you must use the numeric project number. Alphanumeric project IDs are not supported.
  • PAGE_SIZE: Optional. The number of contacts to include in the response. The default value is 50, and the maximum value is 100. If the number of contacts is greater than the page size, the response contains a pagination token that you can use to retrieve the next page of results.
  • NEXT_PAGE_TOKEN: Optional. The pagination token returned in an earlier response from this method. If specified, the list of contacts starts where the previous response ended.

To send your request, expand one of these options:

curl (Linux, macOS, or Cloud Shell)

Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to your service account private key path. Then, make the request:

curl -X GET \
-H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
https://essentialcontacts.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID/contacts?pageSize=PAGE_SIZE&pageToken=NEXT_PAGE_TOKEN
  

PowerShell (Windows)

Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to your service account private key path. Then, make the request:

$cred = gcloud auth application-default print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
  -Method GET `
  -Headers $headers `
  -Uri "https://essentialcontacts.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID/contacts?pageSize=PAGE_SIZE&pageToken=NEXT_PAGE_TOKEN" | Select-Object -Expand Content
  

After sending the request, you receive a JSON response similar to the following example:

{
  "contacts": [
    {
      "name": "projects/my-projects/contacts/1",
      "email": "my-contact-1@example.com",
      "notificationCategorySubscriptions": [
        "ALL"
      ],
      "languageTag": "en-US"
    },
    {
      "name": "projects/my-projects/contacts/2",
      "email": "my-contact-2@example.com",
      "notificationCategorySubscriptions": [
        "BILLING"
      ],
      "languageTag": "en-US"
    }
  ]
}

List contacts and inherited contacts

If you want to list all contacts from a resource and its inherited contacts from an ancestor, you must have a role on the ancestor resource that includes the required permissions to view contacts. Then, use the Essential Contacts API's contacts.compute method.

Request:

GET essentialcontacts.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID/contacts:compute?notificationCategories=NOTIFICATION_CATEGORY&pageSize=PAGE_SIZE&pageToken=NEXT_PAGE_TOKEN

Replace the following:

  • RESOURCE_TYPE: the resource type that you want to view contacts from. Use the value projects, folders, or organizations.
  • RESOURCE_ID: your Google Cloud project number, organization ID, or folder ID. Project numbers, folder IDs, and organization IDs are numeric, like 123456789012. For projects, you must use the numeric project number. Alphanumeric project IDs are not supported.
  • NOTIFICATION_CATEGORY: the notification category you want to view contacts from. You can repeat this field to list contacts from multiple notification categories. It can take any of the following values:

    • BILLING
    • LEGAL
    • PRODUCT_UPDATES
    • SECURITY
    • SUSPENSION
    • TECHNICAL
    • ALL
    • NOTIFICATION_CATEGORY_UNSPECIFIED

    For more information, see Notification categories.

  • PAGE_SIZE: Optional. The number of contacts to include in the response. The default value is 50, and the maximum value is 100. If the number of contacts is greater than the page size, the response contains a pagination token that you can use to retrieve the next page of results.

  • NEXT_PAGE_TOKEN: Optional. The pagination token returned in an earlier response from this method. If specified, the list of contacts starts where the previous response ended.

To send your request, expand one of these options:

curl (Linux, macOS, or Cloud Shell)

Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to your service account private key path. Then, make the request:

curl -X GET \
-H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
https://essentialcontacts.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID/contacts:compute?notificationCategories=NOTIFICATION_CATEGORY&pageSize=PAGE_SIZE&pageToken=NEXT_PAGE_TOKEN

PowerShell (Windows)

Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to your service account private key path. Then, make the request:

$cred = gcloud auth application-default print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
  -Method GET `
  -Headers $headers `
  -Uri "https://essentialcontacts.googleapis.com/v1/RESOURCE_TYPE/RESOURCE_ID/contacts:compute?notificationCategories=NOTIFICATION_CATEGORY&pageSize=PAGE_SIZE&pageToken=NEXT_PAGE_TOKEN" | Select-Object -Expand Content

After sending the request, you receive a JSON response similar to the following example:

{
  "contacts": [
    {
      "name": "projects/my-projects/contacts/1",
      "email": "my-project-contact-1@example.com",
      "notificationCategorySubscriptions": [
        "ALL"
      ],
      "languageTag": "en-US"
    },
    {
      "name": "projects/my-projects/contacts/2",
      "email": "my-project-contact-2@example.com",
      "notificationCategorySubscriptions": [
        "BILLING"
      ],
      "languageTag": "en-US"
    },
    {
      "name": "organizations/my-organization/contacts/1",
      "email": "my-organization-contact@example.com",
      "notificationCategorySubscriptions": [
        "ALL"
      ],
      "languageTag": "en-US"
    }
  ]
}

Add a contact

To add a contact, do the following:

Console

  1. In the Google Cloud console, go to the Essential Contacts page.

    Go to the Essential Contacts page

  2. Make sure the name of your project, folder, or organization appears in the resource selector of the page. The resource selector lets you select the project, folder, or organization from which you want to add Essential Contacts.

  3. Click Add contact.

    A screenshot highlighting the option to add a contact from the Essential Contacts page.

  4. In the Email and Confirm email fields, enter the email address of the contact you want to add.

  5. From the Notification categories drop-down menu, select the categories that you want the contact to receive notifications for.

    For a list of notification categories and recommended contacts, see Notification categories.

  6. Click Save.

gcloud

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. Add a new contact with the gcloud essential-contacts create command:

    gcloud essential-contacts