Everything an AI agent can do with the BigQuery API.

A reference guide for building AI agents: every method, how to authenticate, and the permissions each one needs.

Endpoints31
API versionv2
Last updated23 June 2026
Orientation

How the BigQuery API works.

The BigQuery API is how an app or AI agent works with a BigQuery data warehouse: running a SQL query, streaming new rows into a table, creating or deleting a dataset, or reading a table's rows directly. Access is granted through an OAuth 2.0 access token whose scopes set the broad category of access, while the identity's IAM roles set which projects, datasets, and tables a call can reach. BigQuery does not push events, so an app learns about a finished job by polling it and about new data by querying.

31Endpoints
6Capability groups
12Read
19Write
3Permissions
Authentication
BigQuery authenticates with OAuth 2.0 access tokens, not API keys, minted either for a signed-in person or for a service account (a non-human identity). The token carries scopes, and the identity behind it carries IAM roles. A call must satisfy both: the scope has to cover the action, and the identity's roles have to allow it on that project, dataset, or table.
Permissions
Two layers decide access. OAuth scopes set the broad category, like https://www.googleapis.com/auth/bigquery.readonly for read-only or bigquery.insertdata for streaming rows, while IAM roles (such as BigQuery Data Viewer or Data Editor) set which resources the identity can touch. A dataset also has its own access list naming who can reach it. A 403 with accessDenied means the IAM layer blocked the call.
Versioning
The REST API is served at a single version, v2, in the request path, and Google does not mint a new API version for each feature. Dated changes, new features, GA promotions, and deprecations, ship through the BigQuery release notes instead, so tracking the release notes matters more than a version string.
Data model
BigQuery is organized as projects that hold datasets, and datasets that hold tables, routines (stored functions and procedures), and models. Work that reads or changes data runs as a job, most often a query job, which an app polls for completion. Rows can also be streamed straight into a table or read straight out of one without a query. BigQuery does not push events; an app polls or queries to learn what changed.
Connect & authenticate

Connection & authentication methods.

How an app or AI agent connects to BigQuery determines what it can reach. There is a REST API for running jobs and managing datasets and tables, and a hosted server that exposes BigQuery tools to agents, and each is governed by the credential behind it and the permissions that credential carries.

Ways to connect

REST API

The REST API takes JSON request bodies, returns JSON, and pages through lists with a page token, at https://bigquery.googleapis.com/bigquery/v2 (the older host https://www.googleapis.com/bigquery/v2 still resolves). A call authenticates with an OAuth 2.0 access token in the Authorization header, minted for a user or a service account. The token's scopes plus the caller's IAM roles together decide which projects, datasets, and methods the call can reach.

Best forConnecting an app or AI agent to BigQuery.
Governed byThe OAuth token's scopes and the caller's IAM roles.
Docs ↗

MCP server (preview)

A fully managed, remote Model Context Protocol server at https://bigquery.googleapis.com/mcp exposes BigQuery tools to AI agents and LLM clients, and is enabled when the BigQuery API is enabled. It authenticates with OAuth 2.0 and authorizes with IAM, not API keys, and its tools cover list_dataset_ids, get_dataset_info, list_table_ids, get_table_info, and execute_sql, with a read-only variant for queries. Results are capped (3,000 rows by default), and it was in preview as of January 2026.

Best forConnecting an AI agent to BigQuery through MCP.
Governed byThe OAuth grant and the caller's IAM roles.
Docs ↗
Authentication

OAuth 2.0 (user)

A person signs in and consents to a set of scopes, and the resulting access token acts as that person, limited to both the granted scopes and that person's IAM roles. A refresh token keeps long-running access alive. This is the route for an integration acting on behalf of a human.

TokenOAuth 2.0 access token (user)
Best forActing on behalf of a signed-in person.
Docs ↗

Service account

A service account is a non-human identity with its own IAM roles. Its credentials are exchanged for a short-lived OAuth 2.0 access token, which authenticates server-to-server calls without a person present. The account reaches only the projects and datasets its IAM roles allow.

TokenOAuth 2.0 access token (service account)
Best forServer-side and automated access with no human in the loop.
Docs ↗
Endpoint reference

Every BigQuery API method.

Filter by method, access, or permission, or search any path. Select a row for version detail, rate limits, the related webhook event, and the source.

MethodEndpointWhat it doesAccessPermissionVersion

Jobs (queries & loads)

Methods for running and managing jobs, including queries, loads, exports, and copies.7

Needs https://www.googleapis.com/auth/bigquery or cloud-platform. A SELECT is read-only, but the same method can run DML and DDL that change or delete data, so it is classed as a write.

Acts onjob
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Needs https://www.googleapis.com/auth/bigquery or cloud-platform. A load job that reads from Cloud Storage also needs a storage read scope.

Acts onjob
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only. https://www.googleapis.com/auth/bigquery.readonly is enough.

Acts onjob
Permission (capability)bigquery.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only. https://www.googleapis.com/auth/bigquery.readonly is enough.

Acts onjob
Permission (capability)bigquery.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only. Returns jobs visible to the calling identity.

Acts onjob
Permission (capability)bigquery.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Needs https://www.googleapis.com/auth/bigquery or cloud-platform. Cancellation is best-effort and may not stop a job already finishing.

Acts onjob
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Removes the job record; it does not undo the work the job did.

Acts onjob
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Datasets

Methods for working with datasets, the containers that hold tables, routines, and models.6

Read-only. https://www.googleapis.com/auth/bigquery.readonly is enough.

Acts ondataset
Permission (capability)bigquery.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only. The access list it returns names who can reach the dataset.

Acts ondataset
Permission (capability)bigquery.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Needs https://www.googleapis.com/auth/bigquery or cloud-platform.

Acts ondataset
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Editing the access list changes who can reach the dataset and its tables.

Acts ondataset
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Unlike patch, this overwrites the whole resource, so any field left out is cleared.

Acts ondataset
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

With deleteContents set to true, this removes every table, routine, and model inside the dataset.

Acts ondataset
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Tables

Methods for working with tables and their schemas.7

Read-only.

Acts ontable
Permission (capability)bigquery.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only; returns metadata and schema, not the rows.

Acts ontable
Permission (capability)bigquery.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Needs https://www.googleapis.com/auth/bigquery or cloud-platform.

Acts ontable
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Schema changes are limited to additive and relaxing changes.

Acts ontable
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Overwrites the whole resource, so any field left out is cleared.

Acts ontable
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Removes the table and its rows.

Acts ontable
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Changes who can reach the table at the IAM level, separate from the dataset access list.

Acts ontable
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Table data

Methods for streaming rows into a table and reading rows back out.2

https://www.googleapis.com/auth/bigquery.insertdata is the narrow scope for streaming rows; bigquery and cloud-platform also work. The Storage Write API is the newer alternative.

Acts ontabledata
Permission (capability)bigquery.insertdata
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit10 MB max HTTP request size

Read-only. Reads the stored rows without running a query.

Acts ontabledata
Permission (capability)bigquery.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit3.6 GB max read per minute

Routines

Methods for working with routines, the stored functions and procedures defined in a dataset.5

Read-only.

Acts onroutine
Permission (capability)bigquery.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts onroutine
Permission (capability)bigquery.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Defines a stored function or procedure that later queries can call.

Acts onroutine
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Overwrites the routine in full.

Acts onroutine
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Removes the stored function or procedure.

Acts onroutine
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Models

Methods for working with machine-learning models trained inside a dataset.4

Read-only.

Acts onmodel
Permission (capability)bigquery.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts onmodel
Permission (capability)bigquery.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Edits model metadata; the model is trained through a query job, not this method.

Acts onmodel
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Removes the trained model.

Acts onmodel
Permission (capability)bigquery
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply
No endpoints match those filters.
Webhooks

Webhook events.

BigQuery does not push events to an app. An agent learns about a job by polling its status, and learns about new data by querying it.

EventWhat it signalsTriggered by
No events match that search.
Rate limits & pagination

Rate limits, pagination & request size.

BigQuery limits how often an app can call each method, capped per user per method, alongside separate ceilings on concurrent queries and on how much data a single read call returns.

Request rate

BigQuery limits API calls per user per method, and most core methods allow up to 100 requests per user per method per second; going over returns a 403 with reason rateLimitExceeded. Separate ceilings apply to running work: an interactive query queue holds up to 1,000 queries per project per region (20,000 for batch queries), so a flood of queries waits rather than failing outright. Reads through tabledata.list are also capped by the bytes returned, not just the request count. Where a per-method limit is documented, it is shown on that method's row.

Pagination

List and read methods return a page of results plus a nextPageToken (or pageToken for query results). The caller passes that token back, with maxResults to set the page size, to walk through the rest. A query that returns a large result set is read page by page through jobs.getQueryResults the same way. There is no single cursor object; the page token is the only state carried between calls.

Request size

The legacy streaming insert, tabledata.insertAll, rejects any HTTP request over 10 MB. Direct reads through tabledata.list are capped at 3.6 GB per minute per project, a limit that cannot be raised. Large query results are not returned in one response; they are paged, and very large outputs are written to a destination table and read from there.

Errors

Status codes & error handling.

The status codes an agent should handle, and what to do about each.

StatusCodeMeaningWhat to do
400invalidQueryThe SQL has a syntax or semantic error, or the request body is otherwise invalid (also seen as invalid or badRequest).Read the message, fix the query or request fields, and resend. The request is not retryable as-is.
401unauthorizedNo valid credentials were provided, or the access token is missing or expired.Refresh the OAuth access token and resend with a valid Authorization header.
403accessDeniedThe identity is authenticated but lacks the IAM permission for the project, dataset, or table.Grant the calling identity the required IAM role, or scope the request to a resource it can reach.
403quotaExceededA project quota or free-tier limit was reached, named in the message property.Reduce usage, request a quota increase, or wait for the window to reset.
403rateLimitExceededToo many requests were sent too quickly for a method, user, or project.Slow the request rate and retry with exponential backoff.
404notFoundThe referenced project, dataset, table, or job does not exist, or the request hit the wrong location.Check the resource names and the region or location, then resend.
409duplicateA resource with that name already exists, for example a dataset or table being created twice.Use a different name, or change writeDisposition to overwrite or append.
500internalErrorAn error on BigQuery's side. It is rare and not caused by the request.Retry with truncated exponential backoff, and contact support if it persists.
503backendErrorBigQuery was temporarily unable to serve the request.Retry with truncated exponential backoff.
Versioning & freshness

Version history.

BigQuery serves a single REST API version, v2, in the path, and ships dated feature changes through its release notes rather than minting a new API version for each one.

Version history

What changed, and when

Latest versionv2
v2Current version
BigQuery REST API v2 (current)

BigQuery serves one REST API version, v2, in the request path. Google does not mint a new API version per feature; dated changes ship through the release notes. Recent notable entries are listed below, newest first.

What changed
  • 2026-05-20: Python UDFs reach GA, supporting third-party PyPI libraries and external service access.
  • 2026-03-25: BigQuery Migration Service MCP server launches in preview for SQL translation.
  • 2026-03-12: Advanced runtime becomes the default for all BigQuery projects.
2026-04-30Requires migration
Google Ads transfers require MFA

A breaking change to the Data Transfer Service: individual-user authentication for Google Ads transfers requires multi-factor authentication as of 2026-05-07.

What changed
  • Google Ads data transfers using individual user authentication now require MFA.
  • Affects the Data Transfer Service, not the core REST methods.
2026-02-25Requires migration
Legacy SQL usage to be limited

BigQuery announced that legacy SQL usage will be limited starting 2026-06-01, based on usage patterns from November 2025 onward.

What changed
  • Legacy SQL becomes restricted; standard (GoogleSQL) is the supported dialect.
  • Queries should move to GoogleSQL ahead of the cutover.
2026-01-19Requires migration
Strict act-as mode enforced (Dataform)

Strict act-as mode is enforced at project level for Dataform and orchestration tools, requiring custom service accounts or user credentials.

What changed
  • Default service-account behavior removed for Dataform and orchestration.
  • Pipelines must name a service account or use user credentials.

The REST surface stays at v2; track the release notes for new features and deprecations.

BigQuery release notes ↗
Questions

BigQuery API, answered.

Does BigQuery use API keys or OAuth?+
BigQuery uses OAuth 2.0 access tokens, not API keys. A token is minted for a signed-in person or for a service account, and it is sent in the Authorization header. The token's scopes set the broad category of access, and the identity's IAM roles set which projects and datasets it can reach. A request has to pass both checks.
What's the difference between scopes and IAM roles?+
Scopes and IAM roles are two separate layers. A scope, like https://www.googleapis.com/auth/bigquery.readonly, is attached to the OAuth token and limits the broad category of what the token can do. An IAM role, like BigQuery Data Viewer, is attached to the identity and limits which specific resources it can act on. A call needs a scope that covers the action and a role that allows it on that resource.
How does an agent run a query and get results?+
An agent calls jobs.query, or starts a query job with jobs.insert, which returns a job id. For a long query the agent polls jobs.get until the job finishes, then reads the rows with jobs.getQueryResults, paging through them with the returned page token. A SELECT only reads, but the same query path can run DML and DDL that change or delete data.
Does BigQuery send webhooks?+
No. The BigQuery API does not push events to an app. An agent finds out a job has finished by polling jobs.get, and finds out about new data by querying it. To react to changes as they happen, teams pair BigQuery with a separate Google Cloud service such as Pub/Sub or Eventarc, which is outside the BigQuery API itself.
Is there an official BigQuery MCP server?+
Yes. Google offers a fully managed, remote Model Context Protocol server at https://bigquery.googleapis.com/mcp, enabled when the BigQuery API is enabled. It exposes tools to list datasets and tables, fetch their metadata, and run SQL, authenticates with OAuth 2.0, and authorizes with IAM. It was in preview as of January 2026, and query results are capped by default.
What's the difference between streaming a row and loading data?+
Streaming with tabledata.insertAll sends rows over HTTP for near real-time availability, with a 10 MB cap per request, and is the legacy path; the Storage Write API is the newer alternative. A load job, started with jobs.insert, ingests a whole file from Cloud Storage or an upload in bulk. Streaming suits a steady trickle of rows; a load job suits large batches.
Related

More data API guides for agents

What is Bollard AI?

Control what every AI agent can do in BigQuery.

Bollard AI sits between a team's AI agents and BigQuery. Grant each agent exactly the access it needs, read or write, dataset by dataset, and every call is checked and logged.

  • Set read, write, or full access per agent, never a shared service-account key.
  • Denied by default, so an agent reaches only the datasets and methods explicitly allowed.
  • Every query and write recorded in plain English: who, what, where, and the decision.
BigQuery
Analytics Agent
Run queries ActionOffReadFull use
Stream rows into tables ActionOffReadFull use
Datasets ResourceOffReadFull use
Delete tables ActionOffReadFull use
Per-agent access, set in Bollard AI, not in BigQuery