---
title: BigQuery API Integration on Truto
slug: bigquery
category: Database
canonical: "https://truto.one/integrations/detail/bigquery/"
---

# BigQuery API Integration on Truto



**Category:** Database  
**Status:** Generally available

## MCP-ready AI tools

Truto exposes 47 tools for BigQuery that AI agents can call directly.

- **get_single_big_query_dataset_by_id** — Returns the dataset specified by datasetID. # IAM Permissions Requires the `bigquery.datasets.get` permission on the dataset. The id is the dataset ID. [GET projects/{projectsId}/datasets/{datasetsId}]
- **delete_a_big_query_dataset_by_id** — Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name. # IAM Permissions Requires the `bigquery.datasets.delete` permission on the dataset. The id is the dataset ID. [DELETE projects/{projectsId}/datasets/{datasetsId}]
- **list_all_big_query_datasets** — Lists all datasets in the specified project to which the user has been granted the READER dataset role. # IAM Permissions Requires no specific IAM permission(s) to use this method. Results are filtered to only include datasets on which the caller has the `bigquery.datasets.get` permission. [GET projects/{projectsId}/datasets]
- **big_query_datasets_restore** — Undeletes a dataset which is within time travel window based on datasetId. If a time is specified, the dataset version deleted at that time is undeleted, else the last live version is undeleted. # IAM Permissions Requires the following IAM permission(s) to use this method: - `bigquery.datasets.create` on the project. - `bigquery.datasets.get` on the dataset. Restores a dataset deleted within the time-travel window (body: deletionTime optional). A restored dataset cannot be deleted again for 7 days (undelete cool-down). [POST projects/{projectsId}/datasets/{datasetsId}:undelete]
- **create_a_big_query_dataset** — Creates a new empty dataset. # IAM Permissions Requires the `bigquery.datasets.create` permission on the project. [POST projects/{projectsId}/datasets]
- **update_a_big_query_dataset_by_id** — 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. # IAM Permissions Requires the `bigquery.datasets.update` permission on the dataset. The id is the dataset ID. PUT replaces the whole dataset resource: send datasetReference and every field to keep. In a BigQuery sandbox project also send defaultTableExpirationMs (max 60 days) or the call fails with billingNotEnabled. Use datasets.partial_update to change only some fields. [PUT projects/{projectsId}/datasets/{datasetsId}]
- **big_query_datasets_partial_update** — 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. This method supports RFC5789 patch semantics. # IAM Permissions Requires the following IAM permission(s) to use this method: - `bigquery.datasets.update` on the dataset. - `bigquery.datasets.get` on the dataset. Pass the dataset ID as dataset_id. Only the fields sent are changed. [PATCH projects/{projectsId}/datasets/{datasetsId}]
- **get_single_big_query_job_by_id** — Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role. # IAM Permissions Requires the `bigquery.jobs.get` permission on the job resource. If the user matches the creator of the job, the `bigquery.jobs.create` permission on the project is required instead. The id is the job ID. [GET projects/{projectsId}/jobs/{jobsId}]
- **create_a_big_query_job** — Starts a new asynchronous job. This API has two different kinds of endpoint URIs, as this method supports a variety of use cases. * The *Metadata* URI is used for most interactions, as it accepts the job configuration directly. * The *Upload* URI is ONLY for the case when you're sending both a load job configuration and a data stream together. In this case, the Upload URI accepts the job configuration and the data as two distinct multipart MIME parts. Send the job as JSON (configuration.query / load / extract / copy). Loading a local file by media upload is not supported here; load from Cloud Storage URIs instead. [POST projects/{projectsId}/jobs]
- **list_all_big_query_jobs** — Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property. # IAM Permissions Requires no specific IAM permission(s) to use this method. Users are able to list the jobs they created. [GET projects/{projectsId}/jobs]
- **big_query_jobs_cancel** — Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs. # IAM Permissions Requires the `bigquery.jobs.update` permission on the job resource. If the user matches the creator of the job, the `bigquery.jobs.create` permission on the project is required instead. [POST projects/{projectsId}/jobs/{jobsId}/cancel]
- **delete_a_big_query_job_by_id** — Requests the deletion of the metadata of a job. This call returns when the job's metadata is deleted. # IAM Permissions Requires the `bigquery.jobs.delete` permission on the job resource. The id is the job ID. [DELETE projects/{projectsId}/jobs/{jobsId}/delete]
- **delete_a_big_query_model_by_id** — Deletes the model specified by modelId from the dataset. # IAM Permissions Requires the `bigquery.models.delete` permission on the model. The id is the model ID. [DELETE projects/{projectsId}/datasets/{datasetsId}/models/{modelsId}]
- **update_a_big_query_model_by_id** — Patch specific fields in the specified model. # IAM Permissions Requires the `bigquery.models.updateMetadata` permission on the model. The id is the model ID. [PATCH projects/{projectsId}/datasets/{datasetsId}/models/{modelsId}]
- **list_all_big_query_models** — Lists all models in the specified dataset. Requires the READER dataset role. After retrieving the list of models, you can get information about a particular model by calling the models.get method. # IAM Permissions Requires the `bigquery.models.list` permission on the dataset. [GET projects/{projectsId}/datasets/{datasetsId}/models]
- **get_single_big_query_model_by_id** — Gets the specified model resource by model ID. # IAM Permissions Requires the `bigquery.models.getMetadata` permission on the model. The id is the model ID. [GET projects/{projectsId}/datasets/{datasetsId}/models/{modelsId}]
- **big_query_project_service_accounts_lookup** — RPC to get the service account for a project used for interactions with Google Cloud KMS. Requires the `bigquery.jobs.create` permission on the project resource. This permission is required to authorize the retrieval of the project's service identity for technical management tasks like encryption configuration. [GET projects/{projectsId}/serviceAccount]
- **list_all_big_query_projects** — RPC to list projects to which the user has been granted any project role. Users of this method are encouraged to consider the Resource Manager API, which provides the underlying data for this method and has more capabilities. # IAM Permissions Requires no specific IAM permission(s) to use this method. The results are filtered to only include projects on which the caller has been granted a project-level role such as a BigQuery predefined IAM role or a basic role such as Viewer or Owner. [GET projects]
- **create_a_big_query_query** — Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout. # IAM Permissions Requires the `bigquery.jobs.create` permission on the project resource. Data-level permissions are highly dependent on the SQL statement being executed. While standard queries require data access (such as `bigquery.tables.getData`), complex operations like DDL or DCL may require permissions to manage reservations, IAM policies, or project settings. Runs a query and waits up to timeoutMs for results; if jobComplete is false, poll query_results.get with the returned jobReference.jobId (and location). DML (INSERT/UPDATE/DELETE/MERGE) needs a project with billing; sandbox projects allow SELECT and DDL only. [POST projects/{projectsId}/queries]
- **get_single_big_query_query_result_by_id** — RPC to get the results of a query job. # IAM Permissions Requires the following IAM permission(s) to use this method: - `bigquery.jobs.get` on the job. - `bigquery.tables.getData` on the destination table. If the user matches the creator of the job, the following IAM permission(s) are required instead: - `bigquery.jobs.create` on the project. - `bigquery.tables.getData` on the destination table. The id is the job ID returned by queries.create (jobReference.jobId) or jobs.create. [GET projects/{projectsId}/queries/{queriesId}]
- **big_query_routine_iam_permissions_verify** — Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. [POST projects/{projectsId}/datasets/{datasetsId}/routines/{routinesId}:testIamPermissions]
- **big_query_routine_iam_policies_lookup** — Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. [POST projects/{projectsId}/datasets/{datasetsId}/routines/{routinesId}:getIamPolicy]
- **big_query_routine_iam_policies_bulk_update** — Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. [POST projects/{projectsId}/datasets/{datasetsId}/routines/{routinesId}:setIamPolicy]
- **delete_a_big_query_routine_by_id** — Deletes the routine specified by routineId from the dataset. # IAM Permissions Requires the `bigquery.routines.delete` permission on the routine. The id is the routine ID. [DELETE projects/{projectsId}/datasets/{datasetsId}/routines/{routinesId}]
- **list_all_big_query_routines** — Lists all routines in the specified dataset. Requires the READER dataset role. # IAM Permissions Requires the `bigquery.routines.list` permission on the dataset. [GET projects/{projectsId}/datasets/{datasetsId}/routines]
- **get_single_big_query_routine_by_id** — Gets the specified routine resource by routine ID. # IAM Permissions Requires the `bigquery.routines.get` permission on the routine. The id is the routine ID. [GET projects/{projectsId}/datasets/{datasetsId}/routines/{routinesId}]
- **update_a_big_query_routine_by_id** — Updates information in an existing routine. The update method replaces the entire Routine resource. # IAM Permissions Requires the `bigquery.routines.update` permission on the routine. The id is the routine ID. [PUT projects/{projectsId}/datasets/{datasetsId}/routines/{routinesId}]
- **create_a_big_query_routine** — Creates a new routine in the dataset. # IAM Permissions Requires the `bigquery.routines.create` permission on the dataset. [POST projects/{projectsId}/datasets/{datasetsId}/routines]
- **get_single_big_query_row_access_policy_by_id** — Gets the specified row access policy by policy ID. # IAM Permissions Requires the `bigquery.rowAccessPolicies.get` permission on the table. The id is the row access policy ID. [GET projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}/rowAccessPolicies/{rowAccessPoliciesId}]
- **delete_a_big_query_row_access_policy_by_id** — Deletes a row access policy. # IAM Permissions Requires the following IAM permission(s) on the table: - `bigquery.rowAccessPolicies.delete` - `bigquery.rowAccessPolicies.setIamPolicy`. The id is the row access policy ID. Deleting the last row access policy on a table needs force=true (otherwise BigQuery refuses, because the table would become readable by everyone with table access). [DELETE projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}/rowAccessPolicies/{rowAccessPoliciesId}]
- **list_all_big_query_row_access_policies** — Lists all row access policies on the specified table. # IAM Permissions Requires the `bigquery.rowAccessPolicies.list` permission on the table. [GET projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}/rowAccessPolicies]
- **big_query_row_access_policies_bulk_delete** — Deletes provided row access policies. # IAM Permissions Requires the following IAM permission(s) on the table: - `bigquery.rowAccessPolicies.delete` - `bigquery.rowAccessPolicies.setIamPolicy`. [POST projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}/rowAccessPolicies:batchDelete]
- **update_a_big_query_row_access_policy_by_id** — Updates a row access policy. # IAM Permissions Requires the following IAM permission(s) on the table: - `bigquery.rowAccessPolicies.update` - `bigquery.rowAccessPolicies.setIamPolicy` - `bigquery.tables.getData`. The id is the row access policy ID. [PUT projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}/rowAccessPolicies/{rowAccessPoliciesId}]
- **create_a_big_query_row_access_policy** — Creates a row access policy. # IAM Permissions Requires the following IAM permission(s) on the table: - `bigquery.rowAccessPolicies.create` - `bigquery.rowAccessPolicies.setIamPolicy` - `bigquery.tables.getData`. [POST projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}/rowAccessPolicies]
- **big_query_row_access_policy_iam_permissions_verify** — Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. [POST projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}/rowAccessPolicies/{rowAccessPoliciesId}:testIamPermissions]
- **big_query_row_access_policy_iam_policies_lookup** — Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. [POST projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}/rowAccessPolicies/{rowAccessPoliciesId}:getIamPolicy]
- **big_query_table_iam_permissions_verify** — Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. [POST projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}:testIamPermissions]
- **big_query_table_iam_policies_bulk_update** — Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. [POST projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}:setIamPolicy]
- **big_query_table_iam_policies_lookup** — Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. [POST projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}:getIamPolicy]
- **big_query_table_rows_bulk_create** — Streams data into BigQuery one record at a time without needing to run a load job. # IAM Permissions Requires the following IAM permission(s) to use this method: - `bigquery.tables.updateData` on the table. - `bigquery.tables.get` on the table. - `bigquery.datasets.get` on the dataset. Streams rows into the table: rows = [{json: {column: value}, insertId?}]. Billed streaming insert: projects without billing (BigQuery sandbox / free tier) get accessDenied "Streaming insert is not allowed in the free tier"; write with a query job (jobs.create with destinationTable) instead. [POST projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}/insertAll]
- **list_all_big_query_table_rows** — List the content of a table in rows. # IAM Permissions Requires the `bigquery.tables.getData` permission on the table. Rows come back as {f: [{v: value}]} in the order of the table schema (use tables.get for the column names). [GET projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}/data]
- **list_all_big_query_tables** — Lists all tables in the specified dataset. Requires the READER dataset role. # IAM Permissions Requires the `bigquery.tables.list` permission on the dataset. [GET projects/{projectsId}/datasets/{datasetsId}/tables]
- **create_a_big_query_table** — Creates a new, empty table in the dataset. # IAM Permissions Requires the `bigquery.tables.create` permission on the dataset. [POST projects/{projectsId}/datasets/{datasetsId}/tables]
- **update_a_big_query_table_by_id** — Updates information in an existing table. The update method replaces the entire Table resource, whereas the patch method only replaces fields that are provided in the submitted Table resource. # IAM Permissions Requires the `bigquery.tables.update` permission on the table. The id is the table ID. PUT replaces the whole table resource: send tableReference, schema and every field to keep. In a BigQuery sandbox project also send expirationTime (within 60 days) or the call fails with billingNotEnabled. Use tables.partial_update to change only some fields. [PUT projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}]
- **delete_a_big_query_table_by_id** — Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. # IAM Permissions Requires the `bigquery.tables.delete` permission on the table. The id is the table ID. [DELETE projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}]
- **get_single_big_query_table_by_id** — Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table. # IAM Permissions Requires the `bigquery.tables.get` permission on the table. The id is the table ID. [GET projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}]
- **big_query_tables_partial_update** — Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports RFC5789 patch semantics. # IAM Permissions Requires the following IAM permission(s) on the table: - `bigquery.tables.update` - `bigquery.tables.get`. Pass the table ID as table_id. Only the fields sent are changed. [PATCH projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}]

## How it works

1. **Link your customer's BigQuery account.** Use Truto's frontend SDK; we handle every OAuth and API key flow so you don't need to create the OAuth app.
2. **Authentication is automatic.** Truto refreshes tokens, stores credentials securely, and injects them into every API request.
3. **Call Truto's API to reach BigQuery.** The Proxy API is a 1-to-1 mapping of the BigQuery API.
4. **Get a unified response format.** Every response uses a single shape, with cursor-based pagination and data in the `result` field.

## Use cases

- **Let customers pipe your product data into their BigQuery** — Offer a native 'Push to Warehouse' destination so your users can blend your SaaS data (events, invoices, tickets, CRM records) with the rest of their stack in their own BigQuery project. Truto handles Google OAuth, schema provisioning, and job orchestration so you can ship it in days.
- **Build a Reverse ETL layer powered by customer warehouses** — If you run a PLG CRM, marketing automation, or sales platform, let customers point your app at their BigQuery to pull scored leads, enriched segments, or usage metrics directly into workflows — without forcing them to buy a separate Reverse ETL tool.
- **Embed BigQuery as a live analytics backend** — BI, dashboarding, and embedded analytics SaaS can let customers connect their BigQuery and run SQL queries on demand, rendering results in your UI without ever copying data out. Truto abstracts query submission, polling, and paginated result retrieval.
- **Archive logs and audit trails into the customer's warehouse** — Security, observability, and compliance platforms can stream access logs and detections into the customer's BigQuery for long-term retention and forensic analysis — and lock down sensitive rows with row-level access policies provisioned from your app.
- **Automate schema and dataset provisioning for enterprise rollouts** — Instead of making the customer's data team manually create tables, your onboarding flow can auto-create a dedicated dataset and strongly-typed tables in their BigQuery project the moment they connect, cutting integration time from weeks to minutes.

## What you can build

- **One-click BigQuery connection flow** — Let end users authorize their Google Cloud project through a hosted OAuth flow Truto manages, then route all API calls through a single normalized connection.
- **Auto-provisioned datasets and tables** — Use create_a_big_query_dataset and create_a_big_query_table during onboarding to spin up a namespaced schema in the customer's project with the exact column types your product emits.
- **Batch load jobs from Cloud Storage** — Trigger asynchronous load jobs via create_a_big_query_job to move large historical exports or nightly syncs into customer tables, with job status polling and cancellation via big_query_jobs_cancel.
- **Real-time event streaming** — Push high-volume events into customer tables using big_query_table_rows_bulk_create for sub-second availability in downstream queries and dashboards.
- **Embedded SQL query runner** — Submit SQL through create_a_big_query_query and fetch paginated results with get_single_big_query_query_result_by_id to power in-app dashboards, cohort builders, or Reverse ETL jobs.
- **Row-level security provisioning** — Programmatically create and manage row access policies so your customer's internal teams only see the rows they're entitled to, without them writing a single policy by hand.

## FAQs

### How does authentication to a customer's BigQuery work?

Customers connect via Google OAuth 2.0 to authorize access to their GCP project. Truto stores and refreshes tokens for you, so your app only deals with a single Truto connection ID when calling any BigQuery tool.

### Which BigQuery resources can I manage through Truto today?

Datasets, tables, table rows, jobs, queries and query results, models, routines, row access policies, projects, service accounts, and IAM policies/permissions for tables, routines, and row access policies are all available as tools.

### Can I stream events in real time, or is it batch only?

Both. Use big_query_table_rows_bulk_create for streaming inserts (the insertAll API) for near real-time availability, or create_a_big_query_job with a load configuration for large batch ingests from Google Cloud Storage. Streaming requires the customer's project to have billing enabled (no sandbox).

### How do I run long-running SQL queries without timing out?

Submit the query with create_a_big_query_query, then poll the job and fetch results page-by-page with get_single_big_query_query_result_by_id. This pattern handles queries that take longer than a single synchronous request.

### How are rate limits and pagination handled?

Truto normalizes pagination across list endpoints (datasets, tables, jobs, rows, models, routines, policies) and surfaces BigQuery's quota errors consistently, so you can implement retries and backoff once rather than per endpoint.

### Can I enforce multi-tenant data isolation inside a shared table?

Yes. Use create_a_big_query_row_access_policy (and the bulk update / delete variants) to restrict which of the customer's principals can read specific rows, which is useful for regulated or multi-department datasets.

### Do you support canceling or deleting in-flight jobs?

Yes. big_query_jobs_cancel stops a running job, and delete_a_big_query_job_by_id removes job metadata. This is useful for letting customers abort runaway queries from inside your UI.

## Related reading

- [Sync SaaS Data to BigQuery: Streaming Inserts & Deduplication](https://truto.one/blog/sync-saas-data-to-bigquery-streaming-inserts-deduplication/) — Stream SaaS data into BigQuery with Truto sync jobs. Service-account setup, insertAll streaming inserts, insertId deduplication, and invalid rows.
- [Streaming Normalized SaaS Webhooks to Snowflake & BigQuery for Real-Time Analytics (2026)](https://truto.one/blog/streaming-normalized-saas-webhooks-to-snowflake-bigquery-for-real-time-analytics/) — How to architect a real-time pipeline that streams normalized, enriched SaaS webhooks into Snowflake and BigQuery without building custom verifiers or ETL plumbing.
- [Connect BigQuery to Claude: Control Tables and ML Models](https://truto.one/blog/connect-bigquery-to-claude-control-tables-and-ml-models/) — A technical guide to connecting BigQuery to Claude via an MCP server. Learn how to securely expose BigQuery datasets, run SQL queries, and manage ML models.
- [Connect BigQuery to ChatGPT: Run Queries and Manage Datasets](https://truto.one/blog/connect-bigquery-to-chatgpt-run-queries-and-manage-datasets/) — Learn how to connect BigQuery to ChatGPT using a managed MCP server. This step-by-step guide covers async query polling, dataset management, and rate limits.
- [Connect BigQuery to AI Agents: Automate Jobs and Row Access](https://truto.one/blog/connect-bigquery-to-ai-agents-automate-jobs-and-row-access/) — Learn how to securely connect BigQuery to AI agents using Truto's /tools endpoint. A complete guide on automating async jobs, running queries, and managing Row-Level Security.
