Manage subscriptions
This document describes how to manage your BigQuery sharing subscriptions,covering tasks for both subscribers and publishers.
As a BigQuery sharing subscriber, you can do the following:
- Subscribe to a listing.
- List your current subscriptions in a given Google Cloud project.
- Delete a subscription.
As a BigQuery sharing publisher, you can do the following:
- View all subscriptions to your listing.
- Revoke access to a specific subscription.
A BigQuery sharing subscription is a regionalized resource that residesin the subscriber's project. Subscriptions store relevant information about thesubscriber and represent the contract between publisher and subscriber.
Before you begin
To get started with BigQuery sharing (formerly Analytics Hub), you need toenable the Analytics Hub API inside your Google Cloud project.
To enable the Analytics Hub API, you need the followingIdentity and Access Management (IAM) permissions:
serviceUsage.services.getserviceUsage.services.listserviceUsage.services.enable
The following predefined IAM role includes thepermissions that you need to enable the Analytics Hub API:
- Service Usage Admin (
roles/serviceusage.serviceUsageAdmin)
To enable the Analytics Hub API, select one of the following options:
Console
Go to theAnalytics Hub API page and enable the Analytics Hub API foryour Google Cloud project.
gcloud
Run thegcloud services enablecommand:
gcloud services enable analyticshub.googleapis.com
Required roles
To get the permissions that you need to manage subscriptions, ask your administrator to grant you theAnalytics Hub Subscription Owner (roles/analyticshub.subscriptionOwner) IAM role on the project. For more information about granting roles, seeManage access to projects, folders, and organizations.
You might also be able to get the required permissions throughcustom roles or otherpredefined roles.
Subscriber workflows for managing subscriptions
The following sections describe what BigQuery sharing subscribers can do with subscriptions.
Subscribe to listings
To subscribe to listings, follow the steps inView and subscribe to listings and data exchanges.
List subscriptions
To list your current subscriptions in a given project, use theprojects.locations.subscriptions.list method:
GET https://analyticshub.googleapis.com/v1/projects/PROJECT_ID/location/LOCATION/subscriptions
Replace the following:
PROJECT_ID: the Google Cloud project ID for thesubscriptions that you want to list.LOCATION: the location for the subscriptions that youwant to list.
Delete a subscription
To delete a subscription, use theprojects.locations.subscriptions.delete method:
DELETE https://analyticshub.googleapis.com/v1/projects/PROJECT_ID/location/LOCATION/subscriptions/SUBSCRIPTION_IDReplace the following:
PROJECT_ID: the project ID for the subscription todelete.LOCATION: the location of the subscription to delete.For more information about locations that supportsharing, seeSupported regions.SUBSCRIPTION_ID: the ID of the subscription to delete.
The request body must be empty. If successful, the response body contains anoperation instance.
When a BigQuery sharing subscriber deletes a subscription, it also deletesthe linked dataset from the subscriber's project.
When you delete a subscription from a multi-region listing(Preview), all theprimary and secondary linked dataset replicas are also deleted from thesubscriber's project.
For more information about the tasks you can do with subscriptions using theAPI, see theprojects.locations.subscriptions methods.
Publisher workflows for managing subscriptions
The following sections describe what BigQuery sharing publishers can dowith subscriptions. For more information about managing subscriptions tolistings, seeManage listings.
List subscriptions
To list all subscriptions, select one of the following options.
Console
In the Google Cloud console, go to theSharing (Analytics Hub) page.
The page lists all thedata exchangesyou can access.
Click the data exchange name where you want to list subscriptions.
Click theSubscriptions tab to view all subscriptions for listingswithin the data exchange.
API
To list subscriptions for listings in a particular data exchange, use theprojects.locations.dataExchanges.listSubscriptions method.
GET https://analyticshub.googleapis.com/v1/projects/PROJECT_ID/location/LOCATION/dataExchanges/DATAEXCHANGE_ID:listSubscriptions
Replace the following:
PROJECT_ID: the project ID of the data exchangefor which to list subscriptions.LOCATION: the location of the data exchange forwhich to list subscriptions.DATAEXCHANGE_ID: the ID of the data exchangefor which to list subscriptions.
Revoke a subscription
When a BigQuery sharing publisher revokes a subscription, the subscribercan no longer query the linked dataset. Because this action is initiated by thepublisher on a subscriber-owned resource, the linked dataset remains in thesubscriber's project. The subscriber can remove the dataset by deleting it.
If a publisher revokes a subscription from a multi-region listing(Preview),subscribers can no longer query any primary or secondary linked dataset replicas.
Caution: RevokingCloud Marketplace-integrated commercial subscriptionsmight affect your customers and violate theCloud Marketplace Terms of Service.To revoke a subscription, select one of the following options:
Console
In the Google Cloud console, go to theSharing (Analytics Hub) page.
The page lists all the data exchanges you can access.
Click the data exchange name where you want to revoke the listing.
Click theSubscriptions tab to view all subscriptions for the dataexchange.
Select the subscriptions to revoke.
ClickRevoke subscriptions.
API
To revoke a subscription, use theprojects.locations.subscriptions.revoke method.
POST https://analyticshub.googleapis.com/v1/projects/PROJECT_ID/location/LOCATION/subscriptions/SUBSCRIPTION_ID:revoke
Replace the following:
PROJECT_ID: the project ID of the subscription torevoke.LOCATION: the location of the subscription.SUBSCRIPTION_ID: the ID of the subscription torevoke.
Limitations
Subscriptions have the following limitations:
- You can only use the API to manage subscriptions created after July 25, 2023.Linked datasets created before this date are unsupported because they lack therequired subscription resource.
What's next
- Read aboutBigQuery sharing architecture.
- Learn how toview and subscribe to listings and data exchanges.
- Learn aboutBigQuery sharing user roles.
- Learn how tocreate datasets.
- Learn aboutBigQuery sharing audit logging.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.