Datasets: update

Requires authorization

Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. Try it now.

Warning: The specified access list completely overwrites the existing access list. If you specify an empty access list, you will revoke access to everyone except yourself; you cannot remove all owners from a dataset.

Access control: For more information, see access control.


HTTP request



Parameter name Value Description
Path parameters
datasetId string Dataset ID of the dataset being updated
projectId string Project ID of the dataset being updated


This request requires authorization with at least one of the following scopes (read more about authentication and authorization).


Request body

In the request body, supply a Datasets resource with the following properties:

Property name Value Description Notes
Required Properties
datasetReference.datasetId string [Required] A unique ID for this dataset, without the project name. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
datasetReference.projectId string [Optional] The ID of the project containing this dataset.
Optional Properties
access[].domain string [Pick one] A domain to grant access to. Any users signed in with the domain specified will be granted the specified access. Example: "". writable
access[].groupByEmail string [Pick one] An email address of a Google Group to grant access to. writable
access[].role string [Required] Describes the rights granted to the user specified by the other member of the access object. The following string values are supported: READER, WRITER, OWNER.

For more information about access control in BigQuery, see access control.
access[].specialGroup string [Pick one] A special group to grant access to.

Possible values include:
  • projectOwners: Owners of the enclosing project. 
  • projectReaders: Readers of the enclosing project. 
  • projectWriters: Writers of the enclosing project. 
  • allAuthenticatedUsers: All authenticated BigQuery users.
For more information about access control in BigQuery, see access control.
access[].userByEmail string [Pick one] An email address of a user to grant access to. For example: writable
access[].view nested object [Pick one] A view from a different dataset to grant access to. Queries executed against that view will have read access to tables in this dataset. The role field is not required when this field is set. If that view is updated by any user, access to the view needs to be granted again via an update operation. writable
defaultTableExpirationMs long [Optional] The default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour). Once this property is set, all newly-created tables in the dataset will have an expirationTime property set to the creation time plus the value in this property, and changing the value will only affect new tables, not existing ones. When the expirationTime for a given table is reached, that table will be deleted automatically. If a table's expirationTime is modified or removed before the table expires, or if you provide an explicit expirationTime when creating a table, that value takes precedence over the default expiration time indicated by this property. writable
description string [Optional] A user-friendly description of the dataset. writable
friendlyName string [Optional] A descriptive name for the dataset. writable
labels object The labels associated with this dataset. You can use these to organize and group your datasets. You can set this property when inserting or updating a dataset. See Labeling Datasets for more information. writable


If successful, this method returns a Datasets resource in the response body.

Try it!

Use the APIs Explorer below to call this method on live data and see the response. Alternatively, try the standalone Explorer.

Send feedback about...